For example, I draw something via GDI+. Now I can call `nk_gdip_render_gui(AA)` and it will not erase my drawings, just will draw on top.
Previos API was not changed.
Fix incorrect button drawing (wrong stroke, empty spaces in stroke line near the corners). Since there are quarters of circle in the angles then lines must be moved to R, not to D.
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.
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
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.
I removed the default vertex type and instead create an API to allow the
user to specify the vertex struct layout. Of course you are still
bound on what the library actual has on vertex data but the type and
sequence of the data is now configurable. This commit is quite
experiental and could introduce some bugs, but so far it look fine.
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`.
Taking in an extern demo is almost always a bad idea since I will be
the one to keep to date and I am not always able to do so. Emscript
was the last time I tried. For now on if anyone has a neat demo
please keep it in your own repository and I will create a link to it.
Nuklear now has three different property versions for int, float and
added by this commit a double version. Internally an additional change
happend. Now the type of the property is actually taken into account
and floating pointer errors due to casting are less of an issue.
Previously I packed standard library variable arguments as well as
file operation into one define `NK_INCLUDE_STANDARD_IO`. This caused
some problems and I split the define into two. So if you want the old
behavior you need to define `NK_INCLUDE_STANDARD_IO` as well as
`NK_INCLUDE_STANDARD_VARARGS`. If you only want file operations but
not variable arguments only define `NK_INCLUDE_STANDARD_IO` and
if you only want varargs but not file operations please only define
`NK_INCLUDE_STANDARD_VARARGS`.
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.
Demos for x11 and sdl have been update so that `nk_xxx_handle_event'
return true (1) if the given event was usefull and processed by
nuklear and false (1) if not.
Since it was requested I added a small snippet showing how to create
notebook tabs (header with buttons, selecting content). The added
demo is basically just a combination of already existing widgets +
some small styling changes and can be extended to easily support
case with more tabs then space in the header part. I will have
to think about if it is possible to create an API for this without
taking away the simplicity of it.
Previously if you used movable or scalable groups you had to add
the group border width to the panel to access the updated position
or size. Nuklear now takes control of the process and the new
position/size can be read after `nk_group_end` from `nk_panel`
directly.
It's now possible to define a specific color for each line or
column entry inside a chart. This purely extends the API and all
previous implementation still work.
Hopefully fixed selection bug for empty lines and made edit widget
usable while being only partially visible. I also added two addition
modes for a vim like expierence with view, insert and replace mode
instead of default replace mode, but only added the new behavior into
the x11 demo so far.
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.
Text manipulation in SDL1.2 is quite a pain to say the least. But
since this demo is already quite limited in some aspects I think it
is fine to just get things running. That being said if used seriously
then text input still needs some work.
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)
Previously if you use `nk_edit_string` and use flag
`NK_EDIT_CLIPBOARD`, callbacks were not passed. I only tested it with
`nk_edit_buffer` and set the callbacks directly. This wrong behavior
is now fixed and should work copy & paste should behave correctly.
I passed a depth value inside `nk_xsurf_resize` and changed it to
default value. I tested it by removing the resizing code and it
worked for me again. Hopefully this fixes the bug.
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.
Previously all window, popup, comboboxes, tooltips, menu and
contextuals had a fixed border width of 1 and had the same color.
Now it is possible to change the individual border width and color of
each one seperatly.
This commit extends the optional currently existing low level font
baking API with another more high level font atlas API.
The font atlas takes away some fine grained memory control from the
user but is easier to use and to understand than the lower level API.
I added combined with the font atlas a optional default font which
allows running the library without a user provided truetype font.
While user friendly it is quite big (~12kb) so I added a compiler flag
to remove it from the library while compiling if not wanted.
Finally I added some additional compiler flags to allow easier to use
APIs. The downside is that all of them require the standard library,
so if you don't want to add the standard C library I would recommend
deactivating all flags marked as standard library flags.
Previous visual changes in the library were quite limited with some
colors and some global properties. This commit changes all that and
provides way more control over every widgets visual appearance.
Changes include extended color selection, per widget properties and
the possibility to use skinning.
While the new API allows for a lot more control it is currently quite
low level and needs a lot more testing and probably another higher
level style API to make changes in code easier. I also had to remove
the style modification code inside the demo and will probably first
try to write another higher level API before adding it back in.
This commit also include some breaking changes to existing code like
the missing style stack API and some widget names changes due to
added granularity granted by the rewritten style.
The default draw command buffering API now supports filled and
outlined shapes as well as two additional commands: polygon and
polyline. While zahnrad only requires a small number of basic
filled draw command shapes to actual function the underlying canvas
to convert from draw commands to vertex buffer commands allows
for lot more. So the gap should now be filled and drawing more
complex custom is now a little bit easier. I thought about adding a
path drawing API to the draw command API but decided it is not
worth the hassle, at least for now.
I spend the last week(s) with lot of time thinking about this and I
came to the conclusion that recording it is not really worth doing.
In theory it could be interesting but the truth is I don't want to
do any more complex refactoring anymore and want to have a break
from extending this library. I spend over a year on this and I think
it is time for me to move on to other things. I will continue fixing
errors or adding requested essential smaller features but no
more complex rewrites or risky changes.
This is quite a big commit which adds an experimental text script to
UI bytecode compiler. The compiler is still under heavy development
and can and will be under heavy changes, so use with caution.
In addition I added the old file browser for unix like platforms
back into the demo. At the moment it only supports windows but
the only part of the file browser that is platform dependend
is the directory content loader which should be easy to implement
in other platforms as well.
An additional widget for picking a color was added. Color picker use
the new draw call command multicolor rectangle which is not supported
everywhere. All demos using the optional vertex buffer output can use
the color picker without problems. Other platforms need to support
a drawing function or do not it.
Extended the demo window with a submenu which allows to activated or
deactivate windows. In this particular case the sequence in which the
control and demo window in contrast to all the other windows are
placed is important but only in this demo since querying is done by
the control window.
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.
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.
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 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.
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.