Dimitriy Ryazantcev
876c97454a
Cleanup WIN_CreateCursor() code a bit
...
Closes #6476
2023-11-13 11:46:50 -08:00
Sam Lantinga
1c4723ac66
SDL_CreateWindowFrom() now takes a set of properties that describe the native window and options.
2023-11-12 21:58:58 -08:00
Sam Lantinga
6afae6681b
Allow casting properties of different types
2023-11-12 21:58:58 -08:00
Sam Lantinga
bd269b0f41
Added SDL_SetBooleanProperty() and SDL_GetBooleanProperty()
2023-11-12 21:58:58 -08:00
Ryan C. Gordon
0efb3d90e0
audio: removed a fixed FIXME comment.
2023-11-12 23:41:22 -05:00
nia
69cae07cc1
cpuinfo: Fix detection of physical memory above 2GB on NetBSD
...
Rework the code to clearly prefer 64-bit sysctls first, then
legacy sysctls, and eliminate a second ifdef.
Signed-off-by: Nia Alarie <nia@NetBSD.org >
2023-11-12 18:12:18 -08:00
Sam Lantinga
0907f345cb
Added property types: pointer, string, number, float
2023-11-12 10:48:38 -08:00
Christoph Reichenbach
7c80ac6df7
API for pressure-sensitive pens + XInput2/Wayland
...
This patch adds an API for querying pressure-
sensitive pens, cf. SDL_pen.h:
- Enumerate all pens
- Get pen capabilities, names, GUIDs
- Distinguishes pens and erasers
- Distinguish attached and detached pens
- Pressure and tilt support
- Rotation, distance, throttle wheel support
(throttle wheel untested)
- Pen type and meta-information reporting
(partially tested)
Pen event reporting:
- Three new event structures: PenTip, PenMotion, and
PenButton
- Report location with sub-pixel precision
- Include axis and button status, is-eraser flag
Internal pen tracker, intended to be independent
of platform APIs, cf. SDL_pen_c.h:
- Track known pens
- Handle pen hotplugging
Automatic test:
- testautomation_pen.c
Other features:
- XInput2 implementation, incl. hotplugging
- Wayland implementation, incl. hotplugging
- Backward compatibility: pen events default to
emulating pens with mouse ID SDL_PEN_MOUSEID
- Can be toggled via SDL_HINT_PEN_NOT_MOUSE
- Test/demo program (testpen)
- Wacom pen feature identification by pen ID
Acknowledgements:
- Ping Cheng (Wacom) provided extensive feedback
on Wacom pen features and detection so that
hopefully untested Wacom devices have a
realistic chance of working out of the box.
2023-11-12 09:52:02 -08:00
Sam Lantinga
843873626c
Handle window resizing on the render thread in D3D11 and D3D12
...
This prevents crashing when a separate thread is being used for rendering
Discussion and sample code in https://github.com/libsdl-org/SDL/issues/8528
2023-11-11 12:49:53 -08:00
Sylvain Becker
04b6b2979f
Re-add SDL_assert() with non boolean ptr syntax ( #8530 )
2023-11-11 12:28:24 +03:00
Sam Lantinga
b374105975
Replaced SDL_GetTextureDXGIResource() with texture properties
...
Fixes https://github.com/libsdl-org/SDL/issues/8529
2023-11-10 20:38:13 -08:00
Sam Lantinga
09d1e9defb
Only update the battery status for Bluetooth Switch Pro controllers
...
Controllers that are plugged in are in the wired state
2023-11-10 17:09:39 -08:00
Sam Lantinga
87794d03ad
Added shortened name for "Nintendo Co., Ltd."
2023-11-10 17:04:37 -08:00
Sam Lantinga
fbb6934905
Added support for the Dragonrise GameCube adapter with VID 0x1843
2023-11-10 16:39:32 -08:00
Sam Lantinga
d98e1bdfe1
Use the standard gamepad type for Switch Pro controllers using the GameCube form factor
2023-11-10 16:39:32 -08:00
Sam Lantinga
2991b9f6ac
SDL now represents gamepad buttons as positional elements with a separate label
...
This gives applications and binding systems a clearer view of what the hardware is so they can make intelligent decisions about how to present things to the user.
Gamepad mappings continue to use abxy for the face buttons for simplicity and compatibility with earlier versions of SDL, however the "SDL_GAMECONTROLLER_USE_BUTTON_LABELS" hint no longer has any effect.
Fixes https://github.com/libsdl-org/SDL/issues/6117
2023-11-10 12:21:43 -08:00
meyraud705
8708ba7393
Don't leak if realloc fails
2023-11-10 06:33:39 -08:00
Mathieu Eyraud
36b2d2e463
Fix memory leak in SDL_SendDrop()
2023-11-10 06:32:43 -08:00
Mathieu Eyraud
dfb87e1099
Fix uninitialised variable 'properties'
...
If SDL_CreateHashTable() fails, properties->lock is not initialised, SDL_FreeProperties() is called and destroys the uninitialised lock.
2023-11-10 06:32:15 -08:00
Mathieu Eyraud
e54c5e0204
Fix condition in SDLTest_TrackAllocations()
2023-11-10 06:31:44 -08:00
Ryan C. Gordon
89408a9705
wasapi: ResetWasapiDevice no longer blocks on management thread.
...
It just proxies all its necessary releases and frees to these without
blocking, and sets the appropriate fields to NULL so they can be used again
immediately, regardless of when the old stuff actually gets released.
2023-11-09 20:27:58 -05:00
Frank Praznik
74f3643bfa
wayland: Add missing break to switch statement
2023-11-09 19:48:56 -05:00
Anonymous Maarten
2d6bae70b4
Older gcc does not support #pragma GCC diagnostic inside functions
2023-11-09 23:33:28 +01:00
Sylvain
d8600f717e
Pointer as bool (libsdl-org#7214)
2023-11-09 14:18:36 -08:00
Anonymous Maarten
23db971681
x11: Ignore deprecated declaration of XKeycodeToKeysym
2023-11-09 18:45:54 +01:00
Sylvain
59f93e20a7
Add SDL Video Capture, with back-end for linux/macos/ios/android
2023-11-09 08:36:23 -08:00
Sam Lantinga
3ab98a3572
Removed debug print statements (thanks @stsp!)
2023-11-08 20:43:44 -08:00
Sam Lantinga
f4b61fff30
Implemented VT switching for KMSDRM on Linux
...
Fixes https://github.com/libsdl-org/SDL/issues/3844
2023-11-08 20:35:16 -08:00
Sam Lantinga
bea34c5380
Fixed a memory leak at window creation.
...
Windows updates the desktop display mode once at video init (in WIN_InitModes()) and once when creating a window (in WIN_RefreshDisplays())
Fixes https://github.com/libsdl-org/SDL/issues/7982
Fixes https://github.com/libsdl-org/SDL/issues/8189
2023-11-08 14:26:07 -08:00
Sam Lantinga
b5347c3364
Fixed emscripten and iOS builds
2023-11-08 14:14:41 -08:00
Sam Lantinga
02f356439d
Allow the application to draw while Windows is in a modal move/resize loop
...
If you're using the application main callbacks, your SDL_AppIterate() function will be called while Windows is moving and resizing your window. If not, then SDL will send an SDL_EVENT_WINDOW_EXPOSED event for your window and you can use an event watcher to redraw your window directly from the callback.
Fixes https://github.com/libsdl-org/SDL/issues/1059
Closes https://github.com/libsdl-org/SDL/pull/4836
2023-11-08 13:32:56 -08:00
Sam Lantinga
407a3cb4e0
Fixed infinite recursion initializing properties
2023-11-08 12:38:04 -08:00
Sam Lantinga
979214363f
Added SDL_GetGlobalProperties()
...
We'll undoubtedly want to have global properties available
2023-11-08 12:01:48 -08:00
Sam Lantinga
151cdfa99f
Added the "SDL.window.wayland.registry" property
...
Fixes https://github.com/libsdl-org/SDL/issues/8393
2023-11-08 12:01:48 -08:00
Sam Lantinga
6c91b28e71
Added the "SDL.renderer.d3d12.command_queue" property
...
Fixes https://github.com/libsdl-org/SDL/issues/8491
2023-11-08 12:01:48 -08:00
Sam Lantinga
4e8d1ec983
Fixed crash trying to create a metal view with the dummy driver
2023-11-08 12:01:48 -08:00
Sam Lantinga
fd4a2cce9e
SDL_syswm.h has been removed and replaced with window properties
2023-11-08 12:01:48 -08:00
Sam Lantinga
aea6e6de6f
Simplified SDL_SetProperty() and added SDL_SetPropertyWithCleanup()
...
Most of the time people won't need to set a cleanup callback, so we can simplify the more commonly used API.
2023-11-08 12:01:48 -08:00
Sam Lantinga
a1941fad6c
Replaced SDL_RenderGetD3D11Device(), SDL_RenderGetD3D12Device(), and SDL_RenderGetD3D9Device() with renderer properties.
2023-11-08 12:01:48 -08:00
Sam Lantinga
0cd4b7d3e3
Added display properties
2023-11-08 12:01:48 -08:00
Sam Lantinga
a02afbaea5
Clean up window properties when the window is destroyed
2023-11-08 12:01:48 -08:00
Sam Lantinga
8668943746
Standardized property names for internal SDL properties
2023-11-08 12:01:48 -08:00
Sam Lantinga
a4c6b38fef
Fixed FreeBSD build
2023-11-08 07:46:02 -08:00
Sam Lantinga
d9e6dcc650
Fixed FreeBSD build
2023-11-08 04:45:29 -08:00
Sam Lantinga
7cc3e94eb2
Store the requested muted state
2023-11-08 03:36:47 -08:00
Sam Lantinga
ce9e1bd324
Don't mute the console input if we can't read the keyboard
...
This makes sure you can hit Ctrl-C if you don't have permission to access the raw keyboard device.
Fixes https://github.com/libsdl-org/SDL/issues/4812
2023-11-08 03:29:10 -08:00
Sam Lantinga
80b2bbad21
Removed useless branch test
...
Fixes https://github.com/libsdl-org/SDL/issues/8286
(cherry picked from commit e5ccc80aba )
(cherry picked from commit 7e11bd1ac1 )
2023-11-08 01:36:14 -08:00
Sam Lantinga
15bc12165a
Actually we need to enumerate the 8BitDo Xbox SKUs
...
At the point we're calling SDL_IsJoystickXboxSeriesX(), we don't know for sure that the controller is an Xbox controller.
Fixes https://github.com/libsdl-org/SDL/issues/8174
2023-11-08 00:42:42 -08:00
Sam Lantinga
8049af3355
Assume all 8BitDo Xbox controllers have a share button
...
Fixes https://github.com/libsdl-org/SDL/issues/8174
2023-11-08 00:34:50 -08:00
Sam Lantinga
ed1e0c1530
Make sure joysticks are locked when adding and removing them
...
Fixes https://github.com/libsdl-org/SDL/issues/8146
2023-11-08 00:13:16 -08:00