The shorthand version of this function didn't allow specifying a controller name, which seems pretty important. It seems like anyone actually implementing a virtual joystick is going to want to use some of the extended functionality.
This allows applications to re-query the values if the system locale is changed during runtime, and better matches the other locale functions. A note is included in the documentation mentioning that this can be slow, as it has to call into OS functions.
Also allows for the removal of the init/quit time functions, as they are no longer needed.
Added macros SDL_SINT64_C() and SDL_UINT64_C().
Integer suffixes of SDL_MAX_SINT64, SDL_MIN_SINT64, SDL_MAX_UINT64
and SDL_MIN_UINT64 are now system dependent.
Press 'c' to center the pointer in the window using relative coordinates via SDL_WarpMouseInWindow().
Press alt+'c' to center the pointer in the window using global coordinates via SDL_WarpMouseGlobal().
- Adds support for modal windows to Win32, Mac, and Haiku, and enhances functionality on Wayland and X11, which previous set only the parent window, but not the modal state.
- Windows can be declared modal at creation time, and the modal state can be toggled at any time via SDL_SetWindowModalFor() (tested with UE5 through sdl2-compat).
- Allows dynamic unparenting/reparenting of windows.
- Includes a modal window test.
Replacing function call `kill(0, SIGINT);` with `(void)raise(SIGINT);` in file test/testlock.c.
The `kill()` function is not available on Unix systems when compiling without system extensions enabled.
This allows using a much smaller (1.5 KB) lookup table, in exchange for a small amount of extra work per frame.
The extra work (a few extra loads/mul/adds) is negligible, and can execute in parallel.
The reduction in cache misses almost certainly outweighs any added cost.
The table is generated at runtime, and takes less than 0.02ms on my computer.
If we need to extend this in the future, we'll make a second struct and
a second SDL_AttachVirtualJoystickEx-style function that uses it.
Just zero the struct and don't set a version.
Fixes#9489.
- Also add watchos support to CMake (SDL does not support this platform yet)
Co-authored-by: Ravbug <ravbug@users.noreply.github.com>
Co-authored-by: Anonymous Maarten <anonymous.maarten@gmail.com>
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
- Fixes a leak in pen name allocation that would trigger
for both X11 and Wayland for some non-pen input devices
when new devices are added/removed.
- SDL_PenQuit() now deallocates and resets the table of known pens
- testautomation_pen.c now uses PenInit and PenQuit as setup and
teardown, respectively
testautomation_pen.c was already triggering the leak, and it is
visible with --trackmem, so no new tests are added.