This commit fixed some bugs from the last commit as well as some general
changes and fixes of some old bugs. For overview of all changes please
look inside `CHANGELOG.md`.
`nk_canvas_begin` now takes a background color directly instead of
requiring the user of the API to clear the window background with
another draw call.
I had a long standing bug inside nuklear which prevents you from
swapping out a font while the code is being build. This bug is now
fixed but the fix requires _ALL_ `nk_user_font` data structures
provided by `nk_style_set_font` to be persistent.
This commit adds a GWEN UI style skinning example. It is
certainly not perfect right now (especially windows suck) but
it is probably useful for a general overview. One thing that is
pretty clear for me now is that I need a way to read in a style from
file or memory since manually setting up properties, colors
and images is quite a pain.
Previously the piemenu had a clipping bug caused by different offset
between internal and external properties. I just set spacing and
padding to zero to let the piemenu take the whole popup.
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.
I personally do not have a retina display, but I added some changes
to all `GLFW` demos/examples. If there are still issues please
report back to me what is not working correct (please test out clipping
by playing around with scrollbars as well)
Thanks to @codemeow I fixed some bugs and warnings found with
cppcheck. NOTE: it seems like all static analyzer fail to
detect the assert macro or hate combining assert ans if checks.
All examples use GLFW, so we update the Makefile, remove OpenGL include
headers (GLFW will include them automatically) and conditionally set a
different shader version.
Fixed window movement for windows without header and some small
wrong calculation inside the panel layout code. In addition I
added another example implementing a simple calculator.
This is the first release version of nuklear (previously: zahnrad).
As for those who no the old version will notice: a lot has changed.
Most obvious should be the two biggest changes. First the name change
because I got critique that the name is hard to comprehend and
remember (understandable for non-germans) and the second is the
transistion from four files (zahnrad.h, zahnrad.c, stb_truetype
and stb_rect_pack) to one single header library file nuklear.h.
I am not 100% convinced that using a single header library is the
right choice here but so far I haven't encountered any problems.
Noticable should be as well that nuklear now directly embeds three
stb libraries: stb_truetype, stb_rect_pack and stb_textedit. Like
in previous versions the first two are optional and the library
can be compiled without. stb_textedit on the other hand powers
the text edit implementation for single as well as multiline
text manipulation. The text edit implementation is still relative
new and untested so you can expect some bugs I have not found yet.
In the demo department a lot changed as well. All platform demos
now don't compile one big demo but instead contain a simple
demo and small abstraction layer over the platform. Main benefit is
better understandablity improved ease of use. The old demo
is now split up and transfered into the example folder while each part
is self contained and compileable. (All examples use glfw I don't now
if this is the best platform but it is at least the simplest.
I also removed the apple demo because I don't have an apple system
and cannot make sure the new version runs with the old version.
Finally a lot of small bugs have been fixed as well as bugs found by
clang analyzer and coverity.
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.
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.
Previously all examples used an event based update scheme since
they caused performance issues on Linux. Further testing revealed
that vsync + tripple buffering causes problems and just needs to be
turned off to smoothly run all examples.