Commit Graph

25 Commits

Author SHA1 Message Date
Alexander W. Schultz
b6a7791d13 disables intrinsics on SDL demos
SDL library has an issue where it expects intrinsics headers to be
provided, but intrinsics are not exactly part of a standard, so there is
no guarantee that they will be available. As such, the library allows
you to turn them off. I am disabling them to allow for better
portability and ease of compilation.
2024-10-20 23:17:02 -04:00
Rob Loach
f7847e6024
Add delta_time_seconds to a few renderers (#628) 2024-08-29 22:22:55 -04:00
Rob Loach
b9e84c03f0
Merge pull request #636 from Ryder17z/patch-1
Proposal: Update nuklear_sdl_renderer.h to use recommended path for SDL.h
2024-05-25 15:46:07 -04:00
Rob Loach
8e84d63c6c
sdl: Allow changing the SDL.h path 2024-05-23 13:33:28 -04:00
User
b848bb0141 added nk_sdl_handle_grab declarations to demo/sdl_*/ headers 2024-05-17 08:13:14 +00:00
TheExileFox
38be74be66
Update nuklear_sdl_renderer.h
change SDL include path to the recommended path
2024-04-27 11:03:55 +02:00
Rob Loach
7f5c642bb3
Standardize INCLUDE_OVERVIEW defines 2024-04-25 16:49:50 -04:00
Rob Loach
4cfea49522
Remove STYLE_ defines as we have the style dropdown 2024-04-25 16:37:07 -04:00
paccer
56ab9d96ea Added comment to nk_sdl_handle_grab in SDL demos
Explains call order of SDL_SetRelativeMouseMode and SDL_SetWindowGrab
2024-02-23 20:39:08 +01:00
paccer
a10eb1351a Fix cursor warping to center on older SDL versions
Reverted the order of the SDL_WarpMouseInWindow and SDL_GetMouseState
to its original sequence.
This avoids cursor warping to the center of screen on older SDL versions
It causes an additional SDL_MOUSEMOTION event when ungrabbing, but does
not cause any issues.
2024-02-10 17:21:32 +01:00
paccer
e3b0f24626 Fix missed grab state changes in SDL demos
Move grab handling out of `nk_sdl_handle_event` to `nk_sdl_handle_grab`,
which is now called outside of the event loop.
This change makes the logic similar to the GLFW demos and fixes issues
with missed grab state changes and mouse cursor disappearing.
2024-02-10 03:03:16 +01:00
b-aaz
fb474874db Added required includes to the platform headers .
Added missing include decelerations and in one case removed an unnecessary
one form the platform headers in the demo/ directory .
2024-01-20 16:16:45 +03:30
Richard Gill
54cd692d17 added comment on ifdefs to use styles in demos 2022-10-13 11:51:50 +02:00
Richard Gill
fc5ce1c495 demos: set style with defines
To avoid having to modify the demo code,
conditionnally include a predefined style
2022-10-12 21:19:58 +02:00
Rob Loach
ca49016428
Rename more null variables to tex_null 2022-07-30 17:45:12 -04:00
Rob Loach
54fd67bddd
Rename additional .null variables 2022-07-30 17:43:46 -04:00
Rob Loach
ec4acc7cf4
Rename the null variable to tex_null 2022-07-30 17:38:10 -04:00
Kristian Bolino
04eac1db2a Scale font height rather than oversampling 2022-03-16 17:01:39 -04:00
Kristian Bolino
779c420d06 Fix C89 warnings and oversample at 3x scale 2022-03-15 18:10:01 -04:00
Kristian Bolino
ec4aa9992f Fix high-DPI scaling in sdl_renderer
This commit resolves two issues with high-DPI display rendering:

1. The coordinates were not scaled properly, resulting in tiny output
   and misalignment of actual cursor position with apparent position;
   this is fixed by calling SDL_SetRenderScale with appropriate scaling
   factors determined by comparing the window size to the renderer's
   output size
2. The fonts were not oversampled, resulting in excessively blurry text;
    this is fixed by setting oversample_h and oversample_v on the
    font_config according to the scaling factors
2022-03-15 11:43:31 -04:00
Kristian Bolino
cbfc8f89e9
sdl_renderer: fix Metal rendering (#426)
Addresses an issue where the Metal render driver (macOS) could not handle the clipping rectangle {-8192, -8192, 16384, 16384} and would simply draw nothing to the screen. The solution is to ensure the cliprect coordinates are not negative, which also doesn't break the other render drivers.

Co-authored-by: Kristian Bolino <kbolino@kbolino.com>
2022-03-15 15:28:47 +01:00
crazyBaboon
f0dccaeeec
Integrate file browser with glfw opengl2 demo (#400) and restructure demo/ directory accordingly 2022-03-14 20:46:44 +01:00
Rob Loach
6686ab1dd5
Fix incorrect cast on SDL_RenderGeometryRaw()
Fixes #405
2022-02-06 00:43:54 -05:00
lib-omar
8f5ae21035
Favor switch over if-else chain in event handler. 2022-01-29 14:13:34 -05:00
Rob Loach
cd4990834f
sdl_renderer: Update code 2022-01-06 21:55:20 -05:00