Fixed some non-portable implementation details inside window and
table memory pool which could cause problems for platforms other
than x86/x64 and fixed some strict aliasing problems.
Tables inside windows get removed if a windows is not longer in use
inside `nk_free_window`. But I noticed that they are only removed
if they were not used the last frame, because of a copy & paste bug.
I removed the additional check and every table should now rightfully
be marked as free. I don't know if this bug actually caused any
problems, since I checked memory consumption and there were no
symptoms of wrong behavior before.
This patch hacks the chart API to support display of multiple data sets in a
single chart instances. Tested briefly with the line chart.
Signed-off-by: Jan Viktorin <iviktorin@fit.vutbr.cz>
Previously I only used the `__FILE__` and a user `ID` to make
sure to get an unqiue identifier out of it. Like @ands pointed out
this is not enough. Since it is possible to have multipe instances
with the same `title` in the same `__FILE__`. So to fix that I had
the idea to string concat `__FILE__` and `__LINE__` into a string.
This allows to have the same sequence of `IDs` in different places
in one `__FILE__`.
Previously it was not possible to check if currently any window or
widget is active. To fix that I added function `nk_item_any_active`.
To get correct result you should only call it after all UI code
ran but before calling `nk_clear`. There is currently no other way to
achive the same result inside UI code.
It is now possible to control button click behavior to trigger either
on button pressed or button released. By default nuklear now used
on button pressed but `#define NK_BUTTON_TRIGGER_ON_RELEASE` lets
you change button behavior to trigger on release. I furthermore
enhanced slider dragging behavior to not force you to hover the
slider at all times.
All platform and renderbackend independent examples are now optional
demos for all platforms in `demo/`. Moving some demos from `example/`
provides an easier way to test GUI concepts for users and simplifies
maintenance.
All modifed state changed by the demo rendering functions is now set
to default values after being called. I tried to save and restore all
relavent state but for some reason function glBlendEquationSeperate
is not defined for me. So I decided to make it as easy as possible
for me and just set everything to default. This means you have to
either save and restore or reset your own OpenGL state after calling
`nk_xxx_render`. I know it is not perfect but I have no better
solution at this point in time.
Editfield width inside properties were previously calculate by text
length + padding and always the size of the edit cursor, even in case
were no one is editing the property. Now the cursor size is only
added while editing.