Commit Graph

46 Commits

Author SHA1 Message Date
vurtun
a03c887b71 Fixed #137 by only clipping not visible triangles
Triangle software clipping conditions was incorrect and clipped if
already one vertex was not visible.
2016-05-19 12:27:34 +02:00
vurtun
67588f3ba3 Fixed #135 rendering bug
This commit fixes a stupid reallocation bug I had inside the library.
Basically I get a pointer inside a growing buffer which can be
invalidated by a second allocation and regrowth of said buffer.
Under normal circumstances I do not do this but in one instance I
actually did. That is for allocation temporary normals. This issue
should now be fixed and work correctly.
2016-05-19 12:14:19 +02:00
vurtun
ed4a3133b8 Fixed some issues valgrind and ASAN found
This fixes some small harmless unitialized variable access violations
found by either valgrind or ASAN. Nothing really ground breaking but
still cleaner.
2016-05-18 20:19:48 +02:00
vurtun
570ce73404 Fixed #131 with moving unfocused windows
Previously you had to first activate a window by clicking if it was
visually blocked by another window to move it around which was a
little bit blocky. It should now be possible to directly move and
activate a window.
2016-05-16 14:38:43 +02:00
vurtun
847b9c4a19 Fixed wrong widget hovering for multiple windows
Previously buttons would show up as hovered if another widget was
being hovered in another window. This behavior is now fixed and
everything should work correctly now.
2016-05-16 12:22:11 +02:00
Micha Mettke
a91f801ae2 Merge pull request #126 from hobbitalastair/master
s/memset/memcpy/ - typo fix in documentation
2016-05-10 21:56:48 +02:00
vurtun
b712a3a163 Removed C89 errors and warnings and style issues 2016-05-10 14:05:55 +02:00
vurtun
7e96bfc586 Merge branch 'fixing_window_scaling' of https://github.com/jimon/nuklear into jimon-fixing_window_scaling 2016-05-10 13:36:10 +02:00
Dmytro Ivanov
21d2458bdc fixing window scaling 2016-05-09 21:35:39 +02:00
Dmytro Ivanov
72b06835a2 close popups by clicking anywhere outside of popup bounds 2016-05-08 22:04:20 +02:00
vurtun
74e115dac7 Fixed C++ error 2016-05-06 20:16:25 +02:00
vurtun
da13dc3261 Fixed aliasing/alignment issues with nk_pool
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.
2016-05-06 14:13:14 +02:00
vurtun
c51d0694ac Removed possible dead table memory bug for windows
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.
2016-05-06 11:27:42 +02:00
Alastair Hughes
21c6c12537 s/memset/memcpy/ - typo fix in documentation 2016-05-06 20:39:02 +12:00
vurtun
ac8f0e2069 Extended chart API with slots
I extended the chart API to allow more than one graph and implemented
a testcase using this API inside the `overview.c` chart example.
2016-05-05 22:37:13 +02:00
vurtun
7810bc20bd Changed multi context chart name 2016-05-05 21:18:31 +02:00
Jan Viktorin
86547049df Support multiple data sets in a single chart
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>
2016-05-05 19:43:40 +02:00
vurtun
33185df10a Fixed wrong border line width for popups 2016-05-03 22:17:08 +02:00
vurtun
cc629f45ca Enhanced nk_tree_push_id uniqueness #106
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__`.
2016-05-03 13:23:04 +02:00
vurtun
31938dac3a Removed unnecessary menu clipping #119 2016-05-02 15:28:29 +02:00
vurtun
66ce0ce8e5 Added nk_item_any_active for #107 and fixed typo
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.
2016-04-30 22:27:29 +02:00
vurtun
fa01e2a0db Fixed grapped dragging behavior #116
Fixed mouse grapping emulation for progressbars and window position
dragging which previously still got triggered if other widgets were
being dragged.
2016-04-29 17:25:49 +02:00
vurtun
c7d3901e05 Enhanced widget click and drag interaction #116
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.
2016-04-28 22:51:09 +02:00
vurtun
8f03b5bcdd Set default types for nk_uint/nk_int to u/int #115 2016-04-27 23:15:52 +02:00
vurtun
4d36ca410e Fixed comment typo 2016-04-27 13:07:50 +02:00
vurtun
9974a55eb1 Fixed properties edit field width calculation
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.
2016-04-26 14:48:03 +02:00
vurtun
8ebd0afe79 Fixed window position/size modification
Fixed windows ignoring changes to its position, size or both if a
group layout is used.
2016-04-25 14:11:35 +02:00
vurtun
2a230e2bd6 Removed shadows variable warning 2016-04-25 10:13:09 +02:00
Doug Thayer
72b362325d Fix issue with adding multiple fonts
The total range count grabbed from nk_range_count was being used
to get the glyph count, which resulted in a buffer over-read.
2016-04-24 14:05:34 -07:00
vurtun
412f65fa65 Fix #108 pushing wrong texture in empty draw_list
Fixed a small copy & paste error which pushes the wrong texture
into an empty draw list. In normal cases this never occurs but is
still a big if used independent of libraries use cases.
2016-04-23 16:29:58 +02:00
vurtun
5da8216f71 Fixed property text input
Inserting text into a property would cause an assert because
I forgot to set the upper bounds of the text edit inside the property.
2016-04-23 12:28:45 +02:00
vurtun
bdbc8f9c26 Removed private underscore of nk_tree__push #106
`nk_tree__push` was not supposed to be seen as private but more like
the more extended way of handling duplicate tree elements. But I used
double underscore which is the general indicator for private. I renamed
it know to nk_tree_push_id, to hopefully make it clearer.
2016-04-23 10:34:50 +02:00
vurtun
3929ec8dee Added some additional documentation 2016-04-21 17:35:52 +02:00
vurtun
bc8db2e3f3 Fixed #97 with text input at end of edit field
This commit fixes a bug that occurs if you move the cursor inside
text and then back to the end of the text and insert a character.
Caused was the bug by an incorrect check if the cursor is at the
end of the string.
2016-04-21 12:39:07 +02:00
vurtun
7c9659f3b8 Fixed #99 forgot to set clipboard callbacks
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.
2016-04-21 11:04:18 +02:00
vurtun
7ccd95f2f1 Reverted qsort back to own implementation
Forgot the remove some test code for the last commit.
2016-04-20 18:36:51 +02:00
vurtun
1d7f0244f9 Revert float '=' cond and oversample default font
I previously used a conditional style so I don't have to compare
floats directly with eachother because of warning. This caused some
bugs and I now reverted back all conditions back to normal.
In addition I oversampled the default font to make it look better.
2016-04-20 18:28:04 +02:00
vurtun
18b93fcc8a Fixed #90 cppcheck warning and errors
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.
2016-04-20 10:31:20 +02:00
vurtun
4d02cf9c80 Removed unused variable 2016-04-19 19:46:13 +02:00
Emery Hemingway
92f5257e92 correct type definitions without NK_INCLUDE_FIXED_TYPES 2016-04-19 15:28:44 +02:00
Bruce Mitchener
da46d536f9 Fix some typos. 2016-04-19 15:23:33 +07:00
vurtun
9b2822c06e Fixed #63 error and wrong header dragging calc 2016-04-19 00:35:52 +02:00
Angus Holder
a6e980df6e Clearing up compiler warnings
Some minor issues: an unused variable, fixed a comparison of int against
float, and a pragma warning (pop) that didn't have a matching pragma
warning (push). Potentially more serious was a possible buffer overrun,
where a pointer was being tested against a null terminator, instead of
the char it points to.
2016-04-18 20:29:34 +01:00
Angus Holder
12f3c8406d Fixes for C++ compatibility, corrected an assert call
There were a few casts from void * missing causing problems when
compiling as C++, also the assert function from <assert.h> was being
used instead of NK_ASSERT(...) in one place.
2016-04-18 16:08:43 +01: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
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