Commit Graph

341 Commits

Author SHA1 Message Date
Frederik De Bleser
a8d124adf1 Avoid conditional includes in SDL example. 2016-04-19 13:46:06 +02:00
Frederik De Bleser
3b29a92f0d Avoid conditional includes.
GLFW will automatically include the correct OpenGL headers, so we can
avoid having a conditional include in our code.
2016-04-19 13:45:51 +02:00
Frederik De Bleser
26fc35ac94 Use lower shader version for better compatibility on OS X
We just need the basic features for getting a texture on screen, so
GLSL version 1.5 is enough.
2016-04-19 13:06:54 +02:00
Frederik De Bleser
5b0b4c9ffd Support OS X for the GLFW demo.
Use conditionals to support the appropriate includes and shader
versions needed for OS X.
2016-04-19 11:02:22 +02:00
vurtun
d7a9f14c1c Fixed some small bugs and added calc example
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.
2016-04-15 20:13:50 +02:00
vurtun
e418ae8c02 Put unicode text input back into xlib demo 2016-04-14 21:02:53 +02:00
vurtun
b2c87ed7c0 Release Version 1.0
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.
2016-04-14 16:26:15 +02:00
vurtun
f1e81a59ea Added font merging into font atlas and font baker 2016-04-02 19:16:00 +02:00
vurtun
a97ac0ea4d fixed wrong font height 2016-04-01 21:54:55 +02:00
vurtun
d9f1831321 Finally fixed customizable window border width
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.
2016-04-01 18:34:16 +02:00
vurtun
08ab2b40c1 Added some additional utility functions
Extended the standard library included functions with some
additional functions depending on <stdarg.h>.
2016-03-31 20:44:03 +02:00
vurtun
e1a1239674 fixed test code 2016-03-31 19:47:40 +02:00
vurtun
4eb939f4db Added additional API for simple color styles
Extended the quite complex style and skinning API with another easier
to use API to set the color scheme of the UI only from color.
2016-03-31 19:31:02 +02:00
vurtun
ca5ec8c2a4 removed test code 2016-03-30 16:20:29 +02:00
vurtun
781202223d Added font atlas, default font + compiler switches
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.
2016-03-30 12:54:22 +02:00
vurtun
f21c835363 fixed piemenu 2016-03-28 12:36:56 +02:00
vurtun
fcba0e676b Added skinning and extend customization
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.
2016-03-26 16:05:19 +01:00
vurtun
2cedc57f5d Extend default draw command API
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.
2016-03-16 13:01:47 +01:00
vurtun
467118a86e Removed UI recording and revert to old version
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.
2016-03-15 21:12:25 +01:00
vurtun
5d54d65894 Removed textual UI representation 2016-03-09 13:12:30 +01:00
vurtun
4f677d200e Fixed C++ build errors 2016-03-08 08:58:55 +01:00
vurtun
68edafcd0c Added 'Enter' and 'Leave' widget events 2016-03-08 08:50:21 +01:00
vurtun
b0cc043879 added missing ifdefs for windows 2016-03-08 08:44:31 +01:00
vurtun
b09849f41a Added script to UI bytecode compile + file browser
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.
2016-03-07 18:17:15 +01:00
vurtun
32277127ac Added color picker widget
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.
2016-03-04 17:13:30 +01:00
vurtun
33af175b7e Added color conversion to and from hex string 2016-03-03 21:16:25 +01:00
vurtun
344be6eed2 Added window (de)activation into demo menu
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.
2016-03-03 14:36:28 +01:00
vurtun
3d905b2451 Fixed small C++ error since new is a keyword 2016-03-03 13:17:32 +01:00
vurtun
acb2a31b82 Fixed window hiding and exposing bug
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.
2016-03-03 13:12:20 +01:00
vurtun
047deec3cd Added time and date combobox to demo
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.
2016-03-02 17:58:22 +01:00
vurtun
8159391640 Added Title alignment flags to menu header fix #53
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`.
2016-03-02 09:45:06 +01:00
vurtun
1125016d0a Fixed simple allegro example text drawing bug
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.
2016-03-01 19:52:18 +01:00
vurtun
c19a6a1bbe Finished experimental recording features
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.
2016-03-01 18:48:19 +01:00
vurtun
d0d5414164 first step 2016-02-24 13:19:39 +01:00
vurtun
ae1e3fc003 Fixed C++ errors that depend on typesafe enums
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...)
2016-02-16 13:42:20 +01:00
vurtun
9ab708e543 Fixed some c++ errors that slipped through 2016-02-15 19:37:31 +01:00
vurtun
e4448f5881 Added additional widget utility functions 2016-02-15 19:03:21 +01:00
vurtun
f727058044 Fixed rgb->hsv conversion and extended granularity
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.
2016-02-15 02:19:09 +01:00
vurtun
6adbb375de updated apple demos 2016-02-14 22:06:51 +01:00
vurtun
de384a805b changed layout param from zr_size to int 2016-02-14 22:06:12 +01:00
vurtun
98da4841dd Fixed canvas arc and therefore piemenu drawing
I forgot to add the center point to drawing an arc which resulted
in half spheres. It is now fixed and should work as intended.
2016-02-12 20:30:06 +01:00
vurtun
730fd24746 Fixed popup drawing inside groups
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.
2016-02-12 19:09:36 +01:00
vurtun
890430db76 Fixed node editor node linking
Because clicking was changed to happen on button up instead
of button down linking was bugged. It has been fixed and should
work now was expected.
2016-02-12 17:51:59 +01:00
vurtun
fdbcc52629 Merged examples and demos into one (first step)
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.
2016-02-11 23:29:02 +01:00
vurtun
f5b6010a01 Added additional selectable color themes to demo
This commit extents the provided number of themes inside the demo
and updates the default style by using a smaller default padding
value for windows.
2016-02-09 15:16:05 +01:00
vurtun
c4916f62dd renamed zr_layout to zr_panel 2016-02-02 15:43:19 +01:00
richi
292c33d78b Additional CoreGraphics Example
iOS_CoreGraphics does contain a simple example running
Zahnrad on top of the native CoreGraphics API.
2016-02-01 21:15:25 +01:00
richi
c3da9dc2b6 vertexes -> vertices 2016-02-01 09:42:05 +01:00
vurtun
b2e99df63d Added enter event to edit widget
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.
2016-02-01 09:26:22 +01:00
vurtun
96fe7f7775 Added a global alpha modifier to zr_convert
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.
2016-01-28 22:24:54 +01:00