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.
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.
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.
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.
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.
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.
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`.
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.
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.
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...)
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.