14370 Commits

Author SHA1 Message Date
Caiyi Hsu
5ba839e83b fix XRandR refresh rate calculation 2024-01-26 20:44:23 -08:00
Anonymous Maarten
44a2c4d512 Only retain SDL_* + platform macro's in rename_macros.py 2024-01-26 18:05:49 +01:00
Anonymous Maarten
c5794cd911 ci: bump actions version tag 2024-01-26 02:33:20 +01:00
Anonymous Maarten
33f86d81fc Add all macros from SDL2's SDL_config.h to rename_macros.py 2024-01-26 02:32:00 +01:00
Sam Lantinga
aeac8774f7 Missed one 2024-01-25 16:53:19 -08:00
Sam Lantinga
d0dd60c8ba Updated new pixel format names to be more consistent with the others 2024-01-25 16:51:22 -08:00
Sam Lantinga
0f78aa7c30 Add some high bit-depth pixel formats
These are not fully supported yet, just preparing for future work.
2024-01-25 16:40:46 -08:00
Ozkan Sezer
5ab879f89a SDL_kmsdrmvideo.c: move SDL_kmsdrmvulkan.h include to before all others
Fixes vulkan redefinition errors:

In file included from /tmp/SDL3/src/video/kmsdrm/.././khronos/vulkan/vulkan.h:11,
                 from /tmp/SDL3/src/video/kmsdrm/../SDL_vulkan_internal.h:52,
                 from /tmp/SDL3/src/video/kmsdrm/SDL_kmsdrmvulkan.h:32,
                 from /tmp/SDL3/src/video/kmsdrm/SDL_kmsdrmvideo.c:44:
/tmp/SDL3/src/video/kmsdrm/.././khronos/vulkan/vulkan_core.h:101: error: redefinition of typedef ‘VkInstance’
/tmp/SDL3/include/SDL3/SDL_vulkan.h:52: note: previous declaration of ‘VkInstance’ was here
In file included from /tmp/SDL3/src/video/kmsdrm/.././khronos/vulkan/vulkan.h:11,
                 from /tmp/SDL3/src/video/kmsdrm/../SDL_vulkan_internal.h:52,
                 from /tmp/SDL3/src/video/kmsdrm/SDL_kmsdrmvulkan.h:32,
                 from /tmp/SDL3/src/video/kmsdrm/SDL_kmsdrmvideo.c:44:
/tmp/SDL3/src/video/kmsdrm/.././khronos/vulkan/vulkan_core.h:7513: error: redefinition of typedef ‘VkSurfaceKHR’
/tmp/SDL3/include/SDL3/SDL_vulkan.h:53: note: previous declaration of ‘VkSurfaceKHR’ was here
make[2]: *** [CMakeFiles/SDL3-shared.dir/src/video/kmsdrm/SDL_kmsdrmvideo.c.o] Error 1
2024-01-26 03:20:14 +03:00
Ryan C. Gordon
ecbbef8b8d
blendmode: Corrected docs for SDL_BLENDOPERATION_[REV_]SUBTRACT.
They were documented backwards.

Fixes #8910.
2024-01-25 17:48:12 -05:00
Ryan C. Gordon
8814095aa8
main: Indented SDL_main headers for readability, removed SDL2 compat macros.
Specifically, SDL_WinRTRunApp, SDL_UIKitRunApp, and SDL_GDKRunApp macros were
removed, as likely unnecessary to SDL3 users. A note was added to the
migration doc about how to roll replacements. These are not going into
SDL_oldnames.h.

Fixes #8245.
2024-01-25 17:39:38 -05:00
Frank Praznik
22ea59425d wayland: Fix whitespace 2024-01-25 16:14:41 -05:00
Frank Praznik
c202893fbb wayland: Make sure the primary display is always first under GNOME
GNOME can deliver displays in arbitrary order, which can even change across sleep/wake cycles, so use a DBus method to find the primary display, and try to make sure it is the first exposed by SDL.

On other window managers, continue to assume that the order in which displays are exposed is the preferred order.

This can eventually be replaced by a Wayland protocol that serves the same purpose, if the pending ones are ever finalized.
2024-01-25 16:01:32 -05:00
Ryan C. Gordon
b8081e8e35
video: lowercase some video backend names. 2024-01-25 15:22:57 -05:00
Sam Lantinga
02f59f3ae6 Note that SDL_GetHaptics() is useful in combination with SDL_OpenHaptic() 2024-01-25 08:21:01 -08:00
Sam Lantinga
594eef99ec Added a migration note about SDL_TouchID and SDL_FingerID 2024-01-25 07:30:08 -08:00
Sam Lantinga
2670eb44af Improved timing accuracy of SDL_WaitEventTimeout() on Windows
We don't need to use the hack of setting a timer and waiting for a timer message, MsgWaitForMultipleObjects() will allow us to wait for input directly with a timeout.

Before this change, sleeping for 20 ms would actually sleep for around 30 ms, with this change the sleep time is pretty accurate at 20-21 ms.
2024-01-25 06:30:07 -08:00
Sam Lantinga
5ddd97062e Added test code to validate SDL_WaitEventTimeout()
You can enable this by defining TEST_WAITEVENTTIMEOUT
2024-01-25 06:29:15 -08:00
Ningyuan Li
d6ebbc2fa4 mayflash adapter PS4 support 2024-01-24 19:25:35 -08:00
Sam Lantinga
b8c4ea3cd1 Don't add the FIXME for converted macros
We're pretty sure this is correct and anyone who runs this script is likely to have source control to see the differences
2024-01-24 12:38:44 -08:00
Sam Lantinga
006edcab60 Switch to using SDL_powf() instead of pow() 2024-01-24 12:38:07 -08:00
Sam Lantinga
95a67278d1 Updated documentation after 2654c52d0e03578ea002dc62603a3f48e1353829 2024-01-24 11:00:13 -08:00
Ozkan Sezer
205c417f74 testgles2.c, testgles2_sdf.c: adjust for new SDL_PLATFORM_WINDOWS meaning. 2024-01-24 21:20:50 +03:00
Ozkan Sezer
6b3b7c7d4b SDL_hidapi_ps3.c: adjust for new SDL_PLATFORM_WINDOWS meaning. 2024-01-24 21:20:50 +03:00
Ozkan Sezer
81314c4998 SDL_render_gl.c: adjust for new SDL_PLATFORM_WINDOWS meaning. 2024-01-24 21:20:50 +03:00
Ozkan Sezer
1c79edbe02 SDL_test_memory.c: adjust for new SDL_PLATFORM_WINDOWS meaning. 2024-01-24 21:20:50 +03:00
Ozkan Sezer
07a0c0e402 SDL_hidapi.c: adjust for new SDL_PLATFORM_WINDOWS meaning. 2024-01-24 21:20:50 +03:00
Ozkan Sezer
34f03207c4 SDL_cpuinfo.c: adjust for new SDL_PLATFORM_WINDOWS meaning. 2024-01-24 21:20:50 +03:00
Ozkan Sezer
fd6ec3b9aa SDL_intrin.h: adjust for new SDL_PLATFORM_WINDOWS meaning. 2024-01-24 21:20:50 +03:00
Ozkan Sezer
2654c52d0e macro SDL_PLATFORM_WINDOWS now means Win32 api and Windows-based OS's.
macro SDL_PLATFORM_WIN32 means desktop windows, i.e. anything other than
WinRT or GDK, etc.
2024-01-24 21:20:50 +03:00
Sam Lantinga
1ac9602909 Make sure we include the matching copy of vk_video headers 2024-01-24 09:40:16 -08:00
Sam Lantinga
fc74bf8455 Update to the latest version of the Khronos headers 2024-01-24 09:40:16 -08:00
Ozkan Sezer
12b01ef674 rename_macros.py: fix typo for __WIN32__ 2024-01-24 20:10:00 +03:00
Simon McVittie
a06ee5b98d Don't try to use SDL platform macros in configure-time checks
At the point that we run this, nothing SDL-specific is set up yet.
__APPLE__ is a compiler predefined macro that forms part of the API on
Apple platforms, so it's fine to rely on it.

This partially reverts commit 31d133db.

Fixes: 31d133db "Define SDL_PLATFORM_* macros instead of underscored ones (#8875)"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-01-24 14:12:50 +03:00
Simon McVittie
f61870cfb4 Go back to using compiler built-in macros in ARM assembly code
These files don't #include SDL headers, so SDL-specific macros will
never be defined here.

This partially reverts commit 31d133db.

Fixes: 31d133db "Define SDL_PLATFORM_* macros instead of underscored ones (#8875)"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-01-24 14:12:50 +03:00
Simon McVittie
ed421f4fd8 Revert Khronos headers to upstream version
These are third-party headers, so it's best if they're identical to the
upstream version rather than using SDL-specific macros or coding style.

This partially reverts commits b6ae281e and 31d133db.

Fixes: 31d133db "Define SDL_PLATFORM_* macros instead of underscored ones (#8875)"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-01-24 14:12:50 +03:00
Sam Lantinga
8fe257b541 Added support for other HDR color primaries
Specifically, SDL_COLOR_PRIMARIES_XYZ, SDL_COLOR_PRIMARIES_SMPTE431, and SDL_COLOR_PRIMARIES_SMPTE432
2024-01-23 20:35:29 -08:00
Ozkan Sezer
c5792cc0de SDL_thread.h: replace uses of __GDK__ and __WINRT__ (missed in #8875.) 2024-01-24 06:28:10 +03:00
Anonymous Maarten
31d133db40
Define SDL_PLATFORM_* macros instead of underscored ones (#8875) 2024-01-24 01:40:51 +00:00
SDL Wiki Bot
ceccf24519 Sync SDL3 wiki -> header 2024-01-24 01:20:29 +00:00
Sam Lantinga
7cd914593f Added HDR surface properties and tone mapping from HDR to SDR
This currently only supports PQ, but can be expanded in the future
2024-01-23 17:19:41 -08:00
Sam Lantinga
a71f99c71f Fixed ambiguity between std::byte and byte in rpcndr.h
Fixes https://github.com/libsdl-org/SDL/issues/8911
2024-01-23 09:00:02 -08:00
SDL Wiki Bot
6fb188eb35 Sync SDL3 wiki -> header 2024-01-23 03:24:26 +00:00
Sam Lantinga
cd231a65f6 Added SDL_GetJoystickCaps() and SDL_GetGamepadCaps() to get the capabilities of controllers
Also added SDL_GAMEPAD_CAP_PLAYER_LED to let the application know if the controller has a visible player LED
2024-01-22 19:23:42 -08:00
Ryan C. Gordon
c88c12148d SDL_ShowMessageBox: Remove #ifdefs and respect SDL_VIDEO_DRIVER hint.
Fixes #8892.
2024-01-22 19:29:36 -05:00
Frank Praznik
5f65fd360d wayland: Free the input struct in all initialization failure paths 2024-01-22 13:01:04 -05:00
Frank Praznik
84e47b4af5 wayland: Always create the backing input store, even if there is no seat
Fixes a crash if no seat was available at initialization, but still allows for one to still be created later if an input device is added.

Removes some unnecessary abstractions in the process.
2024-01-22 12:37:24 -05:00
Sam Lantinga
99ce8af439 Fixed warning C4244: '=': conversion from 'Sint64' to 'int', possible loss of data
(cherry picked from commit 12bab1c981edbd9092d58f8479d00032d248d0ce)
2024-01-22 08:39:47 -08:00
Sam Lantinga
a28a42cfc6 Fixed declaration of SDL_HapticRumbleSupported 2024-01-21 11:36:38 -08:00
Sam Lantinga
052b958bf2 Made SDL_HapticEffect const in the API
Also added some additional parameter validation to haptic effect functions
2024-01-21 11:29:40 -08:00
Sam Lantinga
fa5bfe577c Fixed warnings building for UWP 2024-01-21 06:55:29 -08:00