I simplified a lot of API calls by pulling panel memory management
inside the library. All API calls which previously required a panel
as parameter are now handling their panel themself.
Previously every widget border was drawn by two overlapping rectangles
to limit the number of primitives required to be supported by any
potential backend. The biggest problem from using this approach
is drawing overhead and no real way to get widget transparency. So
I changed border drawing to use stroked rectangles instead of a
second filled rectangle drawing call.
calling nk_init_default stores the address to the font (which is on stack) into the nk_context
but when it returns that stack memory is effectively undefined, thus making the program segfault
using memcmp and decide whether to draw a new frame or not:
* added NK_ZERO_COMMAND_MEMORY macro
* when NK_ZERO_COMMAND_MEMORY is defined, inside
nk_command_buffer_push function there is an additional call
to NK_MEMSET after allocating memory for new drawing command
For more information please look inside the changelog. This is more of
an internal fix and hopefully does not break any existing code. I also
removed `nk_strfmt` from the API and made it internal only.
If you had any kind of popups like for example comboboxes inside a
deeper panel structure using nk_group, then `nk_xxx_close` would only
unblock input for the first level and not the whole panel stack. This is
now fixed and works correctly.
This is a breaking change which fixes bad closing behavior in
non-blocking popups. If the maximum size of a non-blocking popup was
not reached and you clicked to close the popup under it could happen
that it wouldn't be closed. This is now fixed in combination with
more popup control by allowing to set both the maximum height as
well as popup width.
Since it is not as clear on how to use the menubar correctly as I
thought added an assert into `nk_menubar_begin` with explainations on
how to use it correctly and stop wrong ussage.
Since it was not as apparent as I thought it is I added some
documentation warning to set the same flags each time you
include "nuklear.h" except `NK_IMPLEMENTATION` which is only
allowed to be defined once in *one* source file.