* fix(demo/sdl3_renderer): Makefile should now support Win + Emsdk
Fixed several issues that would prevent this demo from being compilable
on Windows with Emscripten: (1) there was a typo preventing proper
resolution of BINEXT, (2) in case of using Emscripten, Windows was taking
a precedense due to OS always being defined, (3) BINEXT now has a
special case for Emscipten, (4) pkg-config provided by w64devkit has no
--path flag, so we retry with --exists too, (5) compiler invocation was
missing system flags, which could break on some MSYS2 runtimes,
(6) compiler invocation now uses all kinds of C/CPP/LD flags so you can
easily inject something like --shell-file now, and probably more...
This was done in order to help with implementing and testing for:
https://github.com/Immediate-Mode-UI/Nuklear/issues/888
* refactor(demo/sdl3_renderer): consistent syntax and flow in Makefile
Use ${} for variable expansion and $() for invoking functions.
Use $(or ...) for all branches instead of ifeq(...) blocks.
Hopefully, this will make it easier to read and understand.
* fix(demo/sdl3_renderer): append user provided C/CPP/LD flags in Makefile
Before it was overwriting those flags entirely, meaning that it could
delete some required ones (e.g. from pkg-config). Now it will append
them correctly, so your flags will take priority where it matters.
* Update nuklear.h
fixed pointer and size type defs for MinGW64
* -- added __clang__ macro for windows clang and clang-cl to also work
* updated the template nuklear.h to fix NK_SIZE_TYPE and NK_POINTER_TYPE
* Update src/nuklear.h
* Apply suggestion from @RobLoach
---------
Co-authored-by: Rob Loach <RobLoach@users.noreply.github.com>
Fixes the issue where you would not be able to provide
your own `bool` symbol when it's sizeof is not equal to 4.
This was bloking all custom code from supplying C99 _Bool,
or C++/C23 bool, or any other custom bool like in case of SDL3 demo.
New checks should be way more sane. The old ones never worked,
despite of comment that you could use `char` for it.
Fixes: https://github.com/Immediate-Mode-UI/Nuklear/issues/849
Nuklear changed a lot of stuff from integer types to nk_bool back in:
https://github.com/Immediate-Mode-UI/Nuklear/pull/185
This introduced an issue in demo/common/style_configurator.c where
the int pointer would be passed into nk_checkbox_label()
which expects nk_bool pointer instead, thus causing an unsafe cast.
This change fixes this issue by using a reference of additional variable.
Fixes: https://github.com/Immediate-Mode-UI/Nuklear/issues/812
Those 3 internal functions are only used by nk_dtoa implementation,
which means that you will get -Wunused-function warnings when providing
your own NK_DTOA. Now we are guarding those with NK_DTOA_NEEDED ifdef.
This change was intentionally split into separate commit so it
will be easy to git-bisect and git-revert in case of any issues.
https://github.com/Immediate-Mode-UI/Nuklear/pull/862#pullrequestreview-3480471232
There was a note inside nuklear_sdl3_renderer saying that SDL3 does not
have "dtoa", so I simulated it's behavior with printf. This helps us
test the actual NK_DTOA preprocessor path.
nk_strtod implementation was never guarder by the preprocessor,
so if you ever provided your own NK_STRTOD, the default one would
still be compiled. This fix was intentionally split into another commit,
because the lack of the guard was very suspicious to me...
Fixes: https://github.com/Immediate-Mode-UI/Nuklear/issues/851#issuecomment-3503880414
This fixes an issue, where you would not be able to build Nuklear from
sources (without amalgamated header), caused by nuklear_math/util.c
not declaring some function definitions, due to wrong preprocessor logic.
This fix is an "Option 3" mentioned in following comment...
https://github.com/Immediate-Mode-UI/Nuklear/issues/256#issuecomment-2949725477
... where we define NK_XXX_NEEDED macro at nk_xxx symbol definition
so the preprocessor will be able to correctly detect it in all cases.
Fixes: https://github.com/Immediate-Mode-UI/Nuklear/issues/256
Currently nk_xcb_handle_event discard everything that was sent from
other clients through xcb_send_event.
To enable a minimal IPC over such channel, this patch adds a new option
NK_XCB_CLIENT_MESSAGE to the nk_xcb_event_type enum and stores the
message recieved in xcb_ctx->last_client_message.
This can be useful in particular when a background process or thread
completes a data retrieval or processing and want to wake up the GUI.
This is a highly updated demo for libSDL3. It fixes a lot of long
occuring issues and brings some improvements specific to SDL3 API.
The origin and development of this demo is quite long.
The exact track of development is something like this:
`Nuklear/demo/sdl_renderer` -> https://github.com/Immediate-Mode-UI/Nuklear/pull/772 -> https://github.com/Immediate-Mode-UI/Nuklear/pull/779 + https://github.com/Immediate-Mode-UI/Nuklear/pull/825 -> _this_ commit...
You may wish to read the linked PRs in order to get the full context.
Commit message is too small to describe everything. I'm sorry...
Other "editable" widgets are updating the its window 'edit.active' state,
but not nk_property. SDL3 demo needs this in order to hook SDL_SetTextInput.
This patch was initially proposed by https://github.com/rswinkle
The only thing I changed in it, was a removal of 'edit.name' update,
nk_property is not using the name hash, so there is no reason to set it.
Origin: https://github.com/Immediate-Mode-UI/Nuklear/pull/852#issuecomment-3518277340
Co-authored-by: Robert Winkler <rob121618@gmail.com>
Small refactor in nk_widget_text that makes the code look the same
for X and Y axis alignment. Before it was unconditionally setting
the label.y/.h values for NK_TEXT_ALIGN_TOP, instead of doing it
inside of the branch (unlike the other axis), which was quite
confusing and probably the reason why the bug existed here
in the first place (see previous commit for reference)
Fix nk_widget_text to use NK_TEXT_ALIGN_LEFT by default,
instead of silently failing when no x-axis alignment is provided.
For comparison, y-axis does not have this issue and defaults to TOP.