Commit Graph

765 Commits

Author SHA1 Message Date
vurtun
7c0ad0aeb8 Fixed window hiding/exposing drawing bug
Toggling between hidden and shown window would previously cause
drawing bugs and in the worse case would destroy the drawing loop.
The bug is now fixed by stepping over each window which is hidden
inside the draw call loop.
2016-03-03 14:33:51 +01:00
vurtun
3d905b2451 Fixed small C++ error since new is a keyword 2016-03-03 13:17:32 +01:00
vurtun
acb2a31b82 Fixed window hiding and exposing bug
Previously rapidly closing and exposing windows caused the library
to freeze. This had two reasons one was a bug in the list insert
and remove code the other was in the fact that if the currently
active window is removed no other window would active which resulted
in a blocking UI. Both problems are now fixed but there is a small
visual bug which is triggered if a window is toggled.
2016-03-03 13:12:20 +01:00
vurtun
e847001728 Fixed small opcode format bug
The wrong opcode for `zr_layout_pop` caused a segmations fault.
The format is now fixed and everything should be ok now.
2016-03-03 11:07:59 +01:00
vurtun
b0630e82d7 Fixed #57 C89 violations
C89 does not support or rather allow void pointer to function
pointer conversion and back. While gcc notices and warns
about the issue clang will just stay silent and let it slide.
So note to self compile with gcc to check for C89 violations.
2016-03-03 10:58:18 +01:00
vurtun
53a6a4590d Added the previously mising close window function 2016-03-02 19:06:31 +01:00
vurtun
047deec3cd Added time and date combobox to demo
Extended the demo with two additional very helpful comboboxes.
The first one is a simple time picker and the other one is a
date picker with year, month, week day selection.
2016-03-02 17:58:22 +01:00
vurtun
ffe7d7586b Extended the chart API granularity
Two additional high level functions have been added using the chart
API for better ease of use. Both calculate the min and max value
while one works on an array and the other ones is based on a
callback.
2016-03-02 17:56:49 +01:00
vurtun
4c9eb66b7d Fixed #55 with zr_window_set_focus not working
While setting a window to active `zr_window_set_focus` did not
transfer the window on top of the window stack. This wrong
behavior should now be fixed and do what it is supposed to do.
2016-03-02 13:12:43 +01:00
vurtun
8159391640 Added Title alignment flags to menu header fix #53
Previously all menu titles were centered in X- and Y-axis without any
way to control the alignment. Since it was requested I added an
alignment flag to `zr_menu_text_begin`. To achieve the same outcome
like before this commit the flag has to be `ZR_TEXT_DEFAULT_CENTER`.
2016-03-02 09:45:06 +01:00
vurtun
1125016d0a Fixed simple allegro example text drawing bug
I forgot to change text drawing in the native allegro drawing API.
It should now be fixed and draw correctly. Furthmore I increased the
size of the demo window menu items to ensure that the checkbox text
is correctly drawn without clipping.
2016-03-01 19:52:18 +01:00
vurtun
c19a6a1bbe Finished experimental recording features
First version supporting the new record and play feature which allows
to `record` a number of API calls and lets you replay them at a later
point of time. This could be the basis for creating an Editor and
other more advanced features. While I tested the functionality there
still could be a number of bugs and I would recommend waiting
until all bugs are removed before using it.
2016-03-01 18:48:19 +01:00
vurtun
f035897056 second step 2016-02-28 14:00:10 +01:00
vurtun
d0d5414164 first step 2016-02-24 13:19:39 +01:00
vurtun
fc85f33e93 Fixed Readme example 2016-02-16 18:48:40 +01:00
vurtun
ae1e3fc003 Fixed C++ errors that depend on typesafe enums
Fixed one of the small issues between C and C++. The handling of
enums. While C uses weak types and compiling `zr_flags` or
`enum zr_text_alignment` did not cause any problems, trying to do the
same with C++ results in errors or in this case a linking
error since while the function exist with `zr_flags` it does not
exist with `enum zr_text_alignment` (another problem of function
overloading...)
2016-02-16 13:42:20 +01:00
vurtun
9ab708e543 Fixed some c++ errors that slipped through 2016-02-15 19:37:31 +01:00
vurtun
e4448f5881 Added additional widget utility functions 2016-02-15 19:03:21 +01:00
vurtun
f727058044 Fixed rgb->hsv conversion and extended granularity
The conversion function from rgb color to hsv color was bugged and
provided wrong values. It is now fixed and hopefully is now correct.
In addition a number of utility functions have been added to make
conversion between user provided color format and zahnrads own
format easier.
2016-02-15 02:19:09 +01:00
vurtun
6adbb375de updated apple demos 2016-02-14 22:06:51 +01:00
vurtun
de384a805b changed layout param from zr_size to int 2016-02-14 22:06:12 +01:00
vurtun
741217af1f Changed property dragging behavior for easier use
Previously dragging was activated in properties by clicking on the
label or value and edit mode by clicking inside the empty space.
While it worked it was not as nice to use as intended. Now
it dragging mode is activated by dragging on the empty space or label
and edit mode by clicking on the label.
2016-02-12 20:59:49 +01:00
vurtun
98da4841dd Fixed canvas arc and therefore piemenu drawing
I forgot to add the center point to drawing an arc which resulted
in half spheres. It is now fixed and should work as intended.
2016-02-12 20:30:06 +01:00
vurtun
730fd24746 Fixed popup drawing inside groups
Previously the popup buffer state was stored inside the group
panel layout instead of the window layout. This caused
overdraw for popups and the underlying window. To fix that now
all popups are stored inside the root window panel layout
and everything is drawn correctly.
2016-02-12 19:09:36 +01:00
vurtun
890430db76 Fixed node editor node linking
Because clicking was changed to happen on button up instead
of button down linking was bugged. It has been fixed and should
work now was expected.
2016-02-12 17:51:59 +01:00
vurtun
fdbcc52629 Merged examples and demos into one (first step)
While dividing previously spared me from a lot of work and problems
it is probably best to have everything working for every or as many
platforms as possible. Some platforms fail to provide good ways
to support everything (e.g.:X11 does not have pixmap clipping with
different width/height or alpha-blending) but all OpenGL demos
outside allegro (needs some additional work) should be able to run.
2016-02-11 23:29:02 +01:00
vurtun
18520b418a Added additional text alignment flags
Previously the ussage code had to draw text at the correct Y position
inside a rectangle to have the text centered in the middle. This is
inside the libray itself and can be controlled by additional
alignment flags. In addition a bug was removed that can occurs if you
draw images using the vertex buffer API. The check if an image is
an subimage was incorrect and therefore used the wrong API to draw
the image. The check is now fixed and everything should work fine.
2016-02-10 15:20:23 +01:00
vurtun
f5b6010a01 Added additional selectable color themes to demo
This commit extents the provided number of themes inside the demo
and updates the default style by using a smaller default padding
value for windows.
2016-02-09 15:16:05 +01:00
vurtun
c80a4809fd fixed bugs coverity found 2016-02-07 21:31:57 +01:00
vurtun
5e9486c70a Finally fixed GCC and Clang C++ errors
I totally forgot to compile under C++ and only now noticed it.
And there were a lot of C++ specific errors and warning that
creeped into the codebase. Hopefully everything should
compile just fine under C++ now at it does least for GCC and
Clang.
2016-02-07 18:39:07 +01:00
vurtun
9859d4d40d Added userdata to context,command,draw_command #48
As described in #48 I added optional userdata to zr_context,
zr_command and zr_draw_command. WARNING: I did not extensivly tested
this so any kind of feedback would be great. I also deactivated the
feature my default so to activate it you need to define
`ZR_COMPILE_WITH_COMMAND_USERDATA`. I also thought about deviding it
up into command userdata and draw command userdata but that would
only complicate things further and it is not really neccessary.
2016-02-06 23:38:08 +01:00
vurtun
1db24e4ca3 Fixed property input for negative values
zr_strtof did not have a conversion case for negative float values
which caused problems for negative float text input. In addition
zr_filter_decimal had a bug that did not allow '-' as correct input.
Both bugs have been fixed and it should work now.
2016-02-06 16:45:35 +01:00
vurtun
835e3a04bb Fixed drawing and backspace bug inside zr_edit_xxx
Previously newlines were drawn inside an edit box if some text was
selected. That bug is now fixed. In addition backspace and delete
had the same result in deleting the current character under the
cursor. Now it has the respectable implementation.
While this commit fixes some issues with newlines they are still
bugged and an absolute pain to debug and fix.
2016-02-06 14:27:26 +01:00
vurtun
8f9fa3ee4d updated Readme 2016-02-03 11:28:58 +01:00
vurtun
c85ed0c50c Restructered context functions for better clarity 2016-02-02 22:30:22 +01:00
vurtun
c4916f62dd renamed zr_layout to zr_panel 2016-02-02 15:43:19 +01:00
Micha Mettke
6d8f2e4033 Merge pull request #46 from richi/CoreGraphics
Additional CoreGraphics Example
2016-02-01 22:50:56 +01:00
richi
292c33d78b Additional CoreGraphics Example
iOS_CoreGraphics does contain a simple example running
Zahnrad on top of the native CoreGraphics API.
2016-02-01 21:15:25 +01:00
Micha Mettke
e7439a34df Merge pull request #45 from richi/master
vertexes -> vertices
2016-02-01 13:37:25 +01:00
richi
c3da9dc2b6 vertexes -> vertices 2016-02-01 09:42:05 +01:00
vurtun
6af22b621f fixed missing C++ void* to char* cast 2016-02-01 09:26:22 +01:00
vurtun
1c3d60c260 Convert overdraw in general case to special case
One of the big problems with transparency while using the vertex
buffer output is that repeated overdraw causes artifacts.
Inherintly that is not a problem if there is no overdraw except
zr_widget_field which relies on it for text selection. So I
previously used overdraw for every text, which caused problems.
With this update only zr_widget_field uses overdraw while
every normal text does not.
2016-02-01 09:26:22 +01:00
vurtun
b2e99df63d Added enter event to edit widget
Decided to add support for commit the content of a edit wiget
content by enter if a flag was set. Tried to add other flags
like auto complete but failed for now to find a good way.
Also more importantly added `zr_edit_box` to filter callback.
2016-02-01 09:26:22 +01:00
vurtun
88e40646b8 fixed missing C++ void* to char* cast 2016-01-31 20:12:05 +01:00
vurtun
983a23a130 Convert overdraw in general case to special case
One of the big problems with transparency while using the vertex
buffer output is that repeated overdraw causes artifacts.
Inherintly that is not a problem if there is no overdraw except
zr_widget_field which relies on it for text selection. So I
previously used overdraw for every text, which caused problems.
With this update only zr_widget_field uses overdraw while
every normal text does not.
2016-01-30 14:54:22 +01:00
vurtun
c628115369 Added enter event to edit widget
Decided to add support for commit the content of a edit wiget
content by enter if a flag was set. Tried to add other flags
like auto complete but failed for now to find a good way.
Also more importantly added `zr_edit_box` to filter callback.
2016-01-30 11:46:54 +01:00
vurtun
96fe7f7775 Added a global alpha modifier to zr_convert
Previously it was not possible to control the visibility or rather
the transparency of all render vertex buffer output. For that to
change another settings was added to zr_convert_config to control
the visibility. To achieve the same result as previously it is now
required to fill that property with 1.0f. To make all GUI element
as a whole more transparent a value between 0.0 and 1.0 can be
selected with 0.0 being completely hidden and 1.0f completly
visible.
2016-01-28 22:24:54 +01:00
vurtun
967b6feb30 updated Readme 2016-01-28 15:56:15 +01:00
vurtun
7fa59b8ba5 Removed commented out old code 2016-01-27 10:51:58 +01:00
vurtun
19a49780f7 Added event based updates back into examples
After some thought I decided to turn all examples back into
event based updated UIs. While it is possible to run all
examples without vsync with good performance it is probably best to
keep the examples in a accessable format which makes it possible
to be just by as many people as possible.
2016-01-26 22:52:09 +01:00