Compare commits

...

1494 Commits

Author SHA1 Message Date
Ozkan Sezer
cc9937201e x11: fix a typo after PR/13855 and kill lots of trailing whitespace 2025-09-03 04:37:56 +03:00
Sam Lantinga
ef19c72015 Set the texture scale and address mode when creating a texture
Fixes https://github.com/libsdl-org/sdl2-compat/issues/506
2025-09-02 18:05:31 -07:00
eafton
d14cbd7b50 Introduce X11 toolkit and make message dialogs use it (#13855) 2025-09-02 13:22:48 -07:00
Ryan C. Gordon
af74b1fe84 wikiheaders: Generate a current list of supported environment variables.
Fixes #13827.
2025-09-02 15:49:52 -04:00
Ozkan Sezer
83bb0f9105 cmake: simd detection clean-up for Apple multi-arch configs. 2025-09-02 22:34:10 +03:00
Anonymous Maarten
c0fb71f2a9 cmake: fix SDL_UNINSTALL post-configuration report 2025-09-02 21:29:50 +02:00
Anonymous Maarten
e15e2808f2 cmake: use 'TargetConditionals.h' on Apple for SIMD tests 2025-09-02 21:29:50 +02:00
Anonymous Maarten
1e7d3b51de cmake: use APPLE in dep_option
expands to <nothing> on e.g. Windows, which will be interpreted as true by cmake_dependent_option.
2025-09-02 21:29:50 +02:00
Sam Lantinga
84af0bb53a Updated the 8BitDo Ultimate 2 Wireless Controller dongle update rate
The latest dongle firmware appears to update at 1000Hz
2025-09-02 09:53:09 -07:00
Sam Lantinga
a562e40d2c Revert "Disable rumble for the Ultimate 2 Wireless Controller in dongle mode"
This reverts commit 065fdca953.

8BitDo has fixed the rumble issue with dongle firmware update V1.05
2025-09-02 09:53:09 -07:00
Sam Lantinga
b47572c9bb Fixed build warning with Visual Studio 2025-09-02 09:53:09 -07:00
Ethan Lee
689049f8ec gpu: VK_KHR_get_physical_device_properties2 can be optional 2025-09-02 09:53:01 -07:00
Sylvain
7920e48386 Fixed bug #13849 - Intent always explicit 2025-09-02 09:37:41 -07:00
DominusExult
a223481ed3 xcFramework: Removing the simulators' debug symbols to reduce file size. 2025-09-02 08:57:18 -07:00
Maia
5938dce5de Add missing include 2025-09-02 12:52:53 +02:00
Sylvain
814f0b7d41 Android: more simplification since min API supported is 21 2025-09-02 12:34:38 +02:00
Sam Lantinga
1f007ad5cd Added support for the player LED on Nintendo Switch 2 controllers 2025-09-01 21:11:16 -07:00
Sam Lantinga
4b93e7488f Added support for the Switch 2 Joy-Cons with charging grip 2025-09-01 21:11:16 -07:00
Sylvain
6136ba7a74 Android: simplification since min API supported is 21 2025-09-01 14:24:42 -07:00
Ryan C. Gordon
7323104f97 openslES: Patched to compile.
(whoops.)
2025-09-01 11:10:02 -04:00
Ryan C. Gordon
0b2a003a35 openslES: OpenSL ES on Android only supports two formats, limit to that.
(Three with the floating point extension, which we use.)

This is according to:

https://developer.android.com/ndk/guides/audio/opensl/opensl-for-android

Previously, this would accept a request for Sint8 or Sint32 and disaster
would ensue.

Fixes #13779.
2025-09-01 10:30:29 -04:00
SDL Wiki Bot
4587bc385e Sync SDL3 wiki -> header
[ci skip]
2025-08-31 22:35:36 +00:00
DominusExult
5f39288523 Restructuring the iOS readme to list the recommended xcFramework before embedding the SDL3 Xcode project with some rewording.
Furthermore a script to that is necessary for distributing an SDL3 app on the AppStore when embedding the SDL3 Xcode project.
2025-08-31 15:33:58 -07:00
DominusExult
98c03c644a Adding dSYMs (DWARF debug symbols) to the xcFramework.
Needed to generate debug symbols for both release and debug builds and explicitly set the format so all arches actually generate the dSYMs.
This allows distributing an SDL3 app to the AppStore without the need to generate the dSYMs via script when using either the xcFramework or embedding the SDL3 Xcode project.
Fixes #13573
2025-08-31 15:33:58 -07:00
Frank Praznik
1c8f1e0b4c wayland: Update pointer warp protocol checks and error message 2025-08-31 13:19:32 -04:00
SDL Wiki Bot
ee532e3b66 Sync SDL3 wiki -> header
[ci skip]
2025-08-31 14:29:15 +00:00
Ozkan Sezer
875653658a cmake: revert commit 5d1bbd9 and change sse4.2 test
clang doesn't support -mcrc32 until version 14.0, therefore drop -mcrc32
use in sse 4.2 test, and change it to check _mm_cmpgt_epi64() instead of
_mm_crc32_u32(). without this, sse4.2 check was failing with clang <= 13

Fixes https://github.com/libsdl-org/SDL/pull/12223
2025-08-31 03:20:20 +03:00
Sam Lantinga
7c8df4ea52 Fixed warnings building with Visual Studio 2025-08-30 10:15:58 -07:00
Sam Lantinga
3cf2350f21 Fixed build 2025-08-30 10:15:32 -07:00
Jordan Saunders
265236d952 Fix two uninitialized variables
Found when running in valgrind looking at another issue.

- RenderPass' depth_stencil_target
    Tripped in SDL_BindGPUFragmentSamplers when not binding a DS target

- VulkanCommandBuffer's swapchainRequested
    Tripped in VULKAN_Submit for the end transition barrier when
    creating an image. The field is only reset when reused, not on first
    use
2025-08-30 06:05:22 -07:00
Frank Praznik
fdfde42db1 fs: Fix OpenBSD path retrieval
Set the path start pointer to point to a valid string.
2025-08-29 19:03:44 -04:00
Ozkan Sezer
c0e5fd55d2 CI: add OpenBSD workflow 2025-08-30 01:55:02 +03:00
Frank Praznik
1049426a76 wayland: Add a sigtimedwait() implementation for OpenBSD
sigtimedwait() is an optional part of POSIX.1-2001, and OpenBSD doesn't implement it. Add a replacement implementation based on https://comp.unix.programmer.narkive.com/rEDH0sPT/sigtimedwait-implementation
2025-08-29 18:32:29 -04:00
Xander
dc7a3a1219 Add SDL_SENSOR_COUNT to SDL_SensorType 2025-08-29 07:31:02 -07:00
Ryan C. Gordon
ee69cdc1fe README-emscripten.md: Fixed cmake commmand line for enabling pthreads.
Fixes #13190.
2025-08-29 09:39:14 -04:00
Vicki Pfau
184f6fa231 switch2: Read calibration data 2025-08-29 05:46:19 -07:00
William Horvath
d15e531bad dialog: Fix compilation with pre-Vista headers.
Closes #13823
2025-08-29 05:26:01 -07:00
SDL Wiki Bot
edfbfa27b4 Sync SDL3 wiki -> header
[ci skip]
2025-08-29 03:02:44 +00:00
Matthew Zavislak
4f11feb708 Add elf alignment check for Android artifacts (#13818) 2025-08-28 16:31:03 -07:00
Anonymous Maarten
2734248544 Remove superfluous '/utf-8' from MSBuild projects 2025-08-28 23:26:48 +02:00
Sam Lantinga
fa52949529 Added a note that we dynamically load libusb 2025-08-28 09:13:01 -07:00
Sam Lantinga
1a653f7f89 Exported SDL_hid_get_properties() 2025-08-28 09:13:01 -07:00
SDL Wiki Bot
c1e7b1a540 Sync SDL3 wiki -> header
[ci skip]
2025-08-28 16:12:34 +00:00
Sam Lantinga
ac5ccbe386 Moved Nintendo Switch 2 Controller initialization from hid.c to SDL_hidapi_switch2.c 2025-08-28 09:10:47 -07:00
Sam Lantinga
65c1fc1b42 Added SDL_hid_get_properties() 2025-08-28 09:10:47 -07:00
Sam Lantinga
09ca7e8f64 Move libusb support into a shared location 2025-08-28 09:10:47 -07:00
Sam Lantinga
cdae0d10d1 Fixed button mapping for the Nintendo Switch 2 Pro Controller 2025-08-28 09:10:47 -07:00
Sam Lantinga
fb9fcfa37b Fixed controller name when hotplugging the Nintendo Switch 2 Pro Controller 2025-08-28 09:10:47 -07:00
Sam Lantinga
2bb51e1340 Claim the interface before doing bulk transfers 2025-08-28 09:10:47 -07:00
Ethan Lee
a798da2ec7 hidapi: Add support for NSO GameCube controller via libusb.
Thanks to Nohzockt for the initial libusb init and hidapi polling work!
2025-08-28 09:10:47 -07:00
Ethan Lee
efea62ed61 hidapi: Add a stub driver for Switch 2.
Thanks to kiddkaffeine for the Xcode updates!
2025-08-28 09:10:47 -07:00
Frank Praznik
5972b5295d video: Don't attempt to reconfigure external windows 2025-08-28 12:08:49 -04:00
Frank Praznik
78bea90b18 wayland: Remove an unnecessary surface commit 2025-08-28 10:01:53 -04:00
Sam Lantinga
5d9b170a3d Be explicit that SDL_FLIP_HORIZONTAL_AND_VERTICAL combines horizontal and vertical flipping
Closes https://github.com/libsdl-org/SDL/pull/13821
2025-08-28 04:22:31 -07:00
Susko3
cd21bbe796 Avoid checking for HAVE_POSIX_SPAWN on Android
This makes the CMake build closer to SDL_build_config_android.h
as both will now use SDL_PROCESS_DUMMY.
2025-08-28 04:09:50 -07:00
wankey
6176235a90 fix wrong index in HandleStatePacket with flydigi controller (#13819) 2025-08-28 04:08:54 -07:00
Ryan C. Gordon
e9c2e9bfc3 SDL_iostream.h: Clarified thread-safety docs.
Fixes #13814.
2025-08-27 22:03:50 -04:00
Joshua T. Fisher
dfb343a5f8 cmake: use CONFIGURE_DEPENDS flag in GLOBs 2025-08-28 01:10:16 +00:00
SDL Wiki Bot
a1964dd673 Sync SDL3 wiki -> header
[ci skip]
2025-08-27 22:35:48 +00:00
Anonymous Maarten
625a8335b5 Don't compile helper function when building without audio/video/joystick support 2025-08-27 23:19:50 +02:00
Ozkan Sezer
98bed62259 cmake: fall back to -Wconversion if -Wfloat-conversion isn't available
... during checks for valid isinf/isinff/isnan/isnanf macros.
2025-08-27 22:20:02 +03:00
Anonymous Maarten
c50e4b22ab dlopennot: ngage's g++ compiler does not support variadic macros 2025-08-27 18:53:35 +02:00
Frank Praznik
a904af1b43 tray: Save icons on *nix platforms to PNG instead of BMP
PNG has better compatibility with certain desktops.

This requires the stb_image_write header for PNG writing functionality.
2025-08-27 09:20:42 -07:00
Sam Lantinga
285df94623 Renamed SDL_GPURenderStateDesc to SDL_GPURenderStateCreateInfo for consistency with GPU API conventions
Fixes https://github.com/libsdl-org/SDL/issues/12817
2025-08-27 09:14:19 -07:00
Anonymous Maarten
0a6b80717c Record dynamic dependencies in .note.dlopen elf section 2025-08-27 16:11:39 +00:00
Frank Praznik
152ba829a1 video: Try to reconfigure the window for OpenGL without destroying it
When attaching a renderer (GL based specifically) to a window that was not created with the appropriate flags, the window would be destroyed and recreated to configure it for the desired rendering backend. While most of the issues with this have been mitigated over time, there can still be some undesirable side effects from doing so on certain platforms.

If the window was just created and was never configured for any graphics context, it is possible that the reconfiguration can be done without destroying the window first.

The Wayland implementation fixes an issue when creating a window with the fullscreen flag on wlroots based Wayland compositors, and can likely be extended to other platforms to avoid unnecessarily destroying/recreating a window in the very common case where a window is created, followed immediately by attaching a renderer.
2025-08-27 12:10:48 -04:00
Frank Praznik
6e5994db76 docs: Update Wayland documentation
Note that windows may not report the minimized state, and update the cursor warp documentation to note the newly supported protocol.
2025-08-27 11:26:43 -04:00
Sam Lantinga
da6e9bbf7c Allow building the tray subsystem without the video subsystem
Fixes https://github.com/libsdl-org/SDL/issues/13235
2025-08-27 08:15:24 -07:00
SDL Wiki Bot
943d0f67ba Sync SDL3 wiki -> header
[ci skip]
2025-08-27 13:46:21 +00:00
Sam Lantinga
42f634ff7a Added SDL_AddAtomicU32()
Fixes https://github.com/libsdl-org/SDL/issues/13496
2025-08-27 06:44:51 -07:00
Marcus Harrison
b795762b62 Small fix for snake example (#13790)
Rename THREE_BITS to SNAKE_CELL_SET_BITS
Make SNAKE_CELL_SET_BITS depend on SNAKE_CELL_MAX_BITS
2025-08-27 05:16:24 -07:00
Jaan Soulier
0bbdd86b86 Fix device suitability checks in Vulkan GPU backend to always adhere to priority arrays 2025-08-27 05:15:24 -07:00
Sylvain
26d6352500 Fixed bug #13794: prevent to use the onBackPressed callback API that is enabled on API36 2025-08-27 11:39:00 +02:00
Sam Lantinga
5291e9bbbd Minor cleanup 2025-08-26 19:28:59 -07:00
Frank Praznik
5a06ef5c8f keyboard: Don't clear the keymap when it is set to auto release
Don't unset the keymap when it is set to auto release, or it will infinitely recurse.
2025-08-26 22:16:21 -04:00
Sylvain
e55f636d1e Android: improve check to know if running on ChromeBook or emulator.
https://stackoverflow.com/questions/39784415/how-to-detect-programmatically-if-android-app-is-running-in-chrome-book-or-in
2025-08-26 17:43:58 -07:00
takase1121
95c44dcdc3 process(windows): fallback to GenerateConsoleCtrlEvent and TerminateProcess if necessary 2025-08-26 17:01:37 -07:00
takase1121
c709b8ed98 process(windows): try sending WM_CLOSE for graceful process termination 2025-08-26 17:01:37 -07:00
Semphris
355c001a54 Implement IFileDialog for Windows 2025-08-26 16:48:08 -07:00
SDL Wiki Bot
15e60cd37f Sync SDL3 wiki -> header
[ci skip]
2025-08-26 18:55:26 +00:00
Ryan C. Gordon
5b688514c7 wikiheaders: Don't autolink things that are already linked.
This is a dirty hack, but it currently works for our purposes. We just refuse
to link an eligible string (like, say...`SDL_shadercross`), if there's a '['
character right before it.

This WILL NOT WORK if the string is in the middle of a link! For example, if
you had `[please refer to SDL_shadercross](https://example.com/)`, this will
still fail in the usual ways, but we're not building out a robust parser here
at the moment, and this catches the most common problem.

Fixes #13160.
Fixes https://github.com/libsdl-org/sdlwiki/issues/752
Closes https://github.com/libsdl-org/sdlwiki/pull/725
2025-08-26 14:43:59 -04:00
Frank Praznik
6516f7a9e8 keyboard: Release bound keymaps during the destruction process
If a bound keymap is being destroyed, unbind it to ensure that the keyboard state won't be left pointing to an invalid keymap. Backends now no longer need to manually do this when destroying keymaps during keyboard removal and shutdown.
2025-08-26 12:56:29 -04:00
Frank Praznik
f53f054fd6 x11: Enable the relative mouse system scale hint.
Use the scaled motion values if the relative system scale hint is set, and a custom transformation function is not set.
2025-08-26 11:55:02 -04:00
Sam Lantinga
065fdca953 Disable rumble for the Ultimate 2 Wireless Controller in dongle mode
The dongle appears to stop sending input reports with some combination of rumble patterns, easily reproduced with Forza Horizon 5. We'll disable rumble temporarily until @8BitDo can investigate.
2025-08-26 08:39:00 -07:00
Sam Lantinga
66ab91a314 Added SDL_FLIP_HORIZONTAL_AND_VERTICAL
Closes https://github.com/libsdl-org/SDL/pull/13788
2025-08-26 05:50:51 -07:00
Nintorch
1fbed16cb0 Add Emscripten joystick rumble support
Adds support for Emscripten (Web) joystick rumble support via EM_ASM_INT macros and HTML5's Gamepad API.
2025-08-25 12:58:59 -07:00
Sam Lantinga
b13416d74f Fixed relative motion having desktop mouse scale on Wayland
Fixes https://github.com/libsdl-org/SDL/issues/13753
2025-08-25 11:47:56 -07:00
Merlyn Morgan-Graham
385715c0dd Introduce enum for SDL_GetCameraPermissionState result 2025-08-25 14:43:31 -04:00
Colin Kinloch
5be08481e1 dialog: Print DBus errors where available 2025-08-25 11:35:47 -07:00
Colin Kinloch
c79a18d0fa dialog: Fix save file chooser with xdg portal
This correctly sets the xdg portal fields for targeting a specific
new filename or existing file.

"current_name" sets the dialogs placeholder name.
"current_file" targets an existing file.
"current_folder" for when the target is a folder.
2025-08-25 11:35:47 -07:00
Nintorch
1af7dfb0a7 Allow Android to ignore unnecessary joysticks
Previously, SDL_ShouldIgnoreJoystick wasn't being called for Android, and fingerprint sensors were recognized as joysticks.
2025-08-25 11:23:14 -07:00
Colin Kinloch
81920b5db7 testffmpeg: avutil queue family version check
The `AVVulkanDeviceQueueFamily` struct was introduced by libavutil
59.34.100
2025-08-25 11:10:15 -07:00
Ryan C. Gordon
8f04e4af00 audio: Clean out all the bitshifting.
Hide the implementation details in something human-readable.
2025-08-25 13:10:51 -04:00
Ryan C. Gordon
01d94ca9de audio: Renamed device_hash_lock to subsystem_rwlock.
It protects more than the device hashes!
2025-08-25 13:10:51 -04:00
Ryan C. Gordon
226fecff78 audio: Split current_audio.device_hash into two separate hashtables.
One for physical devices, one for logical devices.

Fixes #13032.
2025-08-25 13:10:51 -04:00
Sam Lantinga
7bbbbb3a1c Fixed build 2025-08-25 09:45:39 -07:00
Sam Lantinga
aab95894a6 Fixed crash if mouse functions are used after video quit 2025-08-25 08:54:43 -07:00
ceski
270737584e Fix vsync-off support for direct3d11 2025-08-24 21:33:02 +03:00
Ethan Lee
0fcaf47658 gpu: D3D12 only requires feature level 11_0 with Resource Binding Tier 2.
We previously thought this wasn't possible because constant buffer offsets and
partial updates were unavailable, but we were reading the wrong table - this is
only the case for D3D11...

https://learn.microsoft.com/en-us/windows/win32/direct3d11/overviews-direct3d-11-devices-downlevel-intro

... while 12 doesn't list this feature at all:

https://learn.microsoft.com/en-us/windows/win32/direct3d12/hardware-feature-levels

We double checked and Jesse Natalie confirmed that this feature is required for
D3D12 even for 11_0 drivers. (Thanks Jesse!)

Additionally, D3D12 requires that UAVs are accessible from all shader stages,
meaning Tier 2 is enough to support the number of UAVs we need. Tier 1 could be
a property to lower the requirements, but that can be done later.
2025-08-22 15:46:05 -04:00
Merlyn Morgan-Graham
dee2414ee7 Fix typo in SDL_power doc comment 2025-08-21 08:40:57 +03:00
arnau.nau
ee5e249008 Docs fix for SDL_stdinc.h: floor,floorf,ceil,ceilf 2025-08-20 18:01:46 -04:00
SDL Wiki Bot
0b082b25b2 Sync SDL3 wiki -> header
[ci skip]
2025-08-19 20:39:22 +00:00
Wilson Jallet
03b14f5211 GPU: Fix Vulkan indexing error for resolve attachment refs (#13768) 2025-08-19 12:10:55 -07:00
SDL Wiki Bot
e3db7f83c2 Sync SDL3 wiki -> header
[ci skip]
2025-08-19 04:41:07 +00:00
suleyth
bad7075de8 Only add VRAM to deviceRank if asking for a high performance device, and if the device already meets all the requirements. 2025-08-17 23:17:37 -04:00
suleyth
618f85fafe Make deviceRank an Uint64 to avoid potential overflow issues in case of future GPUs with huge VRAM 2025-08-17 23:17:37 -04:00
suleyth
c5b79e5f1b Pick dedicated GPU with highest VRAM 2025-08-17 23:17:37 -04:00
Sam Lantinga
5f77da3a50 x11: use raw values for relative mouse motion
Fixes https://github.com/libsdl-org/SDL/issues/13743
2025-08-14 19:30:54 -07:00
Sam Lantinga
fe16c620d8 Fix crash when enumerating Steam Controllers
Closes https://github.com/libsdl-org/SDL/pull/13746
2025-08-14 14:49:04 -07:00
Sam Lantinga
2d855e12d2 Fixed style 2025-08-14 14:48:58 -07:00
Sam Lantinga
20df88a85b Fixed spacing 2025-08-14 14:44:56 -07:00
Sam Lantinga
e11110400a Fixed crash when reinitializing video on X11
The keyboard keymap was left pointing at a freed keymap after X11_QuitKeyboard()
2025-08-14 13:41:40 -07:00
Joshua T. Fisher
f053be22be Improve CMake for IDE Projects (Visual Studio) (#13704) 2025-08-14 08:19:14 -07:00
Sam Lantinga
f934b3e066 x11: fixed creating a window when all displays are disconnected
The X server maintains the desktop, but XRandR sends disconnect notifications for all displays. In this case fall back to the generic X11 desktop as a display.
2025-08-13 19:44:13 -07:00
Sam Lantinga
eeae48464e Fixed crash if X11 initialization fails 2025-08-13 19:44:13 -07:00
Petar Popovic
45feacf608 emscripten tests: fix warning: uninitialized variable 2025-08-13 17:00:45 -07:00
ChaseKnowlden
a743fb578c Use PulseAudio fragsize buffer correctly
Fixes broken microphone input in Sober
2025-08-13 17:36:44 -04:00
Ryan C. Gordon
ec0e4e21c7 docs: Mark most of SDL_filesystem.h as thread-safe.
Fixes #13738.
2025-08-13 16:32:55 -04:00
Salman Alshamrani
29cff6e264 Work around password integrations hiding software keyboard and preventing autofill 2025-08-13 08:05:58 -07:00
Salman Alshamrani
bd7d4708e3 Fix text field resetting text when replaced with a short string
Triggered by auto-filling a password with less than 16 characters from a
password manager.
2025-08-13 08:05:58 -07:00
ChaseKnowlden
10478c59db Keep MSVC Flags Consistent across CMake runs 2025-08-12 19:39:02 -07:00
Mitch Cairns
62b9ac3a09 SEWN Button Convention 2025-08-12 15:19:01 -07:00
Mitch Cairns
87543ba18c SInput: Mapping updates for GCUltimate/ProGCC
- In previous firmwares for my gamepads, the buttons were sent in a static order for ABXY.
- To better be 'transparent' to the driver and save myself from future fragmentation, I am updating the mappings to be consistent, where the HID report should always expect to receive the button inputs based on cardinal button directions rather than button labels.
- This better aligns with the existing 'fallback' behavior of a generic device.
- Coincides with firmware library update: https://github.com/HandHeldLegend/HOJA-LIB-RP2040/pull/30
2025-08-12 15:19:01 -07:00
SDL Wiki Bot
7487880e4c Sync SDL3 wiki -> header
[ci skip]
2025-08-12 17:05:23 +00:00
Sam Lantinga
4725213eef Support the "ambient" value for SDL_HINT_AUDIO_CATEGORY
Fixes https://github.com/libsdl-org/SDL/issues/13732
2025-08-12 09:54:20 -07:00
SDL Wiki Bot
4b2a87a5d3 Sync SDL3 wiki -> header
[ci skip]
2025-08-12 16:53:08 +00:00
Sylvain
970c0bfe96 Fixed bug #13493: Assertion failure at SDL_AddTouch with Android API 28
Java touch id should be -1 because it's reserved for internal SDL
synthetic events.
It should also not be 0, because this is SDL invalid value.
2025-08-12 18:34:42 +02:00
Chase Knowlden
6e422e5ff2 Update NDK version to 28 (#13729)
* Update NDK version to 28 and add 16kb page size linker flags to x86_64

* Remove Android Linker Options

16kb page size is now the default since NDK r28c

* Update Android CI to use NDK 28
2025-08-12 07:45:57 -07:00
Beyley Cardellio
e699f3dca1 GPU: Hold submit lock before waiting for device idle 2025-08-10 07:21:55 -07:00
SDL Wiki Bot
f2df279adc Sync SDL3 wiki -> header
[ci skip]
2025-08-10 05:08:26 +00:00
Sam Lantinga
40ec9592f1 Restored text missing during wiki sync (thanks @sezero!) 2025-08-09 22:07:14 -07:00
SDL Wiki Bot
3970acd1c2 Sync SDL3 wiki -> header
[ci skip]
2025-08-10 02:21:43 +00:00
SDL Wiki Bot
44ce826b57 Sync SDL3 wiki -> header
[ci skip]
2025-08-09 18:34:27 +00:00
Petar Popovic
43f3991398 linux/SDL_syshaptic.c:SDL_SYS_HapticStopAll(): Fix return on error 2025-08-09 09:27:35 -07:00
Petar Popovic
d4819db5e6 SDL_waylandvideo.c:display_remove_global(): Check pointer when removing mouse 2025-08-09 07:37:40 -07:00
Anonymous Maarten
7017fbaa8e release: build aarch64 libraries with 16kiB page size
[ci skip]
2025-08-09 04:51:35 +02:00
Mohamed Shazan
f4c124e4bf SDL_TriggerBreakpoint() will default to __debugbreak() on MinGW toolchain on windows 2025-08-08 16:20:59 -07:00
Frank Praznik
aff1a48bd9 wayland: Cleanup and return if keymap allocation fails 2025-08-08 18:44:41 -04:00
Petar Popovic
d9c20cfd0a SDL_SendJoystickVirtualSensorDataInner(): Fix max_sensor_events increment 2025-08-08 12:48:06 -07:00
Anonymous Maarten
de742e9f9a cmake: detect RISCOS platform before GNU/Hurd 2025-08-08 12:47:09 -07:00
Pino Toscano
171885010d Add GNU/Hurd as platform
SDL has been building on GNU/Hurd for a long time, using either drivers
based on external libraries (e.g. X11, pulseaudio, sndio, etc) or dummy
drivers. This commit introduces it explicitly as platform, so it can be
recognized, and tweaked as needed. In particular:
- introduce the SDL_PLATFORM_HURD define
- tighten/improve the platform detection in cmake, and use "Hurd" as
  identifier
- return the platform name in SDL_GetPlatform()
- tweak the CFLAGS/LDFLAGS so pthreads can be used properly
- implement SDL_GetExeName(), using /proc/self/exe as provided by the
  basic Linux-like procfs
- enable GLES 2 in tests (mostly for consistency with Linux)
2025-08-08 12:47:09 -07:00
Petar Popovic
b63c32e790 SDL_SetRenderDrawBlendMode(): Remove redundant param check 2025-08-08 14:05:33 -04:00
Frank Praznik
7252633345 video: Check the display origin when a fullscreen window is moved
In certain cases when moving fullscreen windows in scaled desktop configurations, the window origin might overlap two displays at once. Check if the window is at the origin of a specific display before falling back to the generic window rectangle check.

Fixes rare fullscreen window misplacement when moving fullscreen windows via a desktop shortcut while using the Wayland scale-to-display mode.
2025-08-08 11:14:09 -04:00
Pino Toscano
248bcf6b29 ime: fcitx: use SDL_GetExeName() in GetAppName()
Use the existing SDL_GetExeName(), available for all the UNIX
platforms, in the internal GetAppName(); this has few advantanges:
- SDL_GetExeName() (and SDL_GetAppID() that builds on top of it) are
  used in various places already; since it caches the executable name,
  this may remove one extra read of the application name
- SDL_GetExeName() has a non-dummy implementation in more OSes than
  GetAppName(), thus providing a small improvement for this IME

As drive-by change: since SDL_GetExeName() provides a constant string,
there is no more need to allocate a new string in GetAppName(), which
is used as constant string anyway. Hence, return a constant string in
GetAppName() too.
2025-08-07 13:58:09 -07:00
Simon McVittie
d83503f80e Fix some typos detected by Debian's lintian QA tool
I assume the demoninator is a typo, rather than an indication that
someone has been playing too much Doom :-)

Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-08-07 13:55:15 -07:00
Simon McVittie
40b941c826 hints: Rephrase documentation to improve grammar
"This thing allows to do something" is not really grammatically correct.
The closest rephrasing would be "allows one to do something" or "allows
the user to do something", but I think the passive voice reads more
naturally here.

Detected by Debian's lintian QA tool.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-08-07 13:55:15 -07:00
cosmonaut
fe6b2161bf GPU: Fix uninitialized value in Vulkan command buffer structure 2025-08-07 13:42:03 -07:00
Sam Lantinga
6981522cd6 Revert "Support Google Play 16 KB Page Size Requirement (#13470)"
This reverts commit dc2c83c383

If you need to support the Google Play 16 kiB page size requirement, the recommendation is to use NDK r28c or newer, which automatically aligns binaries correctly.
2025-08-07 11:44:45 -07:00
Frank Praznik
33c8998598 video: Use additional checks for determining on which display a window should be fullscreen
Trying to determine where a window should be made fullscreen from the size and position can be unreliable if the window exceeds the display bounds. Add additional checks with the following priority:

- If the window was positioned with a macro that explicitly passes a display ID, store and use the requested display as the explicit fullscreen target.
- Check if the window position is an exact match for any display origins, and use that display if found, as positioning a fullscreen window by moving it to the origin of the destination display is common behavior.
- Fall back to the existing center point check if the previous checks were not successful, as it is known behavior, and won't risk breaking existing clients that rely on it.
2025-08-07 14:30:39 -04:00
Pino Toscano
561c99ee11 SDL_endian.h: extend Linux way for GNU libc
The currently used way to determine the endianness (i.e. include
<endian.h> and use the __BYTE_ORDER macro) is provided in general by
GNU libc. Thus, extend that to any platform/OS based on GNU libc.
2025-08-06 16:13:26 -07:00
Frank Praznik
f439e44771 x11: Modernize and optimize key handling
- Use modern Xkb functions where appropriate and cleanly separate the modern and legacy paths.
- Remove the deprecated XKeycodeToKeysym function in favor of directly querying the keymap on the legacy path.
- Look up virtual modifiers by name on the Xkb path to better handle remapping (equivalent to the modifier handling under Wayland).
- Optimize keymap creation on the Xkb path to cut keymap build times and enable fast group switching  (equivalent to keymap handling on Wayland).
- Enable and handle Xkb events to handle changes to the group, mapping, and modifier states. This is more reliable than using the legacy events (group changes may not arrive if the window lacks pointer focus), and better handles cases where modifiers are latched, locked, or activated externally rather than physically pressed.
2025-08-06 13:35:32 -07:00
Frank Praznik
67e5130441 x11: Check axis labels when searching for relative axes
Prefer axes with the 'Rel X'/'Rel Y' labels, followed by 'Abs X'/'Abs Y', and only fall back to the old behavior of using the first two enumerated axes if no others are found.

Fixes a FIXME when determining which axes to use for relative motion.
2025-08-06 14:15:00 -04:00
Sam Lantinga
91be1b054a x11: Fix xsettings pointer not being reset in X11_QuitXsettings 2025-08-06 09:22:33 -07:00
Sam Lantinga
31ba7efa48 x11: Refactor dpi hooks, removing GTK dependency and fixing XSettings watcher
- Removed GTK signal handler in x11settings. XSettings events are now properly dispatched to X11_XsettingsNotify.
  Previously events were not being passed to xsettings-client as no SDL xsettings_window was created. Now all events
  are filtered through xsettings_client_process_event allowing it to process the external window events that are selected.
  Global content scale is updated for changes to any recognized dpi settings.

- X11_GetGlobalContent now reads the current RESOURCE_MANAGER prop off of the root window to ensure it sees the
  current value. XResourceManagerString is now only used if getting the current prop fails as it caches the current resource
  manager value per-display connection.

- Clean up some warnings in SDL_gtk.
2025-08-06 09:22:15 -07:00
A1029384756
b139821903 tray: linux - use .cache directory for temporary icon paths 2025-08-05 23:35:11 -07:00
Frank Praznik
cd0c660dea win32: Use the current flags to determine if NCCALCSIZE is required
SDL_GetWindowFlags() also ORs in pending flags, whereas the current state is needed here, particularly when creating/showing a window.
2025-08-05 18:01:16 -04:00
Frank Praznik
90a023007f win32: Use STYLE_BORDERLESS when showing a pending fullscreen window
In addition to hiding the border on bordered windows that will immediately become fullscreen, The combination of flags used in STYLE_BORDERLESS_WINDOWED will still show the borders on borderless windows if the initial window size exactly matches the desktop, so STYLE_BORDERLESS must be used instead.
2025-08-05 15:57:52 -04:00
Sam Lantinga
aae7736ec6 Added additional examples of paddle and misc buttons (thanks @AL2009man!) 2025-08-05 12:01:31 -07:00
Frank Praznik
f44a98729c cocoa: Wait for fullscreen spaces transitions to complete if switching to an exclusive mode
If attempting to switch to an exclusive mode while a fullscreen spaces transition is active, wait until the transition is complete before trying to apply the changes, or the window can wind up in a weird, broken state if a mode switch occurs while in a fullscreen space.
2025-08-05 11:38:54 -04:00
Frank Praznik
3163e0cc9f Revert "cocoa: Don't re-enter a fullscreen space if leaving to enter an exclusive mode"
This reverts commit ee8f2861e7.

It turns out that the problem is elsewhere, related to needing to block mode changes until spaces transitions are complete.
2025-08-04 23:49:15 -04:00
Alexander Batalov
b6fa89ea74 Fix directory globbing on Android 2025-08-04 23:12:54 -04:00
Mathieu Eyraud
a05aca51ec Fix condition for setting HDR properties 2025-08-04 23:02:25 -04:00
Frank Praznik
ee8f2861e7 cocoa: Don't re-enter a fullscreen space if leaving to enter an exclusive mode
Doing so can leave the window in a weird, offset state.
2025-08-04 22:09:53 -04:00
Sam Lantinga
293b8b9fd6 x11: Fix regression reading GNOME content scale
- Removed gtk-xft-dpi read from GetGlobalContentScale. Xrm either returns either the same value as gtk-xft-dpi or the integer
  scale value in cases where gtk-xft-dpi is 1.

- Refactor SDL_x11settings handlers to defer to GetGlobalContentScale

- GetGlobalContentScale is now exported and the XSettings and Gtk signal handlers now use it for consistency. This involves
  a bit of extra work reading from Xrm rather than the setting notification but ensures consistent handling based on signal
  origin and hints enabled.

- Hook both gtk-xft-dpi in SDL_x11settings. This should generally result in only one being called based on which is updated.
  Since both signal handlers defer to X11_GetGlobalContentScale this will cause the same content scale to be applied multiple
  times. The gtk-xft-dpi signal is now only used to trigger content scale updates when the XSettings notification does not occur.
2025-08-04 16:53:09 -07:00
Sam Lantinga
7bb045ca22 Fixed Windows build 2025-08-04 13:04:17 -07:00
Sam Lantinga
9a71e3fd50 Revert "Add SDL_IsTraySupported"
This reverts commit 47d8bdd1c3.

There are runtime reasons why creating a tray can fail, so the correct approach is not to assume that just because a platform supports a tray that trays are available. Instead, you should create a tray at application startup, for the lifetime of the application, and handle failures at that point.

Closes https://github.com/libsdl-org/SDL/pull/13632
2025-08-04 10:42:43 -07:00
Sam Lantinga
bba6555bf1 Enable background input when using Microsoft GameInput 2025-08-04 10:21:58 -07:00
Frank Praznik
483b8d4d98 x11: Implement precision/pixel scrolling
Manual rebase of #5382 with some changes for SDL3 (thanks @wooosh).
2025-08-04 12:50:06 -04:00
Petar Popovic
23e08f7807 SDL_LoadWAV_IO(): On error, set *audio_buf to NULL and *audio_len to 0 2025-08-03 13:44:10 -04:00
Petar Popovic
faf3bd9991 SDL_enabled_assert(): Use NULL istead of 0 to explicity initialize the pointer members of SDL_AssertData 2025-08-03 13:33:48 -04:00
Sam Lantinga
8dedf44929 Fixed warning: initialization of pointer of type 'VkSampler' (aka 'struct VkSampler_T *') to null from a constant boolean expression
Fixes https://github.com/libsdl-org/SDL/issues/13628
2025-08-03 07:24:51 -07:00
Hayden Gray
cb5436045d tray: linux fix tray menu elements not running callbacks (#13626) 2025-08-03 07:22:32 -07:00
Ryan C. Gordon
e1a623f129 SDL_migration.cocci: Fixed a few incorrect function names. 2025-08-02 22:54:03 -04:00
mitchellcairns
e8b5d90c41 SInput: ABXY Style Application and Code Cleanup (#13624)
ABXY Face Style Application

- The abxy face style extraction now applies to any SInput device.
- The use-case here is that gamepads that allow for changing styles can dynamically adjust the button labels firmware-side to have the physical location better represent the actual button being pressed.

SInput Sub-Type Clarification

- The code has been updated to better reflect the intention behind the sub-type field of the GUID byte 15.
- Any SInput device may utilize the Sub-Type field to indicate variants of the same device (Same device that has rear paddles or additional physical features but is otherwise identical, etc.).

"Firebird" Company Name Clarification

- "Bonjiri" was a wrong translation. Got clarification from the company and official PID registration for the official English spelling (See 0c5234cd92).
- Fixed this spelling for all references (official mapping strings still pending and this will return NULL until this is provided).

Code Notes
- Various notes have been updated to have more clear indications.
- I have moved the face-type and sub-type debug messages to be paired with the extraction for easier location.
- I've removed an incorrect note left-over from a previous commit regarding command response information.
2025-08-02 19:11:18 -07:00
Frank Praznik
51ce3f8c8d x11: Filter mouse wheel events from "Master" devices
Discard wheel events from "Master" devices to avoid duplicates, as wheel events are stateless and can't be deduplicated.
2025-08-02 18:56:41 -04:00
Frank Praznik
42463569d5 GPU: Vulkan backend flags command buffer for cleanup when swapchain is requested
When skipping presentation due to the window being hidden, presentDataCount is not incremented on the command buffer, and subsequently the submitted command buffers will not be cleaned up as long as the window is hidden. This results in a lag spike when showing the window due to all previously submitted command buffers suddenly being cleaned up at once, and lag at shutdown due to an equivalent number of fences needing to be destroyed.

Instead of relying on presentDataCount to determine whether a command buffer should be cleaned up, use a flag, which is set under the appropriate circumstances.
2025-08-02 09:24:02 -07:00
Petar Popovic
ae5ce258cf Fix double-free warning in src/hidapi/linux/hid.c 2025-08-02 07:08:35 -07:00
Antheas Kapenekakis
2b94062482 sinput: fix compiling with debug output on 2025-08-02 06:37:27 -07:00
Anonymous Maarten
5dc801506b ci: Haiku does not need -DSDL_UNIX_CONSOLE_BUILD=ON
Haiku has a native video system
2025-08-02 03:39:38 +02:00
Anonymous Maarten
2190705754 ci: configure with -DCMAKE_SYSTEM_NAME=Haiku for Haiku
Fixes ci regression introduced in e8b69b03fe
2025-08-02 03:08:03 +02:00
Sam Lantinga
8796f0a8ed SDL_gtk: Prevent loading GTK-3 if a different version of GTK is already loaded
- gtk_init_check claims it will not terminate the program on failure, however this is does
  not apply to the internal check it performs to see whether another GTK library is already
  loaded, the detection of which triggers a g_error which glib treats as fatal.

- gtk_progress_get_type and gtk_misc_get_type are checked to match the checks done
  by _gtk_module_has_mixed_deps.

- Clean up gtk/gdk loading. There are no library fallbacks so the one option available can
  be loaded rather than iterating through a list of one item.
2025-08-01 17:44:22 -07:00
Ozkan Sezer
f241e8e8fd windows: replace shobjidl_core.h usage with shobjidl.h except for when targeting xbox
Closes https://github.com/libsdl-org/SDL/pull/13571
2025-08-01 17:11:49 -07:00
capehill
1c5c3b1479 Fix SDL_BlitSurfaceScaled crash
SDL_BlitSurfaceScaled could crash when passed large coordinates, due
to final_dst.w or final_dst.h getting negative values.
2025-08-01 09:22:20 -07:00
Antheas Kapenekakis
d04899fcfd Fix setting RGB without a player led (#13524)
There is a bug where SInput checks for player led capability before
setting RGB. This means that if a controller does not have a player led,
RGB commands are not sent.
2025-08-01 09:15:54 -07:00
Petar Popovic
1749aba641 Fixed a few "-Wredundant-decls" warnings 2025-08-01 18:35:02 +03:00
Frank Praznik
550d95e04f wayland: Cleanup an outdated conditional and comment
There may have been a reason for not attaching a null buffer when destroying a popup at some point in the past, but that is unnecessary now, as is the comment about ShowWindow crashing, as ShowWindow assures that a null buffer is attached before (re)creating the window.
2025-08-01 10:33:55 -04:00
A1029384756
9034375d2f wayland: reorder surface destruction to avoid premature blanking 2025-08-01 10:20:19 -04:00
Ozkan Sezer
83818eeb95 tests: c90 fixes (#endif comments) for consistency after commit 9e37839 2025-08-01 06:28:02 +03:00
Anonymous Maarten
9e3783996b Fix testnative C90 compatibility 2025-08-01 02:27:54 +02:00
Anonymous Maarten
7b501ae71f Add a few include guards to private headers 2025-08-01 02:00:08 +02:00
Anonymous Maarten
06cafa3040 cmake: explicitly disable UNITY_BUILD property for SDL3 libraries 2025-08-01 01:59:18 +02:00
Petar Popovic
09221820f6 Fix potential memory leak in SDL_render_gles2.c 2025-07-31 16:18:47 -07:00
Matthew Zavislak
dc2c83c383 Support Google Play 16 KB Page Size Requirement (#13470)
- See: https://developer.android.com/guide/practices/page-sizes#update-packaging
- Also, make min API uniform at 21 (from 16 and 23 in a few places)
2025-07-31 16:12:54 -07:00
cosmonaut
c5edf4bd5b GPU: Bail out of aquiring Vulkan swapchain if window is hidden 2025-07-31 16:02:58 -07:00
mitchellcairns
6d580d74f2 Fix Axis Inputs for Generic SInput Device (#13489)
- Implement correct SInput generic mapping string to map analog axes
- Implement 6 axis count fallback for generic SInput Device
2025-07-31 15:36:10 -07:00
Sam Lantinga
2989d0c420 Fixed build 2025-07-31 10:18:05 -07:00
Frank Praznik
b0cdb7143f wayland: Adjust popup adjoining check
The previous calculation could result in a window whose original position was positioned exactly corner-to-corner with the parent not being adjusted to be adjoining, and thus subject to spurious closure.
2025-07-31 12:13:28 -04:00
Sam Lantinga
88cbe85fe2 Added missing files 2025-07-31 08:57:59 -07:00
Sam Lantinga
26c41f3f9a Fix Android build
- Android defines SDL_PLATFORM_UNIX but does not compile core/unix sources
  so add checks for SDL_PLATFORM_ANDROID where SDL_gtk is used.

- Fix missing void parameter list in SDL_Gtk_EnterContext.

- Remove unneeded SDL_gtk.h include in SDL_events.c
2025-07-31 08:49:40 -07:00
Sam Lantinga
bf7b4d4a9e x11: Add GTK signal handler for gtk-xft-dpi and reader in GetGlobalContentScale
- This is to support dynamic updates of content scale when running in XWayland. The GTK signal is
  preferred over the XSettings watcher and Xrm database if supported as it will trigger and update
  for both native X11 and XWayland on changes to Xft.dpi.
2025-07-31 08:49:36 -07:00
Sam Lantinga
3c369aa8b4 unix: Refactor GTK bindings from SDL_tray to separate SDL_gtk module to allow shared usage
- SDL creates and requires usage of a specific glib context. This context is set as the global
  glib context with SDL_Gtk_EnterContext and the previous context is restored with
  SDL_Gtk_ExitContext.

- To avoid changing the behavior of SDL_tray, which is the only consumer of SDL_gtk currently,
  the SDL_UpdateTray function now unconditionally runs a single glib frame iteration and is
  responsible for dispatching glib events for all consumers in SDL_PumpEvents.

- Cleaned up some error handling in SDL_tray.
2025-07-31 08:49:31 -07:00
Cheney Wang
d8ac51859e GPU: Fix wrong Vulkan swapchain size when retrying acquire 2025-07-30 15:34:56 -07:00
Wouter Wijsman
3d1a28ccf2 psp: fix audio not playing 2025-07-30 13:11:05 -07:00
Thaddeus Crews
3195980b49 Define relevant macros when LACKS_ERRNO_H is true 2025-07-30 09:11:11 -07:00
Stefan Schlosser
10458f2cac SDL_getenv.c: fix dynamic loading of environ symbol on FreeBSD
The current implementation uses the returned address of the `dlsym` function
directly to load the `environ` symbol. But this function doesn't return the
address to the symbol itself, instead it returns the address to the location
where the actual address is stored, i.e. it's an additional indirection.
Consequently, the implementation fails to load and process the environment
variables successfully.

One example where this error shows up is in the `Dialog API`: in an `X11`
environment, the `zenity` driver requires access to the user's `DISPLAY` and
`XAUTHORITY` environment variables. Because these variables aren't transfered
to the `zenity` process, no dialogs are shown. This can be exercised in the
`test/testdialog.c` testprogram.

The fix changes the indirection level of the `dlsym` call from `char **` to
`char ***`, does a `NULL`-check in case the call failed, and returns the
dereferenced actual adress to the `environ` symbol.
2025-07-30 07:06:25 -07:00
SDL Wiki Bot
e2392984b2 Sync SDL3 wiki -> header
[ci skip]
2025-07-30 08:06:30 +00:00
Ryan C. Gordon
dec21043a0 docs: Slightly improve virtual joystick docs.
Reference https://github.com/libsdl-org/sdlwiki/issues/78
2025-07-30 00:52:29 -04:00
Ryan C. Gordon
ea04bdb5f3 docs: Added a note about virtual joysticks to CategoryJoystick.
Fixes https://github.com/libsdl-org/sdlwiki/issues/78
2025-07-30 00:44:35 -04:00
Sam Lantinga
c663b6ec1f Don't leave garbage in output parameters 2025-07-29 20:48:56 -07:00
SDL Wiki Bot
cd15893ea3 Sync SDL3 wiki -> header
[ci skip]
2025-07-30 03:30:05 +00:00
Ryan C. Gordon
acbe86399d docs: Note SDL_EVENT_AUDIO_DEVICE_ADDED is sent for all devices at startup.
Fixes https://github.com/libsdl-org/sdlwiki/issues/721
2025-07-29 23:22:50 -04:00
SDL Wiki Bot
39794ae9cd Sync SDL3 wiki -> header
[ci skip]
2025-07-30 03:13:02 +00:00
SDL Wiki Bot
d9b578312e Sync SDL3 wiki -> header
[ci skip]
2025-07-30 03:04:38 +00:00
Evan Hemsley
07af4b237b GPU: Fix incorrect block size when D3D12 uniform buffer is rotated (#13469) 2025-07-29 15:34:08 -07:00
Petar Popovic
f27dbb22f0 Fix two use-after-free warnings 2025-07-29 12:29:19 -07:00
Ryan C. Gordon
774c0b36ea android: Different approach to SDL_GetPathInfo() for assets.
Reference Issue #13050.
2025-07-29 12:15:25 -04:00
Petar Popovic
beea8d604e Replaced binary integer literals with hexadecimal integer literals 2025-07-29 06:34:38 -07:00
Vicki Pfau
5f4416bc42 joystick: Improve Xbox controller mapping with xpad quirks (#13305)
xpad has a series of questionable design choices when it comes to button
mapping. Notably, BTN_TRIGGER_HAPPY1-4 are used for the D-pad on dance mats
instead of the typical BTN_DPAD_*, and maps the paddles to
BTN_TRIGGER_HAPPY5-8. This commit plumbs through driver detection for a udev
device and adds special exceptions for xpad's quirks.

Newer kernels (6.17+) add the BTN_GRIP* mappings for paddles on controllers. We
should prefer that if available, as its meaning and mapping is unambiguous.
However, since it's only in new kernels, we need to maintain the older mappings
where we know they exist.

It also exposes KEY_RECORD as the share button regardless of vendor, which had
previously been gated behind being a Microsoft controller. All Xbox Series
controllers can include this button, and many third party ones do.
2025-07-28 20:03:51 -07:00
Sam Lantinga
25cf1a569c Map GameCube controller trigger clicks as misc3 and misc4
This is for consistency with the GC Ultimate controller and allows binding in Steam
2025-07-28 13:11:07 -07:00
SDL Wiki Bot
c8ebbb3e92 Sync SDL3 wiki -> header
[ci skip]
2025-07-28 18:58:19 +00:00
Xen
b3ba1c159e Update SDL_clipboard.h
Typo fixes and a small addition to SDL_SetClipboardData about mime_type list usage clarity.
2025-07-28 11:57:25 -07:00
Dan Andrus
30f0aeb26a Check NSWindow::isVisible before sending SDL_WINDOWEVENT_RESTORED during Cocoa_WindowListener::windowDidResize 2025-07-28 14:47:08 -04:00
Mitch Cairns
49b6bb50c9 Remove Unused Type 2025-07-28 11:05:44 -07:00
Mitch Cairns
2b0b794f86 SInput Generic Types
- Implements 'handheld' flag to indicate whether the SInput device is a gamepad or handheld (ROG Ally etc)
- Implements generic mapping fallback along with face style setting ability
2025-07-28 11:05:44 -07:00
eafton
d983a89241 Restyle message boxes and add icon support to them on X11. (#13267) 2025-07-28 09:23:38 -07:00
Petar Popovic
dc1bf60b15 SDL_waylanddatamanager.c:Wayland_data_offer_check_source(): Return when offer is NULL 2025-07-28 11:25:14 -04:00
Shootfast
507ee033cc Fixed typo in SDL_scancode.h
The backslash/vertical line key is between the left shift and "Z" key on ISO keyboards
2025-07-27 19:58:13 -07:00
Boris I. Bendovsky
d103e5531f Implement SDL_GL_GetAttribute for SDL_GL_FLOATBUFFERS 2025-07-27 19:55:30 -07:00
Ozkan Sezer
9c54d686aa arguably better wording.. 2025-07-27 20:00:02 +03:00
Brenton Bostick
ed4de7aeed Fix warning on Android arm-v7
Building SDL for armeabi-v7a gives this warning:
```
SDL/src/audio/SDL_audiotypecvt.c:541:14: warning: '#pragma FENV_ACCESS' is not supported on this target - ignored [-Wignored-pragmas]
  541 | #pragma STDC FENV_ACCESS ON
```
2025-07-27 08:15:44 -07:00
Brenton Bostick
f361034ac3 fix typos 2025-07-27 08:10:03 -07:00
SDL Wiki Bot
2ed1c35ca6 Sync SDL3 wiki -> header
[ci skip]
2025-07-26 21:11:11 +00:00
Petar Popovic
6a5af95364 SDL_gpu.c: Fixed deref-before-check warning 2025-07-26 12:08:23 -07:00
Petar Popovic
2c2c2c5a48 Fixed a few "-Wstrict-prototypes" warnings 2025-07-26 11:12:40 -07:00
Anonymous Maarten
e6d200e51c ci+n3ds: avoid apt-get package manager
- use Unix Makefiles (with parallelization) CMake generator
- use binutils strings binary from devkitpro
2025-07-26 15:38:08 +02:00
Sam Lantinga
72b7fd10b4 Fixed warning: 'break' will never be executed 2025-07-25 16:20:44 -07:00
Sam Lantinga
970234d62d Fixed documentation for aligned structure members 2025-07-25 13:33:49 -07:00
Frank Praznik
c8e2d13173 wayland: Fix the key level request layout parameter
Use the layout loop index instead of the current layout, which could be invalid if no layout event was received before the keymap event.

Fixes #13418
2025-07-25 10:09:55 -04:00
Ryan C. Gordon
c80d6954cb Revert "audio: Added SDL_SetAudioIterationCallbacks()."
This reverts commit 608f706a95.

Didn't end up using this in SDL3_mixer, and it's a super-awkward API if we
don't need it.

I _might_ bite the bullet and let people lock a physical audio device, though,
as I could see that being useful but less awkward for the same reasons I
originally wanted it.
2025-07-25 01:38:21 -04:00
Sam Lantinga
e5d57d8ad6 Fixed building with GameInput v1.0 2025-07-24 10:52:09 -07:00
Sam Lantinga
0ee0fe1572 Fixed building with GameInput v1.0 2025-07-24 10:42:28 -07:00
Sam Lantinga
66dad9c21f Added Steam Virtual Gamepad support to the GameInput driver 2025-07-24 10:36:09 -07:00
Sam Lantinga
6babade758 Fixed double SDL_EVENT_GAMEPAD_ADDED for controllers with automatic gamepad mappings 2025-07-24 10:36:09 -07:00
Sam Lantinga
3fdd15adaa Fixed double-release of GameInput at shutdown 2025-07-24 10:36:09 -07:00
SDL Wiki Bot
6b9dfcc2fd Sync SDL3 wiki -> header
[ci skip]
2025-07-24 15:52:42 +00:00
Ryan C. Gordon
39e9ac6d1f ci: Patched to compile on Android. 2025-07-23 23:53:46 -04:00
Ryan C. Gordon
f5a0222a8e aaudio: Try to select a more-useful microphone for recording.
Fixes #13402.
2025-07-23 22:38:28 -04:00
Frank Praznik
acb3b0b4be win32: Implement keymap caching
Keymap construction is an expensive process, so keymaps are cached to facilitate fast switching, as they are static after initial construction, and do not need to be rebuilt every time.
2025-07-23 11:48:27 -04:00
Aubrey Hesselgren
34616d1b00 A little more tidying. Better notes around how the absolute maximum threshold was arrived at. 2025-07-22 12:59:47 -07:00
Aubrey Hesselgren
8863e5ee67 Made the maximum noise during accelerometer noise profiling a define, in terms of "G"
Also removed a // comment which was causing the build to error.
2025-07-22 12:59:47 -07:00
Aubrey Hesselgren
6bfc54508c Accelerometer Tolerance is now calibrated before Gyro Drift. 2025-07-22 12:59:47 -07:00
Ryan C. Gordon
07ef532681 hints: Renamed SDL_HINT_LOG_BACKENDS to SDL_DEBUG_LOGGING.
This still logs backend choices, but we might use it for other things. For
example, what Android device is being used, or all the devices we enumerated,
etc.

Ideally this eventually logs all the stuff we often have to ask followup
questions about.
2025-07-22 13:19:30 -04:00
Ryan C. Gordon
af1c05fd58 filesystem: Check SDL_GetPrefPath parameters at the higher level.
...so the backends don't have to do it.

Also added a stern warning about `org` being omitted, but leaving it as
allowed so as not to break existing apps (more than they are already broken,
at least).

Fixes #13322.
2025-07-22 12:28:01 -04:00
Frank Praznik
279a50cc26 wayland: Fall-back to the compositor for fullscreen-desktop window placement
Only use the specified output if an exclusive mode is being used, or a position was explicitly requested before entering fullscreen desktop. Otherwise, let the compositor handle placement, as it has more information about where the window is and where it should go, especially if fullscreen was requested before the window was fully mapped, or the window spans multiple outputs.
2025-07-22 10:56:43 -04:00
L zard
ea995b1694 build_config_windows: define HAVE_STDARG/STDDEF_H outside of
condition.
They are defined in both `#if HAVE_LIBC` and its `#else` anyway.
[sdl-ci-filter msvc-*]
2025-07-21 14:44:23 -07:00
L zard
a977a11fa6 build_config_windows: fix HAVE_VSSCANF defined regardless of MSVC version.
[sdl-ci-filter msvc-*]
2025-07-21 14:44:23 -07:00
Ryan C. Gordon
27caa57695 dialog: Make sure we don't underflow a string in Cocoa backend.
Fixes #13014.
2025-07-21 16:02:42 -04:00
Anon Ymous
b2d152e51f dialog: fix default file name on Cocoa 2025-07-21 15:51:35 -04:00
Sam Lantinga
fc19ae343c Updated SDL_IsJoystickSInputController() to match style in file 2025-07-21 11:38:54 -07:00
Thomas Stehle
0eaf28ed4d Added test and test image for clamped texture address mode to render testautomation 2025-07-21 10:21:31 -07:00
Thomas Stehle
64b19fc504 Added missing handling of texture address mode to SDL render Vulkan backend 2025-07-21 10:21:31 -07:00
Sam Lantinga
86200d1203 Fixed clamp texture address mode in software renderer 2025-07-21 10:20:16 -07:00
SDL Wiki Bot
55e14a2ced Sync SDL3 wiki -> header
[ci skip]
2025-07-21 17:16:40 +00:00
Maia
08fd165dd2 Add POINTER suffix to SDL_PROP_IOSTREAM_MEMORY_FREE_FUNC 2025-07-21 10:15:46 -07:00
mitchellcairns
4a30ee58ca Implement SInput Device Namings (#13391) 2025-07-21 10:08:27 -07:00
SDL Wiki Bot
b0b12b3b09 Sync SDL3 wiki -> header
[ci skip]
2025-07-21 16:55:47 +00:00
Semphris
47d8bdd1c3 Add SDL_IsTraySupported 2025-07-21 12:54:51 -04:00
Frank Praznik
735f0cc300 wayland: Handle text input per-seat
When changing the text input mode on a window, only update the seats that currently hold keyboard focus on that window, otherwise, text input might be inadvertently enabled or disabled on a seat focused on another window.
2025-07-19 10:08:56 -04:00
Acclution
8bd29f7ca3 GPU: Fix Vulkan compute uniform descriptor not being marked as set (#13389) 2025-07-18 15:27:31 -07:00
Frank Praznik
ce9c6e40fd wayland: Refactor keyboard layout handling
Build all the available keyboard layouts at once; this adds a negligible bit of overhead when initially handling the keymap (which was already significantly lowered by previous commits), but reduces the later cost of changing layouts to just swapping a pointer.

Additionally, handling of unknown keysyms, particularly when dealing with virtual keyboards, is improved, as keys generating valid Unicode values with no corresponding scancode will be dynamically added to the keymap with reserved scancodes, allowing for proper round-trip lookup behavior.
2025-07-18 12:22:03 -04:00
Frank Praznik
9c9bb9cec7 wayland: Only create/destroy the compose table when necessary
Initializing the compose table is a very expensive operation, and only necessary if the locale envvar changed, which is often not the case when just changing the keymap, so don't destroy and recreate it whenever the keymap changes. The state only needs to be reset in this case.
2025-07-18 12:22:03 -04:00
Frank Praznik
9b00f3a728 wayland: Optimize keymap creation
Iterate over the list of keys only once while assembling all related state for key levels and modifiers.
2025-07-18 12:22:03 -04:00
mitchellcairns
34d9db3657 SInput Serial MAC Fix (#13388)
* Resolve MAC address Order
2025-07-18 08:08:24 -07:00
Mitch Cairns
46ea7aa80e SInput Serial from MAC 2025-07-17 21:30:39 -07:00
Sam Lantinga
ad52ebf985 Fixed build 2025-07-17 20:56:41 -07:00
Sam Lantinga
e70ecb37c1 Implement the D-pad as a hat for SInput controllers
This lets games that use the joystick API handle the D-pad the same way as other controllers
2025-07-17 20:51:29 -07:00
Mitch Cairns
45674d0024 GC Ultimate Misc
Re-implement digital button press for GC Ultimate
(misc3:b12,misc4:b13)
2025-07-17 20:04:05 -07:00
Sam Lantinga
8f79a6185a Fixed the mapping for the GC Ultimate controller 2025-07-17 19:32:46 -07:00
Sam Lantinga
de20b731f2 Removed unnecessary cast 2025-07-17 19:32:29 -07:00
Sam Lantinga
ada44eaa10 testcontroller: reverted GameInput test code 2025-07-17 18:41:43 -07:00
Sam Lantinga
3b9db3dd62 Added support for Windows GameInput 2.0 2025-07-17 15:38:39 -07:00
SDL Wiki Bot
631aa697e6 Sync SDL3 wiki -> header
[ci skip]
2025-07-17 16:00:47 +00:00
Marcin Serwin
8451ce86c1 iostream: Add optional free_func pointer property to memory streams
Fixes https://github.com/libsdl-org/SDL/issues/13368

Signed-off-by: Marcin Serwin <marcin@serwin.dev>
2025-07-17 08:59:42 -07:00
BurntRanch
ee6d8f78f4 Clarify SDL_GPUVertexBufferDescription.pitch comment (#13381) 2025-07-17 08:53:35 -07:00
Sam Lantinga
855d28e97a Fixed crash if a clipboard event was sent with video uninitialized
This can happen if you're using SDL on Android without using the video subsystem.
2025-07-17 08:47:32 -07:00
Evan Hemsley
bc5c9a686c GPU: Clean up properties in SDL_ReleaseGPUTexture (#13378) 2025-07-17 00:21:34 -07:00
SDL Wiki Bot
1d9fc5f2c8 Sync SDL3 wiki -> header
[ci skip]
2025-07-17 07:20:27 +00:00
SDL Wiki Bot
1b4fd3aa83 Sync SDL3 wiki -> header
[ci skip]
2025-07-17 07:05:50 +00:00
Sam Lantinga
7510a67159 Fixed typo
Fixes https://github.com/libsdl-org/SDL/issues/13373
2025-07-16 19:31:10 -07:00
Blaž Tomažič
62d82ffc15 fix: don't use CLOCK_MONOTONIC_RAW on Android
Older Android phones have a kernel bug where time is not properly calculated
when calling `clock_gettime(CLOCK_MONOTONIC_RAW, ...)`. The returned time
either has nanoseconds out of range (outside of [0, 999999999]) or the returned
time is not monotonic in regards to previous call or both.

The issue is reproducible in Android Studio on arm64 emulators from at least
Android 7.0 (didn't try older versions) up to including Android 8.1 (kernel
3.18.94). The issue is in the kernel, these are just the versions of Android
emulator with buggy kernels.

The kernel commit that fixed this is [1]. Because this fix was backported to
various LTS releases of kernels it's hard to find out exactly which kernels are
buggy and which not. Therefore always use `CLOCK_MONOTONIC` on Android.

The `CLOCK_MONOTONIC` is slowly adjusted in case of NTP changes but not for
more than 0.5ms per second [2]. So it should be good enough for measuring
elapsed time.

---

An option would be to dynamically select
`CLOCK_MONOTONIC_RAW`/`CLOCK_MONOTONIC` at runtime by checking at init time
that `clock_gettime(CLOCK_MONOTONIC_RAW, ...)` returns nanoseconds in range.
Testing showed that nanosecons are out of range for 999/1000 cases. I guess
this could be good enough for support on older phones.

But because this would introduce a small perf hit by always reading a global
variable for first argument to `clock_gettime` and because `CLOCK_MONOTONIC`
does not have that high time deviation, this commit uses `CLOCK_MONOTONIC` on
Android always. It is also less burden to maintain.

---

[1] dbb236c1ce
[2] https://github.com/torvalds/linux/blob/master/include/linux/timex.h#L136
2025-07-16 10:36:14 -07:00
mitchellcairns
8e5fe0ea61 SInput Timestamp and Protocol Version (#13371)
* Implement Uint32 microseconds timestamp for IMU reporting instead of deltas
* Implement protocol version in feature request response
2025-07-16 10:12:38 -07:00
SDL Wiki Bot
504107ad0e Sync SDL3 wiki -> header
[ci skip]
2025-07-16 01:36:42 +00:00
mitchellcairns
18eeaea054 Implement SInput Device Support (#13343)
This implements a new SDL HID driver for a format developed by Hand Held Legend for their gamepad devices called SInput

Devices that are supported by this change with well-defined mappings

GC Ultimate ( https://gcultimate.com )
ProGCC ( https://handheldlegend.com/products/progcc-kit-wireless-wired-bundle )

The SInput format is documented here: https://github.com/HandHeldLegend/SInput-HID
2025-07-15 18:35:47 -07:00
Sam Lantinga
a53eb5221b Added support for the PDP REALMz Wireless Controller for Switch 2025-07-15 17:41:54 -07:00
Ryan C. Gordon
b3af72f69e emscripten: Respect SDL_HINT_MAIN_CALLBACK_RATE.
Fixes #13345.
2025-07-15 20:36:56 -04:00
Sam Lantinga
1b65f25465 testcontroller: use the correct label for face buttons 2025-07-15 15:52:40 -07:00
Sam Lantinga
08e3758e3f Added paddle bindings for the 8BitDo Pro 3 controller 2025-07-15 10:15:52 -07:00
Sam Lantinga
d53fcab609 Reordered the 8BitDo Pro 3 controller 2025-07-15 10:09:06 -07:00
Ryan C. Gordon
f2ae6503c0 audio: Binding an SDL_AudioStream will set missing formats.
It _must_ have the format set for the opposite side from the device (so
playback needs the src format set, and recording needs the dst format set),
since the stream gets mangled by the device thread if not. So if it has never
been set (stream created with NULL audiospec), just set it to match the device.
If the stream is just meant to buffer and not convert, this is desired
behavior, even if it didn't also fix a bug.

Binding the audio stream will always set the device side's format, as usual;
this does not need to be set by the caller at all.

Fixes #13363.
2025-07-15 06:40:09 -04:00
8BitDo
3c04c88c6e Add support for Pro3
Add support for Pro3
2025-07-15 03:26:08 -07:00
SDL Wiki Bot
d5efb11f97 Sync SDL3 wiki -> header
[ci skip]
2025-07-14 23:50:35 +00:00
Ryan C. Gordon
10004ab0ea hints: Added SDL_HINT_LOG_BACKENDS.
Fixes #13354.
2025-07-14 19:49:38 -04:00
Sam Lantinga
277f91c317 Removed the Mayflash GameCube adapter from the PS3 controller list 2025-07-14 11:30:15 -07:00
Andon M. Coleman
a07cf3ecdc Allow 1 kHz sample rate for DualSense Edge over USB
DualSense Edge natively reports at 1 kHz for all connection types, but gyro sample rate was limited to 250 Hz for USB.
2025-07-14 10:02:19 -07:00
Josh Dowell
0a50b798bf windows: Fix crash when using a system that reports itself as Windows 17763 or newer, but is missing many of the newer dark mode window functions (Linux Mint Cinnamon w/ Proton 7.0.6) 2025-07-13 20:08:47 -07:00
Ryan C. Gordon
2d8fd6bee1 Revert "windows: Use wglSwapLayerBuffers if available."
This reverts commit f286558bae.
2025-07-13 21:40:42 -04:00
Ryan C. Gordon
536126fdcf emscripten: Move over to using Pointer Events for all mouse, pen, and touch.
This allows us to avoid browser mouse emulation for touches, since we provide
our own anyhow.

The other option is to "prevent default" in the legacy touch event handlers we
historically used, to tell the browser not to supply emulation, but we can't
currently tell Emscripten to mark those handlers as not "passive," so as it
stands they are unable to prevent default. Using Pointer Events bypasses this
problem entirely.

Fixes #13161.
2025-07-13 16:06:03 -04:00
Kyle Sylvestre
0f061ff154 remove spoofed SDL_HelperWindow when SDL_VIDEO is off 2025-07-12 07:47:13 -07:00
Kyle Sylvestre
d42217ba26 check SDL_PLATFORM_WINDOWS instead of SDL_VIDEO_DRIVER_WINDOWS when using SDL_HelperWindow 2025-07-12 07:47:13 -07:00
Kyle Sylvestre
a190e3b514 move SDL_HelperWindow outside of video
move to SDL_window.c to prevent relying on SDL_VIDEO
2025-07-12 07:47:13 -07:00
Anonymous Maarten
5e787555e8 ci: build MSVC release binary on windows-2025
(cherry picked from commit 554f08bac3)
2025-07-12 01:54:05 +02:00
Ryan C. Gordon
190afc0f4f gpu: Fixed uninitialized variable in SDL_AcquireGPUCommandBuffer().
Fixes #13191.
2025-07-11 18:18:47 -04:00
Ryan C. Gordon
a81cf566f4 wasapi: Force enumerated audio devices to report themselves as float32 format.
This is what they'll end up being when used through WASAPI in shared mode,
regardless of what the hardware actually expects.

Reference Issue #12914.
2025-07-11 16:10:47 -04:00
Sam Lantinga
92e8224d32 Fixed build 2025-07-11 13:05:37 -07:00
Sam Lantinga
0b2e389ee3 Fixed long delay when enumerating the Razer Huntsman keyboard
Fixes https://github.com/libsdl-org/SDL/issues/13236
2025-07-11 12:34:14 -07:00
Sam Lantinga
937e8d55a4 Set hwndTarget to NULL when unregistering raw input
Fixes https://github.com/libsdl-org/SDL/issues/13335
2025-07-11 12:14:36 -07:00
Ryan C. Gordon
9af93abd4f cocoa: Don't minimize fullscreen windows for a modal file dialog.
macOS sends a focus loss event when the dialog is created, which causes SDL
to try to minimize the window, which confuses the entire system. So in this
special case, don't do the minimization.

Fixes #13168.
2025-07-11 15:05:45 -04:00
Sam Lantinga
f199aafaeb Fixed long delay when enumerating the Razer Huntsman keyboard
Fixes https://github.com/libsdl-org/SDL/issues/13236
2025-07-11 11:55:46 -07:00
Ryan C. Gordon
72f4dd17be x11: Avoid duplicate mouse events when using a pen device.
Fixes #12968.
2025-07-11 14:27:12 -04:00
Ryan C. Gordon
a2dcdfcb2d stdinc: Docs said "macro" but meant "datatype." 2025-07-11 14:24:12 -04:00
SDL Wiki Bot
45cc80f02c Sync SDL3 wiki -> header
[ci skip]
2025-07-11 18:20:01 +00:00
Ryan C. Gordon
515433aa8a android: If various POSIX fsops functions fail, try using AAssetManager.
This specifically affects SDL_EnumerateDirectory and SDL_GetPathInfo. Android
assets are read-only, so no need to do this for things like
SDL_CreateDirectory, etc, and the POSIX SDL_CopyFile() uses SDL_IOStream
behind the scenes, which already supports Android assets.

Fixes #13050.
2025-07-11 14:16:18 -04:00
Ryan C. Gordon
f286558bae windows: Use wglSwapLayerBuffers if available.
It apparently works better (or can work better?) on multimonitor setups
than SwapBuffers.

This should be available back to Windows 95, but just in case, it falls
back to standard SwapBuffers if not available.

Fixes #13269.
2025-07-11 12:29:12 -04:00
Anonymous Maarten
cfb8e591cb cmake: remove /RTC1 from CXX flags when building with SDL_LIBC=OFF 2025-07-11 03:25:58 +02:00
Frank Praznik
11ec0c7a8f hashtable: Fix documentation typos 2025-07-09 12:38:16 -04:00
Wouter Wijsman
c64518f300 PSP: Truncate thread name when passing to sceKernelCreateThread 2025-07-09 17:11:26 +02:00
Ozkan Sezer
fb0e03f262 fix ARM64 linkage with Visual Studio >= 17.14 when SDL_LIBC is disabled
Reference issue:  https://github.com/libsdl-org/SDL/issues/13254

(cherry picked from commit 2fb6abb9ad)
2025-07-09 01:30:55 +03:00
Aleksey Sakovets
6386781351 README-macos.md: replace old API calls 2025-07-07 18:37:19 -04:00
Frank Praznik
ef4b7489ff wayland: Use wl_shm_release when available 2025-07-06 11:28:04 -04:00
Frank Praznik
03fcbb4e46 wayland/events: Names will always be sent before devices and capabilities
Wayland previously didn't specify that the seat name preceded the capabilities, but it is now specified that the name event must always come first. Remove the 'SDL_Set<device>Name()' functions that were only added to accommodate the case of compositors sending the name after the seat capabilities, as this clarification means that they are no longer needed.
2025-07-06 11:28:04 -04:00
Frank Praznik
45fa9dba16 wayland: Use wl_fixes for registry destruction 2025-07-06 11:28:04 -04:00
Frank Praznik
b9ab8cf03d wayland: Add support for the key repeat event (seat v10)
The internal key repeat mechanism already disables itself if the key repeat interval is 0, and SDL tracks and handles the flagging of repeated keys itself, so just map the 'repeated' event to 'pressed'.
2025-07-06 11:28:04 -04:00
Ryan C. Gordon
343ad3eddd ngage: SDL_GetPrefPath allows a NULL org parameter.
Reference Issue #13322.
2025-07-05 12:21:13 -04:00
Frank Praznik
ecdc6f2adb wayland: Ensure that the xdg_surface is always configured after creation
The spec states that xdg_surface must have seen an initial configure event before attaching a buffer, however, this was only being done when initially showing the window, and not after show->hide->show cycle.

Always wait for the initial configure event when (re)creating an xdg_surface as part of the show window sequence.
2025-07-05 12:09:17 -04:00
Michael Fitzmayer
7c11a8cb9f Fix typo: remove redundant character 2025-07-03 13:20:47 +02:00
Anonymous Maarten
f3bf387caf testhotplug+testmouse: exit when pressing ESC key 2025-07-03 02:21:51 +02:00
Michael Fitzmayer
03489e249a [Nokia N-Gage] Re-enable FPS counter, fix link in README.
- Re-enable FPS counter, which is hidden by default anyway - but essential while working on an actual project.
- Fix link in the platform's README.
- Re-order list of supported platforms (alphabetical order to maintain consistency).
2025-07-02 21:27:24 +02:00
Ryan C. Gordon
530639aa4a docs: Documentation for SDL_Swap64 was reporting the wrong return type.
Fixes #13309.
2025-07-02 09:29:40 -04:00
SDL Wiki Bot
2606b08036 Sync SDL3 wiki -> header
[ci skip]
2025-07-01 21:25:27 +00:00
nightmareci
380b6a43a3 Change callback_rate_increment type to Uint64 2025-07-01 13:31:39 -04:00
nightmareci
9e6a6c01e4 Add support for floating point main callback rates 2025-07-01 13:31:39 -04:00
Frank Praznik
06cfea6a03 wayland: Improve pointer confinement reliability
If the pointer should be confined, keep trying until a confine/lock signal is received. This considerably improves locking/confinement reliability on compositors where confining can be a racy operation, or may not take effect until the pointer is actually in the confinement region.

A pointer lock is used to special-case 1x1 confinement regions, as otherwise, the pointer can still exhibit jitter at the subpixel level, particularly on scaled desktops.
2025-07-01 13:01:09 -04:00
Frank Praznik
9ff0438863 wayland: Send motion events in a frame
Pointer events in seat version 5 and higher should be grouped and sent together when a pointer frame event occurs. Store pending pointer motion events and dispatch them together when a frame event is received.

This helps avoid spurious pointer motion events that some compositors generate with no associated frame (e.g. from some tablet events).
2025-07-01 13:01:09 -04:00
Piotr Usewicz
e9535fa026 Update SDL_GpuDevice to SDL_GPUDevice 2025-06-30 10:10:39 -04:00
WillyJL
4eff36ef53 SDL3 GPU: Fix -Wbool-conversion warnings 2025-06-29 13:32:21 -04:00
Susko3
923813b399 Disable SDL_DYNAMIC_API when using ReSharper 2025-06-29 12:37:56 -04:00
Ryan C. Gordon
4217d62fa2 Some small fixes and corrections: comment typos, a wrong return value.
Just a few things I stumbled upon this week.
2025-06-29 03:07:51 -04:00
SDL Wiki Bot
34928341d0 Sync SDL3 wiki -> header
[ci skip]
2025-06-28 12:31:32 +00:00
Aubrey Hesselgren
e960bf6904 Gyro instrumentation for test controller (#13287)
This adds several minor changes to the gyro instruments.

* The HID Sensor Time display is now throttled to 10hz.
* Calibration for the gyro is now time based, not sample count based. Different polling rates will have drift calibrated over the same space of time.
* Pitch/Yaw/Roll readout: Yaw is prioritized, and then pitch, and then roll. This gives a more human-readable pitch/yaw/roll display, closely matching game engines.
* Pitch/Yaw/Roll text is colorized to match the axes in the 3D gizmo.
* Added set of axes to the 3D gizmo to show the "Left Hand Space" positive axis directions.
2025-06-26 19:56:06 -07:00
Anonymous Maarten
89eef1bd34 cmake: Android always needs a native HIDAPI implementation 2025-06-26 22:34:30 +00:00
Ryan C. Gordon
279dabfc96 cocoa: Don't use trick of briefly focusing the Dock on newer macOS releases.
On newer systems, the trick isn't necessary, and if you do it, if the user is
moving the mouse when launching the app, it'll show a hidden Dock.

Fixes #10340.
2025-06-26 14:24:53 -04:00
Sam Lantinga
afa27243df Ignore sensor delta values that look like they're out of range 2025-06-26 11:10:21 -07:00
Caleb Heuer
cd98b66114 Allow overriding SDL_FORK_MESSAGEBOX in build environment 2025-06-26 10:49:31 -07:00
Sam Lantinga
8d5bf053f7 Fixed detecting 8BitDo sensor timestamp on older firmware
Also updated the reported sensor rate over USB for new firmware
2025-06-26 10:47:35 -07:00
Frank Praznik
0ac1241b7a x11: Always update the borders on frame extent events
Always update the border sizes on frame extent events, or they can incorrectly still be zero if followed by a PropertyNotify event when leaving fullscreen.

Fixes sending the correct restored window size when leaving fullscreen in fvwm.
2025-06-26 11:52:43 -04:00
Sam Lantinga
f40bf44928 Removed unnecessary include 2025-06-25 18:50:28 -07:00
8BitDo
6d3e8b749e add 8BitDo Controller sensor_timestamp (#13278) 2025-06-25 18:49:43 -07:00
Sam Lantinga
727b4924c8 Update the viewport when logical presentation changes
Fixes https://github.com/libsdl-org/SDL/issues/13256
2025-06-25 09:58:30 -07:00
Paul Vick
de6a23028a Fix #13276: Crash in SDL_GetAudioDeviceChannelMap 2025-06-25 07:47:55 -04:00
Vicki Pfau
8442d4f0f7 joystick: Add support Xbox Adaptive Controller
The Xbox Adaptive Controller reports the pressed guide button state as 2
instead of 1. This is contrary to the spec, but it's needed for the guide
button to work.

This also adds a bit more documentation on observed-but-not-known GUIDs.
2025-06-24 16:51:18 -07:00
Petar Popovic
3cd979b353 SDL_render.h: enum SDL_TextureAddressMode: Removed trailing comma 2025-06-24 21:56:20 +03:00
Rémi Verschelde
db3a35e9bc joystick: Fix MSVC errors C2099 with /fp:strict 2025-06-24 06:58:24 -07:00
Sam Lantinga
9ed83e71f6 Fixed memory leaks in KMSDRM property handling
Also cleaned up the code for consistency so it's easy to see memory leaks here.
2025-06-22 21:33:52 -07:00
SDL Wiki Bot
603118c340 Sync SDL3 wiki -> header
[ci skip]
2025-06-23 04:18:24 +00:00
Sam Lantinga
aa4f916b71 Renamed SDL_PROP_AUDIOSTREAM_KEEP_ON_SHUTDOWN_BOOLEAN to SDL_PROP_AUDIOSTREAM_AUTO_CLEANUP_BOOLEAN 2025-06-22 21:17:06 -07:00
SDL Wiki Bot
6cfe211142 Sync SDL3 wiki -> header
[ci skip]
2025-06-23 04:07:09 +00:00
Ryan C. Gordon
274aa0242e audio: Let apps save an audio stream from destruction during SDL_Quit(). (#13244)
This is a special-case piece of functionality, generally these are expected
to go away during shutdown, but maybe someone is switching between audio
subsystems or something...
2025-06-22 21:06:15 -07:00
Ozkan Sezer
af8bee2dd1 alsa: change an SDL_LogError into SDL_LogDebug.
it is informational only and seeing ERROR on the terminal was confusing
2025-06-22 21:04:44 -07:00
Marcin Serwin
bbc674b9e7 test: Fix resource paths in testtray
Signed-off-by: Marcin Serwin <marcin@serwin.dev>
2025-06-22 21:03:37 -07:00
mitchellcairns
796961acec Resolve bug for calibration Nintendo Switch Pro Controller (#13260)
Resolves a bug which prevents the stored calibration data from loading, only allowing loading of factory-installed calibration data
2025-06-22 20:59:15 -07:00
Mitch Cairns
3a6f9e01f8 Fixed Nintendo Switch thumbstick calibration 2025-06-22 15:26:49 -07:00
Sam Lantinga
038a3806eb Fixed Nintendo Switch Pro thumbstick calibration
Fixes https://github.com/libsdl-org/SDL/issues/13246
2025-06-21 19:55:05 -07:00
Sam Lantinga
e6c2649afc Updated testffmpeg for ffmpeg 7.1 2025-06-21 08:48:40 -07:00
Sasha Szpakowski
e80d084766 expose events originating from a live-resize set the data1 field to 1.
Fixes #13243.
2025-06-21 07:33:25 -07:00
Josh Dowell
6aedc488d3 win32: Invalidate window message mouse button flags when reading buttons from raw input or GameInput
SDL2 would set a high bit in the mouse button flags to indicate when raw input had been read from, without this, if you hold down a mouse button and left raw input mode (leaving relative mode) the button would remain partially stuck, and would require two clicks to start producing mouse down events again.
SDL3's raw input code was refactored to not use the mouse button flags, but forgot to invalidate the flags, causing this bug to manifest.
2025-06-21 07:28:14 -07:00
Ozkan Sezer
81e3066303 hidapi/libusb: disable C5287 warning in MSVC builds
A quick search implies that it is a bogus warning:
https://www.google.com/search?q=visual+studio+C5287
2025-06-21 07:15:53 -07:00
Sam Lantinga
7d9fd48557 alsa: recover from snd_pcm_avail() returning -EPIPE 2025-06-20 16:33:30 -07:00
Sam Lantinga
e68f5ca99a alsa: use udev if available instead of a hotplug thread
This makes detecting audio device changes more responsive.
2025-06-20 19:19:31 -04:00
Sam Lantinga
051ce0ff89 alsa: fixed disconnecting the microphone when opened
Some devices take some time for data to become available, so we'll keep waiting as long as necessary for them to provide data.
2025-06-20 19:19:31 -04:00
Wohlstand
5fcc83d93b Vita Render: Limit the scope of cliprect to viewport
Don't allow cliprect be larger than viewport's scope

(cherry picked from commit 6701f938f7)

# Conflicts:
#	src/render/vitagxm/SDL_render_vita_gxm.c
2025-06-20 14:51:16 -07:00
Wohlstand
1bd5110ff0 Vita: Fixed absence of clipping when viewport is set
#13034

(cherry picked from commit 1c09a7117a)

# Conflicts:
#	src/render/vitagxm/SDL_render_vita_gxm.c
#	src/render/vitagxm/SDL_render_vita_gxm_types.h
2025-06-20 14:51:16 -07:00
Ryan C. Gordon
eb04219efe audio: Enumerating audio devices will skip zombie devices still in the hash. 2025-06-20 17:37:39 -04:00
SDL Wiki Bot
d06b6e42d2 Sync SDL3 wiki -> header
[ci skip]
2025-06-20 21:02:26 +00:00
Sam Lantinga
c19ad189dc Clarify that SDL_GetAudioStreamDevice() returns the logical device. 2025-06-20 14:01:16 -07:00
Sam Lantinga
7882e60f0e Don't log an error for disconnected audio devices 2025-06-20 11:05:08 -07:00
Lilian Gimenez
e4e29b8601 Fix support for F21 to F24 scancodes on Linux 2025-06-20 09:06:57 -07:00
Sam Lantinga
d7939abf42 Use consistent style for pointer declarations and casts 2025-06-18 10:03:44 -07:00
Frank Praznik
390fe65323 test: Fix a window parenting bug in testmodal 2025-06-18 09:26:09 -04:00
Frank Praznik
ca9b7c8ea3 video: Explicitly disallow setting the parent of a window to itself
Doing so causes a cycle in the window hierarchy tree graph, which leads to infinite recursion when destroying the windows.
2025-06-18 09:26:08 -04:00
Ryan C. Gordon
c04624972e alsa: Simplify ALSA_WaitDevice.
- Check for specific availability instead of waiting for "device ready."
- Don't use snd_pcm_wait, just use a simple SDL_Delay (nothing to recover).
- Fixed SDL_max call that should have been SDL_min (now using SDL_clamp).
- ALSA_RecordDevice() now returns 0 if no availability, which kicks us back
  to WaitDevice to try again, as an extra safety check.
2025-06-17 20:40:00 -04:00
Ryan C. Gordon
b4ac5f43f5 include: Fixed copy/paste error in endian-specific SDL_Read function docs. 2025-06-17 16:41:24 -04:00
Ryan C. Gordon
3896b1b3f4 wikiheaders: Let each subproject specify how to find their property symbols. 2025-06-17 16:41:24 -04:00
Sam Lantinga
efed3c63b3 Added support for an alternate version of the Vader 4 Pro 2025-06-17 10:02:10 -07:00
Sam Lantinga
d6bae53341 Added support for an alternate version of the Vader 4 Pro 2025-06-17 08:07:12 -07:00
Sam Lantinga
f62c982bcf Reverted Accelerometer and Gyro displays to throttled display (10hz)
Also made accelerometer threshold for drift calibration more lenient for very noisy accelerometers.

The testcontroller tool could eventually be used to come up with a better way to profile an IMU's "stationary" noise so that this threshold can be as tight as necessary for the sake of automatic drift calibration.

(thanks @HilariousCow!)
2025-06-16 11:14:22 -07:00
Sam Lantinga
b833c618a9 Improved reliability detecting FlyDigi Vader controllers 2025-06-16 11:07:50 -07:00
SDL Wiki Bot
0e262dfd44 Sync SDL3 wiki -> header
[ci skip]
2025-06-16 02:13:37 +00:00
Ryan C. Gordon
6c406dd122 include: a couple of documentation tweaks and typo fixes. 2025-06-15 22:12:21 -04:00
SDL Wiki Bot
42c9fe119d Sync SDL3 wiki -> header
[ci skip]
2025-06-16 00:36:13 +00:00
Aubrey Hesselgren
f5d1402c28 Flydigi Vader 4 Pro IMU rate correction (#13215)
Flydigi IMU rate now matches observed rate of packets in both dongle and wired connection.

Flydigi Vader 4 Pro IMU rate correction was set at a fixed 125hz. In actuality rate is 1000hz over dongle and 500hz when wired.
2025-06-13 22:29:19 -07:00
Aubrey Hesselgren
1e886c8a2f 8 bitdo polling rate corrections (#13221)
Gathered correct IMU polling rate in wired mode for good gyro synchronization.

Wireless: different models had different amounts of Bluetooth packet loss.
USB_PRODUCT_8BITDO_ULTIMATE2_WIRELESS: Solid 120hz over bluetooth (note: only appears via).
USB_PRODUCT_8BITDO_PRO_2_BT: Lossy - 80-90hz registered.
SB_PRODUCT_8BITDO_SN30_PRO_BT & USB_PRODUCT_8BITDO_SN30_PRO_BT: Very Lossy - 60-90hz registered
2025-06-13 22:25:31 -07:00
Aubrey Hesselgren
913b611ccd Added tools for evaluating gyroscope accuracy and IMU polling rates. (#13209)
* Added tools to Test Controller for evaluating gyroscope accuracy and IMU polling rates.

This adds a visual suite to the testcontroller tool to help validate IMU data from new gamepad drivers and HID implementations.

The 3D gizmo renders accumulated rotation using quaternion integration of gyroscope packets. If a controller is rotated 90° in real space, the gizmo should reflect a 90° change, allowing quick detection of incorrect sensitivity or misaligned axes.

Also includes:
- Euler angle readout (pitch, yaw, roll)
- Real-time drift calibration display with noise gating and progress
- Accelerometer vector overlay
- Live polling rate estimation to verify update frequency

Intended for developers working on controller firmware or SDL backend support to confirm correctness of IMU data processing.
2025-06-13 14:01:52 -07:00
Frank Praznik
e2239c36d3 wayland: Ensure that the tablet tool list is always initialized to empty
Otherwise, it will be left in an uninitialized, non-empty state if the tablet protocol isn't present.
2025-06-13 15:57:31 -04:00
Xaver Hugl
ec1297199e wayland: Implement the pointer warp protocol
The pointer warp protocol allows us to warp the pointer to a different position on
the surface, without any hacks like locking and unlocking the pointer.
2025-06-13 15:40:49 -04:00
ceski
558a89fdb6 Read Switch controller gyro/accel sensitivity coeffs (SDL3)
These vary by controller, so using the stored values should improve the accuracy of the sensor data.
2025-06-13 12:18:05 -07:00
SDL Wiki Bot
fd4ffa6d27 Sync SDL3 wiki -> header
[ci skip]
2025-06-13 17:06:54 +00:00
e4m2
c5b1341757 Tweak Vulkan include guard check and 64-bit platform defines (#13210) 2025-06-12 09:32:07 -07:00
Sam Lantinga
e18a6313de Added gyro support for the Flydigi Vader 3 Pro controller 2025-06-12 09:10:07 -07:00
Klay
71f479b4aa Fix a broken link inside README-cmake.md that's meant to send to README-linux.md
also made said link more consistent with other links by adding .md suffix
2025-06-10 18:46:35 -04:00
Cameron Cawley
f2bcfe3dd2 Correct the texture format used for the N-Gage (#13192) 2025-06-08 18:56:24 +02:00
Michael Fitzmayer
685f1720fe Revert "[Nokia N-Gage] Fix alpha transparency in 4K color mode using BitBltMasked"
This reverts commit 2ef7944170 due to unbearable performance issues.
2025-06-07 22:45:54 +02:00
Splendide Imaginarius
a89a20a9ab Fix Markdown typo in Arch Linux dependencies docs
A blank line is needed for the code block to be recognized.
2025-06-07 13:34:56 -04:00
Michael Fitzmayer
cbc9d662ea [Nokia N-Gage] Add define to disable FPS counter by default. 2025-06-07 15:40:53 +02:00
Edu García
d9af41b5ac cmake: more private definitions 2025-06-06 10:29:20 -07:00
Sam Lantinga
5826966873 Fixed replacing existing specific gamepad mappings
If the first mapping we see doesn't have a CRC, continue looking for another exact CRC match.

Fixes testautomation --filter TestVirtualJoystick
2025-06-06 09:53:15 -07:00
Sam Lantinga
f90a21483c Added support for the ZEROPLUS P4 Wired Gamepad 2025-06-06 09:25:36 -07:00
Sam Lantinga
638acdc02a Remove the CRC from automatically generated gamepad mappings
Fixes https://github.com/libsdl-org/SDL/issues/13127
2025-06-06 09:22:14 -07:00
Frank Praznik
45eb6310a8 x11: Resize fixed-size windows after mapping on xmonad
XMonad ignores size hints and shrinks the client area to overlay borders on fixed-size windows, even if no borders were requested, resulting in the window client area being smaller than requested. Calling XResizeWindow after mapping seems to fix it, even though resizing fixed-size windows in this manner doesn't work on any other window manager.
2025-06-06 11:35:31 -04:00
Vicki Pfau
7dd5e765df joystick: Report battery on GIP controllers 2025-06-05 18:34:22 -07:00
Vicki Pfau
c54a017f47 joystick: Clean up Elite Button handling 2025-06-05 18:34:22 -07:00
Vicki Pfau
559efd58e2 joystick: Add headset stub to GIP driver 2025-06-05 18:34:22 -07:00
Frank Praznik
7cc3feeb1b keyboard: Search for the correct base key value when querying the keycode from a scancode
When querying the keycode produced by a scancode with a certain set of modifiers, it would fall back to defaults if a key hash value with the exact set of modifiers wasn't found, which resulted in certain modifier combination returning incorrect keycodes on non-ANSI keyboard layouts. For example, querying SDL_SCANCODE_Y with the alt modifier on a QWERTZ layout returns SDLK_Y instead of SDLK_Z on most platforms, as the backends don't generate a specific entry for this key + modifier combo, so the lookup would fall back to the default ANSI layout.

Adding additional key+modifier combinations when building the keymap is one solution, but it makes an already expensive operation even more so, pushing the time needed to build the keymap into double-digit milliseconds in some cases due to the large amount of key combos that need to be queried, most of which are redundant.

Instead, falling back to searching through the shift levels for the given modifier state when querying the keymap will ensure that the most appropriate keycode is returned. This does add some overhead to lookups if the key doesn't have an entry with the exact set of modifiers, but it is minimal as hash table lookups are an inexpensive operation, and unnecessary lookups are avoided. In my own testing of an optimized build, the difference between best-case and worst-case performance (the latter of which is highly unlikely in real-world usage) is only a few hundred nanoseconds. Additionally, the unmodified keys are queried when pumping events, so there is no additional overhead in that case.
2025-06-05 14:42:29 -04:00
Frank Praznik
22fa45b3c1 win32: Ensure that text input is initially disabled when creating a window
Windows seems to implicitly enable IME text input on windows created while an IME is active, which causes the IME suggestion window to pop up when keys are pressed, even if a client never explicitly enabled it. Ensure that IME support is initially disabled on new windows; SDL will enable it at a later time, if required.
2025-06-05 12:20:35 -04:00
SDL Wiki Bot
c240ed976f Sync SDL3 wiki -> header
[ci skip]
2025-06-05 16:02:05 +00:00
Sam Lantinga
27464ffb08 Clarify that icon and cursor alternate images are added with SDL_AddSurfaceAlternateImage() 2025-06-05 09:00:49 -07:00
Michael Fitzmayer
2ef7944170 [Nokia N-Gage] Fix alpha transparency in 4K color mode using BitBltMasked
Previously, all transparent pixels were rendered as opaque due to the limitations of the 4K color mode. Replaced Gc()->BitBlt() with Gc()->BitBltMasked() and updated the mask during copy operations to correctly respect the alpha channel of textures, while maintaining good performance.
2025-06-04 21:05:29 +02:00
Ethan Lee
d86fb8a83a gdk: Ignore focus loss events caused by text input showing the OSK 2025-06-04 09:40:33 -04:00
Sam Lantinga
6622f4e1ea Added support for the NACON Revolution X Unlimited controller on macOS
This adds support for the controller in Bluetooth mode.

Fixes https://github.com/libsdl-org/SDL/issues/13143
2025-06-03 15:05:11 -07:00
Michael Fitzmayer
45aa497813 [Nokia N-Gage] Fix SDL_GetPerformanceFrequency and SDL_GetPerformanceCounter 2025-06-03 21:59:33 +02:00
Sam Lantinga
7457857304 Fixed input from the MayFlash GameCube adapter with version 7 firmware 2025-06-03 11:13:43 -07:00
SDL Wiki Bot
1ec12b38e5 Sync SDL3 wiki -> header
[ci skip]
2025-06-03 15:31:53 +00:00
Simon McVittie
b6c4a46b85 workflows: Use stable Steam Runtime 3 on both x86_64 and arm64
The first public beta that had a corresponding arm64 version has now
been promoted to stable, and subsequent releases will be for both
x86_64 and arm64.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-06-03 10:44:25 -04:00
Evan Hemsley
fbba5b272a GPU: Binding validation and prevent null dereference if expected binding is missing (#13164) 2025-06-02 13:39:58 -07:00
Sam Lantinga
cf6c42e6e6 Use HEAPU8.set rather than Module.HEAPU8.set (thanks @sbc100!)
The Module object is the external interface to the application, internal symbols like HEAPU8 don't need to be exported to be used and usage should not be prefixed with Module.

Fixes https://github.com/libsdl-org/SDL/issues/13156
Closes https://github.com/libsdl-org/SDL/pull/13157
2025-06-02 09:47:26 -07:00
Sam Lantinga
4b0f48c4cf Mark gamepads as invalid if they can't be opened
Fixes https://github.com/libsdl-org/SDL/issues/13129
2025-06-02 09:21:13 -07:00
SDL Wiki Bot
a314a58e7e Sync SDL3 wiki -> header
[ci skip]
2025-06-01 22:00:52 +00:00
SDL Wiki Bot
d283f4651c Sync SDL3 wiki -> header
[ci skip]
2025-06-01 21:52:34 +00:00
Ryan C. Gordon
8510331f66 .wikiheaders-options: Add Tray to quickreference categories. 2025-06-01 10:48:32 -04:00
Ryan C. Gordon
b8187e2abd wikiheaders: Trim whitespace from end of lines in section headers. 2025-06-01 10:43:08 -04:00
Ryan C. Gordon
9e0d9f30a7 x11: Be a little less aggressive with Xinput2IsInitialized checks.
Just in case this ever get deinitialized sooner, we'd still like to SDL_free()
things on shutdown, etc.

Reference PR #13148.
2025-06-01 10:14:01 -04:00
Mason Remaley
57b6e6c7f9 Checks if xinput is loaded before trying to call xinput functions 2025-06-01 10:11:23 -04:00
Ryan C. Gordon
ac3ab026fe audio: corrected comment about device format minimums. 2025-06-01 03:01:37 -04:00
Ryan C. Gordon
83cc3bc234 audio: Opened device spec must be >= simple minimums, not device's defaults.
Fixes #13159.
2025-06-01 02:56:59 -04:00
Ryan C. Gordon
14a4ae521a pulseaudio: Request more recording data per-fragment.
This seems to help some devices that can't keep up with smaller fragment sizes
for whatever reason.

Fixes #13110.
2025-06-01 02:46:55 -04:00
SDL Wiki Bot
3a4de2ad89 Sync SDL3 wiki -> header
[ci skip]
2025-05-31 21:11:00 +00:00
Ryan C. Gordon
47717f22fd cocoa: Always add a window-sized NSTrackingArea to each window.
Previously this was only done on older macOSes, but it seems to work on all
versions, afaict.

Reference Issue #12725.
2025-05-31 15:00:56 -04:00
Ryan C. Gordon
f61d956a04 cocoa: add explicit tracking areas to the window.
This makes sure we get reliable mouse enter/exit events from the system on
older macOS releases.

Newer releases don't have this problem--my assumption is that Cocoa has a
more aggressive default tracking area installed for some newer UI feature.

For 3.2.16, we'll use the explicit tracking area on older macOSes only, but
I'll remove that check in revision control for newer OSes and see what
happens.

Fixes #12725.
2025-05-31 14:40:12 -04:00
Frank Praznik
58afb0d8ae wayland: Update xkbcommon names and types
Use the proper types for xkb mod masks and layout indices, rename the mod masks to reflect that they are bitmasks and not indices, and use the 'layout' nomenclature instead of the deprecated 'group' nomenclature.
2025-05-31 13:40:58 -04:00
Frank Praznik
c764e8864b wayland: Update xkbcommon to avoid using deprecated modifier names
xkbcommon 1.10.0 declared certain modifier names to be deprecated, and the current plan is to remove them in 1.12.0. Use the new recommended names and modifier mask retrieval function when building against version 1.10.0 and higher.
2025-05-31 13:40:58 -04:00
Michael Fitzmayer
b61586b492 [Nokia N-Gage] Increase max. texture size from 256 to 1024; the previous setting was chosen at random and does not necessarily make sense in practice. 2025-05-31 14:07:49 +02:00
Ozkan Sezer
329b5f27d6 fix preprocessor directive for SDL_RESTRICT definition in C99 case. 2025-05-30 23:56:50 +03:00
Ozkan Sezer
0d58594e66 fix inverted __STDC_VERSION__ condition in SDL_RESTRICT definition. 2025-05-30 23:51:50 +03:00
Ryan C. Gordon
6a686185f7 SDL_begin_code.h: Actually define SDL_RESTRICT.
We wrote documentation for this but never actually filled in the code.
2025-05-30 15:59:40 -04:00
Caleb Heuer
51dfca813b Pass text input rect to steam deck keyboard invocation 2025-05-30 09:54:33 -07:00
Anonymous Maarten
520d73ae57 include/SDL_gpu: fix bool members documentation indentation 2025-05-30 16:34:34 +02:00
Aubrey Hesselgren
a26e5f32e0 Gyro degrees per second is 2000 across all 8bitdo controllers (#13147) 2025-05-29 14:28:55 -07:00
Sam Lantinga
fc1c0618de kmsdrm: fixed creating GBM surfaces on NVIDIA cards 2025-05-29 11:20:24 -07:00
DracoRooks
03a6d98aee Update SDL_pixels.h
Added an opening bracket in line 520, in the comment block of SDL_PixelFormat. Simple addition to the readability of documentation.
2025-05-29 11:03:31 -07:00
Sam Lantinga
885e611f3c Added macros to push/pop error messages while cleaning up 2025-05-29 10:53:46 -07:00
Sam Lantinga
61d105247e Fixed typos 2025-05-29 10:53:30 -07:00
Sam Lantinga
7db0ac7380 Updated SDL_StretchSurface() documentation
Fixes https://github.com/libsdl-org/SDL/issues/13135
2025-05-29 09:09:04 -07:00
Everett Afton
ca988dbc2c Bail out if Xrandr returns zero CRTCs in the X11 messagebox implementation 2025-05-29 11:32:50 -04:00
Everett Afton
c147ddf3e3 Do not use Xrandr if the extension is not queryable in the X11 messagebox implementation 2025-05-29 11:32:50 -04:00
Everett Afton
df07c09f55 Use visuals and colormapsin the X11 messagebox implementation 2025-05-29 11:32:50 -04:00
Sam Lantinga
737b9e117d Removed obsolete documentation 2025-05-28 15:57:04 -07:00
Sam Lantinga
d2be547642 Removed spurious parentheses 2025-05-28 13:28:12 -07:00
Sam Lantinga
36936cbf37 Set the serial number to the Bluetooth MAC address for 8BitDo controllers 2025-05-28 12:18:27 -07:00
SDL Wiki Bot
f80e819c5b Sync SDL3 wiki -> header
[ci skip]
2025-05-28 13:35:21 +00:00
SDL Wiki Bot
b7082e7e18 Sync SDL3 wiki -> header
[ci skip]
2025-05-27 17:31:04 +00:00
Ryan C. Gordon
3940c660be begin_code: Added SDL_ALIGNED macro. 2025-05-27 13:30:04 -04:00
Sam Lantinga
aa870d511e Disable SDL_HINT_JOYSTICK_RAWINPUT by default
Windows can get in a state when it stops reporting raw input events for game controllers until reboot.

The downside of this change is that we lose support for trigger rumble and are limited to 4 controllers again, but if that's important for your application you can use SDL_SetHint(SDL_HINT_JOYSTICK_RAWINPUT, true) to enable this functionality.

Fixes https://github.com/libsdl-org/SDL/issues/13047
2025-05-27 09:51:48 -07:00
Ethan Lee
db972604a8 gpu: Xbox buildfix 2025-05-27 12:41:27 -04:00
Sam Lantinga
8a2e2e75d1 Simplified loop logic 2025-05-27 08:47:32 -07:00
8BitDo
b4f7948410 Ensure that report 06 command reads normally
Ensure that report 06 command reads normally
2025-05-27 08:45:09 -07:00
Frank Praznik
e3d44cdd51 wayland: Use raw timestamps to calculate the elapsed repeat time on a key up event
Using processed timestamps can result in anomalies that cause excessive repeat events, and hard caps can cause issues.

In the key event handler, use the raw elapsed time to calculate any remaining repeat events to avoid the artifacts that can result from using processed timestamps.

The Wayland key repeat rate ranges from 0 to 1000 per second, so millisecond resolution doesn't lose any precision.
2025-05-27 10:59:03 -04:00
SDL Wiki Bot
b51273512b Sync SDL3 wiki -> header
[ci skip]
2025-05-26 20:22:23 +00:00
SDL Wiki Bot
988c0be934 Sync SDL3 wiki -> header
[ci skip]
2025-05-26 20:13:49 +00:00
Sander Ledegen
9b025e3cab PSP fullscreen is the only mode (#13125) 2025-05-26 10:31:48 -07:00
SDL Wiki Bot
08b6f6175a Sync SDL3 wiki -> header
[ci skip]
2025-05-26 16:35:37 +00:00
Ryan C. Gordon
5e50d39b38 audio: Added SDL_PutAudioStreamDataNoCopy. 2025-05-26 12:34:37 -04:00
Ozkan Sezer
25db127450 SDL_video.c: remove two stray line continuation chars . 2025-05-26 01:41:47 +03:00
Christian Kündig
168d1a9253 emscripten: Proxy Emscripten_GetSystemTheme and EMSCRIPTENAUDIO_OpenDevice to the main thread. 2025-05-25 13:50:02 -07:00
mattbsage
f62572344f Clean up INTERFACE_COMPILE_OPTIONS
The extra text causes Meson/Ninja builds to fail as headers are not found.
2025-05-24 19:13:25 -07:00
Frank Praznik
b70919ecd9 x11: Assume the window was mapped after showing
Not all window managers send a MapNotify or PropertyNotify event when the window is shown, so assume that it was mapped and set the flag accordingly.
2025-05-24 09:59:30 -04:00
Frank Praznik
0657ece55d x11: Always send fullscreen dimensions except on XWayland
More non-compositing window managers than just openbox seem to need this, so always force sending the window position and dimensions when entering/leaving fullscreen. If they are wrong, they will be immediately overwritten by the correct dimensions from a subsequent ConfigureNotify event.

This is disabled on XWayland, as it seems to cause hitching on some compositors.
2025-05-24 09:59:30 -04:00
Sam Lantinga
1f6b5c681d Set the initial axis values for HIDAPI and XInput controllers
Fixes https://github.com/libsdl-org/SDL/issues/13020
2025-05-23 12:09:39 -07:00
Frank Praznik
fdc4f8fa39 x11: Include the XTest header when needed
Fixes building when statically linking.
2025-05-23 13:05:52 -04:00
Ivan Epifanov
2b4d61e4a6 VITA: support only fullscreen windows. Fixes #13079 2025-05-23 08:45:15 -07:00
Vicki Pfau
4cd889cb13 joystick: Several minor GIP fixes
This mostly fixes stylistic issues, but also fixes an issue with some
controllers where an erroneous check would clear the DLI flag, offsetting the
share button index so it wouldn't work.
2025-05-22 21:45:00 -07:00
SDL Wiki Bot
0a7548230c Sync SDL3 wiki -> header
[ci skip]
2025-05-22 22:39:10 +00:00
Sam Lantinga
c9cf4c42e0 Improved HIDAPI support for Flydigi controllers 2025-05-22 15:36:38 -07:00
kyle-sylvestre
ead32c706d fix error handling in WideCharToMultiByte 2025-05-22 15:25:06 -07:00
kyle-sylvestre
8ddb074889 bugfix advancing UTF-8 length in UTF-16 string 2025-05-22 15:25:06 -07:00
Ryan C. Gordon
dcdbc0bf9f README-documentation-rules: Add a note about being UTF-8 only! 2025-05-22 15:41:05 -04:00
Ryan C. Gordon
56bb73a8d2 README-ngage.md: Really actually got all the non-UTF-8 characters this time! 2025-05-22 15:38:59 -04:00
Ryan C. Gordon
ecef0d3564 README-ngage.md: Found a few more non-UTF-8 things. 2025-05-22 15:34:04 -04:00
Ryan C. Gordon
fb7afabbd6 README-ngage.md: Removed non-UTF-8 character. 2025-05-22 15:30:21 -04:00
SDL Wiki Bot
73ca59b423 Sync SDL3 wiki -> header
[ci skip]
2025-05-22 19:18:42 +00:00
SDL Wiki Bot
136a44b0bd Sync SDL3 wiki -> header
[ci skip]
2025-05-22 18:08:13 +00:00
Michael Fitzmayer
7ae64592c9 Restore support for the Nokia N-Gage (#12148) 2025-05-22 11:07:22 -07:00
SDL Wiki Bot
26f9940f82 Sync SDL3 wiki -> header
[ci skip]
2025-05-22 17:50:19 +00:00
Sam Lantinga
6f994cc7a8 Fixed macOS build 2025-05-22 10:18:14 -07:00
bakatrouble
354895d975 Add Flydigi VADER 4 Pro HIDAPI support (#12874) 2025-05-22 09:56:17 -07:00
Ryan C. Gordon
8d9a4fe843 stdinc: Corrected documentation for SDL_atan2 and SDL_atan2f.
Fixes #13099.
2025-05-22 09:52:15 -04:00
Frank Praznik
abcfa1b7de wayland: Use SDL_memcpy instead of SDL_copyp to copy the repeated text string
SDL_copyp is not intended to copy arrays. Use SDL_memcpy with the explicit size instead.
2025-05-21 20:38:39 -04:00
Matteo Hausner
22828d5f2a Fix #13083 segfault in SDL_RemoveTrayEntry() for submenu entries
Use `g_object_ref_sink()` in `SDL_CreateTraySubmenu()` as introduced with
3be67ced64 for the top-level menu.
2025-05-21 13:32:28 -07:00
Sam Lantinga
264eb8d440 Fixed the Bluetooth flag for the combined Joy-Con controller 2025-05-21 13:30:00 -07:00
Frank Praznik
05f779f61e wayland: Cap the max key repeat elapsed time
Cap the elapsed time to something sane in case the compositor sends a bad timestamp, which can result it in it looking like the key has been pressed for a *very* long time, bringing everything to a halt while it tries to enqueue all the repeat events.
2025-05-21 12:19:22 -04:00
Frank Praznik
20e8ac0075 wayland: Fix keymap changed event spam with non-latin keyboard layouts
The function SDL_GetCurrentKeymap() would return null instead of the actual bound keymap for non-latin layouts if certain mapping options were set. Add a parameter to ignore the keymap options and always return the actual bound keymap, which is needed in the Wayland backend to avoid spamming keymap changed events on every keystroke with certain layouts.
2025-05-21 11:54:56 -04:00
kyle-sylvestre
b8e055ce64 use SDL style - else on same line as closing brace 2025-05-20 17:12:01 -07:00
kyle-sylvestre
8e22194217 get preferred locales on android 2025-05-20 17:12:01 -07:00
Anthony Fisher
c08b1049d3 gpu/d3d12: Acknowledge that we've bound vertex buffers (#13088) 2025-05-20 16:34:04 -04:00
Francisco Javier Trujillo Mata
c89357bf60 Fix wrong callback type 2025-05-20 11:10:43 -07:00
Logan
f4942b3eae GPU: Update D3D12 to create multisample textures with default MSAA alignment 2025-05-20 11:07:24 -07:00
Frank Praznik
c7549eb0b6 wayland: Set the text input cursor rect properly
The text input cursor should reflect the cursor position, not the entire text input rect. Set it correctly so that IME chooser dialogs appear in the correct location.
2025-05-20 13:40:00 -04:00
krizej
3be57ec774 docs: fix man page return value section generation 2025-05-20 13:04:45 -04:00
cosmonaut
2dad6534b8 GPU: Add missing compute-writeable texture formats 2025-05-19 18:08:35 -07:00
Sam Lantinga
992e4c59bd Fixed rare crash trying to interrupt SDL_WaitEvent()
Fixes https://github.com/libsdl-org/SDL/issues/12797
2025-05-19 14:15:44 -07:00
SDL Wiki Bot
4db8fe2f9b Sync SDL3 wiki -> header
[ci skip]
2025-05-19 20:23:53 +00:00
Frank Praznik
6c61a94a4b wayland: Don't add the nanosecond timestamp offset to the pre-conversion millisecond value 2025-05-19 13:59:46 -04:00
Sam Lantinga
25f2376e79 Fixed touch not being delivered as mouse events by default on Vita
Closes https://github.com/libsdl-org/SDL/pull/13070
2025-05-19 08:32:23 -07:00
Joe [ReRezd]
afd1e51023 Fix: GameCube controller adapter hotplug not working
SDL_PrivateJoystickAdded was called before setting the InstanceId in the adapters ctx->joysticks array.  This would eventually broadcast the SDL_EVENT_JOYSTICK_ADDED event with the new InstanceId, if your program listens for the added events and opens joysticks at that point it would always fail because there would be no matching InstanceId in the ctx->joysticks array.
2025-05-19 08:24:40 -07:00
Ethan Lee
510126ee63 gpu: Check shader format support in PrepareDriver 2025-05-19 08:20:33 -07:00
Logan
8289656a4e GPU: Update to set supported shader formats inside CreateDevice 2025-05-18 18:32:50 -07:00
SDL Wiki Bot
514d96de07 Sync SDL3 wiki -> header
[ci skip]
2025-05-17 00:15:49 +00:00
Eduard Gushchin
d6a99752b7 Fix properties name in SDL_CreateGPUDeviceWithProperties 2025-05-16 17:14:58 -07:00
Caleb Heuer
3dceb728b7 Suppress spammy gamepad and joystick update events 2025-05-16 17:08:23 -07:00
Frank Praznik
b0a282e31f wayland: Enable relative pointer mode based on the window flag
This can be toggled per-window, so use the individual window flags instead of the global toggle to selectively enable it only for the relevant window in a multi-seat scenario, as is already done with keyboard and pointer grabs.
2025-05-16 13:12:45 -04:00
danginsburg
968222e74f Fix #13057 - fixes bug with NSEventTypeMouseMoved having a NULL window causing us to suppress future mouse move events because the window was considered out of focus. 2025-05-16 09:52:27 -07:00
ScolderCreations
d16371b923 Fix reference to nonexistent "README-3ds.md" 2025-05-15 11:23:00 -07:00
Stéphane GINIER
945eb6dc87 MacOS: fix cocoa clipboard text
Adjust Cocoa_SetClipboardData so that SetClipboardText text can be pasted outside SDL
2025-05-15 10:54:04 -07:00
Evan Hemsley
b08d79b832 GPU: Check that a texture format is valid for compute writes (#13044) 2025-05-14 16:24:05 -07:00
Evan Hemsley
604c192154 GPU: Always return NULL if beginning a pass fails an assert check 2025-05-14 15:23:23 -07:00
cosmonaut
252129f433 GPU: Debug mode layer and level index checks
Resolves #13033
2025-05-14 12:22:18 -07:00
Sam Lantinga
db154c8b9b Added HIDAPI mapping for the 8BitDo SF30 Pro 2025-05-14 10:18:51 -07:00
Sam Lantinga
ec685e87fd Clarify logic in UpdateLogicalPresentation() 2025-05-14 10:12:41 -07:00
Frank Praznik
8aa5b97bb5 renderer: Always use the output size when updating the main view
The main view always reflects the size of the output, so don't use the dimensions of the currently bound render target texture when updating it, or it will reflect an incorrect size when the render target texture is unbound.
2025-05-14 09:37:30 -07:00
Ryan C. Gordon
1f7aa16eae wikiheaders: Man pages should escape apostrophe chars.
This prevents problems if one starts a line, which would cause it to be
interpreted as a command character.

Fixes #13038.
2025-05-14 11:36:43 -04:00
Vicki Pfau
cf62637261 joystick: Add support for Xbox One Chatpad attachment 2025-05-13 17:30:39 -07:00
SDL Wiki Bot
83cbf7f811 Sync SDL3 wiki -> header
[ci skip]
2025-05-14 00:29:20 +00:00
Manuel
f85f83ec7c SDL GPU: Implemented opt out Vulkan device features (#13016) 2025-05-13 17:28:28 -07:00
Frank Praznik
1eeffc5933 Revert "x11: Send key events for dead keys consumed by the IME"
This and its related commits introduced some bugs and quirks such as duplicated and delayed/missed key events that can't be easily worked around, so revert this for now.

This reverts commit 47162a4168.
2025-05-13 09:21:39 -07:00
Frank Praznik
3304d24bea Revert "x11: Filter out duplicate key presses when an IME is active"
This reverts commit f4813ca2cf.
2025-05-13 09:21:39 -07:00
Sam Lantinga
cd95152b2c Fixed crash if out of memory in the Vulkan GPU driver 2025-05-13 09:07:15 -07:00
Simon McVittie
70b2d162e3 audio: Assert that all devices from device_hash are the appropriate type
The keys and values of device_hash are pairs
`(SDL_AudioDeviceID devid, void *dev)` where dev can be either a
`SDL_AudioDevice *` or a `SDL_LogicalAudioDevice *`, depending on
bit 1 of devid.

We can confirm that we have got this right by looking at the
instance_id member, because logical audio devices happen to start with
the devid, whereas physical devices start with a pointer which is
unlikely to match the devid by chance.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-05-13 08:53:24 -07:00
Frank Praznik
83d4dce697 wayland: Remove all window references from seats when destroying a window
Compositors typically send keyboard, pointer, touch, and tablet leave events when a window is destroyed, however, this is not guaranteed behavior, and at least one compositor in widespread use doesn't always send pointer leave events immediately upon destroying a window. Ensure that all references held by seats to a focused window are removed before the underlying window surface and structs are destroyed to prevent potential segfaults if the seats are immediately destroyed after the window.
2025-05-13 11:32:02 -04:00
Ryan C. Gordon
0a34279578 audio: Fix SDL_GetAudioDeviceName() not working with logical devices.
Fixes #12977.
2025-05-12 13:53:30 -04:00
SDL Wiki Bot
e2f7c4046c Sync SDL3 wiki -> header
[ci skip]
2025-05-12 16:18:27 +00:00
Takase
f6c1e81394 [Process API] Quoting enhancements (#12946) 2025-05-12 09:17:21 -07:00
yunline
9a6f70d75a tray: Fix wrong fByPositon parameter of SetMenuItemInfoW in SDL_SetTrayEntryLabel 2025-05-12 07:01:05 -07:00
Mike Kosek
38da39c8c9 Added rightx and righty 2025-05-12 05:36:21 -07:00
Dominic Bolin
2ae3418260 GPU Vulkan: set correct destination usage mode for storage buffer read/write bindings (#13009) 2025-05-11 16:11:45 -07:00
ManuBlack
c6e9d6cc79 AAudio: Implemented sample frames hint 2025-05-11 16:05:01 -07:00
Frank Praznik
aaa5d70efc wayland: Check the cursor visibility flag when updating seat pointers 2025-05-11 11:05:37 -04:00
Ryan C. Gordon
e1066ceea1 Revert "pulseaudio: cleanup TLS every time we finish a threaded-mainloop callback."
This reverts commit 3b91017682.

This apparently is cleaning up more threads than expected, so this needs a
rethink.

Fixes #12986.
Fixes https://github.com/libsdl-org/sdl2-compat/issues/486
Fixes https://github.com/libsdl-org/sdl2-compat/issues/482
2025-05-11 10:55:42 -04:00
Frank Praznik
84308e7fba x11: Fix the Openbox quirk flag
Openbox needs fullscreen size/position event synthesized, but does not send display changed events.
2025-05-10 15:50:12 -04:00
dbolin
6344712b04 GPU Vulkan: fix for Swapchain Semaphore Reuse 2025-05-10 07:54:50 -07:00
GamesTrap
3f2226a917 Add progress bar support for Linux 2025-05-10 07:53:36 -07:00
RipleyTom
e90f7ac4a8 Add hid_version and hid_version_str to renamed LIBUSB impl symbols 2025-05-10 07:45:06 -07:00
SDL Wiki Bot
f92843da83 Sync SDL3 wiki -> header
[ci skip]
2025-05-10 13:38:22 +00:00
Evan Hemsley
86b206dadf GPU: Special case to avoid assert on GenerateMipmaps (#12995) 2025-05-09 21:45:54 -07:00
Vicki Pfau
7b3bd8c538 joystick: Improve GIP metadata retry
This reduces the number of retries, since they almost never help, and always
attempts the fallback if metadata fails enough times.
2025-05-08 16:41:26 -07:00
Vicki Pfau
367cf9ba63 joystick: Always continue processing GIP packets
This loop breakout was originally from an attempt to parse coalesced packets.
Breaking out early does more harm than good, and no devices coalesce packets,
so this is unnecessary.
2025-05-08 16:41:26 -07:00
Vicki Pfau
955a49c883 joystick: Add quirk for no impulse vibration on the Spectra Pro 2025-05-08 16:41:26 -07:00
Vicki Pfau
82899501b5 joystick: Fix GIP fast ACK issue
By moving the message sending onto the main thread and adding a small timeout
we can now ensure the ACKs are sent fast enough to avoid the firmware bugs in
these controllers.
2025-05-08 16:41:26 -07:00
Vicki Pfau
9e0edea16f joystick: Assume GIP gamepads have the LED command if no metadata is present 2025-05-08 16:41:26 -07:00
Vicki Pfau
9a96960728 joystick: Sort out GIP vendor messages into the supported interfaces 2025-05-08 16:41:26 -07:00
Vicki Pfau
72dd79752e joystick: Add initial support for GIP flight sticks
At the moment, only the ThrustMaster T.Flight Hotas One has full support. The
documentation says you can query the extra buttons via a specific command, but
the stick appears to reject the command. Further investigation is needed for
automatically querying this state.
2025-05-08 16:41:26 -07:00
Vicki Pfau
2248d3812e joystick: Rework GIP code to allow separate states for individual attachments
This is needed for future work bringing up things like the chatpad.

This commit also fixes a few minor things, such as still sending motor packets
to devices that don't support it, enabling quirks that hide trigger rumble on
devices that are marked as not having it, and fixing #12942.
2025-05-08 16:41:26 -07:00
Sam Lantinga
87fe9ef79b Fixed crash if WGI isn't correlated in RAWINPUT_JoystickRumble() 2025-05-08 15:38:32 -07:00
Sam Lantinga
29d2116495 Define illegal_instruction() when it will be actually used 2025-05-08 11:51:35 -07:00
Sam Lantinga
2aa0957081 Fixed 8BitDo Ultimate 2 Wireless controller on macOS
When connected for the first time over Bluetooth on macOS, the first few reads return 0, so retry a few times in that case.
2025-05-08 10:48:02 -07:00
Ethan Lee
ad55597715 ci: Update Steam Linux Runtime tasks.
- Use "3.0" instead of "Sniper"
- Use "steamrt3" instead of "slrsniper"
- Use latest instead of beta for x86_64
2025-05-08 10:24:35 -07:00
Ethan Lee
36c3a7a5e2 ci: Add slrsniper-arm64 task 2025-05-08 10:24:35 -07:00
Sam Lantinga
8690a9ab54 Prefer the HIDAPI driver for 8BitDo controllers on macOS
The HIDAPI driver supports accelerometer, gyro, and rumble.
2025-05-08 10:08:08 -07:00
Sam Lantinga
2b57d58f7d Added GCController mapping for the 8BitDo SN30 Pro on macOS 2025-05-08 09:57:10 -07:00
Sam Lantinga
d157600d3d Added GCController mapping for the 8BitDo Pro 2 on macOS
Fixes https://github.com/libsdl-org/SDL/issues/12987
2025-05-08 09:49:10 -07:00
SDL Wiki Bot
09c8d4b556 Sync SDL3 wiki -> header
[ci skip]
2025-05-08 14:49:45 +00:00
nmlgc
37b86a6d2f windows: fix Unicode function and type inconsistencies
The surrounding code in all of these instances expects the Unicode
variants. Previously, this code mixed Unicode and ANSI/ASCII calls if
`UNICODE` was undefined, which caused type and logic errors. Explicitly
spelling out the W removes any reliance on that macro.
2025-05-08 07:22:11 -07:00
Ozkan Sezer
d9e58baa6d fixed the field of SDL_MouseMotionTransformCallback 2025-05-08 14:45:24 +03:00
Semphris
e7a765d648 Replace SDL_free with delete for new-allocated objects 2025-05-07 15:43:00 -04:00
Sam Lantinga
5bee85408c Cleanup 8BitDo HIDAPI support for SF30 Pro and SN30 Pro
This sets the correct number of buttons for older controllers, and adds parsing for older firmware USB reports
2025-05-07 12:11:27 -07:00
SDL Wiki Bot
89a8cf2505 Sync SDL3 wiki -> header
[ci skip]
2025-05-07 05:54:39 +00:00
expikr
6b048f59d7 fix #12963 2025-05-06 21:17:34 -07:00
8BitDo
2b3c481215 add 8BitDo Controller (#12964)
add SN30 Pro, SF30 Pro, Pro 2.
Supported versions:
Pro 2 v3.06  above
SF30 Pro/SN30 Pro v2.05 above
2025-05-06 19:47:10 -07:00
Sam Lantinga
ca47dc59a9 Fixed building with the OpenVR video driver 2025-05-06 16:14:22 -07:00
Sam Lantinga
195ad85ba4 Fixed typo 2025-05-06 16:08:03 -07:00
Frank Praznik
f4813ca2cf x11: Filter out duplicate key presses when an IME is active
IME text events can result in sending duplicate key press events, which will result in undesired repeated key presses. Since the events are exact duplicates, compare the serials to filter out redundant key down events.
2025-05-06 18:06:14 -04:00
Sam Clegg
8e1f4bafb4 [emscripten] Remove referenc to Module['createContext']
The Module interface is the one used by the outside world.  This code
is inside the module itself so can use the internal name, avoiding the
need to export this function on the Module at all.

See https://github.com/emscripten-core/emscripten/pull/24269
2025-05-06 14:16:26 -07:00
Ivan Epifanov
1dbb813316 VITA: fix audio playback 2025-05-06 12:55:22 -07:00
SDL Wiki Bot
20f783532b Sync SDL3 wiki -> header
[ci skip]
2025-05-06 17:21:29 +00:00
SDL Wiki Bot
bbd973c8d2 Sync SDL3 wiki -> header
[ci skip]
2025-05-06 16:46:42 +00:00
SDL Wiki Bot
71303b41bf Sync SDL3 wiki -> header
[ci skip]
2025-05-06 05:16:13 +00:00
Ryan C. Gordon
a7344206e8 wikiheaders: Patched to compile.
(whoops.)
2025-05-05 23:58:59 -04:00
Ryan C. Gordon
06c2f9fcfc wikiheaders: Correct wiki README digest links. 2025-05-05 23:56:12 -04:00
Ryan C. Gordon
ad46394e82 wikiheaders: README.md should be READMEs.md
So it doesn't conflict with the old README directory.
2025-05-05 23:49:06 -04:00
Ryan C. Gordon
2c97a48c51 wikiheaders: READMEs go in the base dir of the wiki now.
Reference PR #12529.

(and several other issues.)
2025-05-05 23:36:08 -04:00
Ryan C. Gordon
92a5417a98 docs: Tweak some minor things to keep wikiheaders happy.
You can't have two sections with the same name (so it can generate unique
page anchors), so fix one of these, and tweak another thing that _isn't_ a
header but wikiheader's quick-and-dirty parser thinks is one.
2025-05-05 23:34:20 -04:00
Sam Lantinga
d357aa29a3 Fixed initializing the OpenVR driver 2025-05-05 15:52:28 -07:00
Sam Lantinga
f8c77908ad Use motor sequence ID 0 in the HIDAPI GIP driver
Using a 0 sequence number is always allowed and avoids having to synchronize sequence numbers with the controller (and potentially confusing other things talking to the controller)

Also fixes occasional long running rumble at controller connection.
2025-05-05 15:06:54 -07:00
Frank Praznik
33e5f4885a x11: Don't update grab on enter when the mouse is captured
The xserver will still send EnterNotify events while the pointer is captured, and the grab shouldn't be updated in these cases, as it will cause the capture to be lost.
2025-05-05 12:25:50 -04:00
Frank Praznik
1abac3ccc3 Revert "x11: Better handle XInput2 mouse tracking outside the window"
This reverts commit 8c733d1f7b.
2025-05-05 12:25:50 -04:00
SDL Wiki Bot
85d2345bd8 Sync SDL3 wiki -> header
[ci skip]
2025-05-05 15:21:20 +00:00
SDL Wiki Bot
5bd886519b Sync SDL3 wiki -> header
[ci skip]
2025-05-05 15:10:37 +00:00
Frank Praznik
c6362b4788 tests: Revert some leftover testing code 2025-05-05 11:08:15 -04:00
Frank Praznik
c91f9f6968 x11: #ifdef the XRandR path in the message box code
The runtime check isn't sufficient as the functions are undefined if built without XRandR.
2025-05-05 10:45:54 -04:00
A. Wilcox
7490471796 cpuinfo: Use auxv for AltiVec on Linux if possible
The SIGILL handler is not very reliable and can cause crashes.

Linux provides the CPU's AltiVec support status in getauxval.
2025-05-04 13:52:21 -07:00
Ozkan Sezer
17bba029ba don't prototype strdup() for __clang_analyzer__ case in windows builds.
Fixes:  https://github.com/libsdl-org/SDL/issues/12948.
2025-05-04 10:35:31 -07:00
Katharine Chui
15c6acf74f capture g27 shifter r input
ref: d97f782315/pico_lgff_wheel_adapter/reports.h (L265-L310)
2025-05-03 08:10:41 -07:00
Ryan C. Gordon
795d1ae1fb testmessage: Don't push the event if "Retry" was chosen.
Otherwise, the message box thread goes back to blocking, but the app's main
thread progresses to SDL_WaitThread and won't pump the event queue anymore.

On iOS, this means the messagebox won't pop back up (because it uses
SDL_RunOnMainThread, which needs the event loop to pump), but it's just bad
practice on any platform to stop pumping the event queue for indefinite
lengths of time.
2025-05-02 21:42:47 -04:00
Frank Praznik
d73fe0bc53 win32: Hide the borders when showing a fullscreen window
If it is known that the window will immediately enter fullscreen upon being shown, set the borderless style when showing the window to hide the borders, or they may linger in the background if the client takes some time to draw the first frame.

Unnecessarily calling ShowWindow with SW_RESTORE when applying the window flags must be suppressed in this case, or the borders can reappear in a weird, partial state.
2025-05-02 14:21:36 -04:00
Sam Lantinga
ab12b7cbba Added support for the share button on the GameSir-K1 FLUX controller 2025-05-02 10:15:16 -07:00
Sam Lantinga
1e6a25324c Added support for the PowerA Battle Dragon Advanced Wireless Controller 2025-05-02 10:01:13 -07:00
Ryan C. Gordon
57346f2ba8 dialog: Cocoa backend should reactivate the app after the modal dialog.
Otherwise the window won't have focus until you click on it again. Calling
makeKeyAndOrderFront isn't enough to fix it, either.

This trick comes from a similar problem we solve in our
applicationDidFinishLaunching implementation: activate (give app focus to) the
system Dock, as something that definitely exists that isn't us and is harmless
to activate, and then activate us right afterwards. This unconfuses whatever
is getting confused inside Cocoa.

Fixes #12684.
2025-05-02 01:52:42 -04:00
Sam Lantinga
caf269ce00 Added a link to the GIP documentation 2025-05-01 21:35:10 -07:00
Sam Lantinga
34c045aa39 Fixed paddles on the Xbox Elite controller using the GIP driver 2025-05-01 21:35:10 -07:00
Cameron Gutman
0447c2f3c3 events: Add integer wheel fields for sdl2-compat
It's way simpler to just add them back to SDL3 than emulate them purely in sdl2-compat.
2025-05-01 22:50:52 -05:00
Sam Lantinga
ae251a05be Fixed warning: no previous prototype for function 'GIP_ParseMetadata' 2025-05-01 15:39:49 -07:00
Ryan C. Gordon
193b0c8963 uikit: Use SDL_RunOnMainThread instead of dispatch_sync for message boxes.
Reference Issue #12741.
2025-05-01 18:28:53 -04:00
Ryan C. Gordon
691cc5bb5e dialog: Cocoa shouldn't crash if there's a '.' in the filters.
So something like "index.pb" will now accept any file with a ".pb" extension,
to make macOS happy. This seems like a reasonable tradeoff.

Other minor cleanups.

Fixes #12778.
2025-05-01 18:11:36 -04:00
Temdog007
4ef8b6ce1b X11: Center Message Box on Multi Monitor Displays (#12819)
Use XRandr to find the position of the current screen to center the message box on that window
2025-05-01 13:38:52 -07:00
Frank Praznik
c5d5967c3a video: Store the preferred fullscreen display in a property for sdl2-compat
sdl2-compat will call SDL_GetDisplayForWindow() when querying the display to use for fullscreen, which won't always be correct if the backend can't actually reposition the window. When calling this function, get the ideal fullscreen display and store it in a property for retrieval by sdl2-compat.
2025-05-01 11:24:34 -07:00
SDL Wiki Bot
11e1d4a145 Sync SDL3 wiki -> header
[ci skip]
2025-05-01 18:05:25 +00:00
Vicki Pfau
00f3a82ada Joystick: Add new GIP driver to replace old Xbox One wired driver
This new driver is based on official documentation released by Microsoft in
September, though it still lacks several important features, notably the
Security handshake for wireless dongles and audio support. It is, however, more
reliable and extensible than the old driver.
2025-05-01 11:04:33 -07:00
Sam Lantinga
48dfc03a87 Added the gamepad hint SDL_GAMECONTROLLER_USE_GAMECUBE_LABELS
This is for internal use to signal that a mapping uses positional GameCube buttons. It's set so we know whether a mapping uses the older style labeled buttons or the newer style positional buttons. If a positional mapping is used with SDL2, then it will be ignored, since the hint is marked as defaulting true and the mapping conditional is that the hint is false.
2025-05-01 10:54:16 -07:00
Sam Lantinga
21a7bbbf14 Restore compatibility with older GameCube mappings
Restore the original button values for GameCube controllers, but swap labeled mappings to positional while loading mappings

Fixes https://github.com/libsdl-org/SDL/issues/12847
2025-05-01 10:54:16 -07:00
Dimitriy Ryazantcev
3730128e33 Simplify WIN_CreateHCursor (#12933) 2025-05-01 08:32:12 -07:00
Frank Praznik
6a0505c090 wayland: Remove unnecessary function call 2025-05-01 11:30:16 -04:00
Frank Praznik
fdd8b5d630 wayland: Query the mouse global button states from the seats
Mouse button events that trigger a hit test are not passed to the client, but the client may still query the global mouse button state from within the hit test handler, so the reported buttons need to be accurate. Query the buttons directly from the seat instead of the higher global mouse state to match the behavior of other platforms.
2025-05-01 11:26:32 -04:00
Sam Lantinga
e3df61b070 Fixed right mouse button emulation when using a pen
Pen button 1 is typically used as right click. Pen button 2 (Wacom eraser) doesn't have a specific mapping, but we'll use middle click for now.
2025-04-30 11:07:31 -07:00
Sam Lantinga
106ccc722e Fixed missing simulated mouse events using a Wacom tablet
The low 16-bits of the message extra info is an event sequence number when using the Wacom tablet with Windows Ink disabled. The high bits of normal mouse motion when using touch input match the touch signature, 0xFF515700. The high bits of raw input mouse motion when using touch input do not match that signature, so we have to check for the touch bit in that case.

Fixes https://github.com/libsdl-org/SDL/issues/12927
2025-04-30 11:07:31 -07:00
Sam Lantinga
8ae962c904 Fixed build 2025-04-29 19:06:42 -07:00
Sam Lantinga
e04064350f Fixed right click mouse emulation for the Wacom tablet
The problems are two-fold. When this happens a WM_POINTERDOWN event is sent with IS_POINTER_INCONTACT_WPARAM() evaluating as true. So when SDL_SendPenButton() is sent for the barrel button, there is no pen in contact yet, so the right mouse button is sent. Then SDL_SendPenTouch() is sent, which generates a left button press event.

Fixes https://github.com/libsdl-org/SDL/issues/12926
2025-04-29 19:03:42 -07:00
Evan Hemsley
a163257295 GPU: Validate that textures are not bound for both read and write on render passes (#12925) 2025-04-29 16:52:52 -07:00
Ryan C. Gordon
ea67133e4f pen: Windows can't check WM_POINTER[DOWN|UP] for touches directly.
These events fire for other things, such as pressing a barrel button while
the pen is hovering.

The correct thing to do is check IS_POINTER_INCONTACT_WPARAM in the event.

If the pen is already touching or not, SDL_SendPenTouch() will do the right
thing, so it's safe to call it even if we're already in the right state.
2025-04-29 18:53:38 -04:00
SDL Wiki Bot
f131791005 Sync SDL3 wiki -> header
[ci skip]
2025-04-29 22:48:45 +00:00
Evan Hemsley
e1a41c1c97 GPU Vulkan: Add locks for layout object lookups (#12924) 2025-04-29 15:43:28 -07:00
SDL Wiki Bot
fd5380ffc6 Sync SDL3 wiki -> header
[ci skip]
2025-04-29 16:04:31 +00:00
Frank Praznik
b871ac0d97 Add support for non-constrained and non-grabbing popups
By default, popups are automatically constrained to be completely within display bounds, so as not to cut off information and result in an unusable menu, or unreadable tooltip. In some cases, however, this is not wanted, so a property to toggle this behavior is added.

There are also cases where the client may not want a popup menu to implicitly grab the keyboard focus, as is the default behavior, so popup menus now respect the focusable flag/property, as well as being able to toggle focus grabbing via SDL_SetWindowFocusable().
2025-04-29 12:02:14 -04:00
Sam Lantinga
8abcc27535 Removed timeout in SDL_RunOnMainThread()
Fixes https://github.com/libsdl-org/SDL/issues/12923
2025-04-29 08:56:56 -07:00
Sam Lantinga
ef54c3bf18 Always enable D3D12 GPU on Windows
This isn't dependent on the render subsystem

Fixes https://github.com/libsdl-org/SDL/issues/12922
2025-04-29 08:51:26 -07:00
Cameron Gutman
39d3148185 events: Fix undefined behavior when disabling some event types
Shifting a signed int left by 31 is UB.
2025-04-29 00:10:33 -05:00
expikr
510c7edd9b migrate usage of SetCursor(NULL) to RedrawCursor() 2025-04-28 09:41:44 -07:00
expikr
4779499048 Split the redraw effect to own function 2025-04-28 09:41:44 -07:00
expikr
6c172e5220 SDL_SetCursor should not skip focus check 2025-04-28 09:41:44 -07:00
Maia
cbf44700d8 bytepusher example: always render text to render target and remove unused variable 2025-04-28 09:40:07 -07:00
SDL Wiki Bot
faddff1bcc Sync SDL3 wiki -> header
[ci skip]
2025-04-27 18:02:41 +00:00
Sam Lantinga
31650d566c Added SDL_GAMEPAD_TYPE_GAMECUBE
The GameCube controller has a different face button layout than the Xbox or Nintendo Switch style controllers. It has the B button on the left and the X button on the right, so we should map those to SDL_GAMEPAD_BUTTON_WEST with SDL_GAMEPAD_BUTTON_LABEL_B and SDL_GAMEPAD_BUTTON_EAST with SDL_GAMEPAD_BUTTON_LABEL_X respectively.

Fixes https://github.com/libsdl-org/SDL/issues/12847
2025-04-27 11:01:50 -07:00
expikr
c4d5cc358f streamline boolean logic 2025-04-27 10:25:43 -07:00
expikr
441e7e488f invert cursor_visible to hide_cursor 2025-04-27 10:25:43 -07:00
expikr
d553372682 rename cursor_shown to cursor_visible 2025-04-27 10:25:43 -07:00
Ozkan Sezer
016ba86f93 tray, unix: make pointers g_object_ref and g_object_ref_sink static
Fixes:  https://github.com/libsdl-org/SDL/issues/12908.
2025-04-27 11:34:40 -04:00
Frank Praznik
6f5892e543 cocoa: Immediately update the mouse focus when showing/hiding a popup menu
When showing or hiding a popup menu, manually check and set the focus if the new topmost window under the cursor is an SDL window. Otherwise, the focus won't be updated until the cursor is actually moved.
2025-04-27 09:38:52 -04:00
Frank Praznik
8c733d1f7b x11: Better handle XInput2 mouse tracking outside the window
There is a quirk with XInput2 mouse capture that causes a leave event to be sent if the pointer moves out->in->out, which breaks mouse tracking outside the window. If the mouse leaves the window with buttons pressed, continue tracking it until the buttons are released.
2025-04-26 11:20:37 -04:00
Ozkan Sezer
0dbf585ace fix SDL_audiocvt.c MSVC build. 2025-04-26 05:50:00 +03:00
Ryan C. Gordon
af0972c33f audio: SDL_PutAudioStreamPlanarData should take a channel count.
Fixes #12894.
2025-04-25 21:13:04 -04:00
Ryan C. Gordon
5f03cb3882 d3d12: Patched to compile with GDK builds.
Fixes #12899.
2025-04-25 20:07:35 -04:00
Ozkan Sezer
360cc2791f test/msdf_font.bmp: mark as non-executable. 2025-04-26 02:39:20 +03:00
SDL Wiki Bot
34fe967f3e Sync SDL3 wiki -> header
[ci skip]
2025-04-25 23:31:01 +00:00
Ryan C. Gordon
22692e308f events: Added SDL_GetEventDescription().
Fixes #12877.
2025-04-25 19:30:05 -04:00
Sam Lantinga
c2ed58db7b windows: Fix stale zoom/iconic state in WM_WINDOWPOSCHANGED handler
- IsIconic/IsZoomed must be checked after sending SDL_EVENT_WINDOW_SHOWN as that may trigger window operations if any are pending from when
  the window was hidden. e.g. the window may be shown, which triggers SDL_MaximizeWindow and a new WM_WINDOWPOSCHANGED where
  SDL_EVENT_WINDOW_MAXIMIZED is sent, then control returns to the original WM_WINDOWPOSCHANGED which would not think the window is zoomed
  and send SDL_EVENT_WINDOW_RESTORED.
2025-04-25 16:21:44 -07:00
Austin Almond
14ae45c2b8 GDK: Handle ProjectDir with space
The call to compile_shaders_xbox.bat fails if ProjectDir contains a space. Wrapping the command in quotes fixes the issue.
2025-04-25 15:00:51 -07:00
Ryan C. Gordon
faa2e40406 gpu: Warn about Direct3D 12 texture alignment requirements.
Fixes #12835.
2025-04-25 15:09:13 -04:00
SDL Wiki Bot
2e45198299 Sync SDL3 wiki -> header
[ci skip]
2025-04-25 18:14:48 +00:00
Ryan C. Gordon
608f706a95 audio: Added SDL_SetAudioIterationCallbacks(). 2025-04-25 14:13:53 -04:00
Ryan C. Gordon
18a86ea6bb testaudio: Use SDL_SetAppMetadata at startup.
This helps in finding its outputs in system lists of PipeWire streams, etc.
2025-04-25 13:03:09 -04:00
Ryan C. Gordon
a9bee3c0bf pipewire: Use a more specific stream name than "Audio Stream".
This info shows up in `pw-top` ...Gnome's sound preferences (etc) would
already show something more app-specific, but this command line tool shows
specific stream names.
2025-04-25 13:03:08 -04:00
Ryan C. Gordon
2767c1a440 aaudio: We PlayDevice first and WaitDevice after; reduce semaphore count by 1.
Previously, we would WaitDevice first, but that would feed a silent buffer
to AAudio upfront, introducing latency. When this change was made, the
semaphore count should have been adjusted, since we're waiting on one less
buffer.

Fixes #12882.
2025-04-25 13:03:08 -04:00
Sam Lantinga
7642c0468d Log information about Wayland environment detection 2025-04-25 10:02:03 -07:00
Anonymous Maarten
5b1e92ae88 cmake: use CMAKE_ANDROID_NDK variable as root of Android ndk
This variable is always defined when targeting Android:
- when using the toolchain file shipped along the ndk
  (using  -DCMAKE_TOOLCHAIN_FILE=$ENV{ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake)
- when using the toolchain file provided by CMake
  (using -DCMAKE_SYSTEM_NAME=Android)
2025-04-25 07:58:16 -07:00
Frank Praznik
09b2aae47e cocoa: Popup menus always accept first click 2025-04-25 09:34:29 -04:00
SDL Wiki Bot
29ef31d589 Sync SDL3 wiki -> header
[ci skip]
2025-04-25 03:49:37 +00:00
SDL Wiki Bot
15cb9bd610 Sync SDL3 wiki -> header
[ci skip]
2025-04-25 03:42:51 +00:00
Ryan C. Gordon
b28449a58c audio: Tweak SDL_GetAudioDeviceName.
- Add checks that ObtainPhysicalAudioDevice() was previously doing
  (is subsystem initialized, is device valid).
- Remove optimizations that copy string to stack to release device_hash_lock
  before SDL_GetPersistentString is called. Probably not necessary, and made
  the code more complex.
2025-04-24 22:17:13 -04:00
Sam Lantinga
da3c864d4c Reset the keyboard when entering a modal loop on Windows
Fixes https://github.com/libsdl-org/SDL/issues/12876
2025-04-24 13:58:17 -07:00
expikr
a82f70dc21 use GetMessagePos instead of GetCursorPos 2025-04-24 13:27:22 -07:00
expikr
bfbeaca29f inline WIN_UpdateMouseCapture 2025-04-24 13:27:22 -07:00
Christoph Schied
de2c5c33b7 SDL_hidapi_steamdeck: report touch controller events
Previously, touchpad events were not reported to the application.
This patch exposes two touchpads and forwards x/y/pressure information
from the HIDAPI packet.

This fixes issue #12855
2025-04-24 13:18:24 -07:00
kiddkaffeine
5cacdf2513 Fix crash in UIKit indirect pointer handling 2025-04-24 13:04:43 -07:00
Alynne
32bbabe2a5 Add Padix Rockfire devices (#12884) 2025-04-24 11:28:37 -07:00
Robert Müller
7e1d4f843c Emscripten: fix incorrect error check for WebGL context creation
According to the documentation and testing the `emscripten_webgl_create_context` function returns `0` on error as oppposed to a negative number. This was causing the error message to be empty when the later `emscripten_webgl_make_context_current` call fails given the invalid context.

See https://emscripten.org/docs/api_reference/html5.h.html#c.emscripten_webgl_create_context
2025-04-24 11:25:58 -07:00
Sam Lantinga
fcdaff4110 Fixed compiler warning 2025-04-24 10:36:49 -07:00
expikr
dd625a6763 defer clipcursor refresh unto pump finish 2025-04-24 10:36:29 -07:00
expikr
c84c2aa2c4 pass ground-truth cursor pos to WIN_UpdateFocus 2025-04-24 10:36:29 -07:00
Frank Praznik
11a3296a42 x11: Handle size/position events arriving before state events
Xfce, unlike every other window manager in existence, sends ConfigureNotify events before PropertyNotify events when toggling the fullscreen and maximized window state. Check the window state when handling ConfigureNotify events, and defer emitting SDL size/position events until the corresponding PropertyNotify event arrives, since SDL and clients expect to get the window state before the new size and position.
2025-04-24 12:28:40 -04:00
Maia
d50520462a Add and use SDL_HapticEffectID typedef 2025-04-24 08:51:55 -07:00
Frank Praznik
fb940fff80 audio: Fix warning C4701: potentially uninitialized local variable 'isstack' used
This warning is actually wrong, as the variable is only used if the string pointer is valid, in which case it was initialized, but this is needed to quiet MSVC.
2025-04-24 10:49:10 -04:00
Ryan C. Gordon
e8bd9cc150 audio: SDL_GetAudioDeviceName() doesn't need a full device lock.
Fixes https://github.com/libsdl-org/sdl2-compat/issues/468
2025-04-24 10:30:25 -04:00
Eri the Switch
3343cb2147 gpu: rework alpha-to-coverage validation 2025-04-23 19:28:11 -07:00
Vicki Pfau
ceb9fecfc1 Joystick: Add trigger rumble resend
This was already present for regular rumble to ensure that controllers would
continue rumbling for extended periods, but was missing for trigger rumble. I
don't know if this affects any controllers at the moment, but it's helpful for
future-proofing.
2025-04-23 19:23:11 -07:00
Logan Benjamin
c81b62293a GPU D3D12 - Update to use typeless formats for depth buffer (#12701)
For a depth buffer in D3D12 that is also going to be used in a texture sampler, the creation (on an Intel HD 5500 igpu) fails. e.g. SDL_GPUTextureCreateInfo type = TEXTURE_2D, format = D32_FLOAT, usage = DEPTH_STENCIL_TARGET | SAMPLER

The error messages are:

D32_FLOAT
D3D12 ERROR: ID3D12Device::CreateShaderResourceView: The Format (0x29, R32_FLOAT) is invalid when creating a View; the
Resource was already created with a fully qualified Format, which is not castable (0x28, D32_FLOAT).

D24_UNORM
D3D12 ERROR: ID3D12Device::CreateShaderResourceView: For the resource format D24_UNORM_S8_UINT, when making a D3D view, the format name for the view can't be R24_UNORM_X8_TYPELESS.

I found this is because the texture format needs to be created as _TYPELESS, then the views (depth stencil view, shader resource view) should then be created as their respective types - e.g. texture = R32_TYPELESS, dsv = D32_FLOAT, srv = R32_FLOAT

Tested and working on:
NVidia RTX 3050 (D3D12 feature set 12_2)
Intel HD 5500 (D3D12 feature set 11_1)
2025-04-23 16:30:16 -07:00
Petar Popovic
27b256022b SDL_GetRectIntersectionFloat(): Allow rendering zero-sized srcrect 2025-04-23 16:14:52 -07:00
Lucas Murray
d04b28926c GPU: Make D3D12 debug layers optional 2025-04-23 15:57:48 -07:00
Sam Lantinga
695cad459b Corrected documentation for SDL_SetGPUSwapchainParameters() 2025-04-23 14:54:12 -07:00
Maia
2b16c961ea Add and use typedefs SDL_HapticEffectType and SDL_HapticDirectionType 2025-04-23 12:08:21 -07:00
Frank Praznik
a1332d77f6 wayland: Cleanup timestamp handling
Better handle some very rare, but possible edge cases if the system has been running for many days.
2025-04-23 12:35:51 -04:00
Ozkan Sezer
b5ed0d0138 stb_image.h: apply mainstream PR/1736
Fix root-cause of CVE-2021-45340 : dereference of NULL ptr.
Patch authored by Henner Zeller <h.zeller@acm.org>
Mainstream pull request: https://github.com/nothings/stb/pull/1736
2025-04-23 17:55:02 +03:00
SDL Wiki Bot
e3181a0bcd Sync SDL3 wiki -> header
[ci skip]
2025-04-23 03:31:45 +00:00
Ryan C. Gordon
e3507b390e examples: added audio/05-planar-data 2025-04-22 23:30:50 -04:00
Ryan C. Gordon
3905aa0587 audio: Added SDL_PutAudioStreamPlanarData.
Fixes #12846.
2025-04-22 23:30:50 -04:00
Ryan C. Gordon
483d1c36ed comments: Fixed a few typos I ran into in the audio code. 2025-04-22 19:40:40 -04:00
SDL Wiki Bot
727a5fae59 Sync SDL3 wiki -> header
[ci skip]
2025-04-22 21:34:48 +00:00
Sam Lantinga
5a8be8e4c2 Fixed formatting 2025-04-22 14:33:47 -07:00
Lucas Murray
6e4ace310c GPU: Validate shader bytecode 2025-04-22 13:07:37 -07:00
Sam Lantinga
89d7d406ab Added tests to cover invalid surface blits
Reproduction case for https://github.com/libsdl-org/SDL/issues/12844
2025-04-22 13:05:38 -07:00
Petar Popovic
fe849f1572 SDL_BlitSurfaceScaled(): Do not divide by zero 2025-04-22 13:02:40 -07:00
Petar Popovic
8017d38adc SDL_BlitSurfaceScaled(): Do not blit if surfaces have no pixel data 2025-04-22 13:00:39 -07:00
Sam Lantinga
18fbe6a92f Renamed SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_STENCIL_UINT8 to SDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_STENCIL_NUMBER
Typically we will name the property with the function that is used to set it, and document the range of values.
2025-04-22 10:28:20 -07:00
SDL Wiki Bot
6a6917b0df Sync SDL3 wiki -> header
[ci skip]
2025-04-22 17:25:51 +00:00
Maia
e70a49892b Add missing type suffix to SDL_PROP_WINDOW_OPENVR_OVERLAY_ID 2025-04-22 10:25:02 -07:00
Petar Popovic
a696b108ac SDL_BlitSurface() comment: Remove sentence about final blit rect being stored in srcrect and dstrect 2025-04-22 10:21:36 -07:00
Sam Lantinga
c076b0d17f Removed incorrect documentation for SDL_RenderViewportSet()
Closes https://github.com/libsdl-org/SDL/pull/12854
2025-04-22 10:17:11 -07:00
Cameron Gutman
47162a4168 x11: Send key events for dead keys consumed by the IME
This matches the Wayland backend and what apps originally written for SDL2 are expecting.
2025-04-22 09:18:23 -07:00
Sam Lantinga
3aed80cd82 Updated documentation for SDL_HINT_GPU_DRIVER 2025-04-22 08:58:44 -07:00
Frank Praznik
86b3369491 wayland: Check the origin of clipboard offers before forwarding them to the client
Wayland compositors may send recursive clipboard offers to the client, which need to be filtered out to avoid clearing local data. Previously this was worked around with a hack, but this caused the ownership flag to be set incorrectly, which broke some clients.

This introduces a metadata MIME type of application/x-sdl3-source-id to be sent with SDL3 selection offers, which contains a string that is a unique identifier for the instance, and can be used to detect if a received selection offer is originating from the same instance that generated it.

If DBus is available, the unique identifier string is the unique name of the connection, otherwise, the process ID is used.
2025-04-22 11:29:38 -04:00
SDL Wiki Bot
23a7a74133 Sync SDL3 wiki -> header
[ci skip]
2025-04-22 14:50:56 +00:00
SDL Wiki Bot
3be0ec5631 Sync SDL3 wiki -> header
[ci skip]
2025-04-22 14:46:54 +00:00
Frank Praznik
5bd1578a45 wayland: Account for timer rollover when calculating the elapsed time for key repeats.
The 32-bit millisecond timer can roll over after about 49 days, so this needs to be accounted for.
2025-04-22 10:26:40 -04:00
Frank Praznik
10f51da28d cocoa: Use CGFLOAT_MAX for unbounded max window dimensions 2025-04-21 21:02:01 -04:00
Maia
3519a59d8f The SDL_BUTTON_*MASK defines must come immediately after the SDL_MouseButtonFlags typedef to be associated 2025-04-21 14:24:23 -07:00
SDL Wiki Bot
8e0b39f465 Sync SDL3 wiki -> header
[ci skip]
2025-04-17 18:06:43 +00:00
Frank Praznik
9da46bc37f win32: Check internal data when positioning child windows
Under certain circumstances, processing events may try to position a child before it is fully initialized. Check the internal data before proceeding.
2025-04-16 12:49:50 -04:00
SDL Wiki Bot
90fd2a3cbe Sync SDL3 wiki -> header
[ci skip]
2025-04-13 16:33:01 +00:00
Frank Praznik
edd08771a9 wayland: Add xdg_toplevel v7 edge constraint support
If a window isn't resizable from specific directions, the compositor can inform clients of the current edge constraints, so they don't display resize cursors for non-resizable edges.
2025-04-13 11:10:49 -04:00
Frank Praznik
113475acbd wayland: Add multi-seat support
Wayland environments can expose more than one seat for multiple collections of input devices, which can include multiple, simultaneously active, desktop pointers and keyboards with independent layouts. The Wayland input backend previously presumed that only one seat could exist, which caused broken behavior if the compositor exposed more than one, which is possible on wlroots based compositors such as Sway. This introduces support for handling multiple seats, including proper handling of dynamically added and removed seats and capabilities at run time.

The SDL Wayland input system was accreted over time, and the assumption that only one seat will ever exist resulted in state and related objects not always being tied to their most appropriate owner in a multi-seat scenario, so refactoring was required to manage several bits of state per-seat, instead of per-window or globally.

As Wayland keyboards can have per-seat layouts, fast keymap switching is required when multiplexing input from multiple seats to the global SDL keyboard device. A parameter was added to the keymap creation function to specify if the keymap lifetime should be externally managed to facilitate keymap reuse, and some layout info was moved from the global keyboard state to the keymap state to avoid unnecessarily redetermining it whenever a reused keymap is bound. This reduces the overhead of switching keymaps to setting a single pointer.

Multiple seats also means that multiple windows can have keyboard and/or mouse focus at the same time on some compositors, but this is not currently a well-handled case in SDL, and will require more work to support, if necessary.
2025-04-12 13:39:17 -04:00
Sam Lantinga
4093e4a193 Fixed process I/O redirection to NUL on Windows 2025-04-11 15:44:58 -07:00
Sam Lantinga
c025fdbb7c Add the CREATE_NO_WINDOW flag for background processes
Fixes https://github.com/libsdl-org/SDL/issues/12097
2025-04-11 15:44:58 -07:00
Sam Lantinga
8a57c83ff9 Updated to GameInput v1.1
The biggest change is that the C API is no longer available.

Here are more details:
https://www.nuget.org/packages/Microsoft.GameInput

Fixes https://github.com/libsdl-org/SDL/issues/12802
2025-04-11 13:42:58 -07:00
Sam Lantinga
f35a2736b7 Don't reset the render target when invalidating GPU renderer cache state
Fixes https://github.com/libsdl-org/SDL/issues/12646
2025-04-11 09:23:02 -07:00
SDL Wiki Bot
47e52ab37b Sync SDL3 wiki -> header
[ci skip]
2025-04-10 17:53:43 +00:00
SDL Wiki Bot
6a3dbe34d5 Sync SDL3 wiki -> header
[ci skip]
2025-04-10 17:52:25 +00:00
SDL Wiki Bot
d84c000ac5 Sync SDL3 wiki -> header
[ci skip]
2025-04-10 17:25:30 +00:00
Sam Lantinga
98e76d283f Fixed conflict when linking both SDL and hidapi statically
Fixes https://github.com/libsdl-org/SDL/issues/12790
2025-04-10 09:57:37 -07:00
Patrick José Pereira
f6db5ba4c9 Add Turtle Beach VelocityOne
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2025-04-10 09:48:31 -07:00
Patrick José Pereira
a1016bd06f Allow 01-joystick-polling example to be resizable
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2025-04-10 08:58:40 -07:00
Aubrey Hesselgren
60fb1b5541 Fix IMU orientations for 8bitdo wireless 2 controller in bluetooth mode
Fix IMU timing stamp - simulate the timing stamp from the controller hardware's perspective, as opposed to the receiving computer's perspective. Do this by advancing a time stamp by a fixed rate, based on observation of average rate over bluetooth.
2025-04-09 13:39:25 -07:00
Cameron Cawley
b0860fb0c2 Disable EGL in Emscripten builds 2025-04-09 12:37:03 -07:00
Sam Lantinga
f303ccca64 Updated the report size for Ultimate 2 Wireless firmware v1.02 2025-04-09 09:17:53 -07:00
Adam Kewley
0add037803 [Windows]: dialog: Add OFN_OVERWRITEPROMPT to save dialogs (#12782) 2025-04-08 21:33:29 -07:00
krizej
a390f5716e docs: improve man page generation 2025-04-08 22:52:43 -04:00
Sam Lantinga
93ac1e6894 Fixed non-XBox controllers being detected as Series X controllers
First make sure we have an XBox One controller before checking whether it's a Series X/S controller.
2025-04-08 12:20:27 -07:00
Sam Lantinga
d29bb902f3 Don't treat the Keychron K1 Pro System Control keyboard as a joystick
Fixes https://github.com/libsdl-org/SDL/issues/12758
2025-04-08 11:07:20 -07:00
Ozkan Sezer
ab57ef9d7b update sdlgenblit.pl after PR/12769
Closes: https://github.com/libsdl-org/SDL/issues/12774.
2025-04-08 18:24:11 +03:00
Ozkan Sezer
b0a0d236d8 fix sdlgenblit.pl so that it actually matches the generated source 2025-04-08 18:24:11 +03:00
Ozkan Sezer
0fdfa925f2 rename local pointer vars 'pixel' to 'pixels'
Reference issue: https://github.com/libsdl-org/SDL/issues/12749.
2025-04-08 18:20:03 +03:00
Sam Lantinga
46c314cc3d Revert "bool is 4 bytes in Apple MacOS X 32 bit PPC ABI"
This reverts commit 5a59b5f321.

The strong ABI guarantee only applies if bool is a byte (we repurposed a Uint8 field as a bool in SDL_gpu.h), and 32-bit PPC isn't a platform we support, so I'm going to back this patch out.
2025-04-08 08:14:25 -07:00
SDL Wiki Bot
2abfb92c5a Sync SDL3 wiki -> header
[ci skip]
2025-04-08 12:11:16 +00:00
Cameron Cawley
97eddacd7a Use the actual value of EGL_PLATFORM_DEVICE_EXT if it's not defined 2025-04-07 13:43:40 -07:00
Ozkan Sezer
4c1a3ccd45 rename local vars 'pixel' to 'pixelvalue'
Reference issue: https://github.com/libsdl-org/SDL/issues/12749.
2025-04-07 21:10:51 +03:00
Ozkan Sezer
433704e774 rename 'pixel' params of SDL_GetRGB, SDL_GetRGBA and SDL_LookupRGBAColor
Reference issue: https://github.com/libsdl-org/SDL/issues/12749.
2025-04-07 21:10:51 +03:00
Cameron Cawley
83b261ae83 Remove unused message box includes 2025-04-07 10:34:07 -07:00
Sam Lantinga
cccad933a0 Updated version documentation to match SDL 3.x practice 2025-04-07 10:22:42 -07:00
Frank Praznik
adad7dcae0 x11/wayland: Ignore redundant restore and fullscreen leave requests when showing the window
The window may be initially maximized or made fullscreen by the window manager for various reasons, such as automatically declaring a window that precisely fills the usable desktop space as maximized, or a "kiosk-mode" automatically making the window fullscreen.

Don't redundantly make restored or unset fullscreen calls when initially showing a window, or the expected state can be unset.
2025-04-07 12:36:58 -04:00
SDL Wiki Bot
d7d6d8e283 Sync SDL3 wiki -> header
[ci skip]
2025-04-07 16:26:59 +00:00
Topi-Matti Ritala
f7b7188837 Add SDL_CreateGPURenderer 2025-04-07 09:26:03 -07:00
Ozkan Sezer
5a59b5f321 bool is 4 bytes in Apple MacOS X 32 bit PPC ABI
Reference issue: https://github.com/libsdl-org/SDL/issues/12749.
2025-04-07 19:21:30 +03:00
Ryan C. Gordon
3b91017682 pulseaudio: cleanup TLS every time we finish a threaded-mainloop callback.
These callbacks run in a thread we don't control, but might call SDL_SetError,
which will claim a TLS slot that never gets otherwise deallocated. To prevent
the leak, finish each callback by explicitly freeing any thread-local data.

Fixes #12732.
2025-04-05 23:02:33 -04:00
Frank Praznik
646f1f243f x11: Only enable _NET_WM_SYNC_REQUEST for OpenGL windows
It doesn't work well with Vulkan, and Vulkan windows may not have the Vulkan flag set in all circumstances, so only enable it if we explicitly know that OpenGL is being requested instead.
2025-04-05 15:41:00 -04:00
Evan Hemsley
33f90f2e41 GPU Vulkan: Clean up in Submit in headless mode (#12744) 2025-04-04 14:27:18 -07:00
SDL Wiki Bot
93b06cffd8 Sync SDL3 wiki -> header
[ci skip]
2025-04-04 20:38:50 +00:00
Maia
c2c3a930b4 Add STRING suffix to SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_* string properties 2025-04-04 13:38:02 -07:00
Caleb Cornett
44710a248c gpu: alpha-to-coverage support 2025-04-04 11:39:08 -07:00
Temdog007
d6d2c958a4 Move global event handlers to SDL_VideoInit
Moved the event handlers from SDL_CreateWindow to SDL_VideoInit
emscripten_set_mouseup_callback
emscripten_set_focus_callback
emscripten_set_blur_callback
emscripten_set_pointerlockchange_callback
emscripten_set_fullscreenchange_callback
emscripten_set_resize_callback
2025-04-04 10:21:12 -07:00
Ryan C. Gordon
05939909da SDL_gpu.h: SDL_GetGPUDeviceProperties() is thread-safe. 2025-04-04 11:44:14 -04:00
SDL Wiki Bot
1687bc746d Sync SDL3 wiki -> header
[ci skip]
2025-04-04 15:40:48 +00:00
Ryan C. Gordon
accd952c4e SDL_gpu.h: Another attempt to clean up SDL_GetGPUDeviceProperties() docs. 2025-04-04 11:39:23 -04:00
SDL Wiki Bot
c5f369f557 Sync SDL3 wiki -> header
[ci skip]
2025-04-04 15:30:28 +00:00
SDL Wiki Bot
0c9eccd0ea Sync SDL3 wiki -> header
[ci skip]
2025-04-04 14:35:40 +00:00
Lucas Murray
906c6c7516 GPU: Add missing error code to VkErrorMessages() 2025-04-04 07:34:52 -07:00
Lucas Murray
205c34c62a GPU: The D3D12 blit shaders are DXIL 2025-04-04 07:34:52 -07:00
Lucas Murray
300013cea7 GPU: Don't pass null properties to SDL_CopyProperties() 2025-04-04 07:34:52 -07:00
Lucas Murray
8ad64aba1b GPU: Remove subheadings from SDL_GetGPUDeviceProperties() docs 2025-04-04 07:34:52 -07:00
SDL Wiki Bot
94ab2b76a5 Sync SDL3 wiki -> header
[ci skip]
2025-04-04 03:36:13 +00:00
Sam Lantinga
85281be78d Re-added text removed by the wiki bridge 2025-04-03 15:04:43 -07:00
Evan Hemsley
b53e7b4478 GPU Vulkan: Fix recursive Submit calls causing defrag to fail (#12718)
---------

Co-authored-by: Sam Lantinga <slouken@libsdl.org>
2025-04-03 15:00:22 -07:00
SDL Wiki Bot
b1919783c5 Sync SDL3 wiki -> header
[ci skip]
2025-04-03 22:00:01 +00:00
Sam Lantinga
39a3b14dfe Renamed SDL_GetGPUDeviceDebugProperties() to SDL_GetGPUDeviceProperties()
We may want to extend this with additional properties in the future.

Also removed SDL_PROP_GPU_DEVICE_DEBUG_VULKAN_CONFORMANCE_STRING. If we need feature level queries we can add them in the future.
2025-04-03 14:59:11 -07:00
Frank Praznik
ca613b9d8f x11: Send a restored event before entering fullscreen
Ensures that the maximized flag is cleared on fullscreen windows.
2025-04-03 17:02:17 -04:00
Frank Praznik
667b706a93 x11: Don't set the hidden flag when minimizing windows
On non-compositing window managers, XIconifyWindow can trigger map/unmap events, which would toggle the window hidden/shown state. This should not be done, as a hidden window in SDL is equivalent to a withdrawn window in X, and SDL will try to set/reset state when it is shown again.

Unless the window is explicitly being withdrawn via X11_HideWindow(), set unmapped windows to the minimized/occluded state, and send a restored event when mapped again.
2025-04-03 16:52:27 -04:00
Sam Lantinga
6430aed3dd Removed SDL_XInputVersion, which isn't used 2025-04-03 13:39:09 -07:00
Sam Lantinga
40e08ee7af Assume new XBox controllers have a share button
The list of old XBox controllers was taken from controller_list.h, removing controllers already known to have a share button.
2025-04-03 12:31:45 -07:00
Sam Lantinga
6bb16296b0 Added special handling for SDL_HINT_ANDROID_ALLOW_RECREATE_ACTIVITY
This hint needs to persist outside of the normal application flow, so use the environment to set the initial value, and then save the value set via SDL_SetHint() after that.

Fixes https://github.com/libsdl-org/SDL/issues/12677
2025-04-03 11:33:34 -07:00
Anonymous Maarten
ebb52973e1 cmake: make SDL_CPU_xxx variable visible when using CMAKE_OSX_ARCHITECTURES 2025-04-03 19:07:24 +02:00
Max Bachmann
b4af01cd08 only build static library in some feature tests
This fixes the feature detection in cases where linking the final executable would fail.
This is fine since SDL only opens these libraries using dlopen as well.
2025-04-03 16:45:48 +00:00
Sam Lantinga
756b455d3a Fixed building for Xbox One
Fixes https://github.com/libsdl-org/SDL/issues/12714
2025-04-03 09:08:56 -07:00
SDL Wiki Bot
25232c077d Sync SDL3 wiki -> header
[ci skip]
2025-04-03 15:53:43 +00:00
Lucas Murray
f78aa4d8ea GPU: Expose debug information from devices
Co-authored-by: Nikita Kogut <glinka1202@gmail.com>
2025-04-03 08:52:51 -07:00
SDL Wiki Bot
008690d016 Sync SDL3 wiki -> header
[ci skip]
2025-04-03 15:48:38 +00:00
Sam Lantinga
df32827407 Note that you might get a different size window than you expect 2025-04-03 08:47:23 -07:00
Sam Lantinga
ab34ea5a26 Fixed documentation for SDL_GL_*_SIZE 2025-04-02 22:32:11 -07:00
Anonymous Maarten
87d6beb895 Rename cmake/sdltargets.cmake -> cmake/sdlcommands.cmake 2025-04-02 23:55:29 +02:00
Ryan C. Gordon
208ec18292 Update README-documentation-rules.md
Added notes about lists having to start a paragraph.
2025-04-02 14:08:18 -04:00
SDL Wiki Bot
5709466ddd Sync SDL3 wiki -> header
[ci skip]
2025-04-02 15:34:18 +00:00
Sam Lantinga
b521400861 Note that the Emscripten window properties are strings 2025-04-02 08:33:16 -07:00
Sam Lantinga
82b245d13a Added support for the HORI Taiko No Tatsujin Drum Controller 2025-04-02 08:30:26 -07:00
SDL Wiki Bot
12ef57edeb Sync SDL3 wiki -> header
[ci skip]
2025-04-02 14:36:00 +00:00
Sam Lantinga
735b685816 Fixed wiki reformatting 2025-04-02 07:35:09 -07:00
Temdog007
cc8ec6cf18 Handle global mouse state for Emscripten (#12669) 2025-04-02 07:21:21 -07:00
SDL Wiki Bot
53d053279e Sync SDL3 wiki -> header
[ci skip]
2025-04-02 14:20:46 +00:00
Temdog007
cbc26fe2c4 Add Emscripten window data to window properties 2025-04-02 07:19:52 -07:00
Sam Lantinga
4aefde015e Only send sensor data if sensors are enabled for 8BitDo controllers 2025-04-01 19:58:28 -07:00
siery
6d78273442 Return early in stead of goto 2025-04-01 17:40:34 -07:00
Sam Lantinga
c3ce216c4d Fixed crash at shutdown on Windows
The taskbar list is invalid after OleUninitialize(), so make sure we clean it up first.

Also don't bother creating the taskbar list if we don't have any progress state
2025-04-01 14:56:08 -07:00
Anonymous Maarten
e87a00c07c tests: port failing SDL_Renderer test from pysdl2 to testautomation
(cherry picked from commit 8436ce98b4)
2025-04-01 21:31:10 +02:00
Anonymous Maarten
10819273bf tests: port failing SDL_Renderer test from pysdl2 to testautomation
(cherry picked from commit 7d8a6f1603)
2025-04-01 21:31:10 +02:00
Anonymous Maarten
ffbd434a11 tests: port failing window test from pysdl2 to testautomation
(cherry picked from commit 4f488b9be2)
2025-04-01 21:31:10 +02:00
Anonymous Maarten
2775e7a78f tests: port failing SDL_Rect tests from pysdl2 to testautomation
(cherry picked from commit 39bb71c442)
2025-04-01 21:31:10 +02:00
Anonymous Maarten
39eed1d233 tests: port failing SDL_Hint tests from pysdl2 to testautomation
(cherry picked from commit 177fb9cb6c)
2025-04-01 21:31:10 +02:00
Sam Lantinga
366a5281b9 Fixed comment 2025-04-01 09:07:20 -07:00
Sam Lantinga
79a41ca7fc Implemented DEBUG_8BITDO_PROTOCOL 2025-04-01 09:06:30 -07:00
Sam Lantinga
5922e2cb78 Corrected comment with 8BitDo controller report sizes 2025-04-01 09:01:32 -07:00
Sam Lantinga
0d9ff082fe 8BitDo HIDAPI driver cleanup 2025-04-01 09:00:39 -07:00
8BitDo
e236a48e13 8BitDo
Add adaptation ULTIMATE2_WIRELESS V1.02
2025-03-31 21:22:11 -07:00
Sam Lantinga
4de396734d More clarification for high DPI support 2025-03-31 18:53:40 -07:00
Sam Lantinga
36fc1c2c9c Fixed texture colorspace when creating a texture from a surface
Fixes https://github.com/libsdl-org/SDL/issues/12691
2025-03-31 18:49:58 -07:00
blukai
512485869c fix vulkan vertex buffer indexing
this was causing problems when i was specifying non-zero buffer slots in
`SDL_BindGPUVertexBuffers`, `SDL_GPUVertexAttribute` and
`SDL_GPUVertexBufferDescription`.

`firstSlot + 1` is simply copied over from metal and d3d12 backends.
2025-03-31 18:41:34 -07:00
Sam Lantinga
2e494fda30 Clarify high DPI support and best practices 2025-03-31 16:49:18 -07:00
Sam Lantinga
44faac2921 Fixed A/B/X/Y buttons on Nintendo 3DS
Fixes https://github.com/libsdl-org/SDL/issues/12690
2025-03-31 15:36:03 -07:00
Sam Lantinga
38c2081ae3 Temporarily default SDL_HINT_JOYSTICK_HIDAPI_8BITDO off
We'll default this off for now, since we don't detect whether the controller is running firmware v1.03 and don't have a fallback for controllers running firmware v1.02 (the out-of-box firmware)
2025-03-31 10:00:11 -07:00
SDL Wiki Bot
bcacc37e3e Sync SDL3 wiki -> header
[ci skip]
2025-03-31 16:56:54 +00:00
8BitDo
e18c6bd2e7 8BitDo (#12661)
Added HIDAPI support for the 8BitDo Ultimate 2 Wireless Controller running firmware v1.03 or newer over Bluetooth.
2025-03-31 09:56:01 -07:00
Frank Praznik
6b1d6bfbe7 wayland: Commit the confinement region upon creation
This may prevent the pointer from escaping small regions if moving quickly.
2025-03-31 11:57:42 -04:00
Frank Praznik
266ee41c86 wayland: Defer creating cursor confinement regions until the surface is mapped
Otherwise, the confinement area will be lost if the window is recreated when initializing the renderer.
2025-03-31 11:57:42 -04:00
SDL Wiki Bot
cb1d79db39 Sync SDL3 wiki -> header
[ci skip]
2025-03-31 15:51:57 +00:00
Vittorio Romeo
088ad66f70 Update include/SDL3/SDL_power.h
Co-authored-by: Sam Lantinga <slouken@libsdl.org>
2025-03-31 08:51:04 -07:00
Vittorio Romeo
032d696021 Add performance disclaimer in SDL_GetPowerInfo documentation 2025-03-31 08:51:04 -07:00
Sam Lantinga
0d04e9ea6a Fixed build 2025-03-30 21:35:14 -07:00
Sam Lantinga
7bb95bde49 Set the alpha opaque when blending to an RGB format
Fixes the render_testRGBSurfaceNoAlpha automated test in sdl2-compat
2025-03-30 21:24:53 -07:00
Ryan C. Gordon
8eb57c5a42 diskaudio: Use SDL_GetAudioFormatName instead of recreating it from scratch. 2025-03-30 19:26:02 -04:00
Ryan C. Gordon
f05bb7aae2 diskaudio: Log the raw PCM's format during "device" open. 2025-03-30 14:16:29 -04:00
Frank Praznik
210b317d8d x11: Popup positions after constraining are in the window-relative space, not global 2025-03-29 14:00:53 -04:00
Sam Lantinga
daa7a5ad7e Updated Visual Studio example projects 2025-03-29 09:01:33 -07:00
Andrei Tsurkan
f7a89d19c6 fix missing AVFoundation in CMakeLists.txt 2025-03-29 08:44:51 -07:00
Sam Lantinga
a23f97483f Temporarily disable DwmFlush()
For some reason this locks up the Windows compositor when called by Steam. I'm disabling it for now until we understand why and whether this can cause issues for other applications as well.
2025-03-28 20:31:07 -07:00
Ryan C. Gordon
536a1a236f coreaudio: Added some NULL pointer checks.
These might not be necessary, just trying to track down a reported issue.

Reference Issue #12660.
2025-03-28 18:39:59 -04:00
Cameron Gutman
712c76fdc1 gamepad: Fix inability to disable SDL_EVENT_GAMEPAD_UPDATE_COMPLETE events 2025-03-28 17:06:29 -05:00
SDL Wiki Bot
418acf6295 Sync SDL3 wiki -> header
[ci skip]
2025-03-28 20:52:14 +00:00
Sam Lantinga
633b9f6fb1 Added SDL_SetRenderTextureAddressMode() and SDL_GetRenderTextureAddressMode()
Fixes https://github.com/libsdl-org/SDL/issues/4820
Fixes https://github.com/libsdl-org/SDL/issues/12610
2025-03-28 13:51:19 -07:00
Green Sky
eb918af3dc video: fix surface leak when duplicating mjpeg 2025-03-28 13:18:28 -07:00
Ryan C. Gordon
567dfd2ebc examples/renderer/19-affine-textures: add metadata for examples.libsdl.org. 2025-03-28 14:19:30 -04:00
Ryan C. Gordon
5ab1aef367 examples/renderer/19-affine-textures: blue background so you can see the cube. 2025-03-28 14:19:30 -04:00
Ozkan Sezer
87e6d2250f examples, affine-textures: fix RISC-OS build. 2025-03-28 20:56:50 +03:00
Ryan C. Gordon
254f348083 examples/renderer/19-affine-textures: Flip coords so SDL logo is right-side up. 2025-03-28 13:52:58 -04:00
Ryan C. Gordon
3915451058 examples/renderer/19-affine-textures: Whole source file was indented one space. 2025-03-28 13:15:04 -04:00
Ryan C. Gordon
2ebcee2033 examples: added examples/renderer/19-affine-textures to CMakeLists.txt. 2025-03-28 13:13:05 -04:00
Ryan C. Gordon
2207f6bc9a examples/renderer/affine-textures: Fixed compiler warnings. 2025-03-28 13:11:35 -04:00
expikr
83eea00d66 Create affine-textures.c 2025-03-28 10:06:29 -07:00
Frank Praznik
401aaf3d2f video: Revert unnecessary member assignment 2025-03-28 10:21:24 -04:00
Sam Lantinga
eed94cb034 Updated link to PSP Hello World 2025-03-27 12:30:44 -07:00
SDL Wiki Bot
be2f7f2060 Sync SDL3 wiki -> header
[ci skip]
2025-03-27 18:30:52 +00:00
Sam Lantinga
0f27c3aabd Added SDL_PROP_PROCESS_CREATE_WORKING_DIRECTORY_STRING
Fixes https://github.com/libsdl-org/SDL/issues/12654
2025-03-27 11:30:00 -07:00
Ryan C. Gordon
289f5cfdbb touch: Don't call ResetTouch() if SDL_GetTouch() can't find a virtual device.
Fixes #12577.
2025-03-27 12:02:09 -04:00
Ryan C. Gordon
b00b08f832 touch: Keep state correct when removing virtual touch devices during quit.
This is probably not strictly necessary, since SDL_InitMouse will zero out
the whole struct to start if SDL is reinitialized, but just in case.
2025-03-27 12:02:08 -04:00
Frank Praznik
09fff161e9 cocoa: Clear pending state on fullscreen switch failures
The window failing to enter/exit fullscreen notifications don't necessarily imply anything about the actual state of the window. On failure, dump pending events, and don't presume anything about the current window state, as it will be handled by subsequent enter/leave notifications.
2025-03-27 11:57:47 -04:00
Frank Praznik
05d23cae73 cocoa: Re-add sync timeout
This should never happen, but it's a failsafe against future bugs or odd configurations
2025-03-27 11:49:02 -04:00
Sam Lantinga
2e61b41652 Don't send relative motion while in a modal loop
This fixes queuing up a bunch of relative motion events while moving or resizing a window.
2025-03-27 08:10:50 -07:00
Ryan C. Gordon
4c035a1fd8 audio: Allow PipeWire and PulseAudio streams to migrate to other sinks.
SDL still manages hotplug and default device management here, but if a user
wants to use an external tool, such as `pactl move-sink-input`, to put it
onto a different device, they probably know what they're doing and we
shouldn't stop them.

If this turns out to have some unexpected consequences, though, we can revisit
the change.

Fixes https://github.com/libsdl-org/sdl2-compat/issues/367
2025-03-27 11:00:51 -04:00
SDL Wiki Bot
f3d4e6fe50 Sync SDL3 wiki -> header
[ci skip]
2025-03-26 17:13:19 +00:00
Frank Praznik
8e6eaf12a4 wayland: Expose wl_output objects on video displays
Some protocols take a wl_output object to function, so expose them via a property on the video displays.
2025-03-26 13:12:23 -04:00
SDL Wiki Bot
1f917d5231 Sync SDL3 wiki -> header
[ci skip]
2025-03-26 15:55:25 +00:00
Petar Popovic
00f316737b Progress bar comment changes 2025-03-26 08:54:30 -07:00
Sam Lantinga
e28974124a Added mappings for the NSO N64/SEGA/SNES controllers
These are used on Linux when the HIDAPI driver isn't available.
2025-03-25 14:46:03 -07:00
Sam Lantinga
b88200b797 Fixed face buttons for the NSO SNES controller under the HIDAPI driver 2025-03-25 14:46:03 -07:00
Sam Lantinga
f355c7f217 Allow the progress API to be used on all platforms
It's visually only hooked up on Windows for now, but the API will be internally consistent on all platforms.
2025-03-25 11:24:22 -07:00
Frank Praznik
b45ed98ae9 Fix spelling mistake in documentation 2025-03-25 12:39:34 -04:00
Frank Praznik
716e33f106 x11: Send the _XWAYLAND_MAY_GRAB_KEYBOARD message when grabbing the keyboard
GNOME requires this to allow keyboard grabs on XWayland. Otherwise, XGrabKeyboard will still report success, but shortcuts won't be inhibited.

See 5f132f3975
2025-03-25 12:35:34 -04:00
SDL Wiki Bot
a5633ad0fb Sync SDL3 wiki -> header
[ci skip]
2025-03-25 15:04:30 +00:00
Rémy Tassoux
6cc00a31b6 WindowProgressState API getters and fixes (#12629) 2025-03-25 08:03:32 -07:00
Frank Praznik
b520cde18f cocoa: Properly set the pending fullscreen spaces state when in a transition 2025-03-24 23:23:32 -04:00
Carl Åstholm
dd9b9d4513 Check if GL_OES_EGL_image_external is supported before trying to use it 2025-03-24 19:52:13 -07:00
Carl Åstholm
7ec13a2ead Document SDL_malloc alignment guarantees 2025-03-24 19:10:31 -07:00
Ryan C. Gordon
ae17b04c0d alsa: Don't start the hardware until the device thread is ready to do work.
Otherwise, in the time it takes the thread to start and other init tasks to
complete, we tend to get an underrun on some systems, which ALSA logs to
stderr.

So this is moved to an InitThread implementation, which runs from the device
thread, right before it begins its main loop.

Reference PR #12632.
2025-03-24 19:41:26 -04:00
Ryan C. Gordon
41636959d2 audio: Feed output devices immediately, instead of waiting upfront.
This prevents the waste of an initial buffer of audio on many backends, and is
hopefully harmless on all of them.

Reference PR #12632.
2025-03-24 19:41:26 -04:00
Ryan C. Gordon
48d4104ecb pulseaudio: Fixed typo in commented-out debug logging. 2025-03-24 19:41:26 -04:00
Frank Praznik
8cb303126f wayland: Fix global mouse position retrieval 2025-03-24 19:06:05 -04:00
Sam Lantinga
d6f137b2be Added a note to tag the wiki when doing feature releases
Fixes https://github.com/libsdl-org/SDL/issues/12618
2025-03-24 11:45:20 -07:00
Anonymous Maarten
7f927de1fc x11: remove 'args' and 'ret' from SDL_X11_SYM macro
X11 vararg functions don't extra handling anymore.
2025-03-24 14:32:28 -04:00
Sam Lantinga
b6ca03611f Fixed mixed trigger and body rumble for Xbox controllers on Windows
Fixes https://github.com/libsdl-org/SDL/issues/12095
2025-03-24 11:06:37 -07:00
Cameron Gutman
c3a3a11db4 keyboard: Don't check text input on a null window 2025-03-23 23:51:46 -05:00
Petar Popovic
035d9179a5 WIN_SetWindowProgressState(): Unsupported parameter error message 2025-03-23 10:32:19 -07:00
Petar Popovic
c217663fba SDL_SetWindowProgressState(): Add parameter validation check for state 2025-03-23 10:00:27 -07:00
Sylvain
3fa1bd81fe Fixed previous commit renaming {add,remove}AudioDevice to native{Add,Remove}AudioDevice 2025-03-23 17:15:40 +01:00
SDL Wiki Bot
b8381b3a2e Sync SDL3 wiki -> header
[ci skip]
2025-03-23 15:58:18 +00:00
Petar Popovic
fa0a86409c Additions to progress bar comments 2025-03-23 08:57:22 -07:00
Petar Popovic
721476033c SDL_SetWindowProgressValue(): Move value clamp from WIN_SetWindowProgressValue() to SDL_SetWindowProgressValue() 2025-03-23 08:56:18 -07:00
Sam Lantinga
69ad66b017 Fixed error messages in GetTaskbarList() 2025-03-23 07:58:03 -07:00
Petar Popovic
a3be7a137a WIN_SetWindowProgressValue(): Fix value clamp 2025-03-23 07:51:49 -07:00
Sylvain
0177838353 Native functions renamed: {add,remove}AudioDevice to native{Add,Remove}AudioDevice 2025-03-23 15:25:33 +01:00
Sylvain
6e875397f5 Proguard: remove onNativePen 2025-03-23 15:25:33 +01:00
Frank Praznik
027df89ed3 wayland: Scale accelerated relative pointer coordinates with emulated resolutions
The accelerated relative coordinates are always relative to the desktop resolution, and need to be scaled with emulated fullscreen resolutions for mouse movement to remain stable. Otherwise, pointer speeds will be too fast on emulated resolutions below the desktop resolution, and too slow on those above.
2025-03-22 14:35:39 -04:00
expikr
f52f982b1e chore: rename integer mode field names 2025-03-22 09:32:49 -07:00
SDL Wiki Bot
8407a16255 Sync SDL3 wiki -> header
[ci skip]
2025-03-22 15:05:04 +00:00
Rémy Tassoux
7a10fcdccc Add progress bar support for Windows (#12530) 2025-03-22 08:04:10 -07:00
Sam Lantinga
6b13d69105 Improve move/resize visual smoothness on Windows
Fixes https://github.com/libsdl-org/SDL/issues/12528
2025-03-21 16:46:25 -07:00
Marcin Serwin
4fcef9074b audio: hold floating point exceptions when using neon 2025-03-21 15:08:31 -07:00
Frank Praznik
b493e29a81 x11: Fix backwards _NET_WM_SYNC_REQUEST init check 2025-03-21 15:32:54 -04:00
Sam Lantinga
2fbb583290 SDL_ClaimWindowForGPUDevice() should fail for transparent windows
The GPU API doesn't currently support transparent windows (transparent swapchain effects doesn't seem possible on D3D12) so we should explicitly fail so users don't expect transparency and then not get it.

Fixes https://github.com/libsdl-org/SDL/issues/12410
2025-03-21 12:14:20 -07:00
Frank Praznik
bde49abdb7 GPU: Support swapchain buffer transparency in Vulkan
If the window is flagged with SDL_WINDOW_TRANSPARENT, create the associated swapchain with a composite alpha value that supports blending, if available.

Fixes transparent windows on the Vulkan backend, and prevents possible validation errors by ensuring that the composite alpha value is always a valid bit in VkSurfaceCapabilitiesKHR::supportedCompositeAlpha.
2025-03-21 11:53:32 -07:00
Frank Praznik
79081a178f cocoa: Fix zoom check when leaving fullscreen
Non-resizable windows will always report as zoomed, so isZoomed is not a reliable check here.
2025-03-21 14:43:17 -04:00
Frank Praznik
03cdd297e0 video: Fix boolean logic for getting the pending window position 2025-03-21 13:47:38 -04:00
Sam Lantinga
fbdb637978 Fixed build when virtual joysticks are disabled 2025-03-21 07:34:57 -07:00
Sam Lantinga
758eb256b9 Fixed DebugLogRenderCommands() output 2025-03-20 21:24:39 -07:00
Sam Lantinga
4ceb02434b We need to rebind D3D12 resources after updating them
Fixes https://github.com/libsdl-org/SDL/issues/12544
2025-03-20 20:22:00 -07:00
Sam Lantinga
3538abfb82 Revert "Don't update a texture twice in the same batch on D3D12"
This reverts commit 0681d08817.

There's a simpler fix for this.
2025-03-20 19:56:59 -07:00
Sam Lantinga
0681d08817 Don't update a texture twice in the same batch on D3D12
Fixes https://github.com/libsdl-org/SDL/issues/12544
2025-03-20 19:51:56 -07:00
hwsmm
ac5b2b6102 Don't send text event while ctrl/alt is held on X11/Wayland 2025-03-20 22:30:10 -04:00
Edu Garcia
365b7837c2 add private definitions to SDL_build_config.h.cmake 2025-03-20 16:55:51 -07:00
Max
817260c73d Updates SDL_SetEventFilter code snippet to SDL3
SDL_EventFilter points to a function that now returns a bool
2025-03-20 16:42:34 -07:00
Sam Lantinga
3fd61b0535 Updated for SDL style 2025-03-20 16:42:40 -07:00
Temdog007
581b614291 Emscripten: Support Custom Message Boxes (#12583)
* Allow custom message boxes with colors and multiple buttons to work if Asyncify is enabled
* Keep old functionality of using alert when Asyncify is not available
* Update testmessage to allow for setting random colors as the color scheme of the message box
2025-03-20 16:33:06 -07:00
Carl Åstholm
54f5b73333 emscripten: Don't use legacy JS library functions for assertions 2025-03-20 16:24:16 -07:00
Sam Lantinga
03a53ce0d1 Always show the on-screen keyboard on Steam Deck
Steam will eventually have smarts about whether a keyboard is active and will igore the request appropriately.

Fixes https://github.com/libsdl-org/SDL/issues/12595
2025-03-20 16:19:50 -07:00
Sam Lantinga
8caeaaacdd A Steam Controller might be generating keyboard input
We can't use keyboard input as a signal about whether a keyboard is attached. There might be keyboard input from any number of generated inputs or non-keyboard devices.
2025-03-20 16:19:50 -07:00
Sam Lantinga
cbb83be895 Show the on-screen keyboard if we don't have active keyboard input
Active keyboard input is based on the input the user has most recently sent.

Fixes https://github.com/libsdl-org/SDL/issues/12595
2025-03-20 16:19:50 -07:00
SDL Wiki Bot
67b4c3a156 Sync SDL3 wiki -> header
[ci skip]
2025-03-20 19:53:05 +00:00
Ryan C. Gordon
10072bb07d asyncio: SDL_LoadFileAsync was not null-terminating the file data. 2025-03-20 15:50:06 -04:00
Ryan C. Gordon
85435d5a14 SDL_audio.h: Fixed typos in docs. 2025-03-20 15:50:06 -04:00
Sam Lantinga
3ed61f203e Fixed applications that integrate Qt with SDL joystick support 2025-03-20 12:16:44 -07:00
Anonymous Maarten
de60a5f398 Revert "Make native functions be public otherwise it fails at run-time."
This reverts commit 4fd4d89b63.

This ended up not being necessary since the Android build system
does not minify by default.
When you're minifying, you need to use the proguard rules anyways.

https://github.com/libsdl-org/SDL/pull/12553#issuecomment-2740795848
2025-03-20 19:31:48 +01:00
Sam Lantinga
fe024b8fe3 Fixed typo in build.gradle 2025-03-20 11:22:03 -07:00
Sam Lantinga
10fae8c34b Fixed Android build warnings 2025-03-20 11:02:33 -07:00
Sam Lantinga
bf7b9b020e Fixed gradle deprecation warnings
"Space-assignment syntax in Groovy DSL has been deprecated. This is scheduled to be removed in Gradle 10.0"
2025-03-20 11:02:04 -07:00
Sam Lantinga
ac28702504 Use the android-21 SDK as documented in README-android.md 2025-03-20 10:47:43 -07:00
Sam Lantinga
476e7e54cb Don't create surfaces with invalid pixel formats
Fixes https://github.com/libsdl-org/SDL/issues/12556
2025-03-20 09:42:52 -07:00
Eri the Switch
6f456da63f GPU: Request sampleRateShading feature on Vulkan 2025-03-20 09:31:34 -07:00
Sylvain
4fd4d89b63 Make native functions be public otherwise it fails at run-time.
(they are public such as the one in SDLActivity)
2025-03-20 12:11:49 +01:00
Sam Lantinga
f2ed5c7a1b Fix illegal calls to DwmGetWindowAttribute()
DWMWA_WINDOW_CORNER_PREFERENCE and DWMWA_BORDER_COLOR are only supported for DwmSetWindowAttribute(), they can't be queried.

Fixes https://github.com/libsdl-org/SDL/issues/12206
Closes https://github.com/libsdl-org/SDL/pull/12209
2025-03-19 22:00:42 -07:00
Sam Lantinga
96bf12444c Windows allows windows to be resized to zero height.
Changed the window client rect validation to take this into account.

Fixes https://github.com/libsdl-org/SDL/issues/9796
2025-03-19 21:16:35 -07:00
Sam Lantinga
47b0c75470 Make sure we're getting called for the correct window
Fixes https://github.com/libsdl-org/SDL/issues/12525
2025-03-19 20:20:36 -07:00
Sam Lantinga
3415bc920a Fixed crash if a window couldn't be created on Windows
Fixes https://github.com/libsdl-org/SDL/issues/11482
2025-03-19 20:10:24 -07:00
Dragon-Baroque
07e4dea693 The posix4 library has been merged into the libc library 2025-03-19 16:57:45 -07:00
Anonymous Maarten
9820f655dd android: reduce visiblity as much as possible 2025-03-19 23:36:08 +01:00
Evan Hemsley
c696e93180 GPU Vulkan: Fix render pass race (#12587) 2025-03-19 13:32:14 -07:00
Frank Praznik
7b93a744c8 time: Fix compilation on Solaris
The tm_gmtoff field of the broken-down time 'tm' struct wasn't formally standardized until POSIX.1-2024, but practically it has been available on desktop *nix platforms such as Linux/glibc, FreeBSD, OpenBSD, NetBSD, OSX/macOS (NextStep before that), and others since the 1990s. The notable exception is SunOS/Solaris, where the timezone offset must still be retrieved in the strictly POSIX.1-2008 compliant way.
2025-03-19 12:19:42 -04:00
Carl Åstholm
14deef997c emscripten: Fix undefined behavior in opengles2 renderer 2025-03-18 19:18:24 -07:00
Ethan Lee
5283f73748 storage: Declare a private bootstrap for NDA user storage 2025-03-18 22:12:21 -04:00
Sam Lantinga
8b924df48b Use an autoreleasepool in Cocoa_GetDisplayUsableBounds()
Fixes https://github.com/libsdl-org/SDL/issues/12571
2025-03-18 14:36:48 -07:00
Sam Lantinga
82335fd0e9 Fixed building with SDL_LEAN_AND_MEAN
Fixes https://github.com/libsdl-org/SDL/issues/12578
2025-03-18 09:55:23 -07:00
Arnoldo Adonaí Barón Robles
a551c2a6d7 Fix Vulkan error check 2025-03-17 22:10:54 -07:00
Sam Lantinga
5985f0a327 Fixed infinite recursion in SDL_IsGamepad()
SDL_IsGamepad() calls SDL_GetJoystickTypeForID(), which will call SDL_IsGamepad() if it's not a known controller type. The new code which is breaking was added to prevent Logitech FFB wheels from showing up as gamepads, which we check for separately.
2025-03-17 19:10:26 -07:00
Caleb Cornett
6d0fb0a2e6 gpu: Fix MTLLibrary dispatch data destructor 2025-03-17 18:53:40 -07:00
JaimeHW
3e5664a5be Fix return type in SDL_CreateGPURenderState 2025-03-17 15:22:49 -07:00
Sam Lantinga
4fc9509ab7 Fixed raw input device GUIDs changing randomly between runs
On Windows 11, apparently HidD_GetManufacturerString() and HidD_GetProductString() can return TRUE without actually filling in any string data.

Fixes https://github.com/libsdl-org/SDL/issues/12566
2025-03-17 13:54:56 -07:00
Evan Hemsley
0bd70684b3 GPU: Fix Vulkan backend never checking deallocations (#12567)
---------

Co-authored-by: Sam Lantinga <slouken@libsdl.org>
2025-03-17 13:19:41 -07:00
Sam Lantinga
715301cef5 Fixed crash if info->path is NULL 2025-03-17 09:46:41 -07:00
Jan200101
f5eea7efa2 remove status message for SDL_STATIC_PIC
PIC is controlled through CMAKE_POSITION_INDEPENDENT_CODE and not by an SDL option
2025-03-17 07:29:50 -07:00
Katharine Chui
35c03774f3 [SDL3] Adding input and FFB support for Logitech G29(PS3) on hidapi (#11598)
These changes enable the Logitech G29 wheel to run on hidapi with both SDL_Joystick and SDL_Haptic interfaces.

While it is already possible to use the wheel on Linux in WINE + SDL2 thanks to the in-tree evdev driver as well as new-lg4ff, these set of changes allow the G29 to be used with WINE under MacOS and FreeBSD

These wheels should also be supported, but I can only test them from G29's compat modes: G27, G25, DFGT, DFP, DFEX

Haptic and led support are ported from https://github.com/berarma/new-lg4ff
2025-03-17 07:24:39 -07:00
Frank Praznik
d66483dfcc video: Send pending coordinates for moved, hidden windows
Some backends can't actually position a window until it is shown/mapped, so assume that it will be where it was asked to be as long as it is hidden.
2025-03-16 11:33:12 -04:00
Anonymous Maarten
b9504f247c opengl: pixelart fragment shader uses GLSL version 1.30 2025-03-15 21:58:10 -07:00
Anonymous Maarten
05531c5f4b release: use NDK r21e for building Android release artifact
[ci skip]
2025-03-16 03:02:18 +01:00
DamianS-eng
18185e30e9 Remove breaks under return 2025-03-15 16:19:36 -07:00
DamianS-eng
80ff0f45fd Move default 2025-03-15 16:19:36 -07:00
DamianS-eng
3b58ad9d48 Add breaks and defaults to switch statements 2025-03-15 16:19:36 -07:00
DamianS-eng
8b6e9936e0 Missed a bracket 2025-03-15 16:19:36 -07:00
DamianS-eng
36ec4cd397 Align spacing 2025-03-15 16:19:36 -07:00
DamianS-eng
3b90ce4995 Fix spacing; tabs to 4 spaces 2025-03-15 16:19:36 -07:00
DamianS-eng
60857935ca Add preliminary joystick support for snake example 2025-03-15 16:19:36 -07:00
Cameron Gutman
aad1e35162 mouse: Allow use of integer coordinates with fractional wheel events
SDL 2.0.18 added preciseX/Y to mouse wheel events, which we cannot
emulate in sdl2-compat without a mechanism to control integer position
and scroll deltas separately.
2025-03-15 13:43:50 -07:00
Sam Lantinga
501e71f25f Added unaligned version of SDL_ConvertPixels_SwapNV_std()
Fixes https://github.com/libsdl-org/SDL/issues/12546
2025-03-15 09:24:25 -07:00
Sam Lantinga
ad9f9af4ed Removed accidentally enabled debug code 2025-03-15 09:17:55 -07:00
Sam Lantinga
efe122be4d Removed width/height parameters from LoadTexture()
You can directly access the texture width and height now.
2025-03-14 11:38:13 -07:00
Sam Lantinga
dcb97a5f49 Set a default shader entry point
The default should be the entrypoint generated by SDL_shadercross. That way it doesn't need to be hand-specified in the common workflow.
2025-03-14 11:38:13 -07:00
Frank Praznik
1a2fccc56a hints: The auto mode switching hint is for 3.4.0
This is a feature addition with a slight behavior change, not a bug fix, so move it to 3.4.0.
2025-03-14 14:12:15 -04:00
SDL Wiki Bot
285fa671aa Sync SDL3 wiki -> header
[ci skip]
2025-03-14 17:46:58 +00:00
Frank Praznik
0bfe0497f3 video: Add a hint to disable auto mode switching if an exclusive fullscreen window moves between displays
The existing behavior helps clients that don't expect exclusive fullscreen windows to move by maintaining a consistent size and mode, however, some are aware that this can occur and want to handle mode selection themselves.

Add a hint to disable auto mode switching when an exclusive fullscreen window moves to accommodate this use case, and don't override fullscreen changes that may occur in an event watcher between the display changed event being posted and SDL running the display changed handler, as the mode switch may have already been handled there by the client.
2025-03-14 13:46:00 -04:00
Maia
58f6e9c278 Fix trailing doc comments 2025-03-14 10:04:32 -07:00
SDL Wiki Bot
f15832c685 Sync SDL3 wiki -> header
[ci skip]
2025-03-14 16:40:38 +00:00
Temdog007
17b84dbcf3 emscripten: add window properties for canvas ID and keyboard element (#12509)
Move hints used by Emscripten to window properties. This change will be necessary if multiple windows for Emscripten will be supported in the future.

- Added Window Create Property SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_CANVAS_ID
- Added Window Create Property SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_KEYBOARD_ELEMENT
- Use hint SDL_HINT_EMSCRIPTEN_CANVAS_SELECTOR as override to SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_CANVAS_ID
- Use hint SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT as override to SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_KEYBOARD_ELEMENT
2025-03-14 09:39:46 -07:00
Sam Lantinga
ffe69fc354 Fixed SDL_GPUTextureSupportsSampleCount() documentation
Fixes https://github.com/libsdl-org/sdlwiki/issues/751
2025-03-14 09:30:19 -07:00
SDL Wiki Bot
e671bc2658 Sync SDL3 wiki -> header
[ci skip]
2025-03-14 16:27:22 +00:00
Sam Lantinga
02faa8f75c Rename SDL_SetGPURenderStateFragmentUniformData() to SDL_SetGPURenderStateFragmentUniforms() 2025-03-14 09:26:30 -07:00
Sam Lantinga
96194347bc Added an example of fullscreen shader effects with the GPU renderer 2025-03-14 09:26:30 -07:00
Sam Lantinga
2aee105b43 Added support for custom shaders with the GPU renderer
Added an example of MSDF font rendering with the SDL 2D renderer
2025-03-14 09:26:30 -07:00
SDL Wiki Bot
eb56c8af85 Sync SDL3 wiki -> header
[ci skip]
2025-03-14 12:49:08 +00:00
Sam Lantinga
1ae4ef65e6 Fixed incorrect assert 2025-03-13 22:37:08 -07:00
Sam Lantinga
3e9e22f17d Added SDL_SCALEMODE_PIXELART
This is based on the algorithm presented by t3ssel8r:
https://www.youtube.com/watch?v=d6tp43wZqps
2025-03-13 09:48:37 -07:00
Sam Lantinga
853375da61 Removed texture_size from the GPU renderer vertex shader
This isn't used anywhere, and this saves a UV multiply and divide
2025-03-13 09:48:37 -07:00
Sam Lantinga
28ec461ebf Organize the GPU renderer draw code 2025-03-13 09:48:37 -07:00
Sam Lantinga
af0420d898 Switched GPU renderer shaders to shadercross and HLSL 2025-03-13 09:48:37 -07:00
Ryan C. Gordon
c318b1f926 SDL_mutex.h: Fixed code example. 2025-03-13 10:08:32 -04:00
Caleb Cornett
0e29c6295c gpu: Clean up unused code in Vulkan and D3D12 drivers 2025-03-13 09:30:36 -04:00
SDL Wiki Bot
71c4de190c Sync SDL3 wiki -> header
[ci skip]
2025-03-12 22:23:23 +00:00
Frank Praznik
512d97eaba cocoa: Set the internal window data before calling methods that may result in referencing the internal data 2025-03-12 17:08:22 -04:00
Sam Lantinga
5e951a230e windows: Fix WIN_SetWindowAlwaysOnTop causing owner window z-order changes when child windows are created or change top-level status
- WIN_SetWindowAlwaysOnTop is always called as part of window creation (normally setting HWND_NOTOPMOST) which also set the z-order for the parent
  window when child windows are created. Since HWND_NOTOPMOST is above all non-topmost windows this had the effect of reordering but not focusing
  the parent window.
2025-03-12 13:06:31 -07:00
Sam Lantinga
50a397bb45 Removed help for obsolete (and removed) command line option 2025-03-12 12:38:34 -07:00
Sam Lantinga
3235a4eb4f Initialize the padding of aligned allocations to zero
Fixes valgrind uninitialized memory errors when doing SIMD blits
e.g. testautomation --filter surface_testScale
2025-03-12 11:42:02 -07:00
Ivan Epifanov
efaafd766e VITA: Remove unused/duplicate headers 2025-03-12 09:20:05 -07:00
Joshua T. Fisher
7746a9656e Fixup the mingw readme cmakelists 2025-03-11 19:42:28 -07:00
Sam Lantinga
2ce3dfdf1d Fixed Nintendo controller face button layout under Steam 2025-03-10 17:25:01 -07:00
Sam Lantinga
be6ed6e9c4 Fixed sscanf("026", "%1x%1x%1x", &r, &g, &b)
Fixes https://github.com/libsdl-org/SDL/issues/12510
2025-03-10 14:45:08 -07:00
Sam Lantinga
24339524c5 Use sized types when fixing undefined behavior 2025-03-10 09:12:40 -07:00
rohlem
f1d16e9b4d avoid UB (left shift of negative number) in SDL_windowsevents.c 2025-03-10 09:09:46 -07:00
Caleb Cornett
9fcca83512 gpu: Validate that CopyGPUTextureToTexture formats match 2025-03-09 17:29:47 -04:00
Frank Praznik
f2866418d4 wayland: Fix enum/boolean comparison and assignment 2025-03-09 11:55:05 -04:00
Cameron Gutman
597bfe6b27 mouse: Add internal integer mouse mode hint for sdl2-compat
Performing this inside SDL3 dramatically simplifies sdl2-compat. See https://github.com/libsdl-org/sdl2-compat/issues/372.
2025-03-08 19:06:36 -08:00
bobsayshilol
65cd2256c5 emscripten: Fix handling of special HTML targets
With ASAN enabled the existing code triggered null-pointer-dereference
in the strcmp since EMSCRIPTEN_EVENT_TARGET_WINDOW is a "fake" pointer
with the value ((const char*)2). In fixing this it was also noticed
that using the #window/#document/#screen targets as mentioned in the
docs fails since document.querySelector() returns null for them and we
should instead be mapping them to the special HTML targets provided.
2025-03-08 17:15:43 -08:00
TheMode
5d804a39d9 Implement SDL_GetSystemRAM and SDL_GetNumLogicalCPUCores for the 3ds (#12494) 2025-03-08 09:51:37 -08:00
Sam Lantinga
99336ea378 Fixed memory leak in memory leak tracking 2025-03-08 09:18:25 -08:00
ds-sloth
0306b5a865 Fix n3ds/SDL_syssem.c:SDL_SignalSemaphore (libsdl-org/SDL#12411) 2025-03-07 17:31:06 -08:00
Sam Lantinga
3353b92a96 Fixed pen events on iOS after reinitializing SDL
We weren't resetting apple_pencil_id, so not re-registering it later.
2025-03-07 16:32:53 -08:00
Frank Praznik
ad2584813f cocoa: Ignore both clicks and motion on tooltip windows 2025-03-07 15:05:18 -05:00
Frank Praznik
fe245c6e0d x11: Always synthesize size events for external windows
External windows may call this to update the renderer size, but not pump SDL events, either by syncing or running an event loop, so the size event always needs to be synthesized for external windows. If it is wrong, the true size will be sent if/when events are processed.
2025-03-07 14:12:14 -05:00
Frank Praznik
84d047cc11 wayland: Rollback the round trip when reading data offers
The bug this appeared to fix turned out to be randomly occurring and has other causes, and the read pipe is already polled for readiness, so this extra overhead isn't necessary.
2025-03-07 13:02:23 -05:00
SDL Wiki Bot
fc35107854 Sync SDL3 wiki -> header
[ci skip]
2025-03-07 17:01:23 +00:00
Sam Lantinga
d631a3add0 Add a link to docs/INTRO-mingw.md 2025-03-06 16:25:17 -08:00
Joshua T. Fisher
04b4577b58 Added MinGW Intro readme, touched up CMake and Visual Studio readmes. (#12485) 2025-03-06 16:24:16 -08:00
Sam Lantinga
b99ff00a95 Removed logic forcing vsync on if setting it off fails
The platforms that needed this (Windows Phone and Windows RT) are no longer supported, and if this is needed in the future it should be done at the renderer level, not here.

Fixes https://github.com/libsdl-org/SDL/issues/12475
2025-03-06 16:18:02 -08:00
SDL Wiki Bot
55695d3725 Sync SDL3 wiki -> header
[ci skip]
2025-03-06 20:23:18 +00:00
Frank Praznik
9c7c11f259 wayland: Roundtrip when receiving data offers
Otherwise, the receive operation might not have completed, resulting in there being no data to read.
2025-03-06 11:51:57 -05:00
Frank Praznik
c4be7f77a6 wayland: Add additional MIME types for text drag & drop
Previously, it only specifically accepted "text/plain;charset=utf8", which caused it to reject valid text from certain apps.
2025-03-06 11:51:57 -05:00
Sam Lantinga
e20e27e1fb Added SIMD blitters for 8888 -> 8888 format conversion 2025-03-06 02:14:54 -08:00
Sam Lantinga
4c82b5843e Added support for SDL_PIXELFORMAT_MJPG to SDL_DuplicateSurface()
Fixes https://github.com/libsdl-org/SDL/issues/12472
2025-03-05 23:33:26 -08:00
Sam Lantinga
cb099ebd4f Make texture scale mode a part of the 2D renderer draw state
Also added texture addressing mode support to the PSP and Vita renderers (untested)

Fixes https://github.com/libsdl-org/SDL/issues/12461
2025-03-05 21:35:04 -08:00
Frank Praznik
6e2d3c9b5d x11: Enable legacy synchronization for external window resize and move events
External windows often handle their own events, and SDL implicitly processing events during synchronization can be unexpected and cause issues. For requests that don't change the window state beyond size or position, use the legacy synchronization method that synthesizes events from the window attributes without processing events.
2025-03-05 17:56:28 -05:00
SDL Wiki Bot
bdde074688 Sync SDL3 wiki -> header
[ci skip]
2025-03-05 22:49:13 +00:00
Sam Lantinga
49af576940 Disable XTest by default
On Ubuntu 24.04 running XWayland, XTestFakeMotionEvent() appears to succeed but doesn't actually move the cursor, even if the cursor is hidden.
2025-03-05 13:23:02 -08:00
Sam Lantinga
794ff283e2 Added support for using XTest to warp the mouse 2025-03-05 13:23:02 -08:00
Sam Lantinga
fae324dacb Update XSync code to match SDL3 conventions 2025-03-05 13:23:02 -08:00
SDL Wiki Bot
f01bcaeb17 Sync SDL3 wiki -> header
[ci skip]
2025-03-05 17:08:00 +00:00
Sam Lantinga
fe9bdcf508 Added SDL_HINT_VIDEO_X11_EXTERNAL_WINDOW_INPUT 2025-03-05 09:07:05 -08:00
SDL Wiki Bot
9f557941f3 Sync SDL3 wiki -> header
[ci skip]
2025-03-05 15:25:22 +00:00
Sam Lantinga
8f40dad460 Document the thread safety of SDL surface functions 2025-03-05 07:24:24 -08:00
Sam Lantinga
aef240b2e4 Fixed continuous logging if returning to desktop mode fails on X11 2025-03-04 17:24:29 -08:00
Sam Lantinga
e9632c83c7 Handle XWayland not sending display disconnected events
Also updated X11_CheckDisplaysMoved() to handle multiple X11 screens

Fixes https://github.com/libsdl-org/SDL/issues/12462
2025-03-04 17:23:23 -08:00
Sam Lantinga
ca9bc6b164 Revert "Ignore BadRROutput errors from XRRGetOutputInfo()"
This reverts commit 0c8ddc1f0a.

The real bug here is that XWayland isn't sending us a display disconnected event, which will be handled in the next commit.
2025-03-04 17:16:35 -08:00
Sam Lantinga
0c8ddc1f0a Ignore BadRROutput errors from XRRGetOutputInfo()
Fixes https://github.com/libsdl-org/SDL/issues/12462
2025-03-04 16:08:41 -08:00
Sam Lantinga
80ae3a7516 Fixed crash when restoring the desktop mode on macOS
Fixes https://github.com/libsdl-org/SDL/issues/12460
2025-03-04 14:31:51 -08:00
Sam Lantinga
5f07347e4f Fixed crash unplugging a HIDAPI controller 2025-03-04 11:42:17 -08:00
Sam Lantinga
82552e5b7c Make SDL_RegisterEvents() thread-safe
Fixes https://github.com/libsdl-org/SDL/issues/12457
2025-03-04 10:27:55 -08:00
Frank Praznik
9f9a442823 video: Synthesize fullscreen related moves if the driver does not. 2025-03-04 12:41:06 -05:00
Frank Praznik
e7abbf158a x11: Synthesize fullscreen size events on Openbox
Openbox doesn't send size events when entering fullscreen, so they must be synthesized. This is not desirable on any other window manager, as it can break fullscreen positioning on multi-monitor configurations.
2025-03-04 12:41:06 -05:00
Sam Lantinga
5d20bbf348 Presenting while drawing to a render target should fail.
People are adding present calls while rendering to render targets, not understanding that this doesn't make sense, and wondering why they get flicker on some systems. If there are programs that relied on the previous behavior we can add a hint to control this.

Fixes https://github.com/libsdl-org/SDL/issues/12432
2025-03-04 08:46:13 -08:00
Volian0
debbe1cf75 Fix for Message Box failing to init on X11 (#12455)
Fixed X11 message boxes failing to initialize, because the proper X Logical Font Description could not be found
2025-03-04 08:29:08 -08:00
Sam Lantinga
4bb46e93c8 Fixed clip rect when logical presentation is enabled
We don't need to include the logical offset, it's already included in the viewport.

Fixes https://github.com/libsdl-org/SDL/issues/12454
2025-03-04 08:24:18 -08:00
SDL Wiki Bot
7df0ffd436 Sync SDL3 wiki -> header
[ci skip]
2025-03-04 13:27:13 +00:00
Sam Lantinga
7c29c8b266 Added fullscreen_active to better track fullscreen state
This is true if fullscreen is pending or currently active. This is a better check in SDL_SetDesktopDisplayMode() because a fullscreen mode may be pending and complete asynchronously and the window hasn't been set to fullscreen yet.
2025-03-03 21:18:42 -08:00
Frank Praznik
3b9f0dff10 Use _this pointer to reference the video device 2025-03-03 18:39:44 -05:00
Frank Praznik
0ccf272eea Check the display device before dereferencing
It can be null if the desktop mode is set early during initial display enumeration.
2025-03-03 11:24:25 -05:00
Frank Praznik
6c347cbf33 video: Handle Cocoa desktop mode switch inhibition in the video layer
The X backend had the same issue, so both Cocoa and X can be handled in the same location.
2025-03-03 10:50:20 -05:00
Sam Lantinga
24ec2ed785 Don't save temporary mode changes to the desktop mode
Fixes https://github.com/libsdl-org/SDL/issues/12441
2025-03-03 07:40:55 -08:00
Simon McVittie
d57aa6f7af pipewire: Don't require pw_check_library_version() with Pipewire < 0.3.75
The Debian 12 'bookworm' stable release only has 0.3.65, which is earlier
than the introduction of that symbol. Similarly, Steam Runtime 3 'sniper'
and Steam Runtime 2 'soldier' have a backport of 0.3.65 from Debian 12,
so they have the same limitation.

steamrt/tasks#686

Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-03-03 07:32:19 -08:00
Caleb Cornett
113eb6f01d gpu: Add BC2_RGBA_UNORM_SRGB to GetBlockWidth/Height functions 2025-03-03 01:35:16 -05:00
Sam Lantinga
2c7c3d4d7b Only use VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR on Android
This fixes Nintendo Switch where the identity bit isn't available. We only needed this on Android to automatically handle device user orientation.
2025-03-02 09:12:48 -08:00
Ozkan Sezer
ca3c5fd409 fix build: s/SDL_DetectSandbox/SDL_GetSandbox/ 2025-03-02 19:40:02 +03:00
kemal
eac63b4735 Add the definition for DBUS_TYPE_UNIX_FD to SDL_dbus.h 2025-03-02 08:03:57 -08:00
kemal
16f12c0d55 Implement the XDP Camera portal
This helps the Pipewire camera driver to access cameras
in a sandboxed environment without host Pipewire socket access.
Unlike other platforms, no event is sent when the user rejects
camera access. This is because there is no mechanism to query
cameras through the portal, and we only obtain access to the
Pipewire fd if the user accepts the request. The Pipewire driver
will attempt to open the host socket instead.
2025-03-02 08:03:57 -08:00
SDL Wiki Bot
c3b415641a Sync SDL3 wiki -> header
[ci skip]
2025-03-02 15:56:34 +00:00
SDL Wiki Bot
2a0223487f Sync SDL3 wiki -> header
[ci skip]
2025-03-02 15:55:59 +00:00
Sam Lantinga
1a7c206986 Save and restore error messages when rolling back after failed init
Fixes https://github.com/libsdl-org/SDL/issues/12439
2025-03-02 07:55:56 -08:00
Sam Lantinga
2c46c3d5b7 Updated dynamic API for new functions 2025-03-02 07:53:51 -08:00
expikr
5373271a12 forbid transform change while relative mode active 2025-03-02 07:53:09 -08:00
expikr
428f0dcd61 add SDL_SetRelativeMouseTransform 2025-03-02 07:53:09 -08:00
Arkadiusz Lach
67127afe3f Fix from #12118 2025-03-02 07:52:25 -08:00
Arkadiusz Lach
e25ee22469 Added tiled 9-grid texture rendering function
* New function SDL_RenderTexture9GridTiled, borders and center is tiled instead of stretched
2025-03-02 07:52:25 -08:00
SDL Wiki Bot
954675b32a Sync SDL3 wiki -> header
[ci skip]
2025-03-02 15:52:11 +00:00
Arkadiusz Lach
44bca81fdd Change default texture scale mode per renderer
* SDL_SetDefaultTextureScaleMode(SDL_Renderer *renderer, SDL_ScaleMode scale_mode)
* SDL_GetDefaultTextureScaleMode(SDL_Renderer *renderer, SDL_ScaleMode *scale_mode)
2025-03-02 07:51:17 -08:00
Caleb Cornett
b0d2a4f355 gpu: Fix Z offset for D3D12 realigned 3D texture uploads 2025-03-02 00:04:57 -05:00
Frank Praznik
b69201daeb cocoa: Don't overwrite the desktop mode when changing the fullscreen mode
Changing the mode triggers a display reconfiguration event, which will overwrite the desktop mode with the set fullscreen mode, preventing proper restoration when leaving fullscreen. Don't overwrite the desktop mode if the reconfiguration is due to a fullscreen mode switch.
2025-03-01 22:55:38 -05:00
Frank Praznik
078d737a27 cocoa: Run pending events to completion
Fullscreen spaces and miniaturization will always give us some notification that they succeeded or failed, so the timeout isn't required. This prevents errant timeouts when live-resize is active.
2025-03-01 19:33:38 -08:00
Sam Lantinga
b0df1cbbef Updated to version 3.3.0 for development 2025-03-01 19:31:00 -08:00
Sam Lantinga
65864190cc Added testpen to the Xcode test project 2025-03-01 18:49:25 -08:00
Sam Lantinga
292e431748 Updated to version 3.2.6 for release 2025-03-01 18:30:34 -08:00
Sam Lantinga
f0cb78e082 Handle XCreateIC() failing when composition UI is enabled
Fixes https://github.com/libsdl-org/sdl2-compat/issues/328
2025-03-01 13:54:07 -08:00
Sam Lantinga
55484ef023 Moved WIN_UpdateMouseCapture() to be with the other mouse functions 2025-03-01 12:54:17 -08:00
Sam Lantinga
020664bd10 Update mouse button state when re-entering a window
Fixes https://github.com/libsdl-org/SDL/issues/12423
2025-03-01 12:54:17 -08:00
Sam Lantinga
b836ad4d4f Fix a root signature mismatch for the D3D12 renderer
The shaders hadn't been rebuilt after c74f273848

Fixes https://github.com/libsdl-org/SDL/issues/12276
2025-03-01 12:02:49 -08:00
Ryan C. Gordon
a88105784f camera: Delete some failure code that should have been removed before. 2025-03-01 14:52:56 -05:00
Brick
f868408a3a Ceil the audio resampling rate to avoid over-estimating output samples.
Reverts 580a496391, fixes #12115
2025-03-01 11:07:55 -08:00
Anonymous Maarten
cbdc93b17f cmake: make sure a SDL3 library is present when not using COMPONENTs 2025-03-01 17:54:45 +01:00
Anonymous Maarten
8a7beca122 camera: clear the spec when closing, so re-opening can probe again 2025-03-01 08:34:01 -08:00
SDL Wiki Bot
ee5f5c9172 Sync SDL3 wiki -> header
[ci skip]
2025-03-01 16:26:19 +00:00
Sam Lantinga
6e4193b743 Note that the file names are UTF-8 encoded 2025-03-01 08:25:31 -08:00
Ozkan Sezer
60c65f9fa4 SDL_camera.c: fix failure-return in SDL_PrepareCameraSurfaces(). 2025-03-01 04:37:02 +03:00
Sam Lantinga
b8c2bc143e Added build dependencies for Arch Linux
These are based on the dependencies listed at:
https://archlinux.org/packages/extra/x86_64/sdl3/
2025-02-28 16:31:10 -08:00
SDL Wiki Bot
7ab1412e20 Sync SDL3 wiki -> header
[ci skip]
2025-02-28 21:21:47 +00:00
Ryan C. Gordon
725af6ad16 camera: Fixed surface formats, etc, for Emscripten backend.
Fixes #12374.
2025-02-28 16:15:01 -05:00
Sam Lantinga
ef23ebfb5a Fixed the cursor clip rect when toggling window borders on macOS 2025-02-28 11:57:34 -08:00
guitarfreak
c682599448 GPU_d3d12: Switched the default swapchain scaling mode to none.
Since there is no option to change it this seems like a much better default value. The stretching behaviour is really off-putting.

The new behavior shows a small black border when resizing the windows. This makes it more in line with the other backends and it's what you would expect to happen as a user.
2025-02-28 11:33:51 -08:00
guitarfreak
ea513fd47c Fixed vulkan gpu backend android orientation behaviour to just work like on iOS.
I changed it so that the OS does the orientation change itself with a potential performance penalty.
This makes it automatically do the right thing, just like on iOS which would make the orientation change behaviour more consistent across different platforms.

But without adding an option to the user, this would disallow the user solving the problem in his in the app/shaders and saving some performance.

It's up to you to decide what to do. But I changed this in my local copy of the source for my use case.
But this also
2025-02-28 07:34:16 -08:00
Elbagast
87b1c9736f Fix pen generated mouse events not having SDL_PEN_MOUSEID (#12392)
* Update SDL_mouse.c

Stop a mouseID of SDL_PEN_MOUSEID being discarded when dispatching mouse events. I'm not sure if this enough to fix the lack of SDL_PEN_MOUSEID being emitted.

* Update SDL_mouse.c

Since we test for touch input here we also test for pen input in the same way.

* Stop duplicate synthetic touch events

If SDL_HINT_PEN_MOUSE_EVENTS and SDL_HINT_MOUSE_TOUCH_EVENTS are both enabled, the pen generated synthetic mouse event will then produce a touch event without this additional check.

This requires the previous commits in order to do anything since it needs to be able to identify those pen generated mouse events.
2025-02-27 20:45:27 -05:00
Wim Taymans
a44107540d sysjoystick: don't leak fd on error 2025-02-27 19:49:46 -05:00
Wim Taymans
9a802797d2 SDL_pen: fix eraser check
It looks like a copy and paste error.
2025-02-27 19:49:46 -05:00
SDL Wiki Bot
54c7aa9c90 Sync SDL3 wiki -> header
[ci skip]
2025-02-28 00:42:06 +00:00
Ryan C. Gordon
35e8cf8ee6 render: allow render targets to use logical presentation.
Fixes https://github.com/libsdl-org/sdl2-compat/issues/279
2025-02-27 19:41:11 -05:00
Sam Lantinga
281f0fae1c Include the VID/PID of generic keyboard/mouse devices on Windows 2025-02-27 14:03:39 -08:00
Frank Praznik
d09bf56818 clipboard: Cleanup coding style 2025-02-27 12:35:37 -05:00
Frank Praznik
edaf447678 tests: Add showing/setting the primary selection text to testclipboard 2025-02-27 12:35:37 -05:00
Frank Praznik
7b9036bea6 wayland: Don't overwrite clipboard data with the primary selection text
Primary selection text is handled separately, and shouldn't clobber the clipboard data.
2025-02-27 12:35:37 -05:00
Ryan C. Gordon
f7cadcba84 examples: Use SDL_GetAudioStreamQueued, not SDL_GetAudioStreamAvailable.
The "available" side is at the mercy of whatever format the hardware wants,
but we control what we queued.

Fixes #12403.
2025-02-27 11:46:56 -05:00
Alexander Batalov
b3336c5a73 Match style 2025-02-27 07:10:09 -08:00
Alexander Batalov
2b784b5bf6 Fix SDL_GlobDirectory 2025-02-27 07:10:09 -08:00
Sam Lantinga
eb89d0c8c3 Don't put wired Switch Pro controllers into simple report mode
This stops the controller from sending input or responding to queries until it's unplugged.
2025-02-26 17:54:43 -08:00
Sam Lantinga
1ea99bc904 Early out if setting a duplicate window title
Setting the window title is an expensive windowing operation, so short circuit it if possible.
2025-02-26 17:10:41 -08:00
SDL Wiki Bot
56e2955b6a Sync SDL3 wiki -> header
[ci skip]
2025-02-26 21:03:33 +00:00
Sam Lantinga
cc984c9735 Added a mapping for the 8BitDo SN30 Pro+ controller on macOS
This mapping is for Android mode (Start + B at startup)
Fixes https://github.com/libsdl-org/SDL/issues/12126
2025-02-26 12:24:47 -08:00
Sam Lantinga
ba88b6aa06 Fixed reliability of initializing Switch controllers on macOS
It looks like both macOS (15.1.1) and SDL are trying to talk to the controller at the same time, which can cause interleaved replies or even locking up the controller. Waiting a bit before talking to the controller seems to take care of this.
2025-02-26 12:24:47 -08:00
Sam Lantinga
66ecdc69ac Don't update the report mode until the related hint is set
Fixes https://github.com/libsdl-org/SDL/issues/12404
2025-02-26 12:24:47 -08:00
Frank Praznik
fab52b578f wayland: Ensure that color descriptions are always retrieved 2025-02-26 15:15:44 -05:00
jsoulier
9464aaa8af Change D3D12 GPU backend to respect has_depth_stencil_target 2025-02-26 10:16:50 -08:00
Sam Lantinga
cf819ca818 Don't allow further operations on properties while we're destroying them
Fixes https://github.com/libsdl-org/SDL/issues/12407
2025-02-26 08:34:14 -08:00
Sam Lantinga
e012573766 Don't fixup mappings for Joy-Con controllers
They don't have a D-pad mapping, so look at the paddles instead to see whether we need to fix up the mapping.

Fixes https://github.com/libsdl-org/SDL/issues/12232
2025-02-25 19:14:18 -08:00
Sam Lantinga
34c3734953 Fixed opening one Joy-Con when the other is visible but disconnected
This can happen on Windows when the controller is turned off directly. It still shows up in the device list and you can send packets to it, but it's off and doesn't respond. We'll mark this device as broken and open the other as a single Joy-Con.
2025-02-25 19:14:18 -08:00
Sam Lantinga
049a7a04de Wake the main thread for main function dispatch
Also added a test case to catch the main thread waiting indefinitely when a function is pending.

Fixes https://github.com/libsdl-org/SDL/issues/12390
2025-02-25 12:50:41 -08:00
hwsmm
f0f593f04b Embed a description about Wayland clipboard instead of a link
Co-authored-by: Frank Praznik <frank.praznik@gmail.com>
2025-02-25 14:33:33 -05:00
hwsmm
bb748ef2d9 Don't cleanup clipboard in SDL_SendClipboardUpdate on Wayland 2025-02-25 14:33:33 -05:00
SDL Wiki Bot
38a73a1783 Sync SDL3 wiki -> header
[ci skip]
2025-02-25 18:29:56 +00:00
Sam Lantinga
85a302550d Set an error message if the rect passed to SDL_RenderReadPixels() is entirely outside the viewport 2025-02-25 10:28:57 -08:00
Sam Lantinga
29df99ee38 Clarified SDL_RenderReadPixels() documentation
Clarified that the rect to be read is clipped against the current viewport, not actually relative to it.

Also added a note for people using SDL_SetRenderLogicalPresentation() so they know they have to map between logical space and render space if they want to read back.
2025-02-25 10:28:57 -08:00
cosmonaut
2f77558bad fix comment 2025-02-25 09:44:10 -08:00
cosmonaut
44f1ec35c4 GPU: Make Vulkan transfer buffers dedicated allocs 2025-02-25 09:44:10 -08:00
Sam Lantinga
1c2189c7c9 strings.h isn't available in Windows environments
I believe this header isn't necessary for clang-tidy, string.h has all the functions we care about.

Fixes https://github.com/libsdl-org/SDL/issues/12238
2025-02-25 09:41:50 -08:00
SDL Wiki Bot
ffdca343fb Sync SDL3 wiki -> header
[ci skip]
2025-02-25 16:58:12 +00:00
Sam Lantinga
ac5fca4ae5 Clarify the expected usage of SDL_StorageReady()
Fixes https://github.com/libsdl-org/SDL/issues/12201
2025-02-25 08:56:56 -08:00
SDL Wiki Bot
fc365e945a Sync SDL3 wiki -> header
[ci skip]
2025-02-25 16:39:56 +00:00
Sam Lantinga
ad840e8796 Better document that main functionality is in SDL_main.h
Fixes https://github.com/libsdl-org/SDL/issues/12159
2025-02-25 08:38:39 -08:00
SDL Wiki Bot
bb8dcf08e7 Sync SDL3 wiki -> header
[ci skip]
2025-02-25 15:54:44 +00:00
Sam Lantinga
6980325310 Added support for the "%n" sscanf format specifier 2025-02-24 20:02:59 -08:00
Sam Lantinga
e6a24fcbb5 fix stbi__parse_png_file() reading too much bytes (thanks @miniupnp!)
just "rewind" the bytes that have been read past the IEND chunk.
2025-02-24 17:29:25 -08:00
Sam Lantinga
db4e6c1931 Cocoa metal layers need their size updated before renderer updates
Also refactored event watch code so it can be shared between internal window event dispatch and public event watchers.

Fixes https://github.com/libsdl-org/SDL/issues/12376
2025-02-24 15:37:13 -08:00
SDL Wiki Bot
0a592b78c1 Sync SDL3 wiki -> header
[ci skip]
2025-02-24 23:12:58 +00:00
Tomasz Pakuła
58388e8db4 Add SDL_HINT_JOYSTICK_HAPTIC_AXES
Allows users to overwrite the number of haptic axes defined for a given
joystick. Also supports a "wildcard" VID:PID of `0xFFFF/0xFFFF`
2025-02-24 15:12:04 -08:00
Ethan Lee
db817a37f4 gpu: Fix forward declaration and inclusion of PrivateGPUDriver 2025-02-24 15:46:39 -05:00
zopsicle
a7bc6c5e08 gpu: initialize VkDebugUtilsLabelEXT::color
Fixes #12383.
2025-02-24 11:51:13 -08:00
Caleb Cornett
60b7faa987 gpu: Validate that reserved struct members are unset 2025-02-24 08:57:09 -08:00
Ralph Sennhauser
2990d142c4 Map additonal Linux keycodes to SDL scancodes
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-02-24 07:53:22 -08:00
Ralph Sennhauser
a0086a5cc4 Add missing scancode names
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-02-24 07:53:22 -08:00
Petter Reinholdtsen
35544df838 Changed PULSEAUDIO_FlushRecording() to only flush audio present when called.
When the flushing is not able to keep up with the audio stream coming in, it
will end up flushing forever and block API clients from getting any audio.

The example program in #9706 get some audio with SDL 3, while do not get any
audio with SDL 2, which I suspect is because SDL 3 is quicker at flushing the audio.
A fix for the SDL 2 issue is available in #12378.
2025-02-24 07:30:36 -08:00
SDL Wiki Bot
deadfe0c98 Sync SDL3 wiki -> header
[ci skip]
2025-02-23 20:20:09 +00:00
Caleb Cornett
0815637cf0 vulkan build fix 2025-02-23 12:19:12 -08:00
Caleb Cornett
ea77472d75 Document/ignore GPU features without universal support 2025-02-23 12:19:12 -08:00
Petar Popovic
ad11c6988c src/io/SDL_asyncio.c:SDL_AsyncIOFromFile(): Fix null-dereference warning 2025-02-23 11:12:24 -08:00
Weng Xuetian
8bfde6755e Remove unnecessary fcitx's devel package dependency in linux doc
Fcitx related support only relies on libdbus.
2025-02-23 10:33:18 -08:00
Frank Praznik
52af81ea17 wayland: Fix mapping borderless windows under libdecor
Additionally, add a warning about calling the frame visibility function universally during the mapping process, as the libdecor Cairo plugin has a bug that will cause a crash in this scenario.
2025-02-23 11:04:29 -05:00
Frank Praznik
1a0a94b501 x11: Accommodate the borders when setting the initial window position 2025-02-23 10:49:40 -05:00
Sam Lantinga
52e64f816c Use SDL C runtime functions in OpenVR driver
Fixes link errors when building with -DSDL_LIBC=OFF
2025-02-22 12:41:03 -08:00
Sam Lantinga
7224b40407 Fix errors when building stb_image with -DSDL_LIBC=OFF
I integrated changes from SDL_image and updated as needed for JPEG memory loading functionality.

Fixes https://github.com/libsdl-org/SDL/issues/12364
2025-02-22 12:41:03 -08:00
Cameron Gutman
945da099ae pipewire: Fix possible deadlock when opening a device
If the pipewire thread invokes output_callback() while we're still
waiting inside PIPEWIRE_OpenDevice(), we will deadlock. The pipewire
thread owns the loop lock and is blocked on the audio device lock,
which cannot be released because pw_thread_loop_wait() needs to
reacquire the loop lock before it can return and allow
PIPEWIRE_OpenDevice() to complete and release the device lock.
2025-02-22 11:37:06 -08:00
Anonymous Maarten
70f657e520 ci: farewell, clang32 on msys2 2025-02-22 19:06:27 +01:00
Sam Lantinga
e50db698e2 Disable all camera drivers if SDL_CAMERA_DISABLED is defined
Fixes https://github.com/libsdl-org/SDL/issues/12182
2025-02-22 09:48:49 -08:00
Sam Lantinga
1ddba3ad55 Replace "8BitDo Tech Ltd" with "8BitDo" in the manufacturer string
Fixes the 8BitDo Micro gamepad so it shows up as "8BitDo Bluetooth Wireless Controller" in keyboard mode over Bluetooth.
2025-02-22 09:19:59 -08:00
Sam Lantinga
fdf72d1e45 Use the keyboard/mouse vendor if available
Fixes the 8BitDo Micro gamepad so it shows up as "8BitDo HID-compliant mouse" and "8BitDo HID Keyboard Device" in keyboard mode over USB.
2025-02-22 09:19:59 -08:00
Sam Lantinga
a811e0ef0f Added support for the 8BitDo Micro gamepad 2025-02-22 09:19:59 -08:00
Sam Lantinga
bc85c55350 testcontroller: create window with high pixel density
This improves the picture quality when running on an iPhone.
2025-02-22 09:02:01 -08:00
Sam Lantinga
75bbcbf87b Added support for Motion JPEG pipewire camera capture 2025-02-22 00:23:03 -08:00
Anonymous Maarten
5c214e5e9c testcamera: SDL_AppQuit destroys state and SDL
This fixes a double-free of SDLTest_CommonState
2025-02-21 23:04:13 -08:00
Anonymous Maarten
03e00cd347 v4l2: map SDL_PIXELFORMAT_MJPG to V4L2_PIX_FMT_MJPEG 2025-02-21 23:04:13 -08:00
Sam Lantinga
fcd41c1d2c Check desired window area when checking zoom state
isZoomed returns true if the window has the size and position that it would if it were maximized, so we need to check to see if our floating state matches that before saying we're zoomed.

This fixes calling zoom:nil on a borderless resizable window that was created with the same size as the usable desktop area, which happens to also be the maximized state.

Fixes https://github.com/libsdl-org/SDL/issues/12228
2025-02-21 18:38:12 -08:00
Petar Popovic
b5297de56f Add 'const' to pointer parameters 2025-02-21 15:59:40 -08:00
Sam Lantinga
911e53dece Retain mouse focus as long as we're getting mouse events
Fixes https://github.com/libsdl-org/SDL/issues/12218
Fixes https://github.com/libsdl-org/SDL/issues/12323
2025-02-21 15:35:28 -08:00
Sam Lantinga
3b8cb62283 Make it easier to enable IME debug logs 2025-02-21 15:24:45 -08:00
williamhCode
9a607e886e make start&length represent utf32 indices 2025-02-21 12:54:56 -08:00
Anonymous Maarten
9d06145d6c ci: fix type + names of intel compiler artifacts 2025-02-21 21:11:54 +01:00
Timothee "TTimo" Besset
fa380a4004 Update include/SDL3/SDL_assert.h
Co-authored-by: Sam Lantinga <slouken@libsdl.org>
2025-02-21 11:07:54 -08:00
Timothee "TTimo" Besset
2a1b617fb2 Update include/SDL3/SDL_assert.h
Co-authored-by: Sam Lantinga <slouken@libsdl.org>
2025-02-21 11:07:54 -08:00
Timothee 'TTimo' Besset
69e03094bd fallback to defining SDL_TriggerBreakpoint as __builtin_trap in older linux arm64 environments that do not have a __has_builtin facility 2025-02-21 11:07:54 -08:00
Petar Popovic
c70f54e28b Remove redundant casts 2025-02-21 10:09:10 -08:00
Sam Lantinga
2e346d7166 Added 32-bit texture formats to Texture_GetBlockWidth() and Texture_GetBlockHeight()
Fixes https://github.com/libsdl-org/SDL/issues/12335
2025-02-21 09:29:18 -08:00
Sam Lantinga
5d776c070a Refactored SDL_CreateJoystickName() into a general SDL_CreateDeviceName() 2025-02-21 09:10:54 -08:00
expikr
3293eb1a16 use hidapi to get mouse/keyboard string 2025-02-21 07:42:20 -08:00
Anonymous Maarten
7855842306 ci: disable precompiled headers for classic intel compiler 2025-02-21 04:49:33 +01:00
Anonymous Maarten
71d1de5d96 ci: add cppflags to CMAKE_(C|CXX)_FLAGS 2025-02-21 04:46:26 +01:00
Anonymous Maarten
28f0867948 SPA_FALLTHROUGH expands to nothing when using the Intel compiler 2025-02-21 04:30:19 +01:00
Anonymous Maarten
8d3db06ff2 ci: GitHub is retiring Ubuntu 20.04 support 2025-02-21 04:30:19 +01:00
Anonymous Maarten
c153f83df0 ci: enable ccache 2025-02-21 04:30:19 +01:00
SDL Wiki Bot
52ee0c1058 Sync SDL3 wiki -> header
[ci skip]
2025-02-20 20:17:22 +00:00
Sam Lantinga
9267930fea Added a fast path for converting the same format and pitch 2025-02-20 12:16:26 -08:00
Sam Lantinga
f24f9d3bed Revert "testcamera: added support for Motion JPEG camera frames"
This reverts commit 5ccee77190.
2025-02-20 12:16:26 -08:00
Sam Lantinga
2e89c53ebc Added support for decoding MJPG into NV12 textures 2025-02-20 12:16:26 -08:00
Sam Lantinga
06602f4e80 Document that the pitch is the length of the image data for SDL_PIXELFORMAT_MJPG 2025-02-20 12:16:26 -08:00
Sam Lantinga
a792434a37 Added initial MJPG support using stb_image 2025-02-20 12:16:26 -08:00
Anonymous Maarten
baf69edfc7 Revert "cmake: build SDL_uclibc with -fPIC"
This reverts commit 9784414ddd.

Some platforms (e.g. ps2) do not support pic.
2025-02-20 20:37:53 +01:00
Anonymous Maarten
fdf8e5a704 ci: build static loongarch libraries with -fPIC 2025-02-20 20:28:57 +01:00
Anonymous Maarten
9784414ddd cmake: build SDL_uclibc with -fPIC 2025-02-20 20:28:54 +01:00
Frank Praznik
b48de48efb wayland: Add support for high-DPI icons 2025-02-20 13:57:37 -05:00
Frank Praznik
6e0264d38e x11: Use the current or last-requested window position when setting the size hint
The move operation is just a no-op to try and force the hint to take effect, so it should use the current window coordinates.
2025-02-20 13:25:47 -05:00
Sam Lantinga
1a38960eee Call SDL_DiscardAllCommands() for the software renderer as well 2025-02-20 09:53:11 -08:00
Sam Lantinga
8f4c5e15f1 Finish any drawing when destroying a software renderer
Fixes the SDL3 version of https://github.com/libsdl-org/sdl2-compat/issues/373
2025-02-20 08:49:47 -08:00
Paper
1a853973ab thread/windows: fix stack overflow in exception naming 2025-02-20 07:57:00 -08:00
Sam Clegg
a40b2de946 Fix SDL_emscriptenaudio.c under wasm64
Same as #12332 which already landed on SDL2 branch.
2025-02-19 13:00:47 -08:00
Anonymous Maarten
523e6530a8 SDL_test: fix "'function': different 'const' qualifiers" warning in SDL_test_harness 2025-02-19 19:06:48 +01:00
Frank Praznik
9e4c657ed8 wayland: Fix color manager protocol string check 2025-02-19 11:43:53 -05:00
nightmareci
7500a758b8 Remove usages of restrict keyword in SDL_render.c
I ran into the usage of `restrict` breaking builds targeting Windows XP, as the v141 MSVC toolset doesn't support the keyword.
2025-02-18 11:40:43 -08:00
Frank Praznik
a7f01cd73c x11: Set the pending window position immediately after mapping
Waiting until the first configure event to perform the move can result in the window visibly jumping in position.
2025-02-18 11:27:03 -05:00
Mike Kosek
1fd626939f Renamed DreamPort to DreamPicoPort 2025-02-18 11:06:28 -05:00
ImThour
31f9cb4806 Unchecked Return Value in WIN_SuspendScreenSaver (#12316) 2025-02-17 15:36:56 -08:00
ImThour
057c3602e9 Removing Double-free Issue 2025-02-17 15:34:18 -08:00
ImThour
5c79f4cae1 Incorrect bfOffBits Calculation in WIN_ConvertDIBtoBMP 2025-02-17 13:59:03 -08:00
Cameron Gutman
70d23b2349 README-migration: Remove errant reference to SDL_FALSE_ 2025-02-17 15:16:35 -06:00
Petar Popovic
6aef6ae9a8 AddPulseAudioDevice(): Fix use-after-free 2025-02-17 11:12:44 -08:00
Frank Praznik
3b4cfc11f0 wayland: Update copyright dates in added color manager source files 2025-02-17 11:36:00 -05:00
Frank Praznik
fadb261b66 wayland: Add color manager protocol support
Support the official wp_color_manager_v1 protocol.
2025-02-17 11:31:12 -05:00
Sam Lantinga
6ef687c864 Simplified and fixed media foundation buffer handling 2025-02-17 08:14:30 -08:00
Sam Lantinga
de12cb92dc Fixed crash at shutdown with new hashtable code 2025-02-17 08:14:30 -08:00
ImThour
a513168902 Fixed Memory/Resource Leaks (#12304) 2025-02-17 07:30:30 -08:00
Petar Popovic
045a4492f1 test/testaudio.c: Fix use-after-free warning 2025-02-16 19:35:54 -08:00
Petar Popovic
da2460f9e7 test/testautomation_audio.c: Free variables before returning 2025-02-16 16:57:56 -08:00
captain0xff
7ea0ffb748 update 2025-02-16 13:44:00 -08:00
captain0xff
06eb10c518 haiku: check if the returned _SDL_GLView is null or not 2025-02-16 13:44:00 -08:00
SDL Wiki Bot
dea99e54fd Sync SDL3 wiki -> header
[ci skip]
2025-02-16 17:44:58 +00:00
Sam Lantinga
1754943596 Fixed camera frame acquisition on Windows 7
Fixes https://github.com/libsdl-org/SDL/issues/12210
2025-02-16 08:13:35 -08:00
Sam Lantinga
e3d9f1172c Remove the reference to the thread when it is detached
Fixes https://github.com/libsdl-org/SDL/issues/12301
2025-02-16 07:56:30 -08:00
Petar Popovic
831fc70923 test/testautomation_intrinsics.c: Free variables before returning 2025-02-16 07:50:07 -08:00
Petar Popovic
c6a3b5b6ef src/test/SDL_test_harness.c: Free variables before returning 2025-02-15 21:00:04 -08:00
Ryan C. Gordon
84a236c92e hashtable: Redesign the hashtable API.
This was intended to make the API public, so SDL_hashtable.h got an extreme
documentation makeover, but for now this remains a private header.

This makes several significant interface changes to SDL_HashTable, and
improves code that makes use of it in various ways.

- The ability to make "stackable" tables is removed. Apparently this still
  worked with the current implementation, but I could see a future
  implementation struggle mightily to support this. It'll be better for
  something external to build on top of the table if it needs it, inserting a
  linked list of stacked items as the hash values and managing them separately.
  There was only one place in SDL using this, unnecessarily, and that has also
  been cleaned up to not need it.
- You no longer specify "buckets" when creating a table, but rather an
  estimated number of items the table is meant to hold. The bucket count was
  crucial to our classic hashtable implementation, but meant less once we
  moved to an Open Addressing implementation anyhow, since the bucket count
  isn't static (and they aren't really "buckets" anymore either). Now you
  can just report how many items you think the hash will hold and SDL will
  allocate a reasonable default for you...or 0 to not guess, and SDL will
  start small and grow as necessary, which is often the correct thing to do.
- There's no more SDL_IterateHashTableKey because there's no more "stackable"
  hash tables.
- SDL_IterateHashTable() now uses a callback, which matches other parts of SDL,
  and also lets us hold the read-lock for the entire iteration and get rid of
  the goofy iterator state variable.
- SDL_InsertIntoHashTable() now lets you specify whether to replace existing
  keys or fail if the key already exists.
- Callbacks now use SDL conventions (userdata as the first param).
- Other naming convention fixes.

I discovered we use a lot of hash tables in SDL3 internally. :) So the bulk
of this work is fixing up that code to use the new interfaces, and simplifying
things (like checking for an item to remove it if it already exists before
inserting a replacement...just do the insert atomically, it'll do all that
for you!).
2025-02-15 18:52:56 -05:00
Cameron Gutman
4a9b579195 joystick: remove dead udev code
SDL_USE_LIBUDEV is never even defined here and SDL_hid_init() already does this.
2025-02-15 14:17:13 -06:00
SDL Wiki Bot
ba45256940 Sync SDL3 wiki -> header
[ci skip]
2025-02-15 17:42:27 +00:00
Sam Lantinga
fd4e6d2949 Don't render 0 sized texture rectangles
Fixes https://github.com/libsdl-org/sdl2-compat/issues/355
2025-02-15 07:07:56 -08:00
Frank Praznik
6f3b14a6df audio/video: Fix uninitialized field warnings 2025-02-14 17:16:10 -05:00
Sam Lantinga
5b98c4a524 Fixed motion events with TOOL_TYPE_UNKNOWN
This happens using hand tracking on a VR headset, and should be treated like normal touch interaction.
2025-02-14 11:50:43 -08:00
Chen Steenvoorden
8a648dfd9b emscripten: Fixed unregistering of key event handlers 2025-02-14 10:15:15 -08:00
Petar Popovic
c16b7bcb7a SDL_Get*Driver() functions: Set error message on failure 2025-02-13 16:10:37 -08:00
ImThour
ed0a03e9b5 Fixed Cursor Icon State for SYSTEM_CURSOR_PROGRESS 2025-02-13 11:38:41 -08:00
Petar Popovic
5dce8c748f SDL_GetRelativeMouseState(): Get relative mouse position also when relative mouse mode is disabled 2025-02-13 11:34:24 -08:00
SDL Wiki Bot
cedf53bbc2 Sync SDL3 wiki -> header
[ci skip]
2025-02-13 05:39:38 +00:00
Sam Lantinga
3de975884a Document the "trace" log priority 2025-02-12 21:37:30 -08:00
Sam Lantinga
b9d018f2a2 Fixed wayland cursor use-after-free at shutdown 2025-02-12 20:47:31 -08:00
SDL Wiki Bot
041894a523 Sync SDL3 wiki -> header
[ci skip]
2025-02-13 01:45:34 +00:00
Semphris
3be67ced64 Fix GTK tray icon without menu + lifetime 2025-02-12 16:18:31 -08:00
Ryan C. Gordon
1354affd28 haiku: Fixed keyboard input.
_GetWinID() doesn't work with keyboard-related BMessages, because Haiku
assumes you know what window has keyboard focus at the time, so these events
don't have a `window-id` property. So when this call failed, the key event
handler would return early.

This was probably a copy/paste error that snuck in at some point, as SDL2
doesn't have this issue.
2025-02-12 17:17:14 -05:00
Sam Lantinga
d2b7a84651 Fixed SDL_GetNumGamepadTouchpads() returning 1 for a NULL gamepad 2025-02-12 13:08:41 -08:00
Sam Lantinga
ca29304ce1 Fixed continually resetting keyboard and mouse readings 2025-02-12 13:02:15 -08:00
Sam Lantinga
f67c644649 Fixed reporting hat positions for GameInput controllers 2025-02-12 13:02:15 -08:00
Sam Lantinga
1b35ca9c32 Refactored GameInput initialization 2025-02-12 13:02:15 -08:00
Frank Praznik
706de78a9e audio/video: Skip preferred drivers when loading a driver on demand
Preferred driver entries have special conditions for initializing, which aren't relevant when a specific driver was explicitly requested.
2025-02-12 11:51:36 -05:00
Sam Lantinga
715c18739b Added an internal hint "SDL_VIDEO_X11_XINPUT2" for sdl2-compat 2025-02-11 15:11:33 -08:00
Sam Lantinga
ce69e98989 Copy SDL2_SYSWMEVENT data into temporary memory for the event 2025-02-11 15:11:33 -08:00
coffeechriph
55fd205ba4 Add missing integer texture formats to SDL_GPUTextureFormatTexelBlockSize (#12151) 2025-02-11 14:21:30 -08:00
Semphris
e6029401d9 Check for non-NULL icon for trays on Unix 2025-02-11 13:47:17 -08:00
captain0xff
b03332b68d updated bytepusher demo to be C++ compatible 2025-02-11 13:38:29 -08:00
captain0xff
5dd2492645 updated the snake demo to be C++ compatible 2025-02-11 13:38:29 -08:00
Frank Praznik
78f816d74e x11: Apply the modifier state from key events
Use the modifier state supplied with key events to track the system modifier state instead of relying on the state returned by XQueryPointer(), which can be racy when used with automated text entry.
2025-02-11 14:14:12 -05:00
Sam Lantinga
99cf16287a Fixed the name of SDL_SYSWMEVENT 2025-02-11 09:48:40 -08:00
Sam Lantinga
6c37971521 Removed the mapping for the Sanwa Supply JY-P76USV
It turns out the mapping we include doesn't work for real controllers, and they're using a generic chipset and generic name and can't be generally distinguished from other controllers.

See https://github.com/libsdl-org/SDL/issues/8644 for details.
2025-02-11 07:59:25 -08:00
Edu Garcia
9b18e8438f [GPU] D3D12 backend debug markers were being cut
Code used wcslen that return number of characters, but D3D12 debug layer uses bytes + wide chars
2025-02-11 07:21:44 -08:00
Sam Lantinga
0bce19cf15 The 10-bit texture formats have alpha on Direct3D
A similar change was made for Vulkan in a036aeda3b
2025-02-10 19:45:02 -08:00
Sam Lantinga
3cfa476d3f Added support for SDL_PIXELFORMAT_ABGR8888 textures
This is the output format of stb_image for image decoding, so let's avoid a texture format conversion where possible.

Also standardized SDL_PIXELFORMAT_ARGB8888 as the default texture format for all renderers.
2025-02-10 19:45:02 -08:00
Sam Lantinga
5ccee77190 testcamera: added support for Motion JPEG camera frames 2025-02-10 17:18:16 -08:00
Sam Lantinga
cf41ccc6ce Removed stb_image.h from SDL
This adds quite a bit of code size to SDL for a niche use-case. This is easily handled in the application instead.
2025-02-10 17:18:16 -08:00
Sam Lantinga
9308404e9a Removed functions not used by SDL 2025-02-10 17:18:16 -08:00
Sam Lantinga
5e31bbf05e Remove functions not used when STBI_NO_PNG and STBI_NO_HDR are defined 2025-02-10 17:18:16 -08:00
Sam Lantinga
84b0c13c44 Added support for Motion JPEG camera capture
Fixes https://github.com/libsdl-org/SDL/issues/12183
2025-02-10 17:18:16 -08:00
Frank Praznik
3bc53b9ade wayland: Don't set libdecor frame visibility before the first commit
This will be needed later, after libdecor passes through toplevel bounds, but for now it causes a crash in the Cairo plugin, so remove it.
2025-02-10 18:39:36 -05:00
Frank Praznik
c032586262 wayland: Scale-to-display mode requires both viewports and xdg-output for proper functionality 2025-02-10 15:47:28 -05:00
SDL Wiki Bot
b63d3afc18 Sync SDL3 wiki -> header
[ci skip]
2025-02-10 20:15:51 +00:00
Sam Lantinga
0bc1f87120 Added SDL_PROP_SURFACE_HOTSPOT_X_NUMBER and SDL_PROP_SURFACE_HOTSPOT_Y_NUMBER 2025-02-10 12:15:03 -08:00
Frank Praznik
da464e9e5f win32: Keep the window on the last maximized display when leaving fullscreen
A window may have been maximized by dragging it to the top of another display, in which case the floating position may be out-of-date. If the window is being restored to maximized, and the maximized and floating position are on different displays, try to center the window on the maximized display for restoration, which mimics native Windows behavior.
2025-02-10 15:05:54 -05:00
Mike Kosek
bf01cc8ce7 Renamed "Dreamcast Controller Usb" to "DreamPort" 2025-02-10 10:33:47 -08:00
Sam Lantinga
ecd089bb69 Don't return short waits from SDL_IOReady()
The Wayland keyboard repeat code assumes that if we have a certain timeout then we'll wait at least that long, and generate a key repeat event on timeout. If we wait a shorter time, we won't generate a key repeat event and then return 0, even if we were supposed to wait indefinitely.

Fixes https://github.com/libsdl-org/SDL/issues/12239
2025-02-10 10:29:30 -08:00
danginsburg
4fd0b2a85c Fix #12142 - the problem was if the size of the vertex buffer was exceeded, the currentVertexBuffer would be reset to zero and thus we'd leave it pointing to an in-use VB that would get overwritten on the next present before the vkQueueSubmit occurred. 2025-02-10 08:47:57 -08:00
Sam Lantinga
f6126e9ea1 Centered joystick axis values should be 0
Fixes https://github.com/libsdl-org/sdl2-compat/issues/338
2025-02-10 08:36:00 -08:00
Neal Gompa
d35bef64e9 pipewire: Ensure that the correct struct is used for enumeration APIs
PipeWire now requires the correct struct type is used, otherwise
it will fail to compile.

Reference: 188d920733

Fixes: https://github.com/libsdl-org/SDL/issues/12224
2025-02-10 11:03:01 -05:00
rubisetcie
9bd6d36471 Added SDL_DEPS_SHARED option to control default dynamic loading of shared libraries (#12215) 2025-02-10 07:40:24 -08:00
Stenzek
78721d720c joystick: Fix PS5 player LED hint change callback name
The LED hint was getting registered for SDL_HINT_JOYSTICK_ENHANCED_REPORTS
instead of SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED, which results in a
use-after-free followed by a crash.
2025-02-10 07:36:07 -08:00
ImThour
7aba6c4c73 Proper Resource Cleanup in WIN_UpdateWindowShape
mask is created but never deleted if SetWindowRgn() fails. This may lead to resource leaks.
2025-02-09 16:11:53 -08:00
Christian Walter
e29ebb9f18 Update geometry renderer example
This PR updates the geometry renderer example such that the `color` values of `vertices[3]` are set correctly in `SDL_AppIterate`.
2025-02-09 10:53:14 -08:00
ImThour
ca9a044b3e Memory Leak in WIN_CreateHCursor When CreateColorBitmap Fails 2025-02-09 10:49:56 -08:00
Clint Kilmer
69d28027ad Fix for 500ms hang after user clicks on the title bar, but before moving (#12217)
Reference: https://gamedev.net/forums/topic/672094-keeping-things-moving-during-win32-moveresize-events/5254386/
2025-02-08 11:21:10 -08:00
Guldoman
a0b6c0fd8f x11: Don't wait for events when the connection errored out (#8392)
Calling `X11_XIfEvent` after the X11 connection errored out can result in hangs.
2025-02-08 10:07:11 -08:00
Mike Kosek
864bb65ce9 Removed crc 2025-02-08 07:56:40 -08:00
Mike Kosek
006605c3bf Corrected alphabetical order 2025-02-08 07:56:40 -08:00
Mike Kosek
dc035c5ca6 Added mapping for Dreamcast Controller USB 2025-02-08 07:56:40 -08:00
Michael Savage
5d1bbd9b27 Fix SSE 4.2 test
When building with zig cc I get:

```
error: always_inline function '_mm_crc32_u32' requires target feature 'crc32', but would be inlined into function 'calc_crc32c' that is compiled without support for 'crc32'
    5 |       crc32c = (unsigned)_mm_crc32_u32(crc32c, *(unsigned*)text);
      |                          ^
1 error generated.
```

This PR adds -mcrc32, another option would be to use a different SSE4.2 op
2025-02-08 07:37:14 -08:00
ds-sloth
7c12c63f63 Add generic SDL_syscond to N3DS threads source list 2025-02-06 18:02:03 -08:00
ds-sloth
2ced6b09fc Delete src/thread/n3ds/SDL_syscond.c
This PR removes the incorrect implementation of `SDL_cond` currently included with the 3DS port.

Pseudocode of the incorrect implementation of `SDL_CondWait` this PR removes:

* Receive an `SDL_cond` backed by a `libctru` `CondVar` and an `SDL_mutex` backed by a `libctru` `RecursiveLock`.
* Want to call `libctru` function `CondVar_Wait` which expects a `CondVar` and a `LightLock` (non-recursive lock)
* Do so by calling this function with the internal (inadequately protected) `LightLock` member of the `RecursiveLock` (`&mutex->lock.lock` on line 105), without updating any internal thread or lock count fields of the `RecursiveLock`.

Happy to discuss or test some examples. My own use case works much better with the generic cond logic, and this seems like a safe fix to me given that the generic logic is well-tested and this seems not to be.

If you like the PR I'll send another one for the SDL2 branch.
2025-02-06 18:02:03 -08:00
SDL Wiki Bot
7af17f874c Sync SDL3 wiki -> header
[ci skip]
2025-02-07 02:00:45 +00:00
Sam Lantinga
982094c85c Updated to version 3.2.5 for development 2025-02-06 16:40:59 -08:00
Sam Lantinga
b5c3eab6b4 Updated to version 3.2.4 for release 2025-02-06 16:03:43 -08:00
Sam Lantinga
48c00bfe6c Fixed creating a window with both software and hardware renderer attached 2025-02-06 15:35:38 -08:00
SDL Wiki Bot
3c6e6645fa Sync SDL3 wiki -> header
[ci skip]
2025-02-06 22:54:21 +00:00
Sam Lantinga
ad8429f1b0 Let the renderer always see window events
These are necessary for proper operation of the renderer and shouldn't be blocked by event filters, etc.
2025-02-06 14:38:20 -08:00
Sam Lantinga
c59ac249d2 Revert "wayland: Don't send size events while the window is hidden"
This reverts commit 0825d07a43.

It turns out that resizing while hidden is fine, the real problem in https://github.com/libsdl-org/sdl2-compat/issues/268 is that SDL2 did not send an initial resize event and SDL3 does, which we're fixing in a better way in sdl2-compat.
2025-02-06 14:37:53 -08:00
SDL Wiki Bot
6cb3d37a2b Sync SDL3 wiki -> header
[ci skip]
2025-02-06 20:11:12 +00:00
Petar Popovic
80653a42c7 Remove non-ASCII character from public header SDL_hints.h 2025-02-06 12:10:16 -08:00
Sam Lantinga
a646dc89e5 Note that SDL_GUIDToString() and SDL_StringToGUID() are thread-safe. 2025-02-06 10:44:21 -08:00
Ryan C. Gordon
8730f6a569 dynapi: Don't use SDL_getenv; it might malloc before the app sets an allocator.
Use platform-specific code instead, so SDL's allocator never comes into play.

(cherry picked from commit d2693d4c7d)
2025-02-06 12:46:15 -05:00
Quan Zhuo
c9341489cc Fix #12197: Force set /utf-8 for msvc compilers (#12198)
The MSVC compiler determines the encoding of the source code based on
the BOM of the source code when reading it. If there is no BOM, it
defaults to the local encoding, which is gb2312, codepage 936, on
Simplified Chinese Windows. This can cause errors such as newline
characters in strings.
2025-02-06 09:34:41 -08:00
Sam Lantinga
8397e1fcc0 Fix up SDL2 style mappings for HIDAPI controllers
Fixes https://github.com/libsdl-org/sdl2-compat/issues/316
2025-02-06 09:21:52 -08:00
Sam Lantinga
7691cabe4a Removed incorrect HIDAPI gamepad mapping 2025-02-06 08:37:10 -08:00
Evan Hemsley
86691d325b GPU: Remove stencil bit from sampler aspect mask on Vulkan (#12196) 2025-02-05 17:52:35 -08:00
Sam Lantinga
6782cfe2c5 Don't use the HIDAPI driver for Thrustmaster wheels
Closes https://github.com/libsdl-org/SDL/pull/12173
2025-02-05 17:19:59 -08:00
Sam Lantinga
1c0e2b7f97 SDL_OpenHapticFromJoystick() returns a valid haptic object 2025-02-05 17:08:41 -08:00
Sam Lantinga
c4550d906a testcontroller: show the gamepad device type 2025-02-05 08:27:26 -08:00
SDL Wiki Bot
5ad0337685 Sync SDL3 wiki -> header
[ci skip]
2025-02-05 15:45:41 +00:00
Petar Popovic
68dabd48c4 SDL_GetTrayEntries(): Rename parameter size to count 2025-02-05 07:44:46 -08:00
Sam Lantinga
b99e19c0a2 Fixed potential double-free 2025-02-05 00:04:45 -08:00
Sam Lantinga
8ba8cca69b Fixed memory leak looking up pen tool names 2025-02-04 23:59:08 -08:00
Sam Lantinga
2cd2834dfe Fixed memory leak in the pen cleanup
Fixes https://github.com/libsdl-org/SDL/issues/12099
2025-02-04 23:49:12 -08:00
Cameron Gutman
c4c185283f dbus: fix spurious leak reports with SDL_SHUTDOWN_DBUS_ON_QUIT=0 2025-02-04 17:01:06 -08:00
Cameron Cawley
691a6133d3 Remove #undef __3DS__ 2025-02-04 13:57:41 -08:00
Jean-Philip Desjardins
33c0654d54 Allow OpenGL initialization on XB1 and XSX. 2025-02-04 07:35:52 -08:00
WinterSquire
eb5ab22032 Check nullptr before calling the windows message hook for WM_ENTERSIZEMOVE and WM_ENTERMENULOOP 2025-02-03 21:33:58 -08:00
Ryan C. Gordon
e7f326a84e bmp: Removed debug printf call. 2025-02-03 23:35:08 -05:00
Ryan C. Gordon
61b1c25eeb x11: SDL_SetWindowPosition on an unmapped window will do the actual move later.
Fixes https://github.com/libsdl-org/sdl2-compat/issues/303
2025-02-03 22:52:13 -05:00
Petar Popovic
f1b3523c67 Remove redundant parenthesis in SDL_MUSTLOCK macro 2025-02-03 19:47:16 -08:00
Petar Popovic
8527d042bc Remove const from parameter of inline function SDL_RectsEqualEpsilon() 2025-02-03 19:46:36 -08:00
Sam Lantinga
07c22da464 Fixed decoding 4-bit RLE encoded BMP files
Also flipped the return value of readRlePixels() to match convention.

Fixes https://github.com/libsdl-org/sdl2-compat/issues/308
2025-02-03 19:34:38 -08:00
Petar Popovic
8ccf85c59e Formatting spaces around pointer symbol. 2025-02-03 17:03:26 -08:00
Sam Lantinga
94409d3504 Added Switch Input-only controller entries for Zuiki MasCon controller for Nintendo Switch.
The device string indicates RED on the one I have and is PIDs 0003 and some other posts online say 0001 for the normal model, so I'll try 0001-0003 to get all 3 color variants
2025-02-03 16:49:29 -08:00
Sam Lantinga
a8a2874ef4 Added distinct VID/PIDs for the PS4 vs Xbox eSwap Pro controllers 2025-02-03 13:26:04 -08:00
Sam Lantinga
84bc2abdad Corrected the entry for the PXN V900 racing wheel 2025-02-03 13:11:02 -08:00
Sam Lantinga
eac07bda0a Sort the controller lists by VID/PID 2025-02-03 12:39:53 -08:00
Sam Lantinga
6243a06539 Call the windows message hook for WM_ENTERSIZEMOVE and WM_ENTERMENULOOP
Fixes https://github.com/libsdl-org/SDL/issues/12169
2025-02-03 09:17:17 -08:00
SDL Wiki Bot
ec959a4349 Sync SDL3 wiki -> header
[ci skip]
2025-02-03 16:52:24 +00:00
Sam Lantinga
8e51b2468a Renamed SDL_SoftStretch() to SDL_StretchSurface()
Fixes https://github.com/libsdl-org/SDL/issues/12168
2025-02-03 08:51:32 -08:00
SDL Wiki Bot
f40ef62a2a Sync SDL3 wiki -> header
[ci skip]
2025-02-02 23:14:17 +00:00
SDL Wiki Bot
614ae843a9 Sync SDL3 wiki -> header
[ci skip]
2025-02-02 22:14:15 +00:00
Sam Lantinga
8848f86560 Corrected the version where SDL_SoftStretch() was added 2025-02-02 14:13:13 -08:00
Sam Lantinga
a98a4b8a68 Re-added SDL_SoftStretch() to the API
This is needed for sdl2-compat, since a blit is not quite equivalent.
2025-02-02 13:41:36 -08:00
SDL Wiki Bot
842f85da05 Sync SDL3 wiki -> header
[ci skip]
2025-02-02 21:17:22 +00:00
Sam Lantinga
c06172dc1c Track mouse button state by real mouse ID
We'll switch to the global mouse ID just once we are ready to deliver events.

This makes sure that any button events that come in for a specific mouse ID maintain that state if we switch to relative mode and start using that mouse ID for events.

Fixes https://github.com/libsdl-org/sdl2-compat/issues/263
2025-02-02 12:58:45 -08:00
Ozkan Sezer
73a8143581 timer, windows: allow building high resolution code with old SDKs. 2025-02-02 21:23:50 +03:00
Sam Lantinga
be991239d9 Updated to version 3.2.3 for development 2025-02-01 17:43:38 -08:00
Sam Lantinga
2fa1e7258a Updated to version 3.2.2 for release 2025-02-01 17:01:45 -08:00
Em
c922762791 proposed fix: set curr_src.h is to bottom_height before drawing bottom edges / corners in SDL_RenderTexture9Grid, to avoid issue where inadvertently using top height if the npatch existed on a larger texture than the drawn edge would cause too many pixels to be included in the bottom part of the render. 2025-02-01 16:09:08 -08:00
Sam Lantinga
235022fe2f Fixed error C2059: syntax error: '}'
Fixes https://github.com/libsdl-org/SDL/issues/12155
2025-02-01 15:32:58 -08:00
John Kvalevog
dc13a6ae95 SDL_SaveBMP_IO: Write bitmap header v5 values
bV4CSType was changed to LCS_sRGB to work with Preview on macOS.

Fixes: #11903
2025-02-01 11:10:24 -08:00
SDL Wiki Bot
fe6bd8e9bf Sync SDL3 wiki -> header
[ci skip]
2025-02-01 10:40:21 +00:00
Sam Lantinga
bc3264130d Fixed mouse motion events while the mouse is grabbed
When the mouse is grabbed, the X server sends mouse events only to the grabbing client, and XInput2 events for the master device are not delivered.

We should consider using the window mouse rect confinement instead of a true X server grab for SDL mouse grab functionality.
2025-01-31 23:45:09 -08:00
Sam Lantinga
69d361dee1 Ignore SDL_HINT_RENDER_DRIVER set to software when creating a window surface
We handled the case where software was in a list of render drivers, but not when the hint was set to exactly "software".

Fixes https://github.com/libsdl-org/sdl2-compat/issues/266
2025-01-31 15:49:58 -08:00
Evan Hemsley
70a239210e GPU: Describe "readonly storage" images as sampled images on Vulkan backend (#12149) 2025-01-31 15:07:33 -08:00
Sam Lantinga
4c6d949e6d wayland: make sure the desktop mode is in the fullscreen mode list
Fixes https://github.com/libsdl-org/SDL/issues/12079
2025-01-31 14:53:40 -08:00
Sam Lantinga
ab5cb707a6 Fixed enabling call logging 2025-01-31 14:22:29 -08:00
Sam Lantinga
16f8122a0d Keep the simplest mapping of scancode + modifer for a given keycode
Fixes https://github.com/libsdl-org/sdl2-compat/issues/259
2025-01-31 12:07:08 -08:00
Timothee Besset
6beda34215 do not build camera drivers if camera support is disabled 2025-01-31 10:24:54 -08:00
Frank Praznik
0825d07a43 wayland: Don't send size events while the window is hidden
Some clients don't expect this, and it can cause issues, particularly if events are emitted while creating a hidden window.
2025-01-31 12:40:07 -05:00
Evan Hemsley
8e766c9252 GPU: Resource binding state shadowing (#12138)
---------

Co-authored-by: Caleb Cornett <caleb.cornett@outlook.com>
2025-01-31 08:34:10 -08:00
SDL Wiki Bot
43924ec873 Sync SDL3 wiki -> header
[ci skip]
2025-01-31 01:04:48 +00:00
SDL Wiki Bot
8c2682a219 Sync SDL3 wiki -> header
[ci skip]
2025-01-31 00:56:29 +00:00
Ozkan Sezer
e4fcc7b6e7 gpu/vulkan/SDL_gpu_vulkan.c: fix type redefinition error
src/gpu/vulkan/SDL_gpu_vulkan.c:763: error: redefinition of typedef 'VulkanUniformBuffer'
src/gpu/vulkan/SDL_gpu_vulkan.c:482: note: previous declaration of 'VulkanUniformBuffer' was here
2025-01-31 02:50:00 +03:00
John Alanbrook
14edb21aec check for backslashes as well as the forward slash 2025-01-30 12:41:48 -08:00
SDL Wiki Bot
50b8c6cdfb Sync SDL3 wiki -> header
[ci skip]
2025-01-30 19:31:13 +00:00
Ryan C. Gordon
943c4abcb4 pipewire: Report correct device default formats instead of hardcoding Float32.
The comment in the source wasn't true; PipeWire doesn't _have_ to work in
float format. It presumably does if it has to mix, but if a game is the only
thing making noise on the system--a common scenario--then it might be able to
pass, say, Sint16 data straight through to the hardware without conversion.

Fixes #12129.
2025-01-30 02:46:56 -05:00
Aki
943579a545 Fix inverted pen Y tilt on macOS and add tilt display to example
- Negate tilt.y in Cocoa pen handling to correct inverted Y tilt axis
- Update drawing example to display X/Y tilt values for visualization
- see 0f128fd7c5/src/plugins/platforms/cocoa/qnsview_tablet.mm (L63)
- see https://source.chromium.org/chromium/chromium/src/+/main:components/input/web_input_event_builders_mac.mm;drc=0af5ffa1e4cc4cc4f818725f8fee93ec57855e4b;l=421
2025-01-29 22:09:02 -08:00
Petar Popovic
31364477f2 Rename parameter of type SDL_CameraID from devid to instance_id 2025-01-29 17:49:53 -08:00
Petar Popovic
36758d70c9 Rename parameters of type SDL_AudioDeviceID from dev to devid 2025-01-29 14:44:08 -08:00
Seth Anderson
2abc7735a4 Free XIDeviceInfo in X11_MaybeAddPenByDeviceID 2025-01-29 10:55:49 -08:00
Sam Lantinga
8298d60e4a Dynamically load CreateWaitableTimerExW and SetWaitableTimerEx
These functions are not available on Windows XP
2025-01-29 05:40:49 -08:00
Sam Lantinga
409f3ade88 Removed SDF test program
There's a much better example of SDF support in testgputext in SDL_ttf
2025-01-29 04:15:27 -08:00
Sam Lantinga
4176e188bf Enable testgles2 on all platforms
We use SDL's headers so we're not dependent on system OpenGL header availability.
2025-01-29 04:03:31 -08:00
Timothee Besset
cf249b0cb2 fix -Wformat problem in 32 bit builds 2025-01-28 16:57:25 -08:00
SDL Wiki Bot
11dbff246f Sync SDL3 wiki -> header
[ci skip]
2025-01-28 19:01:16 +00:00
Ryan C. Gordon
ccd5fcef12 audio: Fix potential NULL dereference in AudioStream gain adjustment.
You can end up with a NULL scratch buffer, which is otherwise not needed on
this path, then ConvertAudio will end up needing that scratch space to move
to float32 to apply gain.

Fixes #12091.
(I assume.)
2025-01-28 13:14:25 -05:00
Frank Praznik
48f5550651 wayland: Don't send keyboard and mouse added events during initialization
Only send them when a device is added post-initialization, as is done on other platforms.
2025-01-28 13:02:29 -05:00
Sam Lantinga
2a946e91bc android: updated release build SDK to match documented requirements 2025-01-28 06:03:37 -08:00
Sam Lantinga
44edbf7137 Use templates for the package support files
This makes them more easy to reuse in other projects.
2025-01-28 06:03:37 -08:00
Adam Kewley
1c008d8ed0 Change DBUS introspection timer from INFINITE -> DEFAULT when introspecting available dialog services 2025-01-28 05:13:35 -08:00
Carl Åstholm
c21bc48a70 Fix undefined behavior in SDL_windowsmouse.c
This fix prevents C undefined behavior from being invoked on Windows
if the user's configured cursor speed is below 6.
2025-01-28 05:12:16 -08:00
Sam Lantinga
1c7cc60286 Skip IsRegularFileOrPipe() check on Emscripten
The sandbox guarantees that this will be true.

Fixes https://github.com/libsdl-org/SDL/issues/12108
2025-01-27 22:25:12 -08:00
Ryan C. Gordon
8f958953f1 audio: Fix audio stream gain going wrong in certain scenarios.
Fixes #12091.
2025-01-27 20:20:17 -05:00
Ryan C. Gordon
3b3af7105b audio: Fix a minor code style thing. 2025-01-27 20:20:17 -05:00
mausimus
725ee7665c Documentation: fixed typos around floats precision 2025-01-27 14:12:24 -05:00
Petar Popovic
6f098a920e Avoid a crash when a tray without a menu is clicked on Windows. 2025-01-26 23:27:28 -08:00
Ryan C. Gordon
09f900f66e audio: Remove resampling limits.
Audio streams used to accept audio with a src or dest frequency between
4000Hz and 384000Hz. It was arbitrary (or perhaps a relic of older
resampler revisions), and testing shows unnecessary, so remove it.

Fixes #12098.
2025-01-27 01:13:54 -05:00
Sam Lantinga
5f8e0ebf58 Fixed memory leak at shutdown 2025-01-26 19:30:29 -08:00
Cameron Gutman
913e0a5e53 SDL_migration.cocci: handle more renamed event fields 2025-01-25 23:50:44 -06:00
Cameron Gutman
628130ec8f SDL_migration.cocci: fix incorrect SDL3 API name 2025-01-25 23:50:04 -06:00
SDL Wiki Bot
fa8c0f0552 Sync SDL3 wiki -> header
[ci skip]
2025-01-26 03:57:15 +00:00
SDL Wiki Bot
17c4bdd754 Sync SDL3 wiki -> header
[ci skip]
2025-01-24 21:19:18 +00:00
SDL Wiki Bot
ad8a09000f Sync SDL3 wiki -> header
[ci skip]
2025-01-24 20:06:31 +00:00
cosmonaut
8df17c97d1 GPU: Add notes about shader resource requirements to documentation 2025-01-24 12:04:00 -08:00
Anonymous Maarten
303fd5ed5a release: rename resources/cmake -> resources/CMake in dmg 2025-01-24 20:08:25 +01:00
Anonymous Maarten
fdf33f9047 xcode+cmake: Use SDL3.framework/SDL3 as IMPORTED_LOCATION
Not adding /SDL3 causes CMake to no longer set the RUNPATh on
binaries in the build directory.
It also breaks compatibility with CMake versions older then 3.28.

reverts c56a3f60fe (xcode+cmake: use SDL3.framework folder as IMPORTED_LOCATION)
reverts ad3c7b92f8 (xcode+cmake: use SDL3.framework folder as IMPORTED_LOCATION)
2025-01-24 20:07:51 +01:00
Ryan C. Gordon
cb3d6dc467 .wikiheaders-options: Removed wikipreamble setting.
Reference https://github.com/libsdl-org/sdlwiki/issues/713.
2025-01-24 01:53:51 -05:00
SDL Wiki Bot
84c4ff2f10 Sync SDL3 wiki -> header
[ci skip]
2025-01-24 04:47:03 +00:00
nightmareci
2e381a717f Fix possible integer overflow of size + 1 2025-01-23 15:57:23 -08:00
SDL Wiki Bot
129ebc77b9 Sync SDL3 wiki -> header
[ci skip]
2025-01-23 23:20:22 +00:00
Petar Popovic
a336b62d8b Remove newlines from error messages 2025-01-23 11:45:04 -08:00
Frank Praznik
d0ae093681 x11: Don't force position windows with an undefined position
An undefined position means that the window manager can handle placement, so SDL shouldn't override that by forcing a position when showing a window.

Allows for removing a fair bit of now-unnecessary code as well.
2025-01-23 14:36:26 -05:00
hspir404
72a3eae0da Fix buffer overrun in ConvertAudio with different src/dst channel count
- Source or destination format also has to not be F32 to trigger bug
2025-01-23 13:52:31 -05:00
Petar Popovic
983cfe8b1c Remove even more newlines from log messages 2025-01-23 09:32:50 -08:00
nightmareci
718034f5fa Remove newlines from log messages 2025-01-22 20:25:04 -08:00
Sam Lantinga
17625e20df Removed redundant step in Visual Studio instructions 2025-01-22 13:26:11 -08:00
Sam Lantinga
c806c271c5 Tweaked emscripten introduction 2025-01-22 13:05:44 -08:00
Sam Lantinga
74536243dd Emscripten works well using the normal CMake workflow 2025-01-22 12:56:32 -08:00
Anonymous Maarten
98c447802f ci: bump to NetBSD 10.1 2025-01-22 19:39:17 +01:00
nightmareci
a437dbc7e3 Improve log documentation 2025-01-22 10:37:54 -08:00
SDL Wiki Bot
1c21a72bda Sync SDL3 wiki -> header
[ci skip]
2025-01-22 17:20:25 +00:00
Susko3
73fc2b03a3 Copy pen handling code from SDLSurface to SDLControllerManager 2025-01-21 21:33:11 -08:00
Sam Lantinga
6f3d0b3cdb Fixed build when using an older Xcode SDK
Fixes https://github.com/libsdl-org/SDL/issues/12048
2025-01-21 18:17:02 -08:00
Anonymous Maarten
cb3cc28809 emscripten: pass --no-sandbox to the chrome web driver
This fixes running the Emscripten tests on Ubuntu 24.04.
2025-01-22 02:48:32 +01:00
SDL Wiki Bot
df3cfbc797 Sync SDL3 wiki -> header
[ci skip]
2025-01-21 23:08:39 +00:00
cosmonaut
799093799a GPU: Note buffer alignment requirements 2025-01-21 15:07:34 -08:00
SDL Wiki Bot
5bf077f1f1 Sync SDL3 wiki -> header
[ci skip]
2025-01-21 23:04:33 +00:00
SDL Wiki Bot
5d6a780453 Sync SDL3 wiki -> header
[ci skip]
2025-01-21 23:00:08 +00:00
Sam Lantinga
77b520e93e Updated to version 3.2.1 for development 2025-01-21 14:02:06 -08:00
Klayism
bb3c5b4f3a Fix multiple occurences of typo "an simple" to "a simple" 2025-01-21 14:00:54 -08:00
Anonymous Maarten
efa6e7aece android: add style to test apk's 2025-01-21 20:20:17 +01:00
Sam Lantinga
535d80bade Include the README and related files in the SDL framework 2025-01-21 10:51:21 -08:00
Sam Lantinga
ed2920afef All SDL 3.0 release symbols are at version 3.2.0 2025-01-21 10:19:21 -08:00
Ryan C. Gordon
7a5604cf0c Sync SDL3 wiki -> headers. 2025-01-21 13:12:25 -05:00
Ryan C. Gordon
7e130e27ba fnsince.pl: Remove prerelease version tapdancing. 2025-01-21 13:10:57 -05:00
Sam Lantinga
b775135b4f Removed temporary debug code 2025-01-21 08:57:08 -08:00
Sam Lantinga
a52fc209bb Updated to version 3.2.0 for release 2025-01-21 08:52:28 -08:00
SDL Wiki Bot
f16c67115d Sync SDL3 wiki -> header
[ci skip]
2025-01-21 16:29:55 +00:00
Ryan C. Gordon
90bda6548f video: Don't let SDL_CreateWindowTexture use the software renderer.
It used to check for "software" in the hint, but now it has to parse a
comma-separated list.

If it tries to use the software renderer here, you'll end up in an infinite
recursion.
2025-01-21 11:29:00 -05:00
Ryan C. Gordon
c45c4a5e51 render: SDL_HINT_RENDER_DRIVER now accepts a comma-separated list.
Fixes #11077.
2025-01-21 11:29:00 -05:00
SDL Wiki Bot
670a7d8126 Sync SDL3 wiki -> header
[ci skip]
2025-01-21 16:11:20 +00:00
Frank Praznik
8a67896d9a docs: Note the preferred function for getting the content scale of a window
SDL_GetWindowDisplayScale() should be preferred over SDL_GetDisplayForWindow() + SDL_GetDisplayContentScale() for querying the per-window content scale, as the former provides a more accurate and current value for individual windows, as the per-window value can differ from the base display scale value, particularly on high-DPI and multi-monitor desktops.
2025-01-21 11:07:11 -05:00
Sam Lantinga
8526868563 dialog: cleaned up D-Bus portal implementation
Fixes https://github.com/libsdl-org/SDL/issues/12036
2025-01-20 22:57:42 -08:00
Ryan C. Gordon
071bebf235 coreaudio: Add a note about why this uses 3 buffers instead of 2. 2025-01-20 23:29:53 -05:00
Katelyn Gadd
c0a9d220b9 vulkan: Fixes for swapchain resize crash on X11.
Fixes #11075.
2025-01-20 23:17:38 -05:00
SDL Wiki Bot
ea9880b760 Sync SDL3 wiki -> header
[ci skip]
2025-01-21 04:01:28 +00:00
Quinn X. J.
bcf7ead6e4 documentation typo: SFLOAT -> FLOAT 2025-01-20 20:00:40 -08:00
Ryan C. Gordon
6d5815db52 vulkan: Deal with VK_ERROR_OUT_OF_DATE_KHR returns from vkAcquireNextImageKHR.
Fixes #11075.
2025-01-20 22:32:23 -05:00
Katelyn Gadd
6b7dad7d82 vulkan: move temporary pointer to its own field to prevent a bad dereference.
Reference Issue #11075.
2025-01-20 22:32:23 -05:00
Anonymous Maarten
3e530c6db1 cmake: remove superfluous cmake_minimum_required 2025-01-21 03:10:42 +01:00
Anonymous Maarten
7bff36e4b2 ci: add ubuntu arm job
f
2025-01-21 03:10:42 +01:00
Anonymous Maarten
37140aa9f7 cmake: expand libunwind 2025-01-21 03:10:42 +01:00
Caleb Cornett
abe6d9db97 Automatically detect SDL_main_private.h 2025-01-20 20:48:17 -05:00
Tomasz Pakuła
10c9fbf411 Use proper polar direction when creating FF_RUMBLE effect
Uses proper polar direction of 90 degrees. Previous value probably came from mistakenly using spherical system default.
2025-01-20 16:52:40 -08:00
Tomasz Pakuła
c6c7469708 Translate conditional effect direction instead of hardcoding it to 0
Provious code wrongly assumed that direction is not an important part
of conditional effect. Moreover, if there's need to hardcode polar
direction, the default should be 0x4000 (north).

For one axis affects, a direction of 0 means complete lack of force, if
a FFB-enabled device takes direction into force calculation. A sine function
graph can be used to represent the resulting forces where X is the input
direction and Y is the force multiplier (360 degrees equals to 1).

This fixes conditional effect playback on Moza Racing devices, which do
not ignore direction field.
2025-01-20 16:52:40 -08:00
Sam Lantinga
b476695e67 Call the windows message hook while inside a modal message loop
Fixes https://github.com/libsdl-org/SDL/issues/12029
2025-01-20 15:56:23 -08:00
Ryan C. Gordon
b6d0bc0431 coreaudio: Use three buffers for the audioqueue, not two.
This doesn't affect latency much, but it makes the system usable if the system
drops you down from the bluetooth a2dp profile (headphones) to the handsfree
(I think...?) profile because the bluetooth audio device is also recording,
which would be extremely common in a VoIP app, but also if you're talking
in a different app while also playing audio.

Fixes #8192.
2025-01-20 18:35:04 -05:00
Ryan C. Gordon
aa10e51c74 audio: Added some minor missing comments in struct SDL_AudioDevice. 2025-01-20 18:35:04 -05:00
Frank Praznik
10a5b388df win32: Retain the WS_MAXIMIZEDBOX style while in fullscreen
This needs to be preserved while in fullscreen, or leaving fullscreen for the maximized state can cause the taskbar to disappear with borderless windows.
2025-01-20 17:01:58 -05:00
Frank Praznik
6449339ae3 win32: Restore the base size of a window when leaving fullscreen
Always restore the base floating size of a window before possibly entering the maximized state, as base size can be lost during the fullscreen transition, resulting in the window de-maximizing to the wrong size.
2025-01-20 17:01:58 -05:00
Sam Lantinga
075c0337cd Removed debug print statement 2025-01-20 13:11:19 -08:00
Sam Lantinga
a036aeda3b The Vulkan renderer doesn't actually support RGB texture formats
Fixes https://github.com/libsdl-org/SDL/issues/10400
2025-01-20 13:09:49 -08:00
Sam Lantinga
9b454a762c Revert "testautomation: don't validate alpha values on XRGB formats"
This reverts commit 759e01bd64.

It's better to return the expected format from SDL_RenderReadPixels() than skip alpha testing.
2025-01-20 12:57:48 -08:00
Ryan C. Gordon
dcadd23ba1 render: Prevent division by zero if logical presentation is 0 pixels. 2025-01-20 15:52:33 -05:00
Ryan C. Gordon
adb91fd3db process: Don't use vfork() on Apple platforms.
They want you to use fork(), which is almost-identical in their implementation.
They mark vfork() usage with a big scary deprecation warning.
2025-01-20 15:51:02 -05:00
Frank Praznik
819628c6bf testautomation: Remove Win32 borderless resizable hint
This defaults to 'true' now, so setting it manually is no longer necessary.
2025-01-20 14:49:35 -05:00
Sam Lantinga
759e01bd64 testautomation: don't validate alpha values on XRGB formats
The results are not defined, and some renderers set 0xFF always and other renderers set the alpha to blend results, even though it won't be used when rendering.

Fixes --filter render_testBlendModes with D3D renderers
2025-01-20 11:29:41 -08:00
Sam Lantinga
c698c61f03 renderer: initialize the surface colorspace correctly
Fixes https://github.com/libsdl-org/SDL/issues/12027
2025-01-20 10:48:13 -08:00
Sam Lantinga
c975f77b0f Update joysticks and so forth during live resize
Fixes https://github.com/libsdl-org/SDL/issues/12022
2025-01-20 10:11:31 -08:00
Sam Lantinga
362f96a6cf testcontroller: use SDL_MAIN_USE_CALLBACKS so updates happen during live resizing 2025-01-20 10:11:31 -08:00
Sam Lantinga
f8040b2e01 Use UIKeyboardTypeDecimalPad for number fields on iOS
Fixes https://github.com/libsdl-org/SDL/issues/12025
2025-01-20 09:09:57 -08:00
Ryan C. Gordon
90b2e2527e include: Added a tiny bit to SDL_sensor.h's category documentation.
Reference Issue #11847.
2025-01-20 01:39:37 -05:00
Ryan C. Gordon
2be749b23b include: More category documentation.
Reference Issue #11847.
2025-01-20 01:37:25 -05:00
Ryan C. Gordon
642262e30e cocoa: Fix mousegrab when going fullscreen.
When going into a fullscreen space, update mouseConfinementRect once the
transition is done. When going exclusive fullscreen, force a window sync so
the transition is complete before we do the update.

Fixes #9088.
2025-01-20 01:02:30 -05:00
Ryan C. Gordon
d5766bc4b8 include: More category documentation.
Reference Issue #11847.
2025-01-20 01:02:30 -05:00
Ryan C. Gordon
b809da52fd assert: Try using __builtin_trap() for SDL_TriggerBreakpoint().
This was necessary on an arm64 install of Raspberry Pi OS.
2025-01-20 01:02:30 -05:00
SDL Wiki Bot
c4c0bfdfb1 Sync SDL3 wiki -> header
[ci skip]
2025-01-20 04:34:56 +00:00
William Hou
7133969e3a Feature add hint to remap option as alt key (#12021) 2025-01-19 20:34:04 -08:00
SDL Wiki Bot
53a5350292 Sync SDL3 wiki -> header
[ci skip]
2025-01-20 02:54:44 +00:00
Sam Lantinga
5f2dd5f04e tray: fixed multi-threading issues with GTk implementation
GTK+ documentation states that all GDK and GTK+ calls should be made from the main thread.

Fixes https://github.com/libsdl-org/SDL/issues/11984
2025-01-19 18:53:55 -08:00
Sam Lantinga
dfdc120268 tray: document thread-safety 2025-01-19 18:53:55 -08:00
Sam Lantinga
d4cda51057 tray: renamed SDL_HasNoActiveTrays() to SDL_HasActiveTrays() 2025-01-19 18:53:55 -08:00
Sam Lantinga
a974888aad tray: fixed icon colors on Windows 2025-01-19 18:53:55 -08:00
Sam Lantinga
7570ab106d tray: improved error checking
Also clean up any existing trays when the program quits

Fixes https://github.com/libsdl-org/SDL/issues/11893
2025-01-19 18:53:55 -08:00
Sam Lantinga
b716eeefef testtray: minor cleanup 2025-01-19 18:53:55 -08:00
Sam Lantinga
3afd1e7eaa windows: use WIN_UTF8ToStringW() for dialog titles 2025-01-19 18:53:55 -08:00
SDL Wiki Bot
78023500fa Sync SDL3 wiki -> header
[ci skip]
2025-01-19 23:59:37 +00:00
Ryan C. Gordon
34c12d0db8 include: Add category documentation to SDL_timer.h.
Reference Issue #11847.
2025-01-19 12:19:30 -05:00
SDL Wiki Bot
b088e89191 Sync SDL3 wiki -> header
[ci skip]
2025-01-19 17:12:43 +00:00
Ryan C. Gordon
0851322fb1 include: Add category documentation to SDL_power.h.
Reference Issue #11847.
2025-01-19 12:11:49 -05:00
Semphris
43b54b3d72 Fix Windows dialog folder titles
Same fix as in cf946e32ba, which was not done for the folder implementation.
2025-01-19 08:19:40 -08:00
Ryan C. Gordon
32965b4bf1 pen: Send virtual mouse motion without a button press when a pen is hovering.
Fixes #11470.
2025-01-18 21:51:03 -05:00
Ryan C. Gordon
5da9d4ecc2 cocoa: Slightly better display hotplugging detection.
Fixes #12016.
2025-01-18 17:02:37 -05:00
Semphris
19f42094bb Fix Windows fie dialog args freeing 2025-01-18 13:53:56 -08:00
Semphris
721fc7de0b Correct spacing of pointers ('a* b;' -> 'a *b;') 2025-01-18 13:53:56 -08:00
Semphris
cd269730eb Fix Windows dialog memory management 2025-01-18 13:53:56 -08:00
Sam Lantinga
049a8f0e52 Use SDL_calloc() instead of SDL_malloc()
This automatically initializes memory to zero so you don't have uninitialized memory bugs
2025-01-18 13:41:23 -08:00
Semphris
354d2c390c Initialize invalid parent_{tray,entry} to NULL
The API states that the related functions must return NULL if the function
called (get the parent tray, or get the parent entry) is invalid for this
menu. Initialising the fields to NULL makes that API correct for Windows.
2025-01-18 16:17:16 -05:00
Semphris
b79ada6aa5 Windows trays: Fix ParentEntry & Enabling
The test/testtray program would crash on Windows when adding any item and then removing it, because a submenu's parent_entry field was not set.

Additionally, I noticed that some extraneous code copied from the {G,S}etTrayEntryChecked made {G,S}etTrayEntryEnabled work only for checkboxes, which is not the desired behavior.

Both issues were fixed in this commit.
2025-01-18 16:17:16 -05:00
Sam Lantinga
ba95c54f99 macOS: get the correct display name on macOS 10.15+ 2025-01-18 09:42:37 -08:00
Frank Praznik
42e0fb10f8 wayland: Set the mouse state before calling the hit test callback
Update the mouse state before entering the hit test, in case the global state is queried, or the system menu opened, while in the client hit testing callback.
2025-01-18 12:10:25 -05:00
Sam Lantinga
cd0db8d35e Added Linux evdev mappings for the Wireless HORIPAD For Steam 2025-01-18 08:09:25 -08:00
Ryan C. Gordon
1d7a681e4d Revert "emscripten: resizable windows take whole page, resize with browser window."
This reverts commit d317fc9c08.

This has some issues, we'll revisit it for 3.4.0.

Reference Issue #11949.
2025-01-18 10:15:43 -05:00
SDL Wiki Bot
e054f3c085 Sync SDL3 wiki -> header
[ci skip]
2025-01-18 15:12:47 +00:00
Ryan C. Gordon
75317dae59 include: Added category docs for SDL_mouse.h
Reference Issue #11847.
2025-01-18 10:11:53 -05:00
Sam Lantinga
c7d1fd90ea Added support for the 8BitDo Ultimate 2C Wireless in Bluetooth mode
Closes https://github.com/libsdl-org/SDL/pull/11415
2025-01-18 07:06:46 -08:00
Anonymous Maarten
dbe3baeb0f release: document using the xcframework with CMake 2025-01-18 06:29:17 -08:00
Sam Lantinga
ad3c7b92f8 xcode+cmake: use SDL3.framework folder as IMPORTED_LOCATION
[ci skip]
2025-01-18 06:27:21 -08:00
Sam Lantinga
0401b07eea Fixed typo 2025-01-18 06:23:14 -08:00
Sam Lantinga
08e74d29be Fixed typo 2025-01-18 06:22:29 -08:00
Sam Lantinga
923123a527 emscripten: Let SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT accept "#none"
This is used to say "don't even try to listen for keypresses," for apps that
are managing this outside of SDL.

Fixes #10292.
2025-01-18 06:19:27 -08:00
Sam Lantinga
c603a9c94a Moved flag documentation 2025-01-18 06:16:10 -08:00
Sam Lantinga
90b7174a7d Respect the SDL_BORDERLESS_RESIZABLE_STYLE hint, but default it to true. 2025-01-18 06:07:06 -08:00
Ryan C. Gordon
6a72d32d41 emscripten: Let SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT accept "".
This is used to say "don't even try to listen for keypresses," for apps that
are managing this outside of SDL.

Fixes #10292.
2025-01-18 08:43:55 -05:00
Ryan C. Gordon
f3a39074b0 windows: use WS_THICKFRAME style on borderless windows.
This is apparently necessary in newer Windows releases (Windows 10 and later?)
to allow hit-testing to resize the window.

Fixes #8406.
2025-01-18 08:38:49 -05:00
Nicolas Firmo
842f6dc402 Fixed wrong type of phase (#12014)
`phase` should be a `float` value that ranges between `0` and `1`.
2025-01-17 18:12:47 -08:00
Nicolas Firmo do Patrocinio Barra
b95989d14a Fixed sine wave distortion over time.
Audio distortion after a while caused by loss of precision in dividing a large floating point number resolved by keeping `current_sine_sample` (formelly named `total_samples_generated`) between 0 and freq - 1.
2025-01-17 17:41:56 -08:00
Ryan C. Gordon
010f27dc70 storage: enumerate and glob on storage can accept a NULL path.
This will be treated as the root of the storage tree.
2025-01-17 20:11:50 -05:00
Ryan C. Gordon
a6a8598b98 storage: deal with paths with Windows '\\' path separators appended.
Reference Issue #11986.
2025-01-17 20:11:50 -05:00
Sam Lantinga
7c6adc1ca7 gpu renderer: removed unused sampler slots
There used to be 3 scale modes, now there are only 2.
2025-01-17 16:31:40 -08:00
Ryan C. Gordon
feeea6a776 Sync SDL3 wiki -> headers. 2025-01-17 18:42:04 -05:00
Ryan C. Gordon
e9f7f11f1d fnsince.pl: Fix script once bump to 3.1.10 exposed a bug. 2025-01-17 18:39:12 -05:00
SDL Wiki Bot
d2fc394a2a Sync SDL3 wiki -> header
[ci skip]
2025-01-17 23:11:30 +00:00
Ryan C. Gordon
d317fc9c08 emscripten: resizable windows take whole page, resize with browser window.
This also implements the SetWindowResizable interface, so this can be now
toggled after window creation, too.

Fixes #11949.
2025-01-17 17:59:28 -05:00
SDL Wiki Bot
ee469c6aff Sync SDL3 wiki -> header
[ci skip]
2025-01-17 22:26:32 +00:00
cosmonaut
d4d22dd8de GPU: Add remarks about point topology 2025-01-17 14:25:14 -08:00
Sam Lantinga
59ea078ee2 x11: check to see if displays moved when connected/disconnected
Fixes https://github.com/libsdl-org/SDL/issues/9738
2025-01-17 13:14:16 -08:00
Frank Praznik
1848ce680b win32: Use the window coordinates to get the monitor when de-minimizing a maximized window
MonitorFromWindow can fail if called on a window being de-minimized, so fall back to using the monitor from the last window coordinates if initial retrieval fails.
2025-01-17 15:46:18 -05:00
Sam Lantinga
656c519cca Fixed warning C6313: Incorrect operator. Use an equality test to check for zero-valued flags. 2025-01-17 12:08:58 -08:00
SDL Wiki Bot
9ed96f392d Sync SDL3 wiki -> header
[ci skip]
2025-01-17 19:46:20 +00:00
Sam Lantinga
ae8df1dcbd Note that the primary monitor isn't always at 0,0 2025-01-17 11:52:33 -08:00
Sam Lantinga
4b429b9fa7 Updated README-platforms.md
Also added platform specific README files
2025-01-16 16:21:18 -08:00
Sam Lantinga
616ae99069 Removed README-git.md
We're fully hosted on GitHub, no need for additional explanation.
2025-01-16 15:45:51 -08:00
Ryan C. Gordon
c2dac95f58 Revert "Add CategoryAPICategory to the complete API index"
This reverts commit 21a42d2b0d.

It doesn't work like this, sorry.  :)
2025-01-16 18:02:01 -05:00
Anonymous Maarten
dd4f5df824 release: support android-X-ext-Y directories
[ci skip]
2025-01-16 20:59:13 +01:00
ROllerozxa
cdc5483cf9 Vita: Fix off-by-one error for synthetic mouse events 2025-01-16 11:58:01 -08:00
SDL Wiki Bot
07a5c144c6 Sync SDL3 wiki -> header
[ci skip]
2025-01-16 19:43:08 +00:00
Sam Lantinga
eb168e410c Updated to version 3.1.11 for development 2025-01-16 11:41:28 -08:00
889 changed files with 88060 additions and 36283 deletions

View File

@@ -0,0 +1,102 @@
name: 'Setup Nonka N-Gage SDK'
description: 'Download and setup Nokia N-Gage SDK'
inputs:
path:
description: 'Installation path'
default: 'default'
runs:
using: 'composite'
steps:
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: 'Verify platform'
id: calc
shell: sh
run: |
case "${{ runner.os }}-${{ runner.arch }}" in
"Windows-X86" | "Windows-X64")
echo "ok!"
echo "cache-key=ngage-sdk-windows" >> ${GITHUB_OUTPUT}
default_install_path="C:/ngagesdk"
;;
*)
echo "Unsupported ${{ runner.os }}-${{ runner.arch }}"
exit 1;
;;
esac
install_path="${{ inputs.path }}"
if [ "x$install_path" = "xdefault" ]; then
install_path="$default_install_path"
fi
echo "install-path=$install_path" >> ${GITHUB_OUTPUT}
toolchain_repo="https://github.com/ngagesdk/ngage-toolchain"
toolchain_branch="main"
echo "toolchain-repo=${toolchain_repo}" >> ${GITHUB_OUTPUT}
echo "toolchain-branch=${toolchain_branch}" >> ${GITHUB_OUTPUT}
sdk_repo="https://github.com/ngagesdk/sdk"
sdk_branch="main"
echo "sdk-repo=${sdk_repo}" >> ${GITHUB_OUTPUT}
echo "sdk-branch=${sdk_branch}" >> ${GITHUB_OUTPUT}
tools_repo="https://github.com/ngagesdk/tools"
tools_branch="main"
echo "tools-repo=${tools_repo}" >> ${GITHUB_OUTPUT}
echo "tools-branch=${tools_branch}" >> ${GITHUB_OUTPUT}
extras_repo="https://github.com/ngagesdk/extras"
extras_branch="main"
echo "extras-repo=${extras_repo}" >> ${GITHUB_OUTPUT}
echo "extras-branch=${extras_branch}" >> ${GITHUB_OUTPUT}
# - name: 'Restore cached ${{ steps.calc.outputs.archive }}'
# id: cache-restore
# uses: actions/cache/restore@v4
# with:
# path: '${{ runner.temp }}'
# key: ${{ steps.calc.outputs.cache-key }}
- name: 'Download N-Gage SDK'
# if: ${{ !steps.cache-restore.outputs.cache-hit || steps.cache-restore.outputs.cache-hit == 'false' }}
shell: pwsh
run: |
Invoke-WebRequest "${{ steps.calc.outputs.toolchain-repo }}/archive/refs/heads/${{ steps.calc.outputs.toolchain-branch }}.zip" -OutFile "${{ runner.temp }}/ngage-toolchain.zip"
Invoke-WebRequest "${{ steps.calc.outputs.sdk-repo }}/archive/refs/heads/${{ steps.calc.outputs.sdk-branch }}.zip" -OutFile "${{ runner.temp }}/sdk.zip"
Invoke-WebRequest "${{ steps.calc.outputs.tools-repo }}/archive/refs/heads/${{ steps.calc.outputs.tools-branch }}.zip" -OutFile "${{ runner.temp }}/tools.zip"
Invoke-WebRequest "${{ steps.calc.outputs.extras-repo }}/archive/refs/heads/${{ steps.calc.outputs.extras-branch }}.zip" -OutFile "${{ runner.temp }}/extras.zip"
# - name: 'Cache ${{ steps.calc.outputs.archive }}'
# if: ${{ !steps.cache-restore.outputs.cache-hit || steps.cache-restore.outputs.cache-hit == 'false' }}
# uses: actions/cache/save@v4
# with:
# path: |
# ${{ runner.temp }}/apps.zip
# ${{ runner.temp }}/sdk.zip
# ${{ runner.temp }}/tools.zip
# key: ${{ steps.calc.outputs.cache-key }}
- name: 'Extract N-Gage SDK'
shell: pwsh
run: |
New-Item -ItemType Directory -Path "${{ steps.calc.outputs.install-path }}" -Force
New-Item -ItemType Directory -Path "${{ runner.temp }}/ngage-toolchain-temp" -Force
7z "-o${{ runner.temp }}/ngage-toolchain-temp" x "${{ runner.temp }}/ngage-toolchain.zip"
Move-Item -Path "${{ runner.temp }}/ngage-toolchain-temp/ngage-toolchain-${{ steps.calc.outputs.toolchain-branch }}/*" -Destination "${{ steps.calc.outputs.install-path }}"
7z "-o${{ steps.calc.outputs.install-path }}/sdk" x "${{ runner.temp }}/sdk.zip"
Move-Item -Path "${{ steps.calc.outputs.install-path }}/sdk/sdk-${{ steps.calc.outputs.sdk-branch }}" -Destination "${{ steps.calc.outputs.install-path }}/sdk/sdk"
7z "-o${{ steps.calc.outputs.install-path }}/sdk" x "${{ runner.temp }}/tools.zip"
Move-Item -Path "${{ steps.calc.outputs.install-path }}/sdk/tools-${{ steps.calc.outputs.tools-branch }}" -Destination "${{ steps.calc.outputs.install-path }}/sdk/tools"
7z "-o${{ steps.calc.outputs.install-path }}/sdk" x "${{ runner.temp }}/extras.zip"
Move-Item -Path "${{ steps.calc.outputs.install-path }}/sdk/extras-${{ steps.calc.outputs.extras-branch }}" -Destination "${{ steps.calc.outputs.install-path }}/sdk/extras"
- name: 'Set output variables'
id: final
shell: sh
run: |
echo "${{ steps.calc.outputs.install-path }}/sdk/sdk/6.1/Shared/EPOC32/gcc/bin" >> $GITHUB_PATH
echo "${{ steps.calc.outputs.install-path }}/sdk/sdk/6.1/Shared/EPOC32/ngagesdk/bin" >> $GITHUB_PATH
echo "NGAGESDK=${{ steps.calc.outputs.install-path }}" >> $GITHUB_ENV
echo "CMAKE_TOOLCHAIN_FILE=${{ steps.calc.outputs.install-path }}/cmake/ngage-toolchain.cmake" >> $GITHUB_ENV

View File

@@ -28,9 +28,9 @@ class JobOs(Enum):
WindowsLatest = "windows-latest"
UbuntuLatest = "ubuntu-latest"
MacosLatest = "macos-latest"
Ubuntu20_04 = "ubuntu-20.04"
Ubuntu22_04 = "ubuntu-22.04"
Ubuntu24_04 = "ubuntu-24.04"
Ubuntu24_04_arm = "ubuntu-24.04-arm"
Macos13 = "macos-13"
@@ -54,12 +54,13 @@ class SdlPlatform(Enum):
Riscos = "riscos"
FreeBSD = "freebsd"
NetBSD = "netbsd"
OpenBSD = "openbsd"
NGage = "ngage"
class Msys2Platform(Enum):
Mingw32 = "mingw32"
Mingw64 = "mingw64"
Clang32 = "clang32"
Clang64 = "clang64"
Ucrt64 = "ucrt64"
@@ -101,50 +102,52 @@ class JobSpec:
JOB_SPECS = {
"msys2-mingw32": JobSpec(name="Windows (msys2, mingw32)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw32", msys2_platform=Msys2Platform.Mingw32, ),
"msys2-mingw64": JobSpec(name="Windows (msys2, mingw64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw64", msys2_platform=Msys2Platform.Mingw64, ),
"msys2-clang32": JobSpec(name="Windows (msys2, clang32)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw32-clang", msys2_platform=Msys2Platform.Clang32, ),
"msys2-clang64": JobSpec(name="Windows (msys2, clang64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw64-clang", msys2_platform=Msys2Platform.Clang64, ),
"msys2-ucrt64": JobSpec(name="Windows (msys2, ucrt64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw64-ucrt", msys2_platform=Msys2Platform.Ucrt64, ),
"msvc-x64": JobSpec(name="Windows (MSVC, x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-x64", msvc_arch=MsvcArch.X64, msvc_project="VisualC/SDL.sln", ),
"msvc-x86": JobSpec(name="Windows (MSVC, x86)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-x86", msvc_arch=MsvcArch.X86, msvc_project="VisualC/SDL.sln", ),
"msvc-clang-x64": JobSpec(name="Windows (MSVC, clang-cl x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-clang-cl-x64", msvc_arch=MsvcArch.X64, clang_cl=True, ),
"msvc-clang-x86": JobSpec(name="Windows (MSVC, clang-cl x86)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-clang-cl-x86", msvc_arch=MsvcArch.X86, clang_cl=True, ),
"msvc-arm32": JobSpec(name="Windows (MSVC, ARM)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-arm32", msvc_arch=MsvcArch.Arm32, ),
"msvc-arm64": JobSpec(name="Windows (MSVC, ARM64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-arm64", msvc_arch=MsvcArch.Arm64, ),
"msvc-gdk-x64": JobSpec(name="GDK (MSVC, x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-GDK", msvc_arch=MsvcArch.X64, msvc_project="VisualC-GDK/SDL.sln", gdk=True, no_cmake=True, ),
"ubuntu-20.04": JobSpec(name="Ubuntu 20.04", os=JobOs.Ubuntu20_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu20.04", ),
"ubuntu-22.04": JobSpec(name="Ubuntu 22.04", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu22.04", ),
"steamrt-sniper": JobSpec(name="Steam Linux Runtime (Sniper)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Linux, artifact="SDL-slrsniper", container="registry.gitlab.steamos.cloud/steamrt/sniper/sdk:beta", ),
"ubuntu-intel-icx": JobSpec(name="Ubuntu 20.04 (Intel oneAPI)", os=JobOs.Ubuntu20_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu20.04-oneapi", intel=IntelCompiler.Icx, ),
"ubuntu-intel-icc": JobSpec(name="Ubuntu 20.04 (Intel Compiler)", os=JobOs.Ubuntu20_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu20.04-icc", intel=IntelCompiler.Icc, ),
"macos-framework-x64": JobSpec(name="MacOS (Framework) (x64)", os=JobOs.Macos13, platform=SdlPlatform.MacOS, artifact="SDL-macos-framework", apple_framework=True, apple_archs={AppleArch.Aarch64, AppleArch.X86_64, }, xcode=True, ),
"macos-framework-arm64": JobSpec(name="MacOS (Framework) (arm64)", os=JobOs.MacosLatest, platform=SdlPlatform.MacOS, artifact=None, apple_framework=True, apple_archs={AppleArch.Aarch64, AppleArch.X86_64, }, ),
"macos-gnu-arm64": JobSpec(name="MacOS (GNU prefix)", os=JobOs.MacosLatest, platform=SdlPlatform.MacOS, artifact="SDL-macos-arm64-gnu", apple_framework=False, apple_archs={AppleArch.Aarch64, }, ),
"ios": JobSpec(name="iOS (CMake & xcode)", os=JobOs.MacosLatest, platform=SdlPlatform.Ios, artifact="SDL-ios-arm64", xcode=True, ),
"tvos": JobSpec(name="tvOS (CMake & xcode)", os=JobOs.MacosLatest, platform=SdlPlatform.Tvos, artifact="SDL-tvos-arm64", xcode=True, ),
"android-cmake": JobSpec(name="Android (CMake)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Android, artifact="SDL-android-arm64", android_abi="arm64-v8a", android_arch="aarch64", android_platform=23, ),
"android-cmake-lean": JobSpec(name="Android (CMake, lean)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Android, artifact="SDL-lean-android-arm64", android_abi="arm64-v8a", android_arch="aarch64", android_platform=23, lean=True, ),
"android-mk": JobSpec(name="Android (Android.mk)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Android, artifact=None, no_cmake=True, android_mk=True, ),
"android-gradle": JobSpec(name="Android (Gradle)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Android, artifact=None, no_cmake=True, android_gradle=True, ),
"emscripten": JobSpec(name="Emscripten", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Emscripten, artifact="SDL-emscripten", ),
"haiku": JobSpec(name="Haiku", os=JobOs.UbuntuLatest, platform=SdlPlatform.Haiku, artifact="SDL-haiku-x64", container="ghcr.io/haiku/cross-compiler:x86_64-r1beta5", ),
"loongarch64": JobSpec(name="LoongArch64", os=JobOs.UbuntuLatest, platform=SdlPlatform.LoongArch64, artifact="SDL-loongarch64", ),
"n3ds": JobSpec(name="Nintendo 3DS", os=JobOs.UbuntuLatest, platform=SdlPlatform.N3ds, artifact="SDL-n3ds", container="devkitpro/devkitarm:latest", ),
"ppc": JobSpec(name="PowerPC", os=JobOs.UbuntuLatest, platform=SdlPlatform.PowerPC, artifact="SDL-ppc", container="dockcross/linux-ppc:latest", ),
"ppc64": JobSpec(name="PowerPC64", os=JobOs.UbuntuLatest, platform=SdlPlatform.PowerPC64, artifact="SDL-ppc64le", container="dockcross/linux-ppc64le:latest", ),
"ps2": JobSpec(name="Sony PlayStation 2", os=JobOs.UbuntuLatest, platform=SdlPlatform.Ps2, artifact="SDL-ps2", container="ps2dev/ps2dev:latest", ),
"psp": JobSpec(name="Sony PlayStation Portable", os=JobOs.UbuntuLatest, platform=SdlPlatform.Psp, artifact="SDL-psp", container="pspdev/pspdev:latest", ),
"vita-pib": JobSpec(name="Sony PlayStation Vita (GLES w/ pib)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Vita, artifact="SDL-vita-pib", container="vitasdk/vitasdk:latest", vita_gles=VitaGLES.Pib, ),
"vita-pvr": JobSpec(name="Sony PlayStation Vita (GLES w/ PVR_PSP2)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Vita, artifact="SDL-vita-pvr", container="vitasdk/vitasdk:latest", vita_gles=VitaGLES.Pvr, ),
"riscos": JobSpec(name="RISC OS", os=JobOs.UbuntuLatest, platform=SdlPlatform.Riscos, artifact="SDL-riscos", container="riscosdotinfo/riscos-gccsdk-4.7:latest", ),
"netbsd": JobSpec(name="NetBSD", os=JobOs.UbuntuLatest, platform=SdlPlatform.NetBSD, artifact="SDL-netbsd-x64", ),
"freebsd": JobSpec(name="FreeBSD", os=JobOs.UbuntuLatest, platform=SdlPlatform.FreeBSD, artifact="SDL-freebsd-x64", ),
"msys2-mingw32": JobSpec(name="Windows (msys2, mingw32)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw32", msys2_platform=Msys2Platform.Mingw32, ),
"msys2-mingw64": JobSpec(name="Windows (msys2, mingw64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw64", msys2_platform=Msys2Platform.Mingw64, ),
"msys2-clang64": JobSpec(name="Windows (msys2, clang64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw64-clang", msys2_platform=Msys2Platform.Clang64, ),
"msys2-ucrt64": JobSpec(name="Windows (msys2, ucrt64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw64-ucrt", msys2_platform=Msys2Platform.Ucrt64, ),
"msvc-x64": JobSpec(name="Windows (MSVC, x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-x64", msvc_arch=MsvcArch.X64, msvc_project="VisualC/SDL.sln", ),
"msvc-x86": JobSpec(name="Windows (MSVC, x86)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-x86", msvc_arch=MsvcArch.X86, msvc_project="VisualC/SDL.sln", ),
"msvc-clang-x64": JobSpec(name="Windows (MSVC, clang-cl x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-clang-cl-x64", msvc_arch=MsvcArch.X64, clang_cl=True, ),
"msvc-clang-x86": JobSpec(name="Windows (MSVC, clang-cl x86)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-clang-cl-x86", msvc_arch=MsvcArch.X86, clang_cl=True, ),
"msvc-arm32": JobSpec(name="Windows (MSVC, ARM)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-arm32", msvc_arch=MsvcArch.Arm32, ),
"msvc-arm64": JobSpec(name="Windows (MSVC, ARM64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-arm64", msvc_arch=MsvcArch.Arm64, ),
"msvc-gdk-x64": JobSpec(name="GDK (MSVC, x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-GDK", msvc_arch=MsvcArch.X64, msvc_project="VisualC-GDK/SDL.sln", gdk=True, no_cmake=True, ),
"ubuntu-22.04": JobSpec(name="Ubuntu 22.04", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu22.04", ),
"ubuntu-24.04-arm64": JobSpec(name="Ubuntu 24.04 (ARM64)", os=JobOs.Ubuntu24_04_arm, platform=SdlPlatform.Linux, artifact="SDL-ubuntu24.04-arm64", ),
"steamrt3": JobSpec(name="Steam Linux Runtime 3.0 (x86_64)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Linux, artifact="SDL-steamrt3", container="registry.gitlab.steamos.cloud/steamrt/sniper/sdk:latest", ),
"steamrt3-arm64": JobSpec(name="Steam Linux Runtime 3.0 (arm64)", os=JobOs.Ubuntu24_04_arm, platform=SdlPlatform.Linux, artifact="SDL-steamrt3-arm64", container="registry.gitlab.steamos.cloud/steamrt/sniper/sdk/arm64:latest", ),
"ubuntu-intel-icx": JobSpec(name="Ubuntu 22.04 (Intel oneAPI)", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu22.04-oneapi", intel=IntelCompiler.Icx, ),
"ubuntu-intel-icc": JobSpec(name="Ubuntu 22.04 (Intel Compiler)", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu22.04-icc", intel=IntelCompiler.Icc, ),
"macos-framework-x64": JobSpec(name="MacOS (Framework) (x64)", os=JobOs.Macos13, platform=SdlPlatform.MacOS, artifact="SDL-macos-framework", apple_framework=True, apple_archs={AppleArch.Aarch64, AppleArch.X86_64, }, xcode=True, ),
"macos-framework-arm64": JobSpec(name="MacOS (Framework) (arm64)", os=JobOs.MacosLatest, platform=SdlPlatform.MacOS, artifact=None, apple_framework=True, apple_archs={AppleArch.Aarch64, AppleArch.X86_64, }, ),
"macos-gnu-arm64": JobSpec(name="MacOS (GNU prefix)", os=JobOs.MacosLatest, platform=SdlPlatform.MacOS, artifact="SDL-macos-arm64-gnu", apple_framework=False, apple_archs={AppleArch.Aarch64, }, ),
"ios": JobSpec(name="iOS (CMake & xcode)", os=JobOs.MacosLatest, platform=SdlPlatform.Ios, artifact="SDL-ios-arm64", xcode=True, ),
"tvos": JobSpec(name="tvOS (CMake & xcode)", os=JobOs.MacosLatest, platform=SdlPlatform.Tvos, artifact="SDL-tvos-arm64", xcode=True, ),
"android-cmake": JobSpec(name="Android (CMake)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Android, artifact="SDL-android-arm64", android_abi="arm64-v8a", android_arch="aarch64", android_platform=23, ),
"android-cmake-lean": JobSpec(name="Android (CMake, lean)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Android, artifact="SDL-lean-android-arm64", android_abi="arm64-v8a", android_arch="aarch64", android_platform=23, lean=True, ),
"android-mk": JobSpec(name="Android (Android.mk)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Android, artifact=None, no_cmake=True, android_mk=True, ),
"android-gradle": JobSpec(name="Android (Gradle)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Android, artifact=None, no_cmake=True, android_gradle=True, ),
"emscripten": JobSpec(name="Emscripten", os=JobOs.UbuntuLatest, platform=SdlPlatform.Emscripten, artifact="SDL-emscripten", ),
"haiku": JobSpec(name="Haiku", os=JobOs.UbuntuLatest, platform=SdlPlatform.Haiku, artifact="SDL-haiku-x64", container="ghcr.io/haiku/cross-compiler:x86_64-r1beta5", ),
"loongarch64": JobSpec(name="LoongArch64", os=JobOs.UbuntuLatest, platform=SdlPlatform.LoongArch64, artifact="SDL-loongarch64", ),
"n3ds": JobSpec(name="Nintendo 3DS", os=JobOs.UbuntuLatest, platform=SdlPlatform.N3ds, artifact="SDL-n3ds", container="devkitpro/devkitarm:latest", ),
"ppc": JobSpec(name="PowerPC", os=JobOs.UbuntuLatest, platform=SdlPlatform.PowerPC, artifact="SDL-ppc", container="dockcross/linux-ppc:latest", ),
"ppc64": JobSpec(name="PowerPC64", os=JobOs.UbuntuLatest, platform=SdlPlatform.PowerPC64, artifact="SDL-ppc64le", container="dockcross/linux-ppc64le:latest", ),
"ps2": JobSpec(name="Sony PlayStation 2", os=JobOs.UbuntuLatest, platform=SdlPlatform.Ps2, artifact="SDL-ps2", container="ps2dev/ps2dev:latest", ),
"psp": JobSpec(name="Sony PlayStation Portable", os=JobOs.UbuntuLatest, platform=SdlPlatform.Psp, artifact="SDL-psp", container="pspdev/pspdev:latest", ),
"vita-pib": JobSpec(name="Sony PlayStation Vita (GLES w/ pib)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Vita, artifact="SDL-vita-pib", container="vitasdk/vitasdk:latest", vita_gles=VitaGLES.Pib, ),
"vita-pvr": JobSpec(name="Sony PlayStation Vita (GLES w/ PVR_PSP2)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Vita, artifact="SDL-vita-pvr", container="vitasdk/vitasdk:latest", vita_gles=VitaGLES.Pvr, ),
"riscos": JobSpec(name="RISC OS", os=JobOs.UbuntuLatest, platform=SdlPlatform.Riscos, artifact="SDL-riscos", container="riscosdotinfo/riscos-gccsdk-4.7:latest", ),
"netbsd": JobSpec(name="NetBSD", os=JobOs.UbuntuLatest, platform=SdlPlatform.NetBSD, artifact="SDL-netbsd-x64", ),
"openbsd": JobSpec(name="OpenBSD", os=JobOs.UbuntuLatest, platform=SdlPlatform.OpenBSD, artifact="SDL-openbsd-x64", ),
"freebsd": JobSpec(name="FreeBSD", os=JobOs.UbuntuLatest, platform=SdlPlatform.FreeBSD, artifact="SDL-freebsd-x64", ),
"ngage": JobSpec(name="N-Gage", os=JobOs.WindowsLatest, platform=SdlPlatform.NGage, artifact="SDL-ngage", ),
}
class StaticLibType(Enum):
MSVC = "SDL3-static.lib"
STATIC_LIB = "SDL3-static.lib"
A = "libSDL3.a"
@@ -164,6 +167,7 @@ class JobDetails:
platform: str
artifact: str
no_cmake: bool
ccache: bool = False
build_tests: bool = True
container: str = ""
cmake_build_type: str = "RelWithDebInfo"
@@ -175,6 +179,7 @@ class JobDetails:
brew_packages: list[str] = dataclasses.field(default_factory=list)
cmake_toolchain_file: str = ""
cmake_arguments: list[str] = dataclasses.field(default_factory=list)
cmake_generator: str = "Ninja"
cmake_build_arguments: list[str] = dataclasses.field(default_factory=list)
clang_tidy: bool = True
cppflags: list[str] = dataclasses.field(default_factory=list)
@@ -221,12 +226,17 @@ class JobDetails:
cpactions_install_cmd: str = ""
setup_vita_gles_type: str = ""
check_sources: bool = False
setup_python: bool = False
pypi_packages: list[str] = dataclasses.field(default_factory=list)
setup_gage_sdk_path: str = ""
binutils_strings: str = "strings"
def to_workflow(self, enable_artifacts: bool) -> dict[str, str|bool]:
data = {
"name": self.name,
"key": self.key,
"os": self.os,
"ccache": self.ccache,
"container": self.container if self.container else "",
"platform": self.platform,
"artifact": self.artifact,
@@ -253,6 +263,7 @@ class JobDetails:
"cflags": my_shlex_join(self.cppflags + self.cflags),
"cxxflags": my_shlex_join(self.cppflags + self.cxxflags),
"ldflags": my_shlex_join(self.ldflags),
"cmake-generator": self.cmake_generator,
"cmake-toolchain-file": self.cmake_toolchain_file,
"clang-tidy": self.clang_tidy,
"cmake-arguments": my_shlex_join(self.cmake_arguments),
@@ -285,6 +296,10 @@ class JobDetails:
"setup-vita-gles-type": self.setup_vita_gles_type,
"setup-gdk-folder": self.setup_gdk_folder,
"check-sources": self.check_sources,
"setup-python": self.setup_python,
"pypi-packages": my_shlex_join(self.pypi_packages),
"setup-ngage-sdk-path": self.setup_gage_sdk_path,
"binutils-strings": self.binutils_strings,
}
return {k: v for k, v in data.items() if v != ""}
@@ -337,7 +352,10 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
case IntelCompiler.Icc:
job.cc = "icc"
job.cxx = "icpc"
# Disable deprecation warning
job.cppflags.append("-diag-disable=10441")
# Avoid 'Catastrophic error: cannot open precompiled header file'
job.cmake_arguments.append("-DCMAKE_DISABLE_PRECOMPILE_HEADERS:BOOL=ON")
job.clang_tidy = False
case _:
raise ValueError(f"Invalid intel={spec.intel}")
@@ -357,7 +375,7 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
job.msvc_project_flags.append("-p:TreatWarningsAsError=true")
job.test_pkg_config = False
job.shared_lib = SharedLibType.WIN32
job.static_lib = StaticLibType.MSVC
job.static_lib = StaticLibType.STATIC_LIB
job.cmake_arguments.extend((
"-DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=ProgramDatabase",
"-DCMAKE_EXE_LINKER_FLAGS=-DEBUG",
@@ -374,9 +392,11 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
match spec.msvc_arch:
case MsvcArch.X86:
job.cflags.append("/clang:-m32")
job.cxxflags.append("/clang:-m32")
job.ldflags.append("/MACHINE:X86")
case MsvcArch.X64:
job.cflags.append("/clang:-m64")
job.cxxflags.append("/clang:-m64")
job.ldflags.append("/MACHINE:X64")
case _:
raise ValueError(f"Unsupported clang-cl architecture (arch={spec.msvc_arch})")
@@ -415,6 +435,7 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
if spec.name.startswith("Ubuntu"):
assert spec.os.value.startswith("ubuntu-")
job.apt_packages.extend((
"ccache",
"gnome-desktop-testing",
"libasound2-dev",
"libpulse-dev",
@@ -441,12 +462,14 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
"libudev-dev",
"fcitx-libs-dev",
))
ubuntu_year, ubuntu_month = [int(v) for v in spec.os.value.removeprefix("ubuntu-").split(".", 1)]
match = re.match(r"ubuntu-(?P<year>[0-9]+)\.(?P<month>[0-9]+).*", spec.os.value)
ubuntu_year, ubuntu_month = [int(match["year"]), int(match["month"])]
if ubuntu_year >= 22:
job.apt_packages.extend(("libpipewire-0.3-dev", "libdecor-0-dev"))
job.apt_packages.extend((
"libunwind-dev", # For SDL_test memory tracking
))
job.ccache = True
if trackmem_symbol_names:
# older libunwind is slow
job.cmake_arguments.append("-DSDLTEST_TIMEOUT_MULTIPLIER=2")
@@ -455,8 +478,10 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
fpic = True
case SdlPlatform.Ios | SdlPlatform.Tvos:
job.brew_packages.extend([
"ccache",
"ninja",
])
job.ccache = True
job.clang_tidy = False
job.run_tests = False
job.test_pkg_config = False
@@ -499,8 +524,12 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
))
job.shared_lib = SharedLibType.DYLIB
job.static_lib = StaticLibType.A
job.ccache = True
job.apt_packages = []
job.brew_packages.append("ninja")
job.brew_packages.extend((
"ccache",
"ninja",
))
if job.clang_tidy:
job.brew_packages.append("llvm")
if spec.xcode:
@@ -508,6 +537,7 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
case SdlPlatform.Android:
job.android_gradle = spec.android_gradle
job.android_mk = spec.android_mk
job.apt_packages.append("ccache")
job.run_tests = False
job.shared_lib = SharedLibType.SO
job.static_lib = StaticLibType.A
@@ -518,6 +548,7 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
if spec.android_mk or spec.android_gradle:
job.apt_packages = []
if not spec.no_cmake:
job.ccache = True
job.cmake_arguments.extend((
f"-DANDROID_PLATFORM={spec.android_platform}",
f"-DANDROID_ABI={spec.android_abi}",
@@ -532,13 +563,18 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
"testmultiaudio-apk",
"testsprite-apk",
]
# -fPIC is required after updating NDK from 21 to 28
job.cflags.append("-fPIC")
job.cxxflags.append("-fPIC")
case SdlPlatform.Emscripten:
job.clang_tidy = False # clang-tidy does not understand -gsource-map
job.shared = False
job.ccache = True
job.apt_packages.append("ccache")
job.cmake_config_emulator = "emcmake"
job.cmake_build_type = "Debug"
job.test_pkg_config = False
job.apt_packages.append("python3-selenium")
job.cmake_arguments.extend((
"-DSDLTEST_BROWSER=chrome",
"-DSDLTEST_TIMEOUT_MULTIPLIER=4",
@@ -558,12 +594,15 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
"chromedriver --version",
))
job.static_lib = StaticLibType.A
job.setup_python = True
job.pypi_packages.append("selenium")
case SdlPlatform.Ps2:
job.ccache = False # actions/ccache does not work in psp container (incompatible tar of busybox)
build_parallel = False
job.shared = False
job.sudo = ""
job.apt_packages = []
job.apk_packages = ["cmake", "gmp", "mpc1", "mpfr4", "ninja", "pkgconf", "git", ]
job.apk_packages = ["ccache", "cmake", "gmp", "mpc1", "mpfr4", "ninja", "pkgconf", "git", ]
job.cmake_toolchain_file = "${PS2DEV}/ps2sdk/ps2dev.cmake"
job.clang_tidy = False
job.run_tests = False
@@ -572,10 +611,11 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
job.ldflags = ["-L${PS2DEV}/ps2sdk/ee/lib", "-L${PS2DEV}/gsKit/lib", "-L${PS2DEV}/ps2sdk/ports/lib", ]
job.static_lib = StaticLibType.A
case SdlPlatform.Psp:
job.ccache = False # actions/ccache does not work in psp container (incompatible tar of busybox)
build_parallel = False
job.sudo = ""
job.apt_packages = []
job.apk_packages = ["cmake", "gmp", "mpc1", "mpfr4", "ninja", "pkgconf", ]
job.apk_packages = ["ccache", "cmake", "gmp", "mpc1", "mpfr4", "ninja", "pkgconf", ]
job.cmake_toolchain_file = "${PSPDEV}/psp/share/pspdev.cmake"
job.clang_tidy = False
job.run_tests = False
@@ -585,9 +625,10 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
job.pollute_directories = ["${PSPDEV}/include", "${PSPDEV}/psp/include", "${PSPDEV}/psp/sdk/include", ]
job.static_lib = StaticLibType.A
case SdlPlatform.Vita:
job.ccache = True
job.sudo = ""
job.apt_packages = []
job.apk_packages = ["cmake", "ninja", "pkgconf", "bash", "tar"]
job.apk_packages = ["ccache", "cmake", "ninja", "pkgconf", "bash", "tar"]
job.cmake_toolchain_file = "${VITASDK}/share/vita.toolchain.cmake"
assert spec.vita_gles is not None
job.setup_vita_gles_type = {
@@ -608,32 +649,38 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
job.cc = "arm-vita-eabi-gcc"
job.static_lib = StaticLibType.A
case SdlPlatform.Haiku:
job.ccache = True
fpic = False
job.run_tests = False
job.apt_packages.append("ccache")
job.cc = "x86_64-unknown-haiku-gcc"
job.cxx = "x86_64-unknown-haiku-g++"
job.sudo = ""
job.cmake_arguments.extend((
f"-DCMAKE_C_COMPILER={job.cc}",
f"-DCMAKE_CXX_COMPILER={job.cxx}",
"-DSDL_UNIX_CONSOLE_BUILD=ON",
"-DCMAKE_SYSTEM_NAME=Haiku",
))
job.shared_lib = SharedLibType.SO_0
job.static_lib = StaticLibType.A
case SdlPlatform.PowerPC64 | SdlPlatform.PowerPC:
job.ccache = True
# FIXME: Enable SDL_WERROR
job.werror = False
job.clang_tidy = False
job.run_tests = False
job.sudo = ""
job.apt_packages = []
job.apt_packages = ["ccache"]
job.shared_lib = SharedLibType.SO_0
job.static_lib = StaticLibType.A
job.cmake_arguments.extend((
"-DSDL_UNIX_CONSOLE_BUILD=ON",
))
case SdlPlatform.LoongArch64:
job.ccache = True
fpic = True
job.run_tests = False
job.apt_packages.append("ccache")
job.cc = "${LOONGARCH64_CC}"
job.cxx = "${LOONGARCH64_CXX}"
job.cmake_arguments.extend((
@@ -645,31 +692,36 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
job.shared_lib = SharedLibType.SO_0
job.static_lib = StaticLibType.A
case SdlPlatform.N3ds:
job.cmake_generator = "Unix Makefiles"
job.cmake_build_arguments.append("-j$(nproc)")
job.ccache = False
job.shared = False
job.apt_packages = ["ninja-build", "binutils"]
job.apt_packages = []
job.clang_tidy = False
job.run_tests = False
job.cc_from_cmake = True
job.cmake_toolchain_file = "${DEVKITPRO}/cmake/3DS.cmake"
job.binutils_strings = "/opt/devkitpro/devkitARM/bin/arm-none-eabi-strings"
job.static_lib = StaticLibType.A
case SdlPlatform.Msys2:
job.ccache = True
job.shell = "msys2 {0}"
assert spec.msys2_platform
job.msys2_msystem = spec.msys2_platform.value
job.msys2_env = {
"mingw32": "mingw-w64-i686",
"mingw64": "mingw-w64-x86_64",
"clang32": "mingw-w64-clang-i686",
"clang64": "mingw-w64-clang-x86_64",
"ucrt64": "mingw-w64-ucrt-x86_64",
}[spec.msys2_platform.value]
job.msys2_no_perl = spec.msys2_platform in (Msys2Platform.Mingw32, Msys2Platform.Clang32)
job.msys2_no_perl = spec.msys2_platform in (Msys2Platform.Mingw32, )
job.shared_lib = SharedLibType.WIN32
job.static_lib = StaticLibType.A
case SdlPlatform.Riscos:
job.ccache = False # FIXME: enable when container gets upgrade
# FIXME: Enable SDL_WERROR
job.werror = False
job.apt_packages = ["cmake", "ninja-build"]
job.apt_packages = ["ccache", "cmake", "ninja-build"]
job.test_pkg_config = False
job.shared = False
job.run_tests = False
@@ -681,7 +733,7 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
))
job.cmake_toolchain_file = "/home/riscos/env/toolchain-riscos.cmake"
job.static_lib = StaticLibType.A
case SdlPlatform.FreeBSD | SdlPlatform.NetBSD:
case SdlPlatform.FreeBSD | SdlPlatform.NetBSD | SdlPlatform.OpenBSD:
job.cpactions = True
job.no_cmake = True
job.run_tests = False
@@ -701,22 +753,47 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
))
case SdlPlatform.NetBSD:
job.cpactions_os = "netbsd"
job.cpactions_version = "10.0"
job.cpactions_version = "10.1"
job.cpactions_arch = "x86-64"
job.cpactions_setup_cmd = "export PATH=\"/usr/pkg/sbin:/usr/pkg/bin:/sbin:$PATH\"; export PKG_CONFIG_PATH=\"/usr/pkg/lib/pkgconfig\";export PKG_PATH=\"https://cdn.netBSD.org/pub/pkgsrc/packages/NetBSD/$(uname -p)/$(uname -r|cut -f \"1 2\" -d.)/All/\";echo \"PKG_PATH=$PKG_PATH\";echo \"uname -a -> \"$(uname -a)\"\";sudo -E sysctl -w security.pax.aslr.enabled=0;sudo -E sysctl -w security.pax.aslr.global=0;sudo -E pkgin clean;sudo -E pkgin update"
job.cpactions_install_cmd = "sudo -E pkgin -y install cmake dbus pkgconf ninja-build pulseaudio libxkbcommon wayland wayland-protocols libinotify libusb1"
case SdlPlatform.OpenBSD:
job.cpactions_os = "openbsd"
job.cpactions_version = "7.4"
job.cpactions_arch = "x86-64"
job.cpactions_setup_cmd = "sudo pkg_add -u"
job.cpactions_install_cmd = "sudo pkg_add cmake ninja pkgconf wayland wayland-protocols xwayland libxkbcommon libinotify pulseaudio dbus ibus"
case SdlPlatform.NGage:
build_parallel = False
job.cmake_build_type = "Release"
job.setup_ninja = True
job.static_lib = StaticLibType.STATIC_LIB
job.shared_lib = None
job.clang_tidy = False
job.werror = False # FIXME: enable SDL_WERROR
job.shared = False
job.run_tests = False
job.setup_gage_sdk_path = "C:/ngagesdk"
job.cmake_toolchain_file = "C:/ngagesdk/cmake/ngage-toolchain.cmake"
job.test_pkg_config = False
case _:
raise ValueError(f"Unsupported platform={spec.platform}")
if "ubuntu" in spec.name.lower():
job.check_sources = True
job.setup_python = True
if job.ccache:
job.cmake_arguments.extend((
"-DCMAKE_C_COMPILER_LAUNCHER=ccache",
"-DCMAKE_CXX_COMPILER_LAUNCHER=ccache",
))
if not build_parallel:
job.cmake_build_arguments.append("-j1")
if job.cflags:
job.cmake_arguments.append(f"-DCMAKE_C_FLAGS=\"{my_shlex_join(job.cflags)}\"")
if job.cxxflags:
job.cmake_arguments.append(f"-DCMAKE_CXX_FLAGS=\"{my_shlex_join(job.cxxflags)}\"")
if job.cflags or job.cppflags:
job.cmake_arguments.append(f"-DCMAKE_C_FLAGS=\"{my_shlex_join(job.cflags + job.cppflags)}\"")
if job.cxxflags or job.cppflags:
job.cmake_arguments.append(f"-DCMAKE_CXX_FLAGS=\"{my_shlex_join(job.cxxflags + job.cppflags)}\"")
if job.ldflags:
job.cmake_arguments.append(f"-DCMAKE_SHARED_LINKER_FLAGS=\"{my_shlex_join(job.ldflags)}\"")
job.cmake_arguments.append(f"-DCMAKE_EXE_LINKER_FLAGS=\"{my_shlex_join(job.ldflags)}\"")

View File

@@ -34,6 +34,7 @@ jobs:
${{ (!matrix.platform.msys2-no-perl && format('{0}-perl', matrix.platform.msys2-env)) || '' }}
${{ matrix.platform.msys2-env }}-pkg-config
${{ matrix.platform.msys2-env }}-clang-tools-extra
${{ (matrix.platform.ccache && format('{0}-ccache', matrix.platform.msys2-env)) || '' }}
- name: 'About this job'
run: |
echo "key=${{ matrix.platform.key }}"
@@ -75,7 +76,7 @@ jobs:
id: setup-ndk
with:
local-cache: true
ndk-version: r21e
ndk-version: r28c
- name: 'Configure Android NDK variables'
if: ${{ matrix.platform.android-ndk }}
shell: sh
@@ -92,6 +93,11 @@ jobs:
with:
arch: ${{ matrix.platform.msvc-vcvars-arch }}
sdk: ${{ matrix.platform.msvc-vcvars-sdk }}
- name: 'Set up Nokia N-Gage SDK'
uses: ./.github/actions/setup-ngage-sdk
if: ${{ matrix.platform.setup-ngage-sdk-path != '' }}
with:
path: '${{ matrix.platform.setup-ngage-sdk-path }}'
- name: 'Set up Windows GDK Desktop'
uses: ./.github/actions/setup-gdk-desktop
if: ${{ matrix.platform.setup-gdk-folder != '' }}
@@ -133,6 +139,15 @@ jobs:
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
brew update
brew install ${{ matrix.platform.brew-packages }}
- name: 'Setup Python'
uses: 'actions/setup-python@main'
if: ${{ matrix.platform.setup-python }}
with:
python-version: '3.x'
- name: 'Install PyPI packages'
if: ${{ matrix.platform.pypi-packages != '' }}
run: |
python -m pip install --user ${{ matrix.platform.pypi-packages }}
- name: 'Set up GLES for VITA' # Must be after apk
if: ${{ matrix.platform.setup-vita-gles-type != '' }}
uses: ./.github/actions/setup-vita-gles
@@ -156,12 +171,42 @@ jobs:
done
done
- name: 'Calculate ccache key'
if: ${{ matrix.platform.ccache }}
id: prepare-restore-ccache
run: |
echo "timestamp=$(date -u "+%Y%m%d%H%M_%S")" >> "$GITHUB_OUTPUT"
- name: 'Restore ccache'
if: ${{ matrix.platform.ccache }}
uses: actions/cache/restore@v4
id: restore-ccache
with:
path: ${{ runner.temp }}/ccache
key: ccache-${{ matrix.platform.key }}-${{ steps.prepare-restore-ccache.outputs.timestamp }}
restore-keys: |
ccache-${{matrix.platform.key}}
- name: 'Configure ccache'
if: ${{ matrix.platform.ccache }}
run: |
echo 'CCACHE_DIR=${{ runner.temp }}/ccache' >>${GITHUB_ENV}
- name: 'Prepare ccache'
if: ${{ matrix.platform.ccache && steps.restore-ccache.outputs.cache-hit }}
run: |
if [ "x${{ runner.os }}" = "xmacOS" ]; then
touch_date="2025-02-01T12:00:00Z"
else
touch_date="2025-02-01"
fi
find "${CCACHE_DIR}" -type f -exec touch -a -m -d "$touch_date" {} +
ccache -s
ccache -z
- name: 'Configure (CMake)'
if: ${{ !matrix.platform.no-cmake }}
#shell: ${{ matrix.platform.shell }}
run: |
${{ matrix.platform.source-cmd }}
${{ matrix.platform.cmake-config-emulator }} cmake -S . -B build -GNinja \
${{ matrix.platform.cmake-config-emulator }} cmake -S . -B build -G "${{ matrix.platform.cmake-generator }}" \
-Wdeprecated -Wdev -Werror \
${{ matrix.platform.cmake-toolchain-file != '' && format('-DCMAKE_TOOLCHAIN_FILE={0}', matrix.platform.cmake-toolchain-file) || '' }} \
-DSDL_WERROR=${{ matrix.platform.werror }} \
@@ -192,9 +237,9 @@ jobs:
run: |
echo "This should show us the SDL_REVISION"
echo "Shared library:"
${{ (matrix.platform.shared-lib && format('strings build/{0} | grep "Github Workflow"', matrix.platform.shared-lib)) || 'echo "<Shared library not supported by platform>"' }}
${{ (matrix.platform.shared-lib && format('{0} build/{1} | grep "Github Workflow"', matrix.platform.binutils-strings, matrix.platform.shared-lib)) || 'echo "<Shared library not supported by platform>"' }}
echo "Static library:"
${{ (matrix.platform.static-lib && format('strings build/{0} | grep "Github Workflow"', matrix.platform.static-lib)) || 'echo "<Static library not supported by platform>"' }}
${{ (matrix.platform.static-lib && format('{0} build/{1} | grep "Github Workflow"', matrix.platform.binutils-strings, matrix.platform.static-lib)) || 'echo "<Static library not supported by platform>"' }}
- name: 'Run build-time tests (CMake)'
id: tests
if: ${{ !matrix.platform.no-cmake && matrix.platform.run-tests }}
@@ -281,7 +326,7 @@ jobs:
- name: 'Build (cross-platform-actions, BSD)'
id: cpactions
if: ${{ matrix.platform.cpactions }}
uses: cross-platform-actions/action@v0.26.0
uses: cross-platform-actions/action@v0.27.0
with:
operating_system: '${{ matrix.platform.cpactions-os }}'
architecture: '${{ matrix.platform.cpactions-arch }}'
@@ -348,11 +393,17 @@ jobs:
if: ${{ matrix.platform.xcode-sdk != '' }}
run: |
xcodebuild -project Xcode/SDL/SDL.xcodeproj -target SDL3 -configuration Release -sdk ${{ matrix.platform.xcode-sdk }} clean build
- name: 'Setup Python'
uses: 'actions/setup-python@main'
if: ${{ matrix.platform.check-sources }}
- name: 'Prune old ccache files'
if: ${{ matrix.platform.ccache }}
run: |
ccache --evict-older-than=1d
ccache -s
- name: 'Save ccache'
if: ${{ matrix.platform.ccache }}
uses: actions/cache/save@v4
with:
python-version: '3.x'
path: ${{ runner.temp }}/ccache
key: ${{ steps.restore-ccache.outputs.cache-primary-key }}
- name: 'Check Sources'
if: ${{ matrix.platform.check-sources }}
run: |
@@ -360,6 +411,14 @@ jobs:
build-scripts/test-versioning.sh
python build-scripts/check_android_jni.py
python build-scripts/check_stdlib_usage.py
- name: 'Verify alignment of Android test apks'
if: ${{ matrix.platform.android-ndk && !matrix.platform.no-cmake }}
run: |
find ./ -iname '*.apk' | xargs -L1 ./build-scripts/check_elf_alignment.sh
- name: 'Verify alignment of Android .so files'
if: ${{ matrix.platform.android-ndk && !matrix.platform.no-cmake }}
run: |
find ./ -iname '*.so' | xargs -L1 ./build-scripts/check_elf_alignment.sh
- name: 'Upload binary package'
uses: actions/upload-artifact@v4
if: ${{ always() && matrix.platform.artifact != '' && (steps.package.outcome == 'success' || steps.cpactions.outcome == 'success') && (matrix.platform.enable-artifacts || steps.tests.outcome == 'failure') }}
@@ -382,4 +441,4 @@ jobs:
with:
if-no-files-found: error
name: '${{ matrix.platform.artifact }}-apks'
path: build/test/*.apk
path: build/test/*.apk

View File

@@ -256,7 +256,7 @@ jobs:
msvc:
needs: [src]
runs-on: windows-2019
runs-on: windows-2025
outputs:
VC-x86: ${{ steps.releaser.outputs.VC-x86 }}
VC-x64: ${{ steps.releaser.outputs.VC-x64 }}
@@ -532,10 +532,11 @@ jobs:
with:
sparse-checkout: 'build-scripts/build-release.py'
- name: 'Setup Android NDK'
id: setup-ndk
uses: nttld/setup-ndk@v1
with:
local-cache: true
ndk-version: r21e
ndk-version: r28c
- name: 'Setup Java JDK'
uses: actions/setup-java@v4
with:
@@ -561,6 +562,8 @@ jobs:
run: |
python build-scripts/build-release.py \
--actions android \
--android-api 21 \
--android-ndk-home "${{ steps.setup-ndk.outputs.ndk-path }}" \
--commit ${{ inputs.commit }} \
--root "${{ steps.tar.outputs.path }}" \
--github \

View File

@@ -9,12 +9,13 @@ versionfname = include/SDL3/SDL_version.h
versionmajorregex = \A\#define\s+SDL_MAJOR_VERSION\s+(\d+)\Z
versionminorregex = \A\#define\s+SDL_MINOR_VERSION\s+(\d+)\Z
versionmicroregex = \A\#define\s+SDL_MICRO_VERSION\s+(\d+)\Z
apipropertyregex = \A\s*\#\s*define\s+SDL_PROP_
selectheaderregex = \ASDL.*?\.h\Z
projecturl = https://libsdl.org/
wikiurl = https://wiki.libsdl.org
bugreporturl = https://github.com/libsdl-org/sdlwiki/issues/new
warn_about_missing = 0
wikipreamble = (This is the documentation for SDL3, which is the current stable version. [SDL2](https://wiki.libsdl.org/SDL2/) was the previous version!)
#wikipreamble = (This is the documentation for SDL3, which is the current stable version. [SDL2](https://wiki.libsdl.org/SDL2/) was the previous version!)
wikiheaderfiletext = Defined in [<SDL3/%fname%>](https://github.com/libsdl-org/SDL/blob/main/include/SDL3/%fname%)
manpageheaderfiletext = Defined in SDL3/%fname%
@@ -25,8 +26,16 @@ manpagesymbolfilterregex = \A[US]int\d+\Z
headercategoryeval = s/\ASDL_test_?.*?\.h\Z//; s/\ASDL_?(.*?)\.h\Z/$1/; ucfirst();
quickrefenabled = 1
quickrefcategoryorder = Init,Hints,Error,Version,Properties,Log,Video,Events,Keyboard,Mouse,Touch,Gamepad,Joystick,Haptic,Audio,Time,Timer,Render,SharedObject,Thread,Mutex,Atomic,Filesystem,IOStream,AsyncIO,Storage,Pixels,Surface,Blendmode,Rect,Camera,Clipboard,Dialog,GPU,Messagebox,Vulkan,Metal,Platform,Power,Sensor,Process,Bits,Endian,Assert,CPUInfo,Intrinsics,Locale,System,Misc,GUID,Main,Stdinc
quickrefcategoryorder = Init,Hints,Error,Version,Properties,Log,Video,Events,Keyboard,Mouse,Touch,Gamepad,Joystick,Haptic,Audio,Time,Timer,Render,SharedObject,Thread,Mutex,Atomic,Filesystem,IOStream,AsyncIO,Storage,Pixels,Surface,Blendmode,Rect,Camera,Clipboard,Dialog,Tray,Messagebox,GPU,Vulkan,Metal,Platform,Power,Sensor,Process,Bits,Endian,Assert,CPUInfo,Intrinsics,Locale,System,Misc,GUID,Main,Stdinc
quickreftitle = SDL3 API Quick Reference
quickrefurl = https://libsdl.org/
quickrefdesc = The latest version of this document can be found at https://wiki.libsdl.org/SDL3/QuickReference
quickrefmacroregex = \A(SDL_PLATFORM_.*|SDL_.*_INTRINSICS|SDL_Atomic...Ref|SDL_assert.*?|SDL_COMPILE_TIME_ASSERT|SDL_arraysize|SDL_Swap[BL]E\d\d|SDL_[a-z]+_cast)\Z
envvarenabled = 1
envvartitle = SDL3 Environment Variables
envvardesc = SDL3 can be controlled by the user, externally, with environment variables. They are all operate exactly like the [hints you can get and set programmatically](CategoryHints), but named without the `_HINT` part (so `"SDL_HINT_A"` would be environment variable `"SDL_A"`).\n\nThis list matches the latest in SDL3's revision control.
envvarsymregex = \ASDL_HINT_(.*)\Z
envvarsymreplace = SDL_$1

View File

@@ -42,6 +42,7 @@ LOCAL_SRC_FILES := \
$(wildcard $(LOCAL_PATH)/src/haptic/*.c) \
$(wildcard $(LOCAL_PATH)/src/haptic/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/haptic/dummy/*.c) \
$(wildcard $(LOCAL_PATH)/src/haptic/hidapi/*.c) \
$(wildcard $(LOCAL_PATH)/src/hidapi/*.c) \
$(wildcard $(LOCAL_PATH)/src/hidapi/android/*.cpp) \
$(wildcard $(LOCAL_PATH)/src/joystick/*.c) \

File diff suppressed because it is too large Load Diff

View File

@@ -3,6 +3,7 @@
SDL supports a number of development environments:
- [CMake](docs/INTRO-cmake.md)
- [Visual Studio on Windows](docs/INTRO-visualstudio.md)
- [gcc on Windows](docs/INTRO-mingw.md)
- [Xcode on Apple platforms](docs/INTRO-xcode.md)
- [Android Studio](docs/INTRO-androidstudio.md)
- [Emscripten for web](docs/INTRO-emscripten.md)

View File

@@ -115,6 +115,7 @@
<TypeLibraryName>.\Debug/SDL.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\include\build_config;$(ProjectDir)\..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -145,6 +146,7 @@
<TypeLibraryName>.\Debug/SDL.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\include\build_config;$(ProjectDir)\..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -166,8 +168,8 @@
</Link>
<PreBuildEvent>
<Command>
call $(ProjectDir)..\..\src\render\direct3d12\compile_shaders_xbox.bat $(ProjectDir)..\
call $(ProjectDir)..\..\src\gpu\d3d12\compile_shaders_xbox.bat $(ProjectDir)..\
call "$(ProjectDir)..\..\src\render\direct3d12\compile_shaders_xbox.bat" "$(ProjectDir)..\"
call "$(ProjectDir)..\..\src\gpu\d3d12\compile_shaders_xbox.bat" "$(ProjectDir)..\"
</Command>
</PreBuildEvent>
<PreBuildEvent>
@@ -182,6 +184,7 @@
<TypeLibraryName>.\Debug/SDL.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\include\build_config;$(ProjectDir)\..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -219,6 +222,7 @@
<TypeLibraryName>.\Release/SDL.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\include\build_config;$(ProjectDir)\..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>DLL_EXPORT;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -250,6 +254,7 @@
<TypeLibraryName>.\Release/SDL.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\include\build_config;$(ProjectDir)\..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>DLL_EXPORT;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -288,6 +293,7 @@
<TypeLibraryName>.\Release/SDL.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\include\build_config;$(ProjectDir)\..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>DLL_EXPORT;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -418,6 +424,7 @@
<ClInclude Include="..\..\src\camera\SDL_syscamera.h" />
<ClInclude Include="..\..\src\core\gdk\SDL_gdk.h" />
<ClInclude Include="..\..\src\core\windows\SDL_directx.h" />
<ClInclude Include="..\..\src\core\windows\SDL_gameinput.h" />
<ClInclude Include="..\..\src\core\windows\SDL_hid.h" />
<ClInclude Include="..\..\src\core\windows\SDL_immdevice.h" />
<ClInclude Include="..\..\src\core\windows\SDL_windows.h" />
@@ -434,6 +441,7 @@
<ClInclude Include="..\..\src\events\SDL_displayevents_c.h" />
<ClInclude Include="..\..\src\events\SDL_dropevents_c.h" />
<ClInclude Include="..\..\src\events\SDL_events_c.h" />
<ClInclude Include="..\..\src\events\SDL_eventwatch_c.h" />
<ClInclude Include="..\..\src\events\SDL_keyboard_c.h" />
<ClInclude Include="..\..\src\events\SDL_keymap_c.h" />
<ClInclude Include="..\..\src\events\SDL_mouse_c.h" />
@@ -445,8 +453,10 @@
<ClInclude Include="..\..\src\io\SDL_sysasyncio.h" />
<ClInclude Include="..\..\src\haptic\SDL_haptic_c.h" />
<ClInclude Include="..\..\src\haptic\SDL_syshaptic.h" />
<ClInclude Include="..\..\src\haptic\SDL_hidapihaptic.h" />
<ClInclude Include="..\..\src\haptic\windows\SDL_dinputhaptic_c.h" />
<ClInclude Include="..\..\src\haptic\windows\SDL_windowshaptic_c.h" />
<ClInclude Include="..\..\src\haptic\hidapi\SDL_hidapihaptic_c.h" />
<ClInclude Include="..\..\src\hidapi\hidapi\hidapi.h" />
<ClInclude Include="..\..\src\hidapi\SDL_hidapi_c.h" />
<ClInclude Include="..\..\src\joystick\controller_type.h" />
@@ -587,6 +597,7 @@
<ClInclude Include="..\..\src\video\SDL_pixels_c.h" />
<ClInclude Include="..\..\src\video\SDL_rect_c.h" />
<ClInclude Include="..\..\src\video\SDL_RLEaccel_c.h" />
<ClInclude Include="..\..\src\video\SDL_stb_c.h" />
<ClInclude Include="..\..\src\video\SDL_surface_c.h" />
<ClInclude Include="..\..\src\video\SDL_sysvideo.h" />
<ClInclude Include="..\..\src\video\SDL_vulkan_internal.h" />
@@ -633,6 +644,7 @@
<ClCompile Include="..\..\src\audio\SDL_wave.c" />
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi.c" />
<ClCompile Include="..\..\src\core\SDL_core_unsupported.c" />
<ClCompile Include="..\..\src\core\windows\SDL_gameinput.cpp"/>
<ClCompile Include="..\..\src\core\windows\SDL_hid.c" />
<ClCompile Include="..\..\src\core\windows\SDL_immdevice.c" />
<ClCompile Include="..\..\src\core\windows\SDL_windows.c" />
@@ -666,6 +678,7 @@
<ClCompile Include="..\..\src\events\SDL_displayevents.c" />
<ClCompile Include="..\..\src\events\SDL_dropevents.c" />
<ClCompile Include="..\..\src\events\SDL_events.c" />
<ClCompile Include="..\..\src\events\SDL_eventwatch.c" />
<ClCompile Include="..\..\src\events\SDL_keyboard.c" />
<ClCompile Include="..\..\src\events\SDL_keymap.c" />
<ClCompile Include="..\..\src\events\SDL_mouse.c" />
@@ -691,28 +704,36 @@
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">stdcpp17</LanguageStandard>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">stdcpp17</LanguageStandard>
</ClCompile>
<ClCompile Include="..\..\src\haptic\hidapi\SDL_hidapihaptic.c" />
<ClCompile Include="..\..\src\haptic\hidapi\SDL_hidapihaptic_lg4ff.c" />
<ClCompile Include="..\..\src\hidapi\SDL_hidapi.c" />
<ClCompile Include="..\..\src\joystick\controller_type.c" />
<ClCompile Include="..\..\src\joystick\dummy\SDL_sysjoystick.c" />
<ClCompile Include="..\..\src\joystick\gdk\SDL_gameinputjoystick.c" />
<ClCompile Include="..\..\src\joystick\gdk\SDL_gameinputjoystick.cpp" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapijoystick.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_8bitdo.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_flydigi.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_combined.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_gamecube.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_gip.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_luna.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_ps3.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_ps4.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_ps5.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_rumble.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_shield.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_sinput.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_stadia.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam_hori.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steamdeck.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_switch.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_switch2.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_wii.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xbox360.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xbox360w.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xboxone.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_lg4ff.c" />
<ClCompile Include="..\..\src\joystick\SDL_gamepad.c" />
<ClCompile Include="..\..\src\joystick\SDL_joystick.c" />
<ClCompile Include="..\..\src\joystick\SDL_steam_virtual_gamepad.c" />
@@ -744,6 +765,7 @@
<ClCompile Include="..\..\src\loadso\windows\SDL_sysloadso.c" />
<ClCompile Include="..\..\src\locale\SDL_locale.c" />
<ClCompile Include="..\..\src\locale\windows\SDL_syslocale.c" />
<ClCompile Include="..\..\src\misc\SDL_libusb.c" />
<ClCompile Include="..\..\src\misc\SDL_url.c" />
<ClCompile Include="..\..\src\misc\windows\SDL_sysurl.c" />
<ClCompile Include="..\..\src\power\SDL_power.c" />
@@ -861,18 +883,18 @@
<ClCompile Include="..\..\src\video\SDL_pixels.c" />
<ClCompile Include="..\..\src\video\SDL_rect.c" />
<ClCompile Include="..\..\src\video\SDL_RLEaccel.c" />
<ClCompile Include="..\..\src\video\SDL_stb.c" />
<ClCompile Include="..\..\src\video\SDL_stretch.c" />
<ClCompile Include="..\..\src\video\SDL_surface.c" />
<ClCompile Include="..\..\src\video\SDL_video.c" />
<ClCompile Include="..\..\src\video\SDL_video_unsupported.c" />
<ClCompile Include="..\..\src\video\SDL_vulkan_utils.c" />
<ClCompile Include="..\..\src\video\SDL_yuv.c" />
<ClCompile Include="..\..\src\video\windows\SDL_surface_utils.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsclipboard.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsevents.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsframebuffer.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowskeyboard.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsgameinput.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsgameinput.cpp" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsmessagebox.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsmodes.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsmouse.c" />

View File

@@ -27,6 +27,7 @@
<ClCompile Include="..\..\src\audio\SDL_wave.c" />
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi.c" />
<ClCompile Include="..\..\src\core\SDL_core_unsupported.c" />
<ClCompile Include="..\..\src\core\windows\SDL_gameinput.cpp" />
<ClCompile Include="..\..\src\core\windows\SDL_hid.c" />
<ClCompile Include="..\..\src\core\windows\SDL_immdevice.c" />
<ClCompile Include="..\..\src\core\windows\SDL_windows.c" />
@@ -38,6 +39,7 @@
<ClCompile Include="..\..\src\events\SDL_displayevents.c" />
<ClCompile Include="..\..\src\events\SDL_dropevents.c" />
<ClCompile Include="..\..\src\events\SDL_events.c" />
<ClCompile Include="..\..\src\events\SDL_eventwatch.c" />
<ClCompile Include="..\..\src\events\SDL_keyboard.c" />
<ClCompile Include="..\..\src\events\SDL_keymap.c" />
<ClCompile Include="..\..\src\events\SDL_mouse.c" />
@@ -54,28 +56,36 @@
<ClCompile Include="..\..\src\haptic\SDL_haptic.c" />
<ClCompile Include="..\..\src\haptic\windows\SDL_dinputhaptic.c" />
<ClCompile Include="..\..\src\haptic\windows\SDL_windowshaptic.c" />
<ClCompile Include="..\..\src\haptic\hidapi\SDL_hidapihaptic.c" />
<ClCompile Include="..\..\src\haptic\hidapi\SDL_hidapihaptic_lg4ff.c" />
<ClCompile Include="..\..\src\hidapi\SDL_hidapi.c" />
<ClCompile Include="..\..\src\joystick\controller_type.c" />
<ClCompile Include="..\..\src\joystick\dummy\SDL_sysjoystick.c" />
<ClCompile Include="..\..\src\joystick\gdk\SDL_gameinputjoystick.c" />
<ClCompile Include="..\..\src\joystick\gdk\SDL_gameinputjoystick.cpp" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapijoystick.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_8bitdo.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_flydigi.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_combined.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_gamecube.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_gip.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_luna.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_ps3.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_ps4.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_ps5.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_rumble.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_shield.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_sinput.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_stadia.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam_hori.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steamdeck.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_switch.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_switch2.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_wii.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xbox360.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xbox360w.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xboxone.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_lg4ff.c" />
<ClCompile Include="..\..\src\joystick\SDL_gamepad.c" />
<ClCompile Include="..\..\src\joystick\SDL_joystick.c" />
<ClCompile Include="..\..\src\joystick\SDL_steam_virtual_gamepad.c" />
@@ -89,6 +99,7 @@
<ClCompile Include="..\..\src\loadso\windows\SDL_sysloadso.c" />
<ClCompile Include="..\..\src\locale\SDL_locale.c" />
<ClCompile Include="..\..\src\locale\windows\SDL_syslocale.c" />
<ClCompile Include="..\..\src\misc\SDL_libusb.c" />
<ClCompile Include="..\..\src\misc\SDL_url.c" />
<ClCompile Include="..\..\src\misc\windows\SDL_sysurl.c" />
<ClCompile Include="..\..\src\power\SDL_power.c" />
@@ -175,18 +186,18 @@
<ClCompile Include="..\..\src\video\SDL_pixels.c" />
<ClCompile Include="..\..\src\video\SDL_rect.c" />
<ClCompile Include="..\..\src\video\SDL_RLEaccel.c" />
<ClCompile Include="..\..\src\video\SDL_stb.c" />
<ClCompile Include="..\..\src\video\SDL_stretch.c" />
<ClCompile Include="..\..\src\video\SDL_surface.c" />
<ClCompile Include="..\..\src\video\SDL_video.c" />
<ClCompile Include="..\..\src\video\SDL_video_unsupported.c" />
<ClCompile Include="..\..\src\video\SDL_vulkan_utils.c" />
<ClCompile Include="..\..\src\video\SDL_yuv.c" />
<ClCompile Include="..\..\src\video\windows\SDL_surface_utils.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsclipboard.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsevents.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsframebuffer.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowskeyboard.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsgameinput.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsgameinput.cpp" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsmessagebox.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsmodes.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsmouse.c" />
@@ -314,6 +325,7 @@
<ClInclude Include="..\..\src\audio\wasapi\SDL_wasapi.h" />
<ClInclude Include="..\..\src\core\gdk\SDL_gdk.h" />
<ClInclude Include="..\..\src\core\windows\SDL_directx.h" />
<ClInclude Include="..\..\src\core\windows\SDL_gameinput.h" />
<ClInclude Include="..\..\src\core\windows\SDL_hid.h" />
<ClInclude Include="..\..\src\core\windows\SDL_immdevice.h" />
<ClInclude Include="..\..\src\core\windows\SDL_windows.h" />
@@ -330,6 +342,7 @@
<ClInclude Include="..\..\src\events\SDL_displayevents_c.h" />
<ClInclude Include="..\..\src\events\SDL_dropevents_c.h" />
<ClInclude Include="..\..\src\events\SDL_events_c.h" />
<ClInclude Include="..\..\src\events\SDL_eventwatch_c.h" />
<ClInclude Include="..\..\src\events\SDL_keyboard_c.h" />
<ClInclude Include="..\..\src\events\SDL_keymap_c.h" />
<ClInclude Include="..\..\src\events\SDL_mouse_c.h" />
@@ -338,8 +351,10 @@
<ClInclude Include="..\..\src\gpu\SDL_sysgpu.h" />
<ClInclude Include="..\..\src\haptic\SDL_haptic_c.h" />
<ClInclude Include="..\..\src\haptic\SDL_syshaptic.h" />
<ClInclude Include="..\..\src\haptic\SDL_hidapihaptic.h" />
<ClInclude Include="..\..\src\haptic\windows\SDL_dinputhaptic_c.h" />
<ClInclude Include="..\..\src\haptic\windows\SDL_windowshaptic_c.h" />
<ClInclude Include="..\..\src\haptic\hidapi\SDL_hidapihaptic_c.h" />
<ClInclude Include="..\..\src\hidapi\hidapi\hidapi.h" />
<ClInclude Include="..\..\src\hidapi\SDL_hidapi_c.h" />
<ClInclude Include="..\..\src\joystick\controller_type.h" />
@@ -434,6 +449,7 @@
<ClInclude Include="..\..\src\video\SDL_pixels_c.h" />
<ClInclude Include="..\..\src\video\SDL_rect_c.h" />
<ClInclude Include="..\..\src\video\SDL_RLEaccel_c.h" />
<ClInclude Include="..\..\src\video\SDL_stb_c.h" />
<ClInclude Include="..\..\src\video\SDL_surface_c.h" />
<ClInclude Include="..\..\src\video\SDL_sysvideo.h" />
<ClInclude Include="..\..\src\video\SDL_vulkan_internal.h" />

View File

@@ -103,6 +103,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">
<Midl />
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -117,6 +118,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">
<Midl />
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -131,6 +133,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">
<Midl />
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -145,6 +148,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">
<Midl />
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -159,6 +163,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">
<Midl />
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -173,6 +178,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">
<Midl />
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>

View File

@@ -121,6 +121,7 @@
<TypeLibraryName>.\Release/testcontroller.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -144,6 +145,7 @@
<TypeLibraryName>.\Release/testcontroller.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -167,6 +169,7 @@
<TypeLibraryName>.\Release/testcontroller.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -190,6 +193,7 @@
<TypeLibraryName>.\Debug/testcontroller.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -216,6 +220,7 @@
<TypeLibraryName>.\Debug/testcontroller.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -242,6 +247,7 @@
<TypeLibraryName>.\Debug/testcontroller.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>

View File

@@ -56,8 +56,7 @@ static struct
static SDL_AudioStream *stream;
/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
static void
quit(int rc)
static void quit(int rc)
{
SDL_free(sprites);
SDL_DestroyAudioStream(stream);
@@ -80,8 +79,7 @@ static int fillerup(void)
return 0;
}
void
UserLoggedIn(XUserHandle user)
static void UserLoggedIn(XUserHandle user)
{
HRESULT hr;
char gamertag[128];
@@ -96,8 +94,7 @@ UserLoggedIn(XUserHandle user)
XUserCloseHandle(user);
}
void
AddUserUICallback(XAsyncBlock *asyncBlock)
static void AddUserUICallback(XAsyncBlock *asyncBlock)
{
HRESULT hr;
XUserHandle user = NULL;
@@ -123,8 +120,7 @@ AddUserUICallback(XAsyncBlock *asyncBlock)
delete asyncBlock;
}
void
AddUserUI()
static void AddUserUI()
{
HRESULT hr;
XAsyncBlock *asyncBlock = new XAsyncBlock;
@@ -141,8 +137,7 @@ AddUserUI()
}
}
void
AddUserSilentCallback(XAsyncBlock *asyncBlock)
static void AddUserSilentCallback(XAsyncBlock *asyncBlock)
{
HRESULT hr;
XUserHandle user = NULL;
@@ -168,8 +163,7 @@ AddUserSilentCallback(XAsyncBlock *asyncBlock)
delete asyncBlock;
}
void
AddUserSilent()
static void AddUserSilent()
{
HRESULT hr;
XAsyncBlock *asyncBlock = new XAsyncBlock;
@@ -186,30 +180,27 @@ AddUserSilent()
}
}
int
LoadSprite(const char *file)
static bool LoadSprite(const char *file)
{
int i;
for (i = 0; i < state->num_windows; ++i) {
/* This does the SDL_LoadBMP step repeatedly, but that's OK for test code. */
sprites[i] = LoadTexture(state->renderers[i], file, true, &sprite_w, &sprite_h);
sprites[i] = LoadTexture(state->renderers[i], file, true);
if (!sprites[i]) {
return -1;
}
if (!SDL_SetTextureBlendMode(sprites[i], blendMode)) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't set blend mode: %s\n", SDL_GetError());
SDL_DestroyTexture(sprites[i]);
return -1;
return false;
}
sprite_w = sprites[i]->w;
sprite_h = sprites[i]->h;
SDL_SetTextureBlendMode(sprites[i], blendMode);
}
/* We're ready to roll. :) */
return 0;
return true;
}
void
DrawSprites(SDL_Renderer * renderer, SDL_Texture * sprite)
static void DrawSprites(SDL_Renderer * renderer, SDL_Texture * sprite)
{
SDL_Rect viewport;
SDL_FRect temp;
@@ -300,8 +291,7 @@ DrawSprites(SDL_Renderer * renderer, SDL_Texture * sprite)
SDL_RenderPresent(renderer);
}
void
loop()
static void loop()
{
int i;
SDL_Event event;
@@ -329,8 +319,7 @@ loop()
fillerup();
}
int
main(int argc, char *argv[])
int main(int argc, char *argv[])
{
int i;
const char *icon = "icon.bmp";
@@ -405,7 +394,7 @@ main(int argc, char *argv[])
sprites =
(SDL_Texture **) SDL_malloc(state->num_windows * sizeof(*sprites));
if (!sprites) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!\n");
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!");
quit(2);
}
for (i = 0; i < state->num_windows; ++i) {
@@ -413,20 +402,20 @@ main(int argc, char *argv[])
SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF);
SDL_RenderClear(renderer);
}
if (LoadSprite(icon) < 0) {
if (!LoadSprite(icon)) {
quit(2);
}
soundname = GetResourceFilename(argc > 1 ? argv[1] : NULL, "sample.wav");
if (!soundname) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "%s\n", SDL_GetError());
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "%s", SDL_GetError());
quit(1);
}
/* Load the wave file into memory */
if (!SDL_LoadWAV(soundname, &wave.spec, &wave.sound, &wave.soundlen)) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s\n", soundname, SDL_GetError());
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s", soundname, SDL_GetError());
quit(1);
}
@@ -436,11 +425,11 @@ main(int argc, char *argv[])
SDL_Log("%i: %s", i, SDL_GetAudioDriver(i));
}
SDL_Log("Using audio driver: %s\n", SDL_GetCurrentAudioDriver());
SDL_Log("Using audio driver: %s", SDL_GetCurrentAudioDriver());
stream = SDL_OpenAudioDeviceStream(SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, &wave.spec, NULL, NULL);
if (!stream) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create audio stream: %s\n", SDL_GetError());
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create audio stream: %s", SDL_GetError());
return -1;
}
SDL_ResumeAudioDevice(SDL_GetAudioStreamDevice(stream));

View File

@@ -121,6 +121,7 @@
<TypeLibraryName>.\Release/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -148,6 +149,7 @@
<TypeLibraryName>.\Release/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -175,6 +177,7 @@
<TypeLibraryName>.\Release/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -202,6 +205,7 @@
<TypeLibraryName>.\Debug/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -232,6 +236,7 @@
<TypeLibraryName>.\Debug/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -262,6 +267,7 @@
<TypeLibraryName>.\Debug/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>

View File

@@ -121,6 +121,7 @@
<TypeLibraryName>.\Release/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -148,6 +149,7 @@
<TypeLibraryName>.\Release/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -175,6 +177,7 @@
<TypeLibraryName>.\Release/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -202,6 +205,7 @@
<TypeLibraryName>.\Debug/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -232,6 +236,7 @@
<TypeLibraryName>.\Debug/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -262,6 +267,7 @@
<TypeLibraryName>.\Debug/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>

View File

@@ -69,7 +69,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "camera", "camera", "{AAEC83
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "01-read-and-draw", "examples\camera\01-read-and-draw\01-read-and-draw.vcxproj", "{510ACF0C-4012-4216-98EF-E4F155DE33CE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "game", "game", "{D1BF59F6-22DC-493B-BDEB-451A50DA793D}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{D1BF59F6-22DC-493B-BDEB-451A50DA793D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "01-snake", "examples\demo\01-snake\01-snake.vcxproj", "{7820969A-5B7B-4046-BB0A-82905D457FC5}"
EndProject
@@ -115,6 +115,22 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "02-woodeneye-008", "example
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "03-infinite-monkeys", "examples\demo\03-infinite-monkeys\03-infinite-monkeys.vcxproj", "{75AEE75A-C016-4497-960B-D767B822237D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "19-affine-textures", "examples\renderer\19-affine-textures\19-affine-textures.vcxproj", "{E21C50BF-54B4-434C-AA24-9A6469553987}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "04-multiple-streams", "examples\audio\04-multiple-streams\04-multiple-streams.vcxproj", "{7117A55C-BE4E-41DB-A4FC-4070E35A8B28}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "asyncio", "asyncio", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "input", "input", "{8DEAE483-FDE7-463F-9FD5-F597BBAED1F9}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "01-load-bitmaps", "examples\asyncio\01-load-bitmaps\01-load-bitmaps.vcxproj", "{6A2BFA8B-C027-400D-A18B-3E9E1CC4DDD0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "04-bytepusher", "examples\demo\04-bytepusher\04-bytepusher.vcxproj", "{3DB9B219-769E-43AC-8B8B-319DB6045DCF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "01-joystick-polling", "examples\input\01-joystick-polling\01-joystick-polling.vcxproj", "{B3852DB7-E925-4026-8B9D-D2272EFEFF3C}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "02-joystick-events", "examples\input\02-joystick-events\02-joystick-events.vcxproj", "{FCBDF2B2-1129-49AE-9406-3F219E65CA89}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -515,6 +531,54 @@ Global
{75AEE75A-C016-4497-960B-D767B822237D}.Release|Win32.Build.0 = Release|Win32
{75AEE75A-C016-4497-960B-D767B822237D}.Release|x64.ActiveCfg = Release|x64
{75AEE75A-C016-4497-960B-D767B822237D}.Release|x64.Build.0 = Release|x64
{E21C50BF-54B4-434C-AA24-9A6469553987}.Debug|Win32.ActiveCfg = Debug|Win32
{E21C50BF-54B4-434C-AA24-9A6469553987}.Debug|Win32.Build.0 = Debug|Win32
{E21C50BF-54B4-434C-AA24-9A6469553987}.Debug|x64.ActiveCfg = Debug|x64
{E21C50BF-54B4-434C-AA24-9A6469553987}.Debug|x64.Build.0 = Debug|x64
{E21C50BF-54B4-434C-AA24-9A6469553987}.Release|Win32.ActiveCfg = Release|Win32
{E21C50BF-54B4-434C-AA24-9A6469553987}.Release|Win32.Build.0 = Release|Win32
{E21C50BF-54B4-434C-AA24-9A6469553987}.Release|x64.ActiveCfg = Release|x64
{E21C50BF-54B4-434C-AA24-9A6469553987}.Release|x64.Build.0 = Release|x64
{7117A55C-BE4E-41DB-A4FC-4070E35A8B28}.Debug|Win32.ActiveCfg = Debug|Win32
{7117A55C-BE4E-41DB-A4FC-4070E35A8B28}.Debug|Win32.Build.0 = Debug|Win32
{7117A55C-BE4E-41DB-A4FC-4070E35A8B28}.Debug|x64.ActiveCfg = Debug|x64
{7117A55C-BE4E-41DB-A4FC-4070E35A8B28}.Debug|x64.Build.0 = Debug|x64
{7117A55C-BE4E-41DB-A4FC-4070E35A8B28}.Release|Win32.ActiveCfg = Release|Win32
{7117A55C-BE4E-41DB-A4FC-4070E35A8B28}.Release|Win32.Build.0 = Release|Win32
{7117A55C-BE4E-41DB-A4FC-4070E35A8B28}.Release|x64.ActiveCfg = Release|x64
{7117A55C-BE4E-41DB-A4FC-4070E35A8B28}.Release|x64.Build.0 = Release|x64
{6A2BFA8B-C027-400D-A18B-3E9E1CC4DDD0}.Debug|Win32.ActiveCfg = Debug|Win32
{6A2BFA8B-C027-400D-A18B-3E9E1CC4DDD0}.Debug|Win32.Build.0 = Debug|Win32
{6A2BFA8B-C027-400D-A18B-3E9E1CC4DDD0}.Debug|x64.ActiveCfg = Debug|x64
{6A2BFA8B-C027-400D-A18B-3E9E1CC4DDD0}.Debug|x64.Build.0 = Debug|x64
{6A2BFA8B-C027-400D-A18B-3E9E1CC4DDD0}.Release|Win32.ActiveCfg = Release|Win32
{6A2BFA8B-C027-400D-A18B-3E9E1CC4DDD0}.Release|Win32.Build.0 = Release|Win32
{6A2BFA8B-C027-400D-A18B-3E9E1CC4DDD0}.Release|x64.ActiveCfg = Release|x64
{6A2BFA8B-C027-400D-A18B-3E9E1CC4DDD0}.Release|x64.Build.0 = Release|x64
{3DB9B219-769E-43AC-8B8B-319DB6045DCF}.Debug|Win32.ActiveCfg = Debug|Win32
{3DB9B219-769E-43AC-8B8B-319DB6045DCF}.Debug|Win32.Build.0 = Debug|Win32
{3DB9B219-769E-43AC-8B8B-319DB6045DCF}.Debug|x64.ActiveCfg = Debug|x64
{3DB9B219-769E-43AC-8B8B-319DB6045DCF}.Debug|x64.Build.0 = Debug|x64
{3DB9B219-769E-43AC-8B8B-319DB6045DCF}.Release|Win32.ActiveCfg = Release|Win32
{3DB9B219-769E-43AC-8B8B-319DB6045DCF}.Release|Win32.Build.0 = Release|Win32
{3DB9B219-769E-43AC-8B8B-319DB6045DCF}.Release|x64.ActiveCfg = Release|x64
{3DB9B219-769E-43AC-8B8B-319DB6045DCF}.Release|x64.Build.0 = Release|x64
{B3852DB7-E925-4026-8B9D-D2272EFEFF3C}.Debug|Win32.ActiveCfg = Debug|Win32
{B3852DB7-E925-4026-8B9D-D2272EFEFF3C}.Debug|Win32.Build.0 = Debug|Win32
{B3852DB7-E925-4026-8B9D-D2272EFEFF3C}.Debug|x64.ActiveCfg = Debug|x64
{B3852DB7-E925-4026-8B9D-D2272EFEFF3C}.Debug|x64.Build.0 = Debug|x64
{B3852DB7-E925-4026-8B9D-D2272EFEFF3C}.Release|Win32.ActiveCfg = Release|Win32
{B3852DB7-E925-4026-8B9D-D2272EFEFF3C}.Release|Win32.Build.0 = Release|Win32
{B3852DB7-E925-4026-8B9D-D2272EFEFF3C}.Release|x64.ActiveCfg = Release|x64
{B3852DB7-E925-4026-8B9D-D2272EFEFF3C}.Release|x64.Build.0 = Release|x64
{FCBDF2B2-1129-49AE-9406-3F219E65CA89}.Debug|Win32.ActiveCfg = Debug|Win32
{FCBDF2B2-1129-49AE-9406-3F219E65CA89}.Debug|Win32.Build.0 = Debug|Win32
{FCBDF2B2-1129-49AE-9406-3F219E65CA89}.Debug|x64.ActiveCfg = Debug|x64
{FCBDF2B2-1129-49AE-9406-3F219E65CA89}.Debug|x64.Build.0 = Debug|x64
{FCBDF2B2-1129-49AE-9406-3F219E65CA89}.Release|Win32.ActiveCfg = Release|Win32
{FCBDF2B2-1129-49AE-9406-3F219E65CA89}.Release|Win32.Build.0 = Release|Win32
{FCBDF2B2-1129-49AE-9406-3F219E65CA89}.Release|x64.ActiveCfg = Release|x64
{FCBDF2B2-1129-49AE-9406-3F219E65CA89}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -572,6 +636,14 @@ Global
{608C6C67-7766-471F-BBFF-8B00086039AF} = {1B61A1B7-92DE-4C37-9151-D2928D6449AB}
{A3F601E0-B54C-4DD8-8A97-FDEF7624EE60} = {D1BF59F6-22DC-493B-BDEB-451A50DA793D}
{75AEE75A-C016-4497-960B-D767B822237D} = {D1BF59F6-22DC-493B-BDEB-451A50DA793D}
{E21C50BF-54B4-434C-AA24-9A6469553987} = {F91DDAF0-B74F-4516-A1A9-42ED8DFCBF6A}
{7117A55C-BE4E-41DB-A4FC-4070E35A8B28} = {1B61A1B7-92DE-4C37-9151-D2928D6449AB}
{02EA681E-C7D8-13C7-8484-4AC65E1B71E8} = {1498F0CD-F4DA-4847-9CB2-FB18D48061D5}
{8DEAE483-FDE7-463F-9FD5-F597BBAED1F9} = {1498F0CD-F4DA-4847-9CB2-FB18D48061D5}
{6A2BFA8B-C027-400D-A18B-3E9E1CC4DDD0} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{3DB9B219-769E-43AC-8B8B-319DB6045DCF} = {D1BF59F6-22DC-493B-BDEB-451A50DA793D}
{B3852DB7-E925-4026-8B9D-D2272EFEFF3C} = {8DEAE483-FDE7-463F-9FD5-F597BBAED1F9}
{FCBDF2B2-1129-49AE-9406-3F219E65CA89} = {8DEAE483-FDE7-463F-9FD5-F597BBAED1F9}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C320C9F2-1A8F-41D7-B02B-6338F872BCAD}

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>SDL_VENDOR_INFO="libsdl.org";%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
</Project>

View File

@@ -106,6 +106,7 @@
<TypeLibraryName>.\Debug/SDL.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;$(ProjectDir)/../../include/build_config;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -139,6 +140,7 @@
<TypeLibraryName>.\Debug/SDL.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;$(ProjectDir)/../../include/build_config;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -175,6 +177,7 @@
<TypeLibraryName>.\Release/SDL.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;$(ProjectDir)/../../include/build_config;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>DLL_EXPORT;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -209,6 +212,7 @@
<TypeLibraryName>.\Release/SDL.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;$(ProjectDir)/../../include/build_config;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>DLL_EXPORT;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -331,6 +335,7 @@
<ClInclude Include="..\..\src\camera\SDL_camera_c.h" />
<ClInclude Include="..\..\src\camera\SDL_syscamera.h" />
<ClInclude Include="..\..\src\core\windows\SDL_directx.h" />
<ClInclude Include="..\..\src\core\windows\SDL_gameinput.h" />
<ClInclude Include="..\..\src\core\windows\SDL_hid.h" />
<ClInclude Include="..\..\src\core\windows\SDL_immdevice.h" />
<ClInclude Include="..\..\src\core\windows\SDL_windows.h" />
@@ -348,6 +353,7 @@
<ClInclude Include="..\..\src\events\SDL_displayevents_c.h" />
<ClInclude Include="..\..\src\events\SDL_dropevents_c.h" />
<ClInclude Include="..\..\src\events\SDL_events_c.h" />
<ClInclude Include="..\..\src\events\SDL_eventwatch_c.h" />
<ClInclude Include="..\..\src\events\SDL_keyboard_c.h" />
<ClInclude Include="..\..\src\events\SDL_keymap_c.h" />
<ClInclude Include="..\..\src\events\SDL_mouse_c.h" />
@@ -360,8 +366,10 @@
<ClInclude Include="..\..\src\io\SDL_sysasyncio.h" />
<ClInclude Include="..\..\src\haptic\SDL_haptic_c.h" />
<ClInclude Include="..\..\src\haptic\SDL_syshaptic.h" />
<ClInclude Include="..\..\src\haptic\SDL_hidapihaptic.h" />
<ClInclude Include="..\..\src\haptic\windows\SDL_dinputhaptic_c.h" />
<ClInclude Include="..\..\src\haptic\windows\SDL_windowshaptic_c.h" />
<ClInclude Include="..\..\src\haptic\hidapi\SDL_hidapihaptic_c.h" />
<ClInclude Include="..\..\src\hidapi\hidapi\hidapi.h" />
<ClInclude Include="..\..\src\hidapi\SDL_hidapi_c.h" />
<ClInclude Include="..\..\src\joystick\controller_type.h" />
@@ -415,6 +423,16 @@
<ClCompile Include="..\..\src\camera\dummy\SDL_camera_dummy.c" />
<ClCompile Include="..\..\src\camera\mediafoundation\SDL_camera_mediafoundation.c" />
<ClCompile Include="..\..\src\camera\SDL_camera.c" />
<ClCompile Include="..\..\src\core\windows\pch_cpp.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
</ClCompile>
<ClCompile Include="..\..\src\dialog\SDL_dialog.c" />
<ClCompile Include="..\..\src\dialog\SDL_dialog_utils.c" />
<ClCompile Include="..\..\src\filesystem\SDL_filesystem.c" />
@@ -487,6 +505,7 @@
<ClInclude Include="..\..\src\video\SDL_pixels_c.h" />
<ClInclude Include="..\..\src\video\SDL_rect_c.h" />
<ClInclude Include="..\..\src\video\SDL_RLEaccel_c.h" />
<ClInclude Include="..\..\src\video\SDL_stb_c.h" />
<ClInclude Include="..\..\src\video\SDL_surface_c.h" />
<ClInclude Include="..\..\src\video\SDL_sysvideo.h" />
<ClInclude Include="..\..\src\video\SDL_vulkan_internal.h" />
@@ -533,6 +552,12 @@
<ClCompile Include="..\..\src\audio\SDL_wave.c" />
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi.c" />
<ClCompile Include="..\..\src\core\SDL_core_unsupported.c" />
<ClCompile Include="..\..\src\core\windows\SDL_gameinput.cpp">
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
</ClCompile>
<ClCompile Include="..\..\src\core\windows\SDL_hid.c" />
<ClCompile Include="..\..\src\core\windows\SDL_immdevice.c" />
<ClCompile Include="..\..\src\core\windows\SDL_windows.c" />
@@ -550,6 +575,7 @@
<ClCompile Include="..\..\src\events\SDL_displayevents.c" />
<ClCompile Include="..\..\src\events\SDL_dropevents.c" />
<ClCompile Include="..\..\src\events\SDL_events.c" />
<ClCompile Include="..\..\src\events\SDL_eventwatch.c" />
<ClCompile Include="..\..\src\events\SDL_keyboard.c" />
<ClCompile Include="..\..\src\events\SDL_keymap.c" />
<ClCompile Include="..\..\src\events\SDL_mouse.c" />
@@ -563,28 +589,41 @@
<ClCompile Include="..\..\src\haptic\SDL_haptic.c" />
<ClCompile Include="..\..\src\haptic\windows\SDL_dinputhaptic.c" />
<ClCompile Include="..\..\src\haptic\windows\SDL_windowshaptic.c" />
<ClCompile Include="..\..\src\haptic\hidapi\SDL_hidapihaptic.c" />
<ClCompile Include="..\..\src\haptic\hidapi\SDL_hidapihaptic_lg4ff.c" />
<ClCompile Include="..\..\src\hidapi\SDL_hidapi.c" />
<ClCompile Include="..\..\src\joystick\controller_type.c" />
<ClCompile Include="..\..\src\joystick\dummy\SDL_sysjoystick.c" />
<ClCompile Include="..\..\src\joystick\gdk\SDL_gameinputjoystick.c" />
<ClCompile Include="..\..\src\joystick\gdk\SDL_gameinputjoystick.cpp">
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
</ClCompile>
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapijoystick.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_8bitdo.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_flydigi.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_combined.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_gamecube.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_gip.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_luna.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_ps3.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_ps4.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_ps5.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_rumble.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_shield.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_sinput.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_stadia.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam_hori.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steamdeck.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_switch.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_switch2.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_wii.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xbox360.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xbox360w.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xboxone.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_lg4ff.c" />
<ClCompile Include="..\..\src\joystick\SDL_gamepad.c" />
<ClCompile Include="..\..\src\joystick\SDL_joystick.c" />
<ClCompile Include="..\..\src\joystick\SDL_steam_virtual_gamepad.c" />
@@ -598,6 +637,7 @@
<ClCompile Include="..\..\src\loadso\windows\SDL_sysloadso.c" />
<ClCompile Include="..\..\src\locale\SDL_locale.c" />
<ClCompile Include="..\..\src\locale\windows\SDL_syslocale.c" />
<ClCompile Include="..\..\src\misc\SDL_libusb.c" />
<ClCompile Include="..\..\src\misc\SDL_url.c" />
<ClCompile Include="..\..\src\misc\windows\SDL_sysurl.c" />
<ClCompile Include="..\..\src\power\SDL_power.c" />
@@ -698,18 +738,23 @@
<ClCompile Include="..\..\src\video\SDL_pixels.c" />
<ClCompile Include="..\..\src\video\SDL_rect.c" />
<ClCompile Include="..\..\src\video\SDL_RLEaccel.c" />
<ClCompile Include="..\..\src\video\SDL_stb.c" />
<ClCompile Include="..\..\src\video\SDL_stretch.c" />
<ClCompile Include="..\..\src\video\SDL_surface.c" />
<ClCompile Include="..\..\src\video\SDL_video.c" />
<ClCompile Include="..\..\src\video\SDL_video_unsupported.c" />
<ClCompile Include="..\..\src\video\SDL_vulkan_utils.c" />
<ClCompile Include="..\..\src\video\SDL_yuv.c" />
<ClCompile Include="..\..\src\video\windows\SDL_surface_utils.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsclipboard.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsevents.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsframebuffer.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowskeyboard.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsgameinput.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsgameinput.cpp">
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
</ClCompile>
<ClCompile Include="..\..\src\video\windows\SDL_windowsmessagebox.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsmodes.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsmouse.c" />

View File

@@ -82,6 +82,9 @@
<Filter Include="haptic\windows">
<UniqueIdentifier>{ebc2fca3-3c26-45e3-815e-3e0581d5e226}</UniqueIdentifier>
</Filter>
<Filter Include="haptic\hidapi">
<UniqueIdentifier>{06DB01C0-65B5-4DE7-8ADC-C0B0CA3A1E69}</UniqueIdentifier>
</Filter>
<Filter Include="haptic\dummy">
<UniqueIdentifier>{47c445a2-7014-4e15-9660-7c89a27dddcf}</UniqueIdentifier>
</Filter>
@@ -486,6 +489,12 @@
<ClInclude Include="..\..\src\audio\SDL_audioresample.h">
<Filter>audio</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\windows\SDL_directx.h">
<Filter>core\windows</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\windows\SDL_gameinput.h">
<Filter>core\windows</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\windows\SDL_hid.h">
<Filter>core\windows</Filter>
</ClInclude>
@@ -555,6 +564,9 @@
<ClInclude Include="..\..\src\haptic\SDL_syshaptic.h">
<Filter>haptic</Filter>
</ClInclude>
<ClInclude Include="..\..\src\haptic\SDL_hidapihaptic.h">
<Filter>haptic</Filter>
</ClInclude>
<ClInclude Include="..\..\src\haptic\SDL_haptic_c.h">
<Filter>haptic</Filter>
</ClInclude>
@@ -612,6 +624,9 @@
<ClInclude Include="..\..\src\haptic\windows\SDL_windowshaptic_c.h">
<Filter>haptic\windows</Filter>
</ClInclude>
<ClInclude Include="..\..\src\haptic\hidapi\SDL_hidapihaptic_c.h">
<Filter>haptic\hidapi</Filter>
</ClInclude>
<ClInclude Include="..\..\src\joystick\hidapi\SDL_hidapijoystick_c.h">
<Filter>joystick\hidapi</Filter>
</ClInclude>
@@ -666,6 +681,9 @@
<ClInclude Include="..\..\src\video\SDL_egl_c.h">
<Filter>video</Filter>
</ClInclude>
<ClInclude Include="..\..\src\video\SDL_stb_c.h">
<Filter>video</Filter>
</ClInclude>
<ClInclude Include="..\..\src\video\SDL_yuv_c.h">
<Filter>video</Filter>
</ClInclude>
@@ -941,6 +959,7 @@
<ClInclude Include="..\..\include\SDL3\SDL_storage.h" />
<ClInclude Include="..\..\include\SDL3\SDL_time.h" />
<ClInclude Include="..\..\src\events\SDL_categories_c.h" />
<ClInclude Include="..\..\src\events\SDL_eventwatch_c.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi.c" />
@@ -1028,6 +1047,9 @@
<ClCompile Include="..\..\src\core\SDL_core_unsupported.c">
<Filter>core</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\windows\SDL_gameinput.cpp">
<Filter>core\windows</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\windows\SDL_hid.c">
<Filter>core\windows</Filter>
</ClCompile>
@@ -1115,6 +1137,9 @@
<ClCompile Include="..\..\src\loadso\windows\SDL_sysloadso.c">
<Filter>loadso\windows</Filter>
</ClCompile>
<ClCompile Include="..\..\src\misc\SDL_libusb.c">
<Filter>misc</Filter>
</ClCompile>
<ClCompile Include="..\..\src\misc\SDL_url.c">
<Filter>misc</Filter>
</ClCompile>
@@ -1145,21 +1170,36 @@
<ClCompile Include="..\..\src\haptic\windows\SDL_windowshaptic.c">
<Filter>haptic\windows</Filter>
</ClCompile>
<ClCompile Include="..\..\src\haptic\hidapi\SDL_hidapihaptic.c">
<Filter>haptic\hidapi</Filter>
</ClCompile>
<ClCompile Include="..\..\src\haptic\hidapi\SDL_hidapihaptic_lg4ff.c">
<Filter>haptic\hidapi</Filter>
</ClCompile>
<ClCompile Include="..\..\src\haptic\dummy\SDL_syshaptic.c">
<Filter>haptic\dummy</Filter>
</ClCompile>
<ClCompile Include="..\..\src\joystick\dummy\SDL_sysjoystick.c">
<Filter>joystick\dummy</Filter>
</ClCompile>
<ClCompile Include="..\..\src\joystick\gdk\SDL_gameinputjoystick.c">
<ClCompile Include="..\..\src\joystick\gdk\SDL_gameinputjoystick.cpp">
<Filter>joystick\gdk</Filter>
</ClCompile>
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_8bitdo.c">
<Filter>joystick\hidapi</Filter>
</ClCompile>
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_flydigi.c">
<Filter>joystick\hidapi</Filter>
</ClCompile>
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_combined.c">
<Filter>joystick\hidapi</Filter>
</ClCompile>
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_gamecube.c">
<Filter>joystick\hidapi</Filter>
</ClCompile>
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_gip.c">
<Filter>joystick\hidapi</Filter>
</ClCompile>
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_luna.c">
<Filter>joystick\hidapi</Filter>
</ClCompile>
@@ -1178,6 +1218,9 @@
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_shield.c">
<Filter>joystick\hidapi</Filter>
</ClCompile>
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_sinput.c">
<Filter>joystick\hidapi</Filter>
</ClCompile>
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_stadia.c">
<Filter>joystick\hidapi</Filter>
</ClCompile>
@@ -1193,6 +1236,9 @@
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_switch.c">
<Filter>joystick\hidapi</Filter>
</ClCompile>
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_switch2.c">
<Filter>joystick\hidapi</Filter>
</ClCompile>
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_wii.c">
<Filter>joystick\hidapi</Filter>
</ClCompile>
@@ -1205,6 +1251,9 @@
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xboxone.c">
<Filter>joystick\hidapi</Filter>
</ClCompile>
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_lg4ff.c">
<Filter>joystick\hidapi</Filter>
</ClCompile>
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapijoystick.c">
<Filter>joystick\hidapi</Filter>
</ClCompile>
@@ -1283,6 +1332,9 @@
<ClCompile Include="..\..\src\video\SDL_rect.c">
<Filter>video</Filter>
</ClCompile>
<ClCompile Include="..\..\src\video\SDL_stb.c">
<Filter>video</Filter>
</ClCompile>
<ClCompile Include="..\..\src\video\SDL_stretch.c">
<Filter>video</Filter>
</ClCompile>
@@ -1310,9 +1362,6 @@
<ClCompile Include="..\..\src\video\dummy\SDL_nullvideo.c">
<Filter>video\dummy</Filter>
</ClCompile>
<ClCompile Include="..\..\src\video\windows\SDL_surface_utils.c">
<Filter>video\windows</Filter>
</ClCompile>
<ClCompile Include="..\..\src\video\windows\SDL_windowsclipboard.c">
<Filter>video\windows</Filter>
</ClCompile>
@@ -1325,7 +1374,7 @@
<ClCompile Include="..\..\src\video\windows\SDL_windowskeyboard.c">
<Filter>video\windows</Filter>
</ClCompile>
<ClCompile Include="..\..\src\video\windows\SDL_windowsgameinput.c">
<ClCompile Include="..\..\src\video\windows\SDL_windowsgameinput.cpp">
<Filter>video\windows</Filter>
</ClCompile>
<ClCompile Include="..\..\src\video\windows\SDL_windowsmessagebox.c">
@@ -1564,11 +1613,12 @@
<ClCompile Include="..\..\src\storage\generic\SDL_genericstorage.c" />
<ClCompile Include="..\..\src\storage\steam\SDL_steamstorage.c" />
<ClCompile Include="..\..\src\storage\SDL_storage.c" />
<ClCompile Include="..\..\src\events\SDL_eventwatch.c" />
<ClCompile Include="..\..\src\core\windows\pch_cpp.cpp">
<Filter>core\windows</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\src\core\windows\version.rc" />
</ItemGroup>
<ItemGroup>
<MASM Include="..\..\src\stdlib\SDL_mslibc_x64.masm" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>SDL_VENDOR_INFO="libsdl.org";%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
</Project>

View File

@@ -86,6 +86,7 @@
</Command>
</PreBuildEvent>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -104,6 +105,7 @@
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -122,6 +124,7 @@
</Command>
</PreBuildEvent>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -140,6 +143,7 @@
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>

View File

@@ -161,6 +161,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>{6A2BFA8B-C027-400D-A18B-3E9E1CC4DDD0}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ItemGroup>
<None Include="$(SolutionDir)\..\examples\asyncio\01-load-bitmaps\README.txt" />
<ClCompile Include="$(SolutionDir)\..\examples\asyncio\01-load-bitmaps\load-bitmaps.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>{7117A55C-BE4E-41DB-A4FC-4070E35A8B28}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ItemGroup>
<None Include="$(SolutionDir)\..\examples\audio\04-multiple-streams\README.txt" />
<ClCompile Include="$(SolutionDir)\..\examples\audio\04-multiple-streams\multiple-streams.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>{3DB9B219-769E-43AC-8B8B-319DB6045DCF}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ItemGroup>
<None Include="$(SolutionDir)\..\examples\demo\04-bytepusher\README.txt" />
<ClCompile Include="$(SolutionDir)\..\examples\demo\04-bytepusher\bytepusher.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@@ -47,7 +47,8 @@ def main():
for category in path.iterdir():
if category.is_dir():
for example in category.iterdir():
generate(category.name, example.name, get_c_source_filename(example))
if example.is_dir():
generate(category.name, example.name, get_c_source_filename(example))
if __name__ == "__main__":

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>{B3852DB7-E925-4026-8B9D-D2272EFEFF3C}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ItemGroup>
<None Include="$(SolutionDir)\..\examples\input\01-joystick-polling\README.txt" />
<ClCompile Include="$(SolutionDir)\..\examples\input\01-joystick-polling\joystick-polling.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>{FCBDF2B2-1129-49AE-9406-3F219E65CA89}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ItemGroup>
<None Include="$(SolutionDir)\..\examples\input\02-joystick-events\README.txt" />
<ClCompile Include="$(SolutionDir)\..\examples\input\02-joystick-events\joystick-events.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>{E21C50BF-54B4-434C-AA24-9A6469553987}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ItemGroup>
<None Include="$(SolutionDir)\..\examples\renderer\19-affine-textures\README.txt" />
<ClCompile Include="$(SolutionDir)\..\examples\renderer\19-affine-textures\affine-textures.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@@ -88,6 +88,7 @@
<TypeLibraryName>.\Debug/checkkeys.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -114,6 +115,7 @@
<TypeLibraryName>.\Debug/checkkeys.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -140,6 +142,7 @@
<TypeLibraryName>.\Release/checkkeys.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -166,6 +169,7 @@
<TypeLibraryName>.\Release/checkkeys.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>

View File

@@ -88,6 +88,7 @@
<TypeLibraryName>.\Release/loopwave.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -114,6 +115,7 @@
<TypeLibraryName>.\Release/loopwave.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -140,6 +142,7 @@
<TypeLibraryName>.\Debug/loopwave.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -166,6 +169,7 @@
<TypeLibraryName>.\Debug/loopwave.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>

View File

@@ -88,6 +88,7 @@
<TypeLibraryName>.\Debug/testatomic.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -114,6 +115,7 @@
<TypeLibraryName>.\Debug/testatomic.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -140,6 +142,7 @@
<TypeLibraryName>.\Release/testatomic.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -163,6 +166,7 @@
<TypeLibraryName>.\Release/testatomic.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>

View File

@@ -88,6 +88,7 @@
<TypeLibraryName>.\Debug/testautomation.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;$(SolutionDir)/../include/build_config;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -114,6 +115,7 @@
<TypeLibraryName>.\Debug/testautomation.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;$(SolutionDir)/../include/build_config;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -140,6 +142,7 @@
<TypeLibraryName>.\Release/testautomation.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;$(SolutionDir)/../include/build_config;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -163,6 +166,7 @@
<TypeLibraryName>.\Release/testautomation.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;$(SolutionDir)/../include/build_config;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>

View File

@@ -88,6 +88,7 @@
<TypeLibraryName>.\Release/testcontroller.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -111,6 +112,7 @@
<TypeLibraryName>.\Release/testcontroller.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -134,6 +136,7 @@
<TypeLibraryName>.\Debug/testcontroller.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -160,6 +163,7 @@
<TypeLibraryName>.\Debug/testcontroller.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>

View File

@@ -88,6 +88,7 @@
<TypeLibraryName>.\Debug/testdialog.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -114,6 +115,7 @@
<TypeLibraryName>.\Debug/testdialog.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -140,6 +142,7 @@
<TypeLibraryName>.\Release/testdialog.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -163,6 +166,7 @@
<TypeLibraryName>.\Release/testdialog.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>

View File

@@ -88,6 +88,7 @@
<TypeLibraryName>.\Release/testdraw.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -111,6 +112,7 @@
<TypeLibraryName>.\Release/testdraw.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -134,6 +136,7 @@
<TypeLibraryName>.\Debug/testdraw.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -160,6 +163,7 @@
<TypeLibraryName>.\Debug/testdraw.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>

View File

@@ -88,6 +88,7 @@
<TypeLibraryName>.\Debug/testfile.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -114,6 +115,7 @@
<TypeLibraryName>.\Debug/testfile.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -140,6 +142,7 @@
<TypeLibraryName>.\Release/testfile.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -163,6 +166,7 @@
<TypeLibraryName>.\Release/testfile.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>

View File

@@ -88,6 +88,7 @@
<TypeLibraryName>.\Debug/testgl.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -115,6 +116,7 @@
<TypeLibraryName>.\Debug/testgl.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -142,6 +144,7 @@
<TypeLibraryName>.\Release/testgl.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>NDEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -166,6 +169,7 @@
<TypeLibraryName>.\Release/testgl.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>NDEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions)</PreprocessorDefinitions>

View File

@@ -88,6 +88,7 @@
<TypeLibraryName>.\Debug/testgles2.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -114,6 +115,7 @@
<TypeLibraryName>.\Debug/testgles2.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -140,6 +142,7 @@
<TypeLibraryName>.\Release/testgles2.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -163,6 +166,7 @@
<TypeLibraryName>.\Release/testgles2.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>

View File

@@ -88,6 +88,7 @@
<TypeLibraryName>.\Release/testoverlay.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -111,6 +112,7 @@
<TypeLibraryName>.\Release/testoverlay.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -134,6 +136,7 @@
<TypeLibraryName>.\Debug/testoverlay.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -160,6 +163,7 @@
<TypeLibraryName>.\Debug/testoverlay.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>

View File

@@ -88,6 +88,7 @@
<TypeLibraryName>.\Debug/testpower.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -114,6 +115,7 @@
<TypeLibraryName>.\Debug/testpower.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -140,6 +142,7 @@
<TypeLibraryName>.\Release/testpower.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -163,6 +166,7 @@
<TypeLibraryName>.\Release/testpower.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>

View File

@@ -90,6 +90,7 @@
</HeaderFileName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -119,6 +120,7 @@
</HeaderFileName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -148,6 +150,7 @@
</HeaderFileName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -174,6 +177,7 @@
</HeaderFileName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>

View File

@@ -88,6 +88,7 @@
<TypeLibraryName>.\Debug/testpower.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -114,6 +115,7 @@
<TypeLibraryName>.\Debug/testpower.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -140,6 +142,7 @@
<TypeLibraryName>.\Release/testpower.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -163,6 +166,7 @@
<TypeLibraryName>.\Release/testpower.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>

View File

@@ -88,6 +88,7 @@
<TypeLibraryName>.\Release/testrendertarget.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -111,6 +112,7 @@
<TypeLibraryName>.\Release/testrendertarget.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -134,6 +136,7 @@
<TypeLibraryName>.\Debug/testrendertarget.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -160,6 +163,7 @@
<TypeLibraryName>.\Debug/testrendertarget.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>

View File

@@ -88,6 +88,7 @@
<TypeLibraryName>.\Debug/testrumble.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -114,6 +115,7 @@
<TypeLibraryName>.\Debug/testrumble.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -140,6 +142,7 @@
<TypeLibraryName>.\Release/testrumble.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -163,6 +166,7 @@
<TypeLibraryName>.\Release/testrumble.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>

View File

@@ -88,6 +88,7 @@
<TypeLibraryName>.\Release/testscale.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -111,6 +112,7 @@
<TypeLibraryName>.\Release/testscale.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -134,6 +136,7 @@
<TypeLibraryName>.\Debug/testscale.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -160,6 +163,7 @@
<TypeLibraryName>.\Debug/testscale.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>

View File

@@ -88,6 +88,7 @@
<TypeLibraryName>.\Debug/testsensor.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -114,6 +115,7 @@
<TypeLibraryName>.\Debug/testsensor.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -140,6 +142,7 @@
<TypeLibraryName>.\Release/testsensor.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -163,6 +166,7 @@
<TypeLibraryName>.\Release/testsensor.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>

View File

@@ -88,6 +88,7 @@
<TypeLibraryName>.\Release/testshape.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -111,6 +112,7 @@
<TypeLibraryName>.\Release/testshape.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -134,6 +136,7 @@
<TypeLibraryName>.\Debug/testshape.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -160,6 +163,7 @@
<TypeLibraryName>.\Debug/testshape.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>

View File

@@ -88,6 +88,7 @@
<TypeLibraryName>.\Release/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -111,6 +112,7 @@
<TypeLibraryName>.\Release/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -134,6 +136,7 @@
<TypeLibraryName>.\Debug/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -160,6 +163,7 @@
<TypeLibraryName>.\Debug/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>

View File

@@ -88,6 +88,7 @@
<TypeLibraryName>.\Release/testsurround.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -114,6 +115,7 @@
<TypeLibraryName>.\Release/testsurround.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -140,6 +142,7 @@
<TypeLibraryName>.\Debug/testsurround.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -166,6 +169,7 @@
<TypeLibraryName>.\Debug/testsurround.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>

View File

@@ -88,6 +88,7 @@
<TypeLibraryName>.\Debug/testvulkan.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -114,6 +115,7 @@
<TypeLibraryName>.\Debug/testvulkan.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -140,6 +142,7 @@
<TypeLibraryName>.\Release/testvulkan.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>NDEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -163,6 +166,7 @@
<TypeLibraryName>.\Release/testvulkan.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>NDEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions)</PreprocessorDefinitions>

View File

@@ -88,6 +88,7 @@
<TypeLibraryName>.\Debug/testwm.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -114,6 +115,7 @@
<TypeLibraryName>.\Debug/testwm.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -140,6 +142,7 @@
<TypeLibraryName>.\Release/testwm.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -163,6 +166,7 @@
<TypeLibraryName>.\Release/testwm.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>

View File

@@ -88,6 +88,7 @@
<TypeLibraryName>.\Release/testyuv.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -111,6 +112,7 @@
<TypeLibraryName>.\Release/testyuv.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -134,6 +136,7 @@
<TypeLibraryName>.\Debug/testyuv.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -160,6 +163,7 @@
<TypeLibraryName>.\Debug/testyuv.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>

View File

@@ -1,6 +1,16 @@
This is a list of major changes in SDL's version history.
---------------------------------------------------------------------------
3.2.10:
---------------------------------------------------------------------------
* Added SDL_HINT_VIDEO_X11_EXTERNAL_WINDOW_INPUT to control whether XSelectInput() should be called on external windows to enable input events.
---------------------------------------------------------------------------
3.2.4:
---------------------------------------------------------------------------
* Added SDL_StretchSurface()
---------------------------------------------------------------------------
3.2.0:
---------------------------------------------------------------------------

View File

@@ -19,10 +19,10 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>3.1.10</string>
<string>3.3.0</string>
<key>CFBundleSignature</key>
<string>SDLX</string>
<key>CFBundleVersion</key>
<string>3.1.10</string>
<string>3.3.0</string>
</dict>
</plist>

View File

@@ -71,7 +71,12 @@
63134A262A7902FD0021E9A6 /* SDL_pen.c in Sources */ = {isa = PBXBuildFile; fileRef = 63134A242A7902FD0021E9A6 /* SDL_pen.c */; };
75E0915A241EA924004729E1 /* SDL_virtualjoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = 75E09158241EA924004729E1 /* SDL_virtualjoystick.c */; };
75E09163241EA924004729E1 /* SDL_virtualjoystick_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 75E09159241EA924004729E1 /* SDL_virtualjoystick_c.h */; };
89E5801E2D03602200DAF6D3 /* SDL_hidapi_lg4ff.c in Sources */ = {isa = PBXBuildFile; fileRef = 89E5801D2D03602200DAF6D3 /* SDL_hidapi_lg4ff.c */; };
89E580232D03606400DAF6D3 /* SDL_hidapihaptic.c in Sources */ = {isa = PBXBuildFile; fileRef = 89E5801F2D03606400DAF6D3 /* SDL_hidapihaptic.c */; };
89E580242D03606400DAF6D3 /* SDL_hidapihaptic_lg4ff.c in Sources */ = {isa = PBXBuildFile; fileRef = 89E580212D03606400DAF6D3 /* SDL_hidapihaptic_lg4ff.c */; };
89E580252D03606400DAF6D3 /* SDL_hidapihaptic_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 89E580202D03606400DAF6D3 /* SDL_hidapihaptic_c.h */; };
9846B07C287A9020000C35C8 /* SDL_hidapi_shield.c in Sources */ = {isa = PBXBuildFile; fileRef = 9846B07B287A9020000C35C8 /* SDL_hidapi_shield.c */; };
02D6A1C228A84B8F00A7F002 /* SDL_hidapi_sinput.c in Sources */ = {isa = PBXBuildFile; fileRef = 02D6A1C128A84B8F00A7F001 /* SDL_hidapi_sinput.c */; };
A1626A3E2617006A003F1973 /* SDL_triangle.c in Sources */ = {isa = PBXBuildFile; fileRef = A1626A3D2617006A003F1973 /* SDL_triangle.c */; };
A1626A522617008D003F1973 /* SDL_triangle.h in Headers */ = {isa = PBXBuildFile; fileRef = A1626A512617008C003F1973 /* SDL_triangle.h */; };
A1BB8B6327F6CF330057CFA8 /* SDL_list.c in Sources */ = {isa = PBXBuildFile; fileRef = A1BB8B6127F6CF320057CFA8 /* SDL_list.c */; };
@@ -224,6 +229,7 @@
A7D8B54523E2514300DCD162 /* SDL_hidapijoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A7C423E2513E00DCD162 /* SDL_hidapijoystick.c */; };
A7D8B54B23E2514300DCD162 /* SDL_hidapi_xboxone.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A7C523E2513E00DCD162 /* SDL_hidapi_xboxone.c */; };
A7D8B55123E2514300DCD162 /* SDL_hidapi_switch.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A7C623E2513E00DCD162 /* SDL_hidapi_switch.c */; };
A7D8B55123E2514300DCD163 /* SDL_hidapi_switch2.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A7C623E2513E00DCD163 /* SDL_hidapi_switch2.c */; };
A7D8B55723E2514300DCD162 /* SDL_hidapijoystick_c.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A7C723E2513E00DCD162 /* SDL_hidapijoystick_c.h */; };
A7D8B55D23E2514300DCD162 /* SDL_hidapi_xbox360w.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A7C823E2513E00DCD162 /* SDL_hidapi_xbox360w.c */; };
A7D8B56323E2514300DCD162 /* SDL_hidapi_gamecube.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A7C923E2513E00DCD162 /* SDL_hidapi_gamecube.c */; };
@@ -384,6 +390,10 @@
F32DDAD42AB795A30041EAA5 /* SDL_audioresample.c in Sources */ = {isa = PBXBuildFile; fileRef = F32DDACE2AB795A30041EAA5 /* SDL_audioresample.c */; };
F338A1182D1B37D8007CDFDF /* SDL_tray.m in Sources */ = {isa = PBXBuildFile; fileRef = F338A1172D1B37D8007CDFDF /* SDL_tray.m */; };
F338A11A2D1B37E4007CDFDF /* SDL_tray.c in Sources */ = {isa = PBXBuildFile; fileRef = F338A1192D1B37E4007CDFDF /* SDL_tray.c */; };
F3395BA82D9A5971007246C8 /* SDL_hidapi_8bitdo.c in Sources */ = {isa = PBXBuildFile; fileRef = F3395BA72D9A5971007246C8 /* SDL_hidapi_8bitdo.c */; };
F34400342D40217A003F26D7 /* LICENSE.txt in Resources */ = {isa = PBXBuildFile; fileRef = F373DA182D388A1E002158FA /* LICENSE.txt */; };
F34400362D40217A003F26D7 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = F373DA192D388A1E002158FA /* README.md */; };
F344003D2D4022E1003F26D7 /* INSTALL.md in Resources */ = {isa = PBXBuildFile; fileRef = F344003C2D4022E1003F26D7 /* INSTALL.md */; };
F34B9895291DEFF500AAC96E /* SDL_hidapi_steam.c in Sources */ = {isa = PBXBuildFile; fileRef = A75FDAAC23E2795C00529352 /* SDL_hidapi_steam.c */; };
F362B9192B3349E200D30B94 /* controller_list.h in Headers */ = {isa = PBXBuildFile; fileRef = F362B9152B3349E200D30B94 /* controller_list.h */; };
F362B91A2B3349E200D30B94 /* SDL_gamepad_c.h in Headers */ = {isa = PBXBuildFile; fileRef = F362B9162B3349E200D30B94 /* SDL_gamepad_c.h */; };
@@ -430,6 +440,7 @@
F3B439532C935C2C00792030 /* SDL_posixprocess.c in Sources */ = {isa = PBXBuildFile; fileRef = F3B439522C935C2C00792030 /* SDL_posixprocess.c */; };
F3B439562C937DAB00792030 /* SDL_process.c in Sources */ = {isa = PBXBuildFile; fileRef = F3B439542C937DAB00792030 /* SDL_process.c */; };
F3B439572C937DAB00792030 /* SDL_sysprocess.h in Headers */ = {isa = PBXBuildFile; fileRef = F3B439552C937DAB00792030 /* SDL_sysprocess.h */; };
F3B6B80A2DC3EA54004954FD /* SDL_hidapi_gip.c in Sources */ = {isa = PBXBuildFile; fileRef = F3B6B8092DC3EA54004954FD /* SDL_hidapi_gip.c */; };
F3C1BD752D1F1A3000846529 /* SDL_tray_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = F3C1BD742D1F1A3000846529 /* SDL_tray_utils.c */; };
F3C1BD762D1F1A3000846529 /* SDL_tray_utils.h in Headers */ = {isa = PBXBuildFile; fileRef = F3C1BD732D1F1A3000846529 /* SDL_tray_utils.h */; };
F3C2CB222C5DDDB2004D7998 /* SDL_categories_c.h in Headers */ = {isa = PBXBuildFile; fileRef = F3C2CB202C5DDDB2004D7998 /* SDL_categories_c.h */; };
@@ -509,10 +520,18 @@
F3D46B122D20625800D9CBDF /* SDL_egl.h in Headers */ = {isa = PBXBuildFile; fileRef = F3D46A8E2D20625800D9CBDF /* SDL_egl.h */; settings = {ATTRIBUTES = (Public, ); }; };
F3D46B132D20625800D9CBDF /* SDL_filesystem.h in Headers */ = {isa = PBXBuildFile; fileRef = F3D46A922D20625800D9CBDF /* SDL_filesystem.h */; settings = {ATTRIBUTES = (Public, ); }; };
F3D60A8328C16A1900788A3A /* SDL_hidapi_wii.c in Sources */ = {isa = PBXBuildFile; fileRef = F3D60A8228C16A1800788A3A /* SDL_hidapi_wii.c */; };
F3D8BDFC2D6D2C7000B22FA1 /* SDL_eventwatch_c.h in Headers */ = {isa = PBXBuildFile; fileRef = F3D8BDFB2D6D2C7000B22FA1 /* SDL_eventwatch_c.h */; };
F3D8BDFD2D6D2C7000B22FA1 /* SDL_eventwatch.c in Sources */ = {isa = PBXBuildFile; fileRef = F3D8BDFA2D6D2C7000B22FA1 /* SDL_eventwatch.c */; };
F3DC38C92E5FC60300CD73DE /* SDL_libusb.h in Headers */ = {isa = PBXBuildFile; fileRef = F3DC38C72E5FC60300CD73DE /* SDL_libusb.h */; };
F3DC38CA2E5FC60300CD73DE /* SDL_libusb.c in Sources */ = {isa = PBXBuildFile; fileRef = F3DC38C82E5FC60300CD73DE /* SDL_libusb.c */; };
F3DDCC562AFD42B600B0842B /* SDL_clipboard_c.h in Headers */ = {isa = PBXBuildFile; fileRef = F3DDCC4D2AFD42B500B0842B /* SDL_clipboard_c.h */; };
F3DDCC5B2AFD42B600B0842B /* SDL_video_c.h in Headers */ = {isa = PBXBuildFile; fileRef = F3DDCC522AFD42B600B0842B /* SDL_video_c.h */; };
F3DDCC5D2AFD42B600B0842B /* SDL_rect_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = F3DDCC542AFD42B600B0842B /* SDL_rect_impl.h */; };
F3E5A6EB2AD5E0E600293D83 /* SDL_properties.c in Sources */ = {isa = PBXBuildFile; fileRef = F3E5A6EA2AD5E0E600293D83 /* SDL_properties.c */; };
F3EFA5ED2D5AB97300BCF22F /* SDL_stb_c.h in Headers */ = {isa = PBXBuildFile; fileRef = F3EFA5EA2D5AB97300BCF22F /* SDL_stb_c.h */; };
F3EFA5EE2D5AB97300BCF22F /* stb_image.h in Headers */ = {isa = PBXBuildFile; fileRef = F3EFA5EC2D5AB97300BCF22F /* stb_image.h */; };
F3EFA5EF2D5AB97300BCF22F /* SDL_surface_c.h in Headers */ = {isa = PBXBuildFile; fileRef = F3EFA5EB2D5AB97300BCF22F /* SDL_surface_c.h */; };
F3EFA5F02D5AB97300BCF22F /* SDL_stb.c in Sources */ = {isa = PBXBuildFile; fileRef = F3EFA5E92D5AB97300BCF22F /* SDL_stb.c */; };
F3F07D5A269640160074468B /* SDL_hidapi_luna.c in Sources */ = {isa = PBXBuildFile; fileRef = F3F07D59269640160074468B /* SDL_hidapi_luna.c */; };
F3F15D7F2D011912007AE210 /* SDL_dialog.c in Sources */ = {isa = PBXBuildFile; fileRef = F3F15D7D2D011912007AE210 /* SDL_dialog.c */; };
F3F15D802D011912007AE210 /* SDL_dialog_utils.h in Headers */ = {isa = PBXBuildFile; fileRef = F3F15D7E2D011912007AE210 /* SDL_dialog_utils.h */; };
@@ -526,6 +545,7 @@
F3FA5A232B59ACE000FEAD97 /* yuv_rgb_lsx.c in Sources */ = {isa = PBXBuildFile; fileRef = F3FA5A1A2B59ACE000FEAD97 /* yuv_rgb_lsx.c */; };
F3FA5A242B59ACE000FEAD97 /* yuv_rgb_lsx.h in Headers */ = {isa = PBXBuildFile; fileRef = F3FA5A1B2B59ACE000FEAD97 /* yuv_rgb_lsx.h */; };
F3FA5A252B59ACE000FEAD97 /* yuv_rgb_common.h in Headers */ = {isa = PBXBuildFile; fileRef = F3FA5A1C2B59ACE000FEAD97 /* yuv_rgb_common.h */; };
F3FBB1082DDF93AB0000F99F /* SDL_hidapi_flydigi.c in Sources */ = {isa = PBXBuildFile; fileRef = F3395BA72D9A5971007246C9 /* SDL_hidapi_flydigi.c */; };
F3FD042E2C9B755700824C4C /* SDL_hidapi_nintendo.h in Headers */ = {isa = PBXBuildFile; fileRef = F3FD042C2C9B755700824C4C /* SDL_hidapi_nintendo.h */; };
F3FD042F2C9B755700824C4C /* SDL_hidapi_steam_hori.c in Sources */ = {isa = PBXBuildFile; fileRef = F3FD042D2C9B755700824C4C /* SDL_hidapi_steam_hori.c */; };
FA73671D19A540EF004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73671C19A540EF004122E4 /* CoreVideo.framework */; platformFilters = (ios, maccatalyst, macos, tvos, ); settings = {ATTRIBUTES = (Required, ); }; };
@@ -599,7 +619,12 @@
63134A242A7902FD0021E9A6 /* SDL_pen.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_pen.c; sourceTree = "<group>"; };
75E09158241EA924004729E1 /* SDL_virtualjoystick.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_virtualjoystick.c; sourceTree = "<group>"; };
75E09159241EA924004729E1 /* SDL_virtualjoystick_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_virtualjoystick_c.h; sourceTree = "<group>"; };
89E5801D2D03602200DAF6D3 /* SDL_hidapi_lg4ff.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_lg4ff.c; sourceTree = "<group>"; };
89E5801F2D03606400DAF6D3 /* SDL_hidapihaptic.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SDL_hidapihaptic.c; sourceTree = "<group>"; };
89E580202D03606400DAF6D3 /* SDL_hidapihaptic_c.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDL_hidapihaptic_c.h; sourceTree = "<group>"; };
89E580212D03606400DAF6D3 /* SDL_hidapihaptic_lg4ff.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SDL_hidapihaptic_lg4ff.c; sourceTree = "<group>"; };
9846B07B287A9020000C35C8 /* SDL_hidapi_shield.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_shield.c; sourceTree = "<group>"; };
02D6A1C128A84B8F00A7F001 /* SDL_hidapi_sinput.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_sinput.c; sourceTree = "<group>"; };
A1626A3D2617006A003F1973 /* SDL_triangle.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_triangle.c; sourceTree = "<group>"; };
A1626A512617008C003F1973 /* SDL_triangle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_triangle.h; sourceTree = "<group>"; };
A1BB8B6127F6CF320057CFA8 /* SDL_list.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_list.c; sourceTree = "<group>"; };
@@ -791,6 +816,7 @@
A7D8A7C423E2513E00DCD162 /* SDL_hidapijoystick.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapijoystick.c; sourceTree = "<group>"; };
A7D8A7C523E2513E00DCD162 /* SDL_hidapi_xboxone.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_xboxone.c; sourceTree = "<group>"; };
A7D8A7C623E2513E00DCD162 /* SDL_hidapi_switch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_switch.c; sourceTree = "<group>"; };
A7D8A7C623E2513E00DCD163 /* SDL_hidapi_switch2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_switch2.c; sourceTree = "<group>"; };
A7D8A7C723E2513E00DCD162 /* SDL_hidapijoystick_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_hidapijoystick_c.h; sourceTree = "<group>"; };
A7D8A7C823E2513E00DCD162 /* SDL_hidapi_xbox360w.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_xbox360w.c; sourceTree = "<group>"; };
A7D8A7C923E2513E00DCD162 /* SDL_hidapi_gamecube.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_gamecube.c; sourceTree = "<group>"; };
@@ -929,6 +955,9 @@
F32DDACE2AB795A30041EAA5 /* SDL_audioresample.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_audioresample.c; sourceTree = "<group>"; };
F338A1172D1B37D8007CDFDF /* SDL_tray.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDL_tray.m; sourceTree = "<group>"; };
F338A1192D1B37E4007CDFDF /* SDL_tray.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SDL_tray.c; sourceTree = "<group>"; };
F3395BA72D9A5971007246C8 /* SDL_hidapi_8bitdo.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_8bitdo.c; sourceTree = "<group>"; };
F3395BA72D9A5971007246C9 /* SDL_hidapi_flydigi.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_flydigi.c; sourceTree = "<group>"; };
F344003C2D4022E1003F26D7 /* INSTALL.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = INSTALL.md; sourceTree = "<group>"; };
F362B9152B3349E200D30B94 /* controller_list.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = controller_list.h; sourceTree = "<group>"; };
F362B9162B3349E200D30B94 /* SDL_gamepad_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_gamepad_c.h; sourceTree = "<group>"; };
F362B9172B3349E200D30B94 /* SDL_steam_virtual_gamepad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_steam_virtual_gamepad.h; sourceTree = "<group>"; };
@@ -992,6 +1021,7 @@
F3B439522C935C2C00792030 /* SDL_posixprocess.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_posixprocess.c; sourceTree = "<group>"; };
F3B439542C937DAB00792030 /* SDL_process.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_process.c; sourceTree = "<group>"; };
F3B439552C937DAB00792030 /* SDL_sysprocess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysprocess.h; sourceTree = "<group>"; };
F3B6B8092DC3EA54004954FD /* SDL_hidapi_gip.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_gip.c; sourceTree = "<group>"; };
F3C1BD732D1F1A3000846529 /* SDL_tray_utils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDL_tray_utils.h; sourceTree = "<group>"; };
F3C1BD742D1F1A3000846529 /* SDL_tray_utils.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SDL_tray_utils.c; sourceTree = "<group>"; };
F3C2CB202C5DDDB2004D7998 /* SDL_categories_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_categories_c.h; sourceTree = "<group>"; };
@@ -1071,10 +1101,18 @@
F3D46AC82D20625800D9CBDF /* SDL_video.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDL_video.h; sourceTree = "<group>"; };
F3D46AC92D20625800D9CBDF /* SDL_vulkan.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDL_vulkan.h; sourceTree = "<group>"; };
F3D60A8228C16A1800788A3A /* SDL_hidapi_wii.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_wii.c; sourceTree = "<group>"; };
F3D8BDFA2D6D2C7000B22FA1 /* SDL_eventwatch.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SDL_eventwatch.c; sourceTree = "<group>"; };
F3D8BDFB2D6D2C7000B22FA1 /* SDL_eventwatch_c.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDL_eventwatch_c.h; sourceTree = "<group>"; };
F3DC38C72E5FC60300CD73DE /* SDL_libusb.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDL_libusb.h; sourceTree = "<group>"; };
F3DC38C82E5FC60300CD73DE /* SDL_libusb.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SDL_libusb.c; sourceTree = "<group>"; };
F3DDCC4D2AFD42B500B0842B /* SDL_clipboard_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_clipboard_c.h; sourceTree = "<group>"; };
F3DDCC522AFD42B600B0842B /* SDL_video_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_video_c.h; sourceTree = "<group>"; };
F3DDCC542AFD42B600B0842B /* SDL_rect_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rect_impl.h; sourceTree = "<group>"; };
F3E5A6EA2AD5E0E600293D83 /* SDL_properties.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_properties.c; sourceTree = "<group>"; };
F3EFA5E92D5AB97300BCF22F /* SDL_stb.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SDL_stb.c; sourceTree = "<group>"; };
F3EFA5EA2D5AB97300BCF22F /* SDL_stb_c.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDL_stb_c.h; sourceTree = "<group>"; };
F3EFA5EB2D5AB97300BCF22F /* SDL_surface_c.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDL_surface_c.h; sourceTree = "<group>"; };
F3EFA5EC2D5AB97300BCF22F /* stb_image.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = stb_image.h; sourceTree = "<group>"; };
F3F07D59269640160074468B /* SDL_hidapi_luna.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_luna.c; sourceTree = "<group>"; };
F3F15D7C2D011912007AE210 /* SDL_dialog.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDL_dialog.h; sourceTree = "<group>"; };
F3F15D7D2D011912007AE210 /* SDL_dialog.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SDL_dialog.c; sourceTree = "<group>"; };
@@ -1380,6 +1418,8 @@
children = (
F3ADAB8C2576F08500A6B1D9 /* ios */,
5616CA48252BB285005D5928 /* macos */,
F3DC38C72E5FC60300CD73DE /* SDL_libusb.h */,
F3DC38C82E5FC60300CD73DE /* SDL_libusb.c */,
5616CA4A252BB2A6005D5928 /* SDL_sysurl.h */,
5616CA49252BB2A5005D5928 /* SDL_url.c */,
);
@@ -1461,6 +1501,16 @@
path = virtual;
sourceTree = "<group>";
};
89E580222D03606400DAF6D3 /* hidapi */ = {
isa = PBXGroup;
children = (
89E5801F2D03606400DAF6D3 /* SDL_hidapihaptic.c */,
89E580202D03606400DAF6D3 /* SDL_hidapihaptic_c.h */,
89E580212D03606400DAF6D3 /* SDL_hidapihaptic_lg4ff.c */,
);
path = hidapi;
sourceTree = "<group>";
};
A75FDAA423E2790500529352 /* ios */ = {
isa = PBXGroup;
children = (
@@ -1519,6 +1569,7 @@
A7D8A5C223E2513D00DCD162 /* haptic */ = {
isa = PBXGroup;
children = (
89E580222D03606400DAF6D3 /* hidapi */,
A7D8A5CD23E2513D00DCD162 /* darwin */,
A7D8A5C323E2513D00DCD162 /* dummy */,
A7D8A5C623E2513D00DCD162 /* SDL_haptic_c.h */,
@@ -1582,43 +1633,47 @@
A7D8A60523E2513D00DCD162 /* dummy */,
A7D8A72123E2513E00DCD162 /* khronos */,
A7D8A5EC23E2513D00DCD162 /* offscreen */,
A7D8A61823E2513D00DCD162 /* uikit */,
A7D8A76C23E2513E00DCD162 /* yuv2rgb */,
A7D8A76B23E2513E00DCD162 /* SDL_blit.h */,
A7D8A64C23E2513D00DCD162 /* SDL_blit.c */,
A7D8A66223E2513E00DCD162 /* SDL_blit_0.c */,
A7D8A6FA23E2513E00DCD162 /* SDL_blit_1.c */,
A7D8A66423E2513E00DCD162 /* SDL_blit_A.c */,
A7D8A63F23E2513D00DCD162 /* SDL_blit_auto.c */,
A7D8A73F23E2513E00DCD162 /* SDL_blit_auto.h */,
A7D8A61623E2513D00DCD162 /* SDL_blit_copy.c */,
A7D8A63F23E2513D00DCD162 /* SDL_blit_auto.c */,
A7D8A76623E2513E00DCD162 /* SDL_blit_copy.h */,
A7D8A61623E2513D00DCD162 /* SDL_blit_copy.c */,
A7D8A64223E2513D00DCD162 /* SDL_blit_N.c */,
A7D8A60223E2513D00DCD162 /* SDL_blit_slow.c */,
A7D8A66323E2513E00DCD162 /* SDL_blit_slow.h */,
A7D8A64C23E2513D00DCD162 /* SDL_blit.c */,
A7D8A76B23E2513E00DCD162 /* SDL_blit.h */,
A7D8A60223E2513D00DCD162 /* SDL_blit_slow.c */,
A7D8A77323E2513E00DCD162 /* SDL_bmp.c */,
F3DDCC4D2AFD42B500B0842B /* SDL_clipboard_c.h */,
A7D8A67B23E2513E00DCD162 /* SDL_clipboard.c */,
A7D8A60423E2513D00DCD162 /* SDL_egl_c.h */,
F3DDCC4D2AFD42B500B0842B /* SDL_clipboard_c.h */,
A7D8A6B623E2513E00DCD162 /* SDL_egl.c */,
A7D8A60423E2513D00DCD162 /* SDL_egl_c.h */,
A7D8A76823E2513E00DCD162 /* SDL_fillrect.c */,
A7D8A74023E2513E00DCD162 /* SDL_pixels_c.h */,
A7D8A64D23E2513D00DCD162 /* SDL_pixels.c */,
A7D8A74023E2513E00DCD162 /* SDL_pixels_c.h */,
A7D8A63423E2513D00DCD162 /* SDL_rect.c */,
A7D8A60C23E2513D00DCD162 /* SDL_rect_c.h */,
F3DDCC542AFD42B600B0842B /* SDL_rect_impl.h */,
A7D8A63423E2513D00DCD162 /* SDL_rect.c */,
A7D8A76723E2513E00DCD162 /* SDL_RLEaccel_c.h */,
A7D8A61523E2513D00DCD162 /* SDL_RLEaccel.c */,
A7D8A76723E2513E00DCD162 /* SDL_RLEaccel_c.h */,
F3EFA5E92D5AB97300BCF22F /* SDL_stb.c */,
F3EFA5EA2D5AB97300BCF22F /* SDL_stb_c.h */,
A7D8A60323E2513D00DCD162 /* SDL_stretch.c */,
A7D8A61423E2513D00DCD162 /* SDL_surface.c */,
F3EFA5EB2D5AB97300BCF22F /* SDL_surface_c.h */,
A7D8A61723E2513D00DCD162 /* SDL_sysvideo.h */,
A7D8A60E23E2513D00DCD162 /* SDL_video.c */,
F3DDCC522AFD42B600B0842B /* SDL_video_c.h */,
E4F7981F2AD8D87F00669F54 /* SDL_video_unsupported.c */,
A7D8A60E23E2513D00DCD162 /* SDL_video.c */,
A7D8A63E23E2513D00DCD162 /* SDL_vulkan_internal.h */,
A7D8A64023E2513D00DCD162 /* SDL_vulkan_utils.c */,
A7D8A76A23E2513E00DCD162 /* SDL_yuv_c.h */,
A7D8A67C23E2513E00DCD162 /* SDL_yuv.c */,
A7D8A76A23E2513E00DCD162 /* SDL_yuv_c.h */,
F3EFA5EC2D5AB97300BCF22F /* stb_image.h */,
A7D8A61823E2513D00DCD162 /* uikit */,
A7D8A76C23E2513E00DCD162 /* yuv2rgb */,
);
path = video;
sourceTree = "<group>";
@@ -1884,8 +1939,12 @@
A7D8A7BE23E2513E00DCD162 /* hidapi */ = {
isa = PBXGroup;
children = (
F3395BA72D9A5971007246C8 /* SDL_hidapi_8bitdo.c */,
F32305FE28939F6400E66D30 /* SDL_hidapi_combined.c */,
F3395BA72D9A5971007246C9 /* SDL_hidapi_flydigi.c */,
A7D8A7C923E2513E00DCD162 /* SDL_hidapi_gamecube.c */,
F3B6B8092DC3EA54004954FD /* SDL_hidapi_gip.c */,
89E5801D2D03602200DAF6D3 /* SDL_hidapi_lg4ff.c */,
F3F07D59269640160074468B /* SDL_hidapi_luna.c */,
F3FD042C2C9B755700824C4C /* SDL_hidapi_nintendo.h */,
F388C95428B5F6F600661ECF /* SDL_hidapi_ps3.c */,
@@ -1894,11 +1953,13 @@
A75FDBC323EA380300529352 /* SDL_hidapi_rumble.h */,
A75FDBC423EA380300529352 /* SDL_hidapi_rumble.c */,
9846B07B287A9020000C35C8 /* SDL_hidapi_shield.c */,
02D6A1C128A84B8F00A7F001 /* SDL_hidapi_sinput.c */,
F3984CCF25BCC92800374F43 /* SDL_hidapi_stadia.c */,
A75FDAAC23E2795C00529352 /* SDL_hidapi_steam.c */,
F3FD042D2C9B755700824C4C /* SDL_hidapi_steam_hori.c */,
A797456F2B2E9D39009D224A /* SDL_hidapi_steamdeck.c */,
A7D8A7C623E2513E00DCD162 /* SDL_hidapi_switch.c */,
A7D8A7C623E2513E00DCD163 /* SDL_hidapi_switch2.c */,
F3D60A8228C16A1800788A3A /* SDL_hidapi_wii.c */,
A7D8A7C223E2513E00DCD162 /* SDL_hidapi_xbox360.c */,
A7D8A7C823E2513E00DCD162 /* SDL_hidapi_xbox360w.c */,
@@ -2193,29 +2254,31 @@
A7D8A93623E2514000DCD162 /* scancodes_linux.h */,
A7D8A92C23E2514000DCD162 /* scancodes_windows.h */,
A7D8A94123E2514000DCD162 /* scancodes_xfree86.h */,
F3C2CB202C5DDDB2004D7998 /* SDL_categories_c.h */,
F3C2CB212C5DDDB2004D7998 /* SDL_categories.c */,
A7D8A93923E2514000DCD162 /* SDL_clipboardevents_c.h */,
F3C2CB202C5DDDB2004D7998 /* SDL_categories_c.h */,
A7D8A93A23E2514000DCD162 /* SDL_clipboardevents.c */,
A7D8A93123E2514000DCD162 /* SDL_displayevents_c.h */,
A7D8A93923E2514000DCD162 /* SDL_clipboardevents_c.h */,
A7D8A92D23E2514000DCD162 /* SDL_displayevents.c */,
A7D8A92E23E2514000DCD162 /* SDL_dropevents_c.h */,
A7D8A93123E2514000DCD162 /* SDL_displayevents_c.h */,
A7D8A93B23E2514000DCD162 /* SDL_dropevents.c */,
A7D8A94223E2514000DCD162 /* SDL_events_c.h */,
A7D8A92E23E2514000DCD162 /* SDL_dropevents_c.h */,
A7D8A93523E2514000DCD162 /* SDL_events.c */,
A7D8A93D23E2514000DCD162 /* SDL_keyboard_c.h */,
A7D8A94223E2514000DCD162 /* SDL_events_c.h */,
F3D8BDFA2D6D2C7000B22FA1 /* SDL_eventwatch.c */,
F3D8BDFB2D6D2C7000B22FA1 /* SDL_eventwatch_c.h */,
A7D8A93823E2514000DCD162 /* SDL_keyboard.c */,
F31013C62C24E98200FBE946 /* SDL_keymap_c.h */,
A7D8A93D23E2514000DCD162 /* SDL_keyboard_c.h */,
F31013C52C24E98200FBE946 /* SDL_keymap.c */,
A7D8A92B23E2514000DCD162 /* SDL_mouse_c.h */,
F31013C62C24E98200FBE946 /* SDL_keymap_c.h */,
A7D8A92A23E2514000DCD162 /* SDL_mouse.c */,
63134A232A7902FD0021E9A6 /* SDL_pen_c.h */,
A7D8A92B23E2514000DCD162 /* SDL_mouse_c.h */,
63134A242A7902FD0021E9A6 /* SDL_pen.c */,
63134A232A7902FD0021E9A6 /* SDL_pen_c.h */,
A7D8A93C23E2514000DCD162 /* SDL_quit.c */,
A7D8A93723E2514000DCD162 /* SDL_touch_c.h */,
A7D8A93E23E2514000DCD162 /* SDL_touch.c */,
A7D8A94323E2514000DCD162 /* SDL_windowevents_c.h */,
A7D8A93723E2514000DCD162 /* SDL_touch_c.h */,
A7D8A92F23E2514000DCD162 /* SDL_windowevents.c */,
A7D8A94323E2514000DCD162 /* SDL_windowevents_c.h */,
);
path = events;
sourceTree = "<group>";
@@ -2311,6 +2374,14 @@
path = cocoa;
sourceTree = "<group>";
};
F344003B2D40229E003F26D7 /* framework */ = {
isa = PBXGroup;
children = (
F344003C2D4022E1003F26D7 /* INSTALL.md */,
);
path = framework;
sourceTree = "<group>";
};
F36C7ACF294B9F5E004D61C3 /* core */ = {
isa = PBXGroup;
children = (
@@ -2408,6 +2479,7 @@
F59C710100D5CB5801000001 /* resources */ = {
isa = PBXGroup;
children = (
F344003B2D40229E003F26D7 /* framework */,
F37A8E1928405AA100C38E95 /* CMake */,
F373DA182D388A1E002158FA /* LICENSE.txt */,
F373DA192D388A1E002158FA /* README.md */,
@@ -2445,6 +2517,9 @@
A7D8BB6F23E2514500DCD162 /* SDL_clipboardevents_c.h in Headers */,
A7D8AECA23E2514100DCD162 /* SDL_cocoaclipboard.h in Headers */,
A7D8AF1223E2514100DCD162 /* SDL_cocoaevents.h in Headers */,
F3EFA5ED2D5AB97300BCF22F /* SDL_stb_c.h in Headers */,
F3EFA5EE2D5AB97300BCF22F /* stb_image.h in Headers */,
F3EFA5EF2D5AB97300BCF22F /* SDL_surface_c.h in Headers */,
A7D8AE8E23E2514100DCD162 /* SDL_cocoakeyboard.h in Headers */,
A7D8AF0623E2514100DCD162 /* SDL_cocoamessagebox.h in Headers */,
A7D8AEB223E2514100DCD162 /* SDL_cocoametalview.h in Headers */,
@@ -2583,6 +2658,7 @@
F37E18642BAA40670098C111 /* SDL_time_c.h in Headers */,
F31013C82C24E98200FBE946 /* SDL_keymap_c.h in Headers */,
63134A252A7902FD0021E9A6 /* SDL_pen_c.h in Headers */,
89E580252D03606400DAF6D3 /* SDL_hidapihaptic_c.h in Headers */,
F36C34312C0F876500991150 /* SDL_offscreenvulkan.h in Headers */,
A7D8B2C023E2514200DCD162 /* SDL_pixels_c.h in Headers */,
F37E18622BAA40090098C111 /* SDL_sysfilesystem.h in Headers */,
@@ -2679,6 +2755,8 @@
A7D8B3D423E2514300DCD162 /* yuv_rgb.h in Headers */,
F3FA5A252B59ACE000FEAD97 /* yuv_rgb_common.h in Headers */,
F3FA5A1D2B59ACE000FEAD97 /* yuv_rgb_internal.h in Headers */,
F3D8BDFC2D6D2C7000B22FA1 /* SDL_eventwatch_c.h in Headers */,
F3DC38C92E5FC60300CD73DE /* SDL_libusb.h in Headers */,
F3FA5A242B59ACE000FEAD97 /* yuv_rgb_lsx.h in Headers */,
F3FA5A1E2B59ACE000FEAD97 /* yuv_rgb_lsx_func.h in Headers */,
F3FA5A1F2B59ACE000FEAD97 /* yuv_rgb_sse.h in Headers */,
@@ -2754,6 +2832,9 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F344003D2D4022E1003F26D7 /* INSTALL.md in Resources */,
F34400342D40217A003F26D7 /* LICENSE.txt in Resources */,
F34400362D40217A003F26D7 /* README.md in Resources */,
F37A8E1A28405AA100C38E95 /* CMake in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -2795,7 +2876,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# Build an xcframework with both device and simulator files for all platforms.\n# Adapted from an answer in\n# https://developer.apple.com/forums/thread/666335?answerId=685927022#685927022\n\nif [ \"$XCODE_VERSION_ACTUAL\" -lt 1100 ]\nthen\n echo \"error: Building an xcframework requires Xcode 11 minimum.\"\n exit 1\nfi\n\nFRAMEWORK_NAME=\"SDL3\"\nPROJECT_NAME=\"SDL\"\nSCHEME=\"SDL3\"\n\nMACOS_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-macosx.xcarchive\"\nIOS_SIMULATOR_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-iphonesimulator.xcarchive\"\nIOS_DEVICE_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-iphoneos.xcarchive\"\nTVOS_SIMULATOR_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-appletvsimulator.xcarchive\"\nTVOS_DEVICE_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-appletvos.xcarchive\"\n\nOUTPUT_DIR=\"./build/\"\n\n# macOS\nxcodebuild archive \\\n ONLY_ACTIVE_ARCH=NO \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${MACOS_ARCHIVE_PATH} \\\n -destination 'generic/platform=macOS,name=Any Mac' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n \n# iOS simulator\nxcodebuild archive \\\n ONLY_ACTIVE_ARCH=NO \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${IOS_SIMULATOR_ARCHIVE_PATH} \\\n -destination 'generic/platform=iOS Simulator' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# iOS device\nxcodebuild archive \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${IOS_DEVICE_ARCHIVE_PATH} \\\n -destination 'generic/platform=iOS' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# tvOS simulator\nxcodebuild archive \\\n ONLY_ACTIVE_ARCH=NO \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${TVOS_SIMULATOR_ARCHIVE_PATH} \\\n -destination 'generic/platform=tvOS Simulator' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# tvOS device\nxcodebuild archive \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${TVOS_DEVICE_ARCHIVE_PATH} \\\n -destination 'generic/platform=tvOS' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# Clean-up any existing instance of this xcframework from the Products directory\nrm -rf \"${OUTPUT_DIR}${FRAMEWORK_NAME}.xcframework\"\n\n# Create final xcframework\nxcodebuild -create-xcframework \\\n -framework \"${MACOS_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -framework \"${IOS_DEVICE_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -framework \"${IOS_SIMULATOR_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -framework \"${TVOS_DEVICE_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -framework \"${TVOS_SIMULATOR_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -output ${OUTPUT_DIR}/${FRAMEWORK_NAME}.xcframework\n\n# Ensure git doesn't pick up on our Products folder. \nrm -rf ${OUTPUT_DIR}/.gitignore\necho \"*\" >> ${OUTPUT_DIR}/.gitignore\n";
shellScript = "# Build an xcframework with both device and simulator files for all platforms.\n# Adapted from an answer in\n# https://developer.apple.com/forums/thread/666335?answerId=685927022#685927022\n\nif [ \"$XCODE_VERSION_ACTUAL\" -lt 1100 ]\nthen\n echo \"error: Building an xcframework requires Xcode 11 minimum.\"\n exit 1\nfi\n\nFRAMEWORK_NAME=\"SDL3\"\nPROJECT_NAME=\"SDL\"\nSCHEME=\"SDL3\"\n\nMACOS_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-macosx.xcarchive\"\nIOS_SIMULATOR_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-iphonesimulator.xcarchive\"\nIOS_DEVICE_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-iphoneos.xcarchive\"\nTVOS_SIMULATOR_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-appletvsimulator.xcarchive\"\nTVOS_DEVICE_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-appletvos.xcarchive\"\n\nOUTPUT_DIR=\"./build/\"\n\n# macOS\nxcodebuild archive \\\n ONLY_ACTIVE_ARCH=NO \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${MACOS_ARCHIVE_PATH} \\\n -destination 'generic/platform=macOS,name=Any Mac' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n \n# iOS simulator\nxcodebuild archive \\\n ONLY_ACTIVE_ARCH=NO \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${IOS_SIMULATOR_ARCHIVE_PATH} \\\n -destination 'generic/platform=iOS Simulator' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# iOS device\nxcodebuild archive \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${IOS_DEVICE_ARCHIVE_PATH} \\\n -destination 'generic/platform=iOS' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# tvOS simulator\nxcodebuild archive \\\n ONLY_ACTIVE_ARCH=NO \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${TVOS_SIMULATOR_ARCHIVE_PATH} \\\n -destination 'generic/platform=tvOS Simulator' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# tvOS device\nxcodebuild archive \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${TVOS_DEVICE_ARCHIVE_PATH} \\\n -destination 'generic/platform=tvOS' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# Clean-up any existing instance of this xcframework from the Products directory\nrm -rf \"${OUTPUT_DIR}${FRAMEWORK_NAME}.xcframework\"\n\n# Create final xcframework\nxcodebuild -create-xcframework \\\n -framework \"${MACOS_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -debug-symbols \"${MACOS_ARCHIVE_PATH}\"/dSYMs/$FRAMEWORK_NAME.framework.dSYM \\\n -framework \"${IOS_DEVICE_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -debug-symbols \"${IOS_DEVICE_ARCHIVE_PATH}\"/dSYMs/$FRAMEWORK_NAME.framework.dSYM \\\n -framework \"${IOS_SIMULATOR_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -framework \"${TVOS_DEVICE_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -debug-symbols \"${TVOS_DEVICE_ARCHIVE_PATH}\"/dSYMs/$FRAMEWORK_NAME.framework.dSYM \\\n -framework \"${TVOS_SIMULATOR_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -output ${OUTPUT_DIR}/${FRAMEWORK_NAME}.xcframework\n\n# Ensure git doesn't pick up on our Products folder. \nrm -rf ${OUTPUT_DIR}/.gitignore\necho \"*\" >> ${OUTPUT_DIR}/.gitignore\n";
};
/* End PBXShellScriptBuildPhase section */
@@ -2809,6 +2890,7 @@
A7D8B62F23E2514300DCD162 /* SDL_sysfilesystem.m in Sources */,
A7D8B41C23E2514300DCD162 /* SDL_systls.c in Sources */,
9846B07C287A9020000C35C8 /* SDL_hidapi_shield.c in Sources */,
02D6A1C228A84B8F00A7F002 /* SDL_hidapi_sinput.c in Sources */,
F31013C72C24E98200FBE946 /* SDL_keymap.c in Sources */,
F3A9AE992C8A13C100AAC390 /* SDL_render_gpu.c in Sources */,
A7D8BBD923E2574800DCD162 /* SDL_uikitmessagebox.m in Sources */,
@@ -2867,6 +2949,8 @@
A7D8BBDD23E2574800DCD162 /* SDL_uikitmodes.m in Sources */,
A7D8BA3723E2514400DCD162 /* SDL_d3dmath.c in Sources */,
F3A9AE9C2C8A13C100AAC390 /* SDL_pipeline_gpu.c in Sources */,
89E580232D03606400DAF6D3 /* SDL_hidapihaptic.c in Sources */,
89E580242D03606400DAF6D3 /* SDL_hidapihaptic_lg4ff.c in Sources */,
75E0915A241EA924004729E1 /* SDL_virtualjoystick.c in Sources */,
F338A11A2D1B37E4007CDFDF /* SDL_tray.c in Sources */,
A7D8ABEB23E2514100DCD162 /* SDL_nullvideo.c in Sources */,
@@ -2928,12 +3012,15 @@
A7D8B76423E2514300DCD162 /* SDL_mixer.c in Sources */,
A7D8BB5723E2514500DCD162 /* SDL_events.c in Sources */,
A7D8ADE623E2514100DCD162 /* SDL_blit_0.c in Sources */,
89E5801E2D03602200DAF6D3 /* SDL_hidapi_lg4ff.c in Sources */,
A7D8B8A823E2514400DCD162 /* SDL_diskaudio.c in Sources */,
56A2373329F9C113003CCA5F /* SDL_sysrwlock.c in Sources */,
F3A9AE9A2C8A13C100AAC390 /* SDL_shaders_gpu.c in Sources */,
566E26CF246274CC00718109 /* SDL_syslocale.m in Sources */,
A7D8AFC023E2514200DCD162 /* SDL_egl.c in Sources */,
A7D8AC3323E2514100DCD162 /* SDL_RLEaccel.c in Sources */,
F3D8BDFD2D6D2C7000B22FA1 /* SDL_eventwatch.c in Sources */,
F3EFA5F02D5AB97300BCF22F /* SDL_stb.c in Sources */,
A7D8BBB123E2514500DCD162 /* SDL_assert.c in Sources */,
A7D8B3DA23E2514300DCD162 /* SDL_bmp.c in Sources */,
A7D8B96E23E2514400DCD162 /* SDL_stdlib.c in Sources */,
@@ -2962,6 +3049,7 @@
F3FA5A222B59ACE000FEAD97 /* yuv_rgb_sse.c in Sources */,
F3C2CB232C5DDDB2004D7998 /* SDL_categories.c in Sources */,
A7D8B55123E2514300DCD162 /* SDL_hidapi_switch.c in Sources */,
A7D8B55123E2514300DCD163 /* SDL_hidapi_switch2.c in Sources */,
A7D8B96223E2514400DCD162 /* SDL_strtokr.c in Sources */,
A7D8BB7523E2514500DCD162 /* SDL_clipboardevents.c in Sources */,
E4F798202AD8D87F00669F54 /* SDL_video_unsupported.c in Sources */,
@@ -2989,6 +3077,7 @@
A7D8BA5B23E2514400DCD162 /* SDL_shaders_gles2.c in Sources */,
A7D8B14023E2514200DCD162 /* SDL_blit_1.c in Sources */,
A7D8BBDB23E2574800DCD162 /* SDL_uikitmetalview.m in Sources */,
F3B6B80A2DC3EA54004954FD /* SDL_hidapi_gip.c in Sources */,
A7D8BB1523E2514500DCD162 /* SDL_mouse.c in Sources */,
F395C19C2569C68F00942BFF /* SDL_iokitjoystick.c in Sources */,
A7D8B4B223E2514300DCD162 /* SDL_sysjoystick.c in Sources */,
@@ -3011,12 +3100,15 @@
000028F8113A53F4333E0000 /* SDL_main_callbacks.c in Sources */,
000098E9DAA43EF6FF7F0000 /* SDL_camera.c in Sources */,
F310138E2C1F2CB700FBE946 /* SDL_random.c in Sources */,
F3395BA82D9A5971007246C8 /* SDL_hidapi_8bitdo.c in Sources */,
00001B2471F503DD3C1B0000 /* SDL_camera_dummy.c in Sources */,
00002B20A48E055EB0350000 /* SDL_camera_coremedia.m in Sources */,
000080903BC03006F24E0000 /* SDL_filesystem.c in Sources */,
F3FBB1082DDF93AB0000F99F /* SDL_hidapi_flydigi.c in Sources */,
0000481D255AF155B42C0000 /* SDL_sysfsops.c in Sources */,
0000494CC93F3E624D3C0000 /* SDL_systime.c in Sources */,
000095FA1BDE436CF3AF0000 /* SDL_time.c in Sources */,
F3DC38CA2E5FC60300CD73DE /* SDL_libusb.c in Sources */,
0000140640E77F73F1DF0000 /* SDL_dialog_utils.c in Sources */,
0000D5B526B85DE7AB1C0000 /* SDL_cocoapen.m in Sources */,
6312C66D2B42341400A7BB00 /* SDL_murmur3.c in Sources */,
@@ -3045,8 +3137,8 @@
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
DEPLOYMENT_POSTPROCESSING = YES;
DYLIB_COMPATIBILITY_VERSION = 111.0.0;
DYLIB_CURRENT_VERSION = 111.0.0;
DYLIB_COMPATIBILITY_VERSION = 301.0.0;
DYLIB_CURRENT_VERSION = 301.0.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_ALTIVEC_EXTENSIONS = YES;
@@ -3081,7 +3173,7 @@
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 3.1.10;
MARKETING_VERSION = 3.3.0;
OTHER_LDFLAGS = "$(CONFIG_FRAMEWORK_LDFLAGS)";
PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL3;
PRODUCT_NAME = SDL3;
@@ -3098,6 +3190,8 @@
baseConfigurationReference = F3F7BE3B2CBD79D200C984AF /* config.xcconfig */;
buildSettings = {
CLANG_LINK_OBJC_RUNTIME = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
OTHER_LDFLAGS = "-liconv";
SUPPORTS_MACCATALYST = YES;
};
@@ -3109,8 +3203,8 @@
ALLOW_TARGET_PLATFORM_SPECIALIZATION = YES;
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
DYLIB_COMPATIBILITY_VERSION = 111.0.0;
DYLIB_CURRENT_VERSION = 111.0.0;
DYLIB_COMPATIBILITY_VERSION = 301.0.0;
DYLIB_CURRENT_VERSION = 301.0.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
@@ -3142,7 +3236,7 @@
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 3.1.10;
MARKETING_VERSION = 3.3.0;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = "$(CONFIG_FRAMEWORK_LDFLAGS)";
PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL3;
@@ -3160,6 +3254,8 @@
baseConfigurationReference = F3F7BE3B2CBD79D200C984AF /* config.xcconfig */;
buildSettings = {
CLANG_LINK_OBJC_RUNTIME = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
OTHER_LDFLAGS = "-liconv";
SUPPORTS_MACCATALYST = YES;
};

View File

@@ -1,4 +1,4 @@
Title SDL 3.1.10
Title SDL 3.3.0
Version 1
Description SDL Library for macOS (http://www.libsdl.org)
DefaultLocation /Library/Frameworks

View File

@@ -3,7 +3,9 @@
This package contains SDL built for Xcode, and includes support for macOS, iOS and tvOS.
To use this package, drag SDL3.xcframework into your project.
To use this package in Xcode, drag `SDL3.xcframework` into your project.
To use this package in a CMake project, copy both `SDL3.xcframework` and `share` to `~/Library/Frameworks`.
# Documentation

View File

@@ -0,0 +1,41 @@
# Using this package
This package contains SDL built for Xcode.
To use this package in Xcode, drag `SDL3.framework` into your project.
# Documentation
An API reference, tutorials, and additional documentation is available at:
https://wiki.libsdl.org/SDL3
# Example code
There are simple example programs available at:
https://examples.libsdl.org/SDL3
# Discussions
## Discord
You can join the official Discord server at:
https://discord.com/invite/BwpFGBWsv8
## Forums/mailing lists
You can join SDL development discussions at:
https://discourse.libsdl.org/
Once you sign up, you can use the forum through the website or as a mailing list from your email client.
## Announcement list
You can sign up for the low traffic announcement list at:
https://www.libsdl.org/mailing-list.php

View File

@@ -92,7 +92,7 @@ if(NOT TARGET SDL3::Headers)
add_library(SDL3::Headers INTERFACE IMPORTED)
set_target_properties(SDL3::Headers
PROPERTIES
INTERFACE_COMPILE_OPTIONS "SHELL:-F \"${_sdl3_framework_parent_path}\""
INTERFACE_COMPILE_OPTIONS "-F${_sdl3_framework_parent_path}"
)
endif()
set(SDL3_Headers_FOUND TRUE)
@@ -112,7 +112,7 @@ if(NOT TARGET SDL3::SDL3-shared)
set_target_properties(SDL3::SDL3-shared
PROPERTIES
FRAMEWORK "TRUE"
IMPORTED_LOCATION "${_sdl3_framework_path}"
IMPORTED_LOCATION "${_sdl3_framework_path}/SDL3"
INTERFACE_LINK_LIBRARIES "SDL3::Headers"
)
endif()

View File

@@ -167,6 +167,9 @@
F399C6512A7892D800C86979 /* testautomation_intrinsics.c in Sources */ = {isa = PBXBuildFile; fileRef = F399C6502A7892D800C86979 /* testautomation_intrinsics.c */; };
F399C6522A7892D800C86979 /* testautomation_intrinsics.c in Sources */ = {isa = PBXBuildFile; fileRef = F399C6502A7892D800C86979 /* testautomation_intrinsics.c */; };
F399C6552A78933100C86979 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F399C6542A78933000C86979 /* Cocoa.framework */; };
F3B7FD642D73FC630086D1D0 /* SDL3.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL3.framework */; };
F3B7FD662D73FC630086D1D0 /* SDL3.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL3.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
F3B7FD6C2D73FC9E0086D1D0 /* testpen.c in Sources */ = {isa = PBXBuildFile; fileRef = F3B7FD6B2D73FC9E0086D1D0 /* testpen.c */; };
F3C17C7728E40BC800E1A26D /* testutils.c in Sources */ = {isa = PBXBuildFile; fileRef = F3C17C7328E40ADE00E1A26D /* testutils.c */; };
F3C17C7928E40C6E00E1A26D /* testutils.c in Sources */ = {isa = PBXBuildFile; fileRef = F3C17C7328E40ADE00E1A26D /* testutils.c */; };
F3C17C7B28E40D4E00E1A26D /* testutils.c in Sources */ = {isa = PBXBuildFile; fileRef = F3C17C7328E40ADE00E1A26D /* testutils.c */; };
@@ -717,6 +720,17 @@
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
F3B7FD652D73FC630086D1D0 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
F3B7FD662D73FC630086D1D0 /* SDL3.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
F3CB568B2A7895F800766177 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
@@ -1356,6 +1370,8 @@
F399C6492A78929400C86979 /* gamepadutils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = gamepadutils.c; sourceTree = "<group>"; };
F399C6502A7892D800C86979 /* testautomation_intrinsics.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testautomation_intrinsics.c; sourceTree = "<group>"; };
F399C6542A78933000C86979 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
F3B7FD6A2D73FC630086D1D0 /* testpen.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testpen.app; sourceTree = BUILT_PRODUCTS_DIR; };
F3B7FD6B2D73FC9E0086D1D0 /* testpen.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = testpen.c; sourceTree = "<group>"; };
F3C17C6A28E3FD4400E1A26D /* config.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = config.xcconfig; sourceTree = "<group>"; };
F3C17C7328E40ADE00E1A26D /* testutils.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = testutils.c; sourceTree = "<group>"; };
F3C17CD628E416AC00E1A26D /* testgeometry.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testgeometry.c; sourceTree = "<group>"; };
@@ -1732,6 +1748,14 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
F3B7FD632D73FC630086D1D0 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
F3B7FD642D73FC630086D1D0 /* SDL3.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
F3C17CD928E416CF00E1A26D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@@ -1789,6 +1813,7 @@
083E4872006D84C97F000001 /* loopwave.c */,
0017958F1074216E00F5D044 /* testatomic.c */,
001795B01074222D00F5D044 /* testaudioinfo.c */,
F35E56CC2983130F00A43A5F /* testautomation.c */,
F35E56C42983130D00A43A5F /* testautomation_audio.c */,
F35E56BC2983130B00A43A5F /* testautomation_clipboard.c */,
F35E56BB2983130B00A43A5F /* testautomation_events.c */,
@@ -1815,7 +1840,6 @@
A1A8594B2BC72FC20045DD6C /* testautomation_time.c */,
F35E56BD2983130B00A43A5F /* testautomation_timer.c */,
F35E56C12983130C00A43A5F /* testautomation_video.c */,
F35E56CC2983130F00A43A5F /* testautomation.c */,
F36C342C2C0F869B00991150 /* testcamera.c */,
BBFC088E164C6820003E6A99 /* testcontroller.c */,
001797711074320D00F5D044 /* testdraw.c */,
@@ -1837,11 +1861,12 @@
092D6D75FFB313BB7F000001 /* testlock.c */,
DB166CBD16A1C74100A1396C /* testmessage.c */,
001798151074359B00F5D044 /* testmultiaudio.c */,
0017985A107436ED00F5D044 /* testnative.c */,
0017985B107436ED00F5D044 /* testnative.h */,
0017985A107436ED00F5D044 /* testnative.c */,
0017985C107436ED00F5D044 /* testnativecocoa.m */,
00179872107438D000F5D044 /* testnativex11.c */,
002F345209CA201C00EBEB88 /* testoverlay.c */,
F3B7FD6B2D73FC9E0086D1D0 /* testpen.c */,
002F346F09CA20A600EBEB88 /* testplatform.c */,
001798B910743A4900F5D044 /* testpower.c */,
DB166CBF16A1C74100A1396C /* testrelative.c */,
@@ -1918,6 +1943,7 @@
F3C17CDC28E416CF00E1A26D /* testgeometry.app */,
F35E56AA298312CB00A43A5F /* testautomation.app */,
F36C34272C0F85DB00991150 /* testcamera.app */,
F3B7FD6A2D73FC630086D1D0 /* testpen.app */,
);
name = Products;
sourceTree = "<group>";
@@ -2756,6 +2782,23 @@
productReference = F36C34272C0F85DB00991150 /* testcamera.app */;
productType = "com.apple.product-type.application";
};
F3B7FD602D73FC630086D1D0 /* testpen */ = {
isa = PBXNativeTarget;
buildConfigurationList = F3B7FD672D73FC630086D1D0 /* Build configuration list for PBXNativeTarget "testpen" */;
buildPhases = (
F3B7FD612D73FC630086D1D0 /* Sources */,
F3B7FD632D73FC630086D1D0 /* Frameworks */,
F3B7FD652D73FC630086D1D0 /* Embed Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = testpen;
productName = testalpha;
productReference = F3B7FD6A2D73FC630086D1D0 /* testpen.app */;
productType = "com.apple.product-type.application";
};
F3C17CDB28E416CF00E1A26D /* testgeometry */ = {
isa = PBXNativeTarget;
buildConfigurationList = F3C17CE828E416D000E1A26D /* Build configuration list for PBXNativeTarget "testgeometry" */;
@@ -2972,6 +3015,7 @@
001798781074392D00F5D044 /* testnative */,
002F343C09CA1FB300EBEB88 /* testoverlay */,
002F345909CA204F00EBEB88 /* testplatform */,
F3B7FD602D73FC630086D1D0 /* testpen */,
0017989D107439DF00F5D044 /* testpower */,
DB166DDC16A1D50C00A1396C /* testrelative */,
DB166DF316A1D57C00A1396C /* testrendercopyex */,
@@ -3455,6 +3499,14 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
F3B7FD612D73FC630086D1D0 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F3B7FD6C2D73FC9E0086D1D0 /* testpen.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
F3C17CD828E416CF00E1A26D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@@ -4704,6 +4756,26 @@
};
name = Release;
};
F3B7FD682D73FC630086D1D0 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
};
name = Debug;
};
F3B7FD692D73FC630086D1D0 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
};
name = Release;
};
F3C17CE928E416D000E1A26D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@@ -5159,6 +5231,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug;
};
F3B7FD672D73FC630086D1D0 /* Build configuration list for PBXNativeTarget "testpen" */ = {
isa = XCConfigurationList;
buildConfigurations = (
F3B7FD682D73FC630086D1D0 /* Debug */,
F3B7FD692D73FC630086D1D0 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug;
};
F3C17CE828E416D000E1A26D /* Build configuration list for PBXNativeTarget "testgeometry" */ = {
isa = XCConfigurationList;
buildConfigurations = (

View File

@@ -5,7 +5,7 @@ plugins {
def buildWithCMake = project.hasProperty('BUILD_WITH_CMAKE');
android {
namespace "org.libsdl.app"
namespace = "org.libsdl.app"
compileSdkVersion 35
defaultConfig {
minSdkVersion 21
@@ -14,12 +14,12 @@ android {
versionName "1.0"
externalNativeBuild {
ndkBuild {
arguments "APP_PLATFORM=android-19"
arguments "APP_PLATFORM=android-21"
// abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
abiFilters 'arm64-v8a'
}
cmake {
arguments "-DANDROID_PLATFORM=android-19", "-DANDROID_STL=c++_static"
arguments "-DANDROID_PLATFORM=android-21", "-DANDROID_STL=c++_static"
// abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
abiFilters 'arm64-v8a'
}
@@ -53,7 +53,7 @@ android {
}
lint {
abortOnError false
abortOnError = false
}
}

View File

@@ -7,4 +7,4 @@
APP_ABI := armeabi-v7a arm64-v8a x86 x86_64
# Min runtime API level
APP_PLATFORM=android-16
APP_PLATFORM=android-21

View File

@@ -36,7 +36,6 @@
int messageboxShowMessageBox(int, java.lang.String, java.lang.String, int[], int[], java.lang.String[], int[]);
void minimizeWindow();
boolean openURL(java.lang.String);
void onNativePen(int, int, int , float , float , float);
void requestPermission(java.lang.String, int);
boolean showToast(java.lang.String, int, int, int, int);
boolean sendMessage(int, int);
@@ -51,6 +50,8 @@
boolean supportsRelativeMouse();
int openFileDescriptor(java.lang.String, java.lang.String);
boolean showFileDialog(java.lang.String[], boolean, boolean, int);
java.lang.String getPreferredLocales();
java.lang.String formatLocale(java.util.Locale);
}
-keep,includedescriptorclasses,allowoptimization class org.libsdl.app.HIDDeviceManager {

View File

@@ -71,6 +71,7 @@
android:icon="@mipmap/ic_launcher"
android:allowBackup="true"
android:theme="@style/AppTheme"
android:enableOnBackInvokedCallback="false"
android:hardwareAccelerated="true" >
<!-- Example of setting SDL hints from AndroidManifest.xml:

View File

@@ -44,9 +44,9 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe
private static final int CHROMEBOOK_CONNECTION_CHECK_INTERVAL = 10000;
static public final UUID steamControllerService = UUID.fromString("100F6C32-1735-4313-B402-38567131E5F3");
static public final UUID inputCharacteristic = UUID.fromString("100F6C33-1735-4313-B402-38567131E5F3");
static public final UUID reportCharacteristic = UUID.fromString("100F6C34-1735-4313-B402-38567131E5F3");
static final UUID steamControllerService = UUID.fromString("100F6C32-1735-4313-B402-38567131E5F3");
static final UUID inputCharacteristic = UUID.fromString("100F6C33-1735-4313-B402-38567131E5F3");
static final UUID reportCharacteristic = UUID.fromString("100F6C34-1735-4313-B402-38567131E5F3");
static private final byte[] enterValveMode = new byte[] { (byte)0xC0, (byte)0x87, 0x03, 0x08, 0x07, 0x00 };
static class GattOperation {
@@ -156,12 +156,12 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe
}
}
public HIDDeviceBLESteamController(HIDDeviceManager manager, BluetoothDevice device) {
HIDDeviceBLESteamController(HIDDeviceManager manager, BluetoothDevice device) {
mManager = manager;
mDevice = device;
mDeviceId = mManager.getDeviceIDForIdentifier(getIdentifier());
mIsRegistered = false;
mIsChromebook = mManager.getContext().getPackageManager().hasSystemFeature("org.chromium.arc.device_management");
mIsChromebook = SDLActivity.isChromebook();
mOperations = new LinkedList<GattOperation>();
mHandler = new Handler(Looper.getMainLooper());
@@ -169,17 +169,17 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe
// final HIDDeviceBLESteamController finalThis = this;
// mHandler.postDelayed(new Runnable() {
// @Override
// public void run() {
// void run() {
// finalThis.checkConnectionForChromebookIssue();
// }
// }, CHROMEBOOK_CONNECTION_CHECK_INTERVAL);
}
public String getIdentifier() {
String getIdentifier() {
return String.format("SteamController.%s", mDevice.getAddress());
}
public BluetoothGatt getGatt() {
BluetoothGatt getGatt() {
return mGatt;
}
@@ -219,7 +219,7 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe
return btManager.getConnectionState(mDevice, BluetoothProfile.GATT);
}
public void reconnect() {
void reconnect() {
if (getConnectionState() != BluetoothProfile.STATE_CONNECTED) {
mGatt.disconnect();
@@ -401,12 +401,12 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe
queueGattOperation(op);
}
public void writeCharacteristic(UUID uuid, byte[] value) {
void writeCharacteristic(UUID uuid, byte[] value) {
GattOperation op = HIDDeviceBLESteamController.GattOperation.writeCharacteristic(mGatt, uuid, value);
queueGattOperation(op);
}
public void readCharacteristic(UUID uuid) {
void readCharacteristic(UUID uuid) {
GattOperation op = HIDDeviceBLESteamController.GattOperation.readCharacteristic(mGatt, uuid);
queueGattOperation(op);
}
@@ -415,6 +415,7 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe
////////////// BluetoothGattCallback overridden methods
//////////////////////////////////////////////////////////////////////////////////////////////////////
@Override
public void onConnectionStateChange(BluetoothGatt g, int status, int newState) {
//Log.v(TAG, "onConnectionStateChange status=" + status + " newState=" + newState);
mIsReconnecting = false;
@@ -437,6 +438,7 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe
// Disconnection is handled in SteamLink using the ACTION_ACL_DISCONNECTED Intent.
}
@Override
public void onServicesDiscovered(BluetoothGatt gatt, int status) {
//Log.v(TAG, "onServicesDiscovered status=" + status);
if (status == 0) {
@@ -453,6 +455,7 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe
}
}
@Override
public void onCharacteristicRead(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) {
//Log.v(TAG, "onCharacteristicRead status=" + status + " uuid=" + characteristic.getUuid());
@@ -463,6 +466,7 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe
finishCurrentGattOperation();
}
@Override
public void onCharacteristicWrite(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) {
//Log.v(TAG, "onCharacteristicWrite status=" + status + " uuid=" + characteristic.getUuid());
@@ -478,6 +482,7 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe
finishCurrentGattOperation();
}
@Override
public void onCharacteristicChanged(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic) {
// Enable this for verbose logging of controller input reports
//Log.v(TAG, "onCharacteristicChanged uuid=" + characteristic.getUuid() + " data=" + HexDump.dumpHexString(characteristic.getValue()));
@@ -487,10 +492,12 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe
}
}
@Override
public void onDescriptorRead(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status) {
//Log.v(TAG, "onDescriptorRead status=" + status);
}
@Override
public void onDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status) {
BluetoothGattCharacteristic chr = descriptor.getCharacteristic();
//Log.v(TAG, "onDescriptorWrite status=" + status + " uuid=" + chr.getUuid() + " descriptor=" + descriptor.getUuid());
@@ -508,14 +515,17 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe
finishCurrentGattOperation();
}
@Override
public void onReliableWriteCompleted(BluetoothGatt gatt, int status) {
//Log.v(TAG, "onReliableWriteCompleted status=" + status);
}
@Override
public void onReadRemoteRssi(BluetoothGatt gatt, int rssi, int status) {
//Log.v(TAG, "onReadRemoteRssi status=" + status);
}
@Override
public void onMtuChanged(BluetoothGatt gatt, int mtu, int status) {
//Log.v(TAG, "onMtuChanged status=" + status);
}

View File

@@ -32,7 +32,7 @@ public class HIDDeviceManager {
private static HIDDeviceManager sManager;
private static int sManagerRefCount = 0;
public static HIDDeviceManager acquire(Context context) {
static public HIDDeviceManager acquire(Context context) {
if (sManagerRefCount == 0) {
sManager = new HIDDeviceManager(context);
}
@@ -40,7 +40,7 @@ public class HIDDeviceManager {
return sManager;
}
public static void release(HIDDeviceManager manager) {
static public void release(HIDDeviceManager manager) {
if (manager == sManager) {
--sManagerRefCount;
if (sManagerRefCount == 0) {
@@ -108,7 +108,7 @@ public class HIDDeviceManager {
HIDDeviceRegisterCallback();
mSharedPreferences = mContext.getSharedPreferences("hidapi", Context.MODE_PRIVATE);
mIsChromebook = mContext.getPackageManager().hasSystemFeature("org.chromium.arc.device_management");
mIsChromebook = SDLActivity.isChromebook();
// if (shouldClear) {
// SharedPreferences.Editor spedit = mSharedPreferences.edit();
@@ -121,11 +121,11 @@ public class HIDDeviceManager {
}
}
public Context getContext() {
Context getContext() {
return mContext;
}
public int getDeviceIDForIdentifier(String identifier) {
int getDeviceIDForIdentifier(String identifier) {
SharedPreferences.Editor spedit = mSharedPreferences.edit();
int result = mSharedPreferences.getInt(identifier, 0);
@@ -193,7 +193,7 @@ public class HIDDeviceManager {
filter.addAction(UsbManager.ACTION_USB_DEVICE_ATTACHED);
filter.addAction(UsbManager.ACTION_USB_DEVICE_DETACHED);
filter.addAction(HIDDeviceManager.ACTION_USB_PERMISSION);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
if (Build.VERSION.SDK_INT >= 33) { /* Android 13.0 (TIRAMISU) */
mContext.registerReceiver(mUsbBroadcast, filter, Context.RECEIVER_EXPORTED);
} else {
mContext.registerReceiver(mUsbBroadcast, filter);
@@ -288,9 +288,13 @@ public class HIDDeviceManager {
0x1532, // Razer Wildcat
0x20d6, // PowerA
0x24c6, // PowerA
0x294b, // Snakebyte
0x2dc8, // 8BitDo
0x2e24, // Hyperkin
0x2e95, // SCUF
0x3285, // Nacon
0x3537, // GameSir
0x366c, // ByoWave
};
if (usbInterface.getId() == 0 &&
@@ -376,7 +380,7 @@ public class HIDDeviceManager {
return;
}
if (!mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE) || (Build.VERSION.SDK_INT < 18 /* Android 4.3 (JELLY_BEAN_MR2) */)) {
if (!mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) {
Log.d(TAG, "Couldn't initialize Bluetooth, this version of Android does not support Bluetooth LE");
return;
}
@@ -408,7 +412,7 @@ public class HIDDeviceManager {
IntentFilter filter = new IntentFilter();
filter.addAction(BluetoothDevice.ACTION_ACL_CONNECTED);
filter.addAction(BluetoothDevice.ACTION_ACL_DISCONNECTED);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
if (Build.VERSION.SDK_INT >= 33) { /* Android 13.0 (TIRAMISU) */
mContext.registerReceiver(mBluetoothBroadcast, filter, Context.RECEIVER_EXPORTED);
} else {
mContext.registerReceiver(mBluetoothBroadcast, filter);
@@ -439,7 +443,7 @@ public class HIDDeviceManager {
// Chromebooks do not pass along ACTION_ACL_CONNECTED / ACTION_ACL_DISCONNECTED properly.
// This function provides a sort of dummy version of that, watching for changes in the
// connected devices and attempting to add controllers as things change.
public void chromebookConnectionHandler() {
void chromebookConnectionHandler() {
if (!mIsChromebook) {
return;
}
@@ -478,7 +482,7 @@ public class HIDDeviceManager {
}, 10000);
}
public boolean connectBluetoothDevice(BluetoothDevice bluetoothDevice) {
boolean connectBluetoothDevice(BluetoothDevice bluetoothDevice) {
Log.v(TAG, "connectBluetoothDevice device=" + bluetoothDevice);
synchronized (this) {
if (mBluetoothDevices.containsKey(bluetoothDevice)) {
@@ -499,7 +503,7 @@ public class HIDDeviceManager {
return true;
}
public void disconnectBluetoothDevice(BluetoothDevice bluetoothDevice) {
void disconnectBluetoothDevice(BluetoothDevice bluetoothDevice) {
synchronized (this) {
HIDDeviceBLESteamController device = mBluetoothDevices.get(bluetoothDevice);
if (device == null)
@@ -513,7 +517,7 @@ public class HIDDeviceManager {
}
}
public boolean isSteamController(BluetoothDevice bluetoothDevice) {
boolean isSteamController(BluetoothDevice bluetoothDevice) {
// Sanity check. If you pass in a null device, by definition it is never a Steam Controller.
if (bluetoothDevice == null) {
return false;
@@ -567,7 +571,7 @@ public class HIDDeviceManager {
////////// JNI interface functions
//////////////////////////////////////////////////////////////////////////////////////////////////////
public boolean initialize(boolean usb, boolean bluetooth) {
boolean initialize(boolean usb, boolean bluetooth) {
Log.v(TAG, "initialize(" + usb + ", " + bluetooth + ")");
if (usb) {
@@ -579,7 +583,7 @@ public class HIDDeviceManager {
return true;
}
public boolean openDevice(int deviceID) {
boolean openDevice(int deviceID) {
Log.v(TAG, "openDevice deviceID=" + deviceID);
HIDDevice device = getDevice(deviceID);
if (device == null) {
@@ -599,13 +603,10 @@ public class HIDDeviceManager {
} else {
flags = 0;
}
if (Build.VERSION.SDK_INT >= 33 /* Android 14.0 (U) */) {
Intent intent = new Intent(HIDDeviceManager.ACTION_USB_PERMISSION);
intent.setPackage(mContext.getPackageName());
mUsbManager.requestPermission(usbDevice, PendingIntent.getBroadcast(mContext, 0, intent, flags));
} else {
mUsbManager.requestPermission(usbDevice, PendingIntent.getBroadcast(mContext, 0, new Intent(HIDDeviceManager.ACTION_USB_PERMISSION), flags));
}
Intent intent = new Intent(HIDDeviceManager.ACTION_USB_PERMISSION);
intent.setPackage(mContext.getPackageName());
mUsbManager.requestPermission(usbDevice, PendingIntent.getBroadcast(mContext, 0, intent, flags));
} catch (Exception e) {
Log.v(TAG, "Couldn't request permission for USB device " + usbDevice);
HIDDeviceOpenResult(deviceID, false);
@@ -621,7 +622,7 @@ public class HIDDeviceManager {
return false;
}
public int writeReport(int deviceID, byte[] report, boolean feature) {
int writeReport(int deviceID, byte[] report, boolean feature) {
try {
//Log.v(TAG, "writeReport deviceID=" + deviceID + " length=" + report.length);
HIDDevice device;
@@ -638,7 +639,7 @@ public class HIDDeviceManager {
return -1;
}
public boolean readReport(int deviceID, byte[] report, boolean feature) {
boolean readReport(int deviceID, byte[] report, boolean feature) {
try {
//Log.v(TAG, "readReport deviceID=" + deviceID);
HIDDevice device;
@@ -655,7 +656,7 @@ public class HIDDeviceManager {
return false;
}
public void closeDevice(int deviceID) {
void closeDevice(int deviceID) {
try {
Log.v(TAG, "closeDevice deviceID=" + deviceID);
HIDDevice device;

View File

@@ -30,7 +30,7 @@ class HIDDeviceUSB implements HIDDevice {
mRunning = false;
}
public String getIdentifier() {
String getIdentifier() {
return String.format("%s/%x/%x/%d", mDevice.getDeviceName(), mDevice.getVendorId(), mDevice.getProductId(), mInterfaceIndex);
}
@@ -52,13 +52,11 @@ class HIDDeviceUSB implements HIDDevice {
@Override
public String getSerialNumber() {
String result = null;
if (Build.VERSION.SDK_INT >= 21 /* Android 5.0 (LOLLIPOP) */) {
try {
result = mDevice.getSerialNumber();
}
catch (SecurityException exception) {
//Log.w(TAG, "App permissions mean we cannot get serial number for device " + getDeviceName() + " message: " + exception.getMessage());
}
try {
result = mDevice.getSerialNumber();
}
catch (SecurityException exception) {
//Log.w(TAG, "App permissions mean we cannot get serial number for device " + getDeviceName() + " message: " + exception.getMessage());
}
if (result == null) {
result = "";
@@ -73,10 +71,8 @@ class HIDDeviceUSB implements HIDDevice {
@Override
public String getManufacturerName() {
String result = null;
if (Build.VERSION.SDK_INT >= 21 /* Android 5.0 (LOLLIPOP) */) {
result = mDevice.getManufacturerName();
}
String result;
result = mDevice.getManufacturerName();
if (result == null) {
result = String.format("%x", getVendorId());
}
@@ -85,10 +81,8 @@ class HIDDeviceUSB implements HIDDevice {
@Override
public String getProductName() {
String result = null;
if (Build.VERSION.SDK_INT >= 21 /* Android 5.0 (LOLLIPOP) */) {
result = mDevice.getProductName();
}
String result;
result = mDevice.getProductName();
if (result == null) {
result = String.format("%x", getProductId());
}
@@ -100,7 +94,7 @@ class HIDDeviceUSB implements HIDDevice {
return mDevice;
}
public String getDeviceName() {
String getDeviceName() {
return getManufacturerName() + " " + getProductName() + "(0x" + String.format("%x", getVendorId()) + "/0x" + String.format("%x", getProductId()) + ")";
}

View File

@@ -12,14 +12,14 @@ public class SDL {
// This function should be called first and sets up the native code
// so it can call into the Java classes
public static void setupJNI() {
static public void setupJNI() {
SDLActivity.nativeSetupJNI();
SDLAudioManager.nativeSetupJNI();
SDLControllerManager.nativeSetupJNI();
}
// This function should be called each time the activity is started
public static void initialize() {
static public void initialize() {
setContext(null);
SDLActivity.initialize();
@@ -28,20 +28,20 @@ public class SDL {
}
// This function stores the current activity (SDL or not)
public static void setContext(Context context) {
static public void setContext(Context context) {
SDLAudioManager.setContext(context);
mContext = context;
}
public static Context getContext() {
static public Context getContext() {
return mContext;
}
public static void loadLibrary(String libraryName) throws UnsatisfiedLinkError, SecurityException, NullPointerException {
static void loadLibrary(String libraryName) throws UnsatisfiedLinkError, SecurityException, NullPointerException {
loadLibrary(libraryName, mContext);
}
public static void loadLibrary(String libraryName, Context context) throws UnsatisfiedLinkError, SecurityException, NullPointerException {
static void loadLibrary(String libraryName, Context context) throws UnsatisfiedLinkError, SecurityException, NullPointerException {
if (libraryName == null) {
throw new NullPointerException("No library name provided.");

View File

@@ -23,6 +23,7 @@ import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.LocaleList;
import android.os.Message;
import android.os.ParcelFileDescriptor;
import android.util.DisplayMetrics;
@@ -59,8 +60,8 @@ import java.util.Locale;
public class SDLActivity extends Activity implements View.OnSystemUiVisibilityChangeListener {
private static final String TAG = "SDL";
private static final int SDL_MAJOR_VERSION = 3;
private static final int SDL_MINOR_VERSION = 1;
private static final int SDL_MICRO_VERSION = 10;
private static final int SDL_MINOR_VERSION = 3;
private static final int SDL_MICRO_VERSION = 0;
/*
// Display InputType.SOURCE/CLASS of events and devices
//
@@ -106,11 +107,9 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
if ((s & tst) == tst) src += " GAMEPAD";
s2 &= ~tst;
if (Build.VERSION.SDK_INT >= 21) {
tst = InputDevice.SOURCE_HDMI;
if ((s & tst) == tst) src += " HDMI";
s2 &= ~tst;
}
tst = InputDevice.SOURCE_HDMI;
if ((s & tst) == tst) src += " HDMI";
s2 &= ~tst;
tst = InputDevice.SOURCE_JOYSTICK;
if ((s & tst) == tst) src += " JOYSTICK";
@@ -145,11 +144,9 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
if ((s & tst) == tst) src += " TOUCHSCREEN";
s2 &= ~tst;
if (Build.VERSION.SDK_INT >= 18) {
tst = InputDevice.SOURCE_TOUCH_NAVIGATION;
if ((s & tst) == tst) src += " TOUCH_NAVIGATION";
s2 &= ~tst;
}
tst = InputDevice.SOURCE_TOUCH_NAVIGATION;
if ((s & tst) == tst) src += " TOUCH_NAVIGATION";
s2 &= ~tst;
tst = InputDevice.SOURCE_TRACKBALL;
if ((s & tst) == tst) src += " TRACKBALL";
@@ -911,39 +908,37 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
}
break;
case COMMAND_CHANGE_WINDOW_STYLE:
if (Build.VERSION.SDK_INT >= 19 /* Android 4.4 (KITKAT) */) {
if (context instanceof Activity) {
Window window = ((Activity) context).getWindow();
if (window != null) {
if ((msg.obj instanceof Integer) && ((Integer) msg.obj != 0)) {
int flags = View.SYSTEM_UI_FLAG_FULLSCREEN |
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY |
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.INVISIBLE;
window.getDecorView().setSystemUiVisibility(flags);
window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
SDLActivity.mFullscreenModeActive = true;
} else {
int flags = View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_VISIBLE;
window.getDecorView().setSystemUiVisibility(flags);
window.addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
SDLActivity.mFullscreenModeActive = false;
}
if (Build.VERSION.SDK_INT >= 28 /* Android 9 (Pie) */) {
window.getAttributes().layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
}
if (Build.VERSION.SDK_INT >= 30 /* Android 11 (R) */ &&
Build.VERSION.SDK_INT < 35 /* Android 15 */) {
SDLActivity.onNativeInsetsChanged(0, 0, 0, 0);
}
if (context instanceof Activity) {
Window window = ((Activity) context).getWindow();
if (window != null) {
if ((msg.obj instanceof Integer) && ((Integer) msg.obj != 0)) {
int flags = View.SYSTEM_UI_FLAG_FULLSCREEN |
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY |
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.INVISIBLE;
window.getDecorView().setSystemUiVisibility(flags);
window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
SDLActivity.mFullscreenModeActive = true;
} else {
int flags = View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_VISIBLE;
window.getDecorView().setSystemUiVisibility(flags);
window.addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
SDLActivity.mFullscreenModeActive = false;
}
if (Build.VERSION.SDK_INT >= 28 /* Android 9 (Pie) */) {
window.getAttributes().layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
}
if (Build.VERSION.SDK_INT >= 30 /* Android 11 (R) */ &&
Build.VERSION.SDK_INT < 35 /* Android 15 */) {
SDLActivity.onNativeInsetsChanged(0, 0, 0, 0);
}
} else {
Log.e(TAG, "error handling message, getContext() returned no Activity");
}
} else {
Log.e(TAG, "error handling message, getContext() returned no Activity");
}
break;
case COMMAND_TEXTEDIT_HIDE:
@@ -993,53 +988,51 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
msg.obj = data;
boolean result = commandHandler.sendMessage(msg);
if (Build.VERSION.SDK_INT >= 19 /* Android 4.4 (KITKAT) */) {
if (command == COMMAND_CHANGE_WINDOW_STYLE) {
// Ensure we don't return until the resize has actually happened,
// or 500ms have passed.
if (command == COMMAND_CHANGE_WINDOW_STYLE) {
// Ensure we don't return until the resize has actually happened,
// or 500ms have passed.
boolean bShouldWait = false;
boolean bShouldWait = false;
if (data instanceof Integer) {
// Let's figure out if we're already laid out fullscreen or not.
Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
DisplayMetrics realMetrics = new DisplayMetrics();
display.getRealMetrics(realMetrics);
if (data instanceof Integer) {
// Let's figure out if we're already laid out fullscreen or not.
Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
DisplayMetrics realMetrics = new DisplayMetrics();
display.getRealMetrics(realMetrics);
boolean bFullscreenLayout = ((realMetrics.widthPixels == mSurface.getWidth()) &&
(realMetrics.heightPixels == mSurface.getHeight()));
boolean bFullscreenLayout = ((realMetrics.widthPixels == mSurface.getWidth()) &&
(realMetrics.heightPixels == mSurface.getHeight()));
if ((Integer) data == 1) {
// If we aren't laid out fullscreen or actively in fullscreen mode already, we're going
// to change size and should wait for surfaceChanged() before we return, so the size
// is right back in native code. If we're already laid out fullscreen, though, we're
// not going to change size even if we change decor modes, so we shouldn't wait for
// surfaceChanged() -- which may not even happen -- and should return immediately.
bShouldWait = !bFullscreenLayout;
} else {
// If we're laid out fullscreen (even if the status bar and nav bar are present),
// or are actively in fullscreen, we're going to change size and should wait for
// surfaceChanged before we return, so the size is right back in native code.
bShouldWait = bFullscreenLayout;
}
if ((Integer) data == 1) {
// If we aren't laid out fullscreen or actively in fullscreen mode already, we're going
// to change size and should wait for surfaceChanged() before we return, so the size
// is right back in native code. If we're already laid out fullscreen, though, we're
// not going to change size even if we change decor modes, so we shouldn't wait for
// surfaceChanged() -- which may not even happen -- and should return immediately.
bShouldWait = !bFullscreenLayout;
} else {
// If we're laid out fullscreen (even if the status bar and nav bar are present),
// or are actively in fullscreen, we're going to change size and should wait for
// surfaceChanged before we return, so the size is right back in native code.
bShouldWait = bFullscreenLayout;
}
}
if (bShouldWait && (SDLActivity.getContext() != null)) {
// We'll wait for the surfaceChanged() method, which will notify us
// when called. That way, we know our current size is really the
// size we need, instead of grabbing a size that's still got
// the navigation and/or status bars before they're hidden.
//
// We'll wait for up to half a second, because some devices
// take a surprisingly long time for the surface resize, but
// then we'll just give up and return.
//
synchronized (SDLActivity.getContext()) {
try {
SDLActivity.getContext().wait(500);
} catch (InterruptedException ie) {
ie.printStackTrace();
}
if (bShouldWait && (SDLActivity.getContext() != null)) {
// We'll wait for the surfaceChanged() method, which will notify us
// when called. That way, we know our current size is really the
// size we need, instead of grabbing a size that's still got
// the navigation and/or status bars before they're hidden.
//
// We'll wait for up to half a second, because some devices
// take a surprisingly long time for the surface resize, but
// then we'll just give up and return.
//
synchronized (SDLActivity.getContext()) {
try {
SDLActivity.getContext().wait(500);
} catch (InterruptedException ie) {
ie.printStackTrace();
}
}
}
@@ -1330,10 +1323,17 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
* This method is called by SDL using JNI.
*/
public static boolean isChromebook() {
if (getContext() == null) {
return false;
// https://stackoverflow.com/questions/39784415/how-to-detect-programmatically-if-android-app-is-running-in-chrome-book-or-in
if (getContext() != null) {
if (getContext().getPackageManager().hasSystemFeature("org.chromium.arc")
|| getContext().getPackageManager().hasSystemFeature("org.chromium.arc.device_management")) {
return true;
}
}
return getContext().getPackageManager().hasSystemFeature("org.chromium.arc.device_management");
// Running on AVD emulator
boolean isChromebookEmulator = (Build.MODEL != null && Build.MODEL.startsWith("sdk_gpc_"));
return isChromebookEmulator;
}
/**
@@ -1766,16 +1766,14 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
private final Runnable rehideSystemUi = new Runnable() {
@Override
public void run() {
if (Build.VERSION.SDK_INT >= 19 /* Android 4.4 (KITKAT) */) {
int flags = View.SYSTEM_UI_FLAG_FULLSCREEN |
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY |
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.INVISIBLE;
int flags = View.SYSTEM_UI_FLAG_FULLSCREEN |
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY |
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.INVISIBLE;
SDLActivity.this.getWindow().getDecorView().setSystemUiVisibility(flags);
}
SDLActivity.this.getWindow().getDecorView().setSystemUiVisibility(flags);
}
};
@@ -1970,12 +1968,9 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
int flags = Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_MULTIPLE_TASK;
if (Build.VERSION.SDK_INT >= 21 /* Android 5.0 (LOLLIPOP) */) {
flags |= Intent.FLAG_ACTIVITY_NEW_DOCUMENT;
} else {
flags |= Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET;
}
int flags = Intent.FLAG_ACTIVITY_NO_HISTORY
| Intent.FLAG_ACTIVITY_MULTIPLE_TASK
| Intent.FLAG_ACTIVITY_NEW_DOCUMENT;
i.addFlags(flags);
mSingleton.startActivity(i);
@@ -2116,6 +2111,44 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
int requestCode;
boolean multipleChoice;
}
/**
* This method is called by SDL using JNI.
*/
public static String getPreferredLocales() {
String result = "";
if (Build.VERSION.SDK_INT >= 24 /* Android 7 (N) */) {
LocaleList locales = LocaleList.getAdjustedDefault();
for (int i = 0; i < locales.size(); i++) {
if (i != 0) result += ",";
result += formatLocale(locales.get(i));
}
} else if (mCurrentLocale != null) {
result = formatLocale(mCurrentLocale);
}
return result;
}
public static String formatLocale(Locale locale) {
String result = "";
String lang = "";
if (locale.getLanguage() == "in") {
// Indonesian is "id" according to ISO 639.2, but on Android is "in" because of Java backwards compatibility
lang = "id";
} else if (locale.getLanguage() == "") {
// Make sure language is never empty
lang = "und";
} else {
lang = locale.getLanguage();
}
if (locale.getCountry() == "") {
result = lang;
} else {
result = lang + "_" + locale.getCountry();
}
return result;
}
}
/**

View File

@@ -10,14 +10,14 @@ import android.util.Log;
import java.util.Arrays;
import java.util.ArrayList;
public class SDLAudioManager {
class SDLAudioManager {
protected static final String TAG = "SDLAudio";
protected static Context mContext;
private static AudioDeviceCallback mAudioDeviceCallback;
public static void initialize() {
static void initialize() {
mAudioDeviceCallback = null;
if(Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */)
@@ -26,25 +26,25 @@ public class SDLAudioManager {
@Override
public void onAudioDevicesAdded(AudioDeviceInfo[] addedDevices) {
for (AudioDeviceInfo deviceInfo : addedDevices) {
addAudioDevice(deviceInfo.isSink(), deviceInfo.getProductName().toString(), deviceInfo.getId());
nativeAddAudioDevice(deviceInfo.isSink(), deviceInfo.getProductName().toString(), deviceInfo.getId());
}
}
@Override
public void onAudioDevicesRemoved(AudioDeviceInfo[] removedDevices) {
for (AudioDeviceInfo deviceInfo : removedDevices) {
removeAudioDevice(deviceInfo.isSink(), deviceInfo.getId());
nativeRemoveAudioDevice(deviceInfo.isSink(), deviceInfo.getId());
}
}
};
}
}
public static void setContext(Context context) {
static void setContext(Context context) {
mContext = context;
}
public static void release(Context context) {
static void release(Context context) {
// no-op atm
}
@@ -74,7 +74,7 @@ public class SDLAudioManager {
return null;
}
public static void registerAudioDeviceCallback() {
static void registerAudioDeviceCallback() {
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
// get an initial list now, before hotplug callbacks fire.
@@ -82,16 +82,16 @@ public class SDLAudioManager {
if (dev.getType() == AudioDeviceInfo.TYPE_TELEPHONY) {
continue; // Device cannot be opened
}
addAudioDevice(dev.isSink(), dev.getProductName().toString(), dev.getId());
nativeAddAudioDevice(dev.isSink(), dev.getProductName().toString(), dev.getId());
}
for (AudioDeviceInfo dev : audioManager.getDevices(AudioManager.GET_DEVICES_INPUTS)) {
addAudioDevice(dev.isSink(), dev.getProductName().toString(), dev.getId());
nativeAddAudioDevice(dev.isSink(), dev.getProductName().toString(), dev.getId());
}
audioManager.registerAudioDeviceCallback(mAudioDeviceCallback, null);
}
}
public static void unregisterAudioDeviceCallback() {
static void unregisterAudioDeviceCallback() {
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
audioManager.unregisterAudioDeviceCallback(mAudioDeviceCallback);
@@ -99,7 +99,7 @@ public class SDLAudioManager {
}
/** This method is called by SDL using JNI. */
public static void audioSetThreadPriority(boolean recording, int device_id) {
static void audioSetThreadPriority(boolean recording, int device_id) {
try {
/* Set thread name */
@@ -117,10 +117,10 @@ public class SDLAudioManager {
}
}
public static native int nativeSetupJNI();
static native int nativeSetupJNI();
public static native void removeAudioDevice(boolean recording, int deviceId);
static native void nativeRemoveAudioDevice(boolean recording, int deviceId);
public static native void addAudioDevice(boolean recording, String name, int deviceId);
static native void nativeAddAudioDevice(boolean recording, String name, int deviceId);
}

View File

@@ -20,20 +20,20 @@ import android.view.View;
public class SDLControllerManager
{
public static native int nativeSetupJNI();
static native int nativeSetupJNI();
public static native void nativeAddJoystick(int device_id, String name, String desc,
static native void nativeAddJoystick(int device_id, String name, String desc,
int vendor_id, int product_id,
int button_mask,
int naxes, int axis_mask, int nhats, boolean can_rumble);
public static native void nativeRemoveJoystick(int device_id);
public static native void nativeAddHaptic(int device_id, String name);
public static native void nativeRemoveHaptic(int device_id);
public static native boolean onNativePadDown(int device_id, int keycode);
public static native boolean onNativePadUp(int device_id, int keycode);
public static native void onNativeJoy(int device_id, int axis,
static native void nativeRemoveJoystick(int device_id);
static native void nativeAddHaptic(int device_id, String name);
static native void nativeRemoveHaptic(int device_id);
static public native boolean onNativePadDown(int device_id, int keycode);
static public native boolean onNativePadUp(int device_id, int keycode);
static native void onNativeJoy(int device_id, int axis,
float value);
public static native void onNativeHat(int device_id, int hat_id,
static native void onNativeHat(int device_id, int hat_id,
int x, int y);
protected static SDLJoystickHandler mJoystickHandler;
@@ -41,13 +41,9 @@ public class SDLControllerManager
private static final String TAG = "SDLControllerManager";
public static void initialize() {
static void initialize() {
if (mJoystickHandler == null) {
if (Build.VERSION.SDK_INT >= 19 /* Android 4.4 (KITKAT) */) {
mJoystickHandler = new SDLJoystickHandler_API19();
} else {
mJoystickHandler = new SDLJoystickHandler_API16();
}
mJoystickHandler = new SDLJoystickHandler();
}
if (mHapticHandler == null) {
@@ -62,48 +58,48 @@ public class SDLControllerManager
}
// Joystick glue code, just a series of stubs that redirect to the SDLJoystickHandler instance
public static boolean handleJoystickMotionEvent(MotionEvent event) {
static public boolean handleJoystickMotionEvent(MotionEvent event) {
return mJoystickHandler.handleMotionEvent(event);
}
/**
* This method is called by SDL using JNI.
*/
public static void pollInputDevices() {
static void pollInputDevices() {
mJoystickHandler.pollInputDevices();
}
/**
* This method is called by SDL using JNI.
*/
public static void pollHapticDevices() {
static void pollHapticDevices() {
mHapticHandler.pollHapticDevices();
}
/**
* This method is called by SDL using JNI.
*/
public static void hapticRun(int device_id, float intensity, int length) {
static void hapticRun(int device_id, float intensity, int length) {
mHapticHandler.run(device_id, intensity, length);
}
/**
* This method is called by SDL using JNI.
*/
public static void hapticRumble(int device_id, float low_frequency_intensity, float high_frequency_intensity, int length) {
static void hapticRumble(int device_id, float low_frequency_intensity, float high_frequency_intensity, int length) {
mHapticHandler.rumble(device_id, low_frequency_intensity, high_frequency_intensity, length);
}
/**
* This method is called by SDL using JNI.
*/
public static void hapticStop(int device_id)
static void hapticStop(int device_id)
{
mHapticHandler.stop(device_id);
}
// Check if a given device is considered a possible SDL joystick
public static boolean isDeviceSDLJoystick(int deviceId) {
static public boolean isDeviceSDLJoystick(int deviceId) {
InputDevice device = InputDevice.getDevice(deviceId);
// We cannot use InputDevice.isVirtual before API 16, so let's accept
// only nonnegative device ids (VIRTUAL_KEYBOARD equals -1)
@@ -133,33 +129,16 @@ public class SDLControllerManager
}
/* Actual joystick functionality available for API >= 19 devices */
class SDLJoystickHandler {
/**
* Handles given MotionEvent.
* @param event the event to be handled.
* @return if given event was processed.
*/
public boolean handleMotionEvent(MotionEvent event) {
return false;
}
/**
* Handles adding and removing of input devices.
*/
public void pollInputDevices() {
}
}
/* Actual joystick functionality available for API >= 12 devices */
class SDLJoystickHandler_API16 extends SDLJoystickHandler {
static class SDLJoystick {
public int device_id;
public String name;
public String desc;
public ArrayList<InputDevice.MotionRange> axes;
public ArrayList<InputDevice.MotionRange> hats;
int device_id;
String name;
String desc;
ArrayList<InputDevice.MotionRange> axes;
ArrayList<InputDevice.MotionRange> hats;
}
static class RangeComparator implements Comparator<InputDevice.MotionRange> {
@Override
@@ -210,13 +189,15 @@ class SDLJoystickHandler_API16 extends SDLJoystickHandler {
private final ArrayList<SDLJoystick> mJoysticks;
public SDLJoystickHandler_API16() {
SDLJoystickHandler() {
mJoysticks = new ArrayList<SDLJoystick>();
}
@Override
public void pollInputDevices() {
/**
* Handles adding and removing of input devices.
*/
void pollInputDevices() {
int[] deviceIds = InputDevice.getDeviceIds();
for (int device_id : deviceIds) {
@@ -298,8 +279,12 @@ class SDLJoystickHandler_API16 extends SDLJoystickHandler {
return null;
}
@Override
public boolean handleMotionEvent(MotionEvent event) {
/**
* Handles given MotionEvent.
* @param event the event to be handled.
* @return if given event was processed.
*/
boolean handleMotionEvent(MotionEvent event) {
int actionPointerIndex = event.getActionIndex();
int action = event.getActionMasked();
if (action == MotionEvent.ACTION_MOVE) {
@@ -321,7 +306,7 @@ class SDLJoystickHandler_API16 extends SDLJoystickHandler {
return true;
}
public String getJoystickDescriptor(InputDevice joystickDevice) {
String getJoystickDescriptor(InputDevice joystickDevice) {
String desc = joystickDevice.getDescriptor();
if (desc != null && !desc.isEmpty()) {
@@ -330,34 +315,16 @@ class SDLJoystickHandler_API16 extends SDLJoystickHandler {
return joystickDevice.getName();
}
public int getProductId(InputDevice joystickDevice) {
return 0;
}
public int getVendorId(InputDevice joystickDevice) {
return 0;
}
public int getAxisMask(List<InputDevice.MotionRange> ranges) {
return -1;
}
public int getButtonMask(InputDevice joystickDevice) {
return -1;
}
}
class SDLJoystickHandler_API19 extends SDLJoystickHandler_API16 {
@Override
public int getProductId(InputDevice joystickDevice) {
int getProductId(InputDevice joystickDevice) {
return joystickDevice.getProductId();
}
@Override
public int getVendorId(InputDevice joystickDevice) {
int getVendorId(InputDevice joystickDevice) {
return joystickDevice.getVendorId();
}
@Override
public int getAxisMask(List<InputDevice.MotionRange> ranges) {
int getAxisMask(List<InputDevice.MotionRange> ranges) {
// For compatibility, keep computing the axis mask like before,
// only really distinguishing 2, 4 and 6 axes.
int axis_mask = 0;
@@ -393,8 +360,7 @@ class SDLJoystickHandler_API19 extends SDLJoystickHandler_API16 {
return axis_mask;
}
@Override
public int getButtonMask(InputDevice joystickDevice) {
int getButtonMask(InputDevice joystickDevice) {
int button_mask = 0;
int[] keys = new int[] {
KeyEvent.KEYCODE_BUTTON_A,
@@ -491,7 +457,7 @@ class SDLJoystickHandler_API19 extends SDLJoystickHandler_API16 {
class SDLHapticHandler_API31 extends SDLHapticHandler {
@Override
public void run(int device_id, float intensity, int length) {
void run(int device_id, float intensity, int length) {
SDLHaptic haptic = getHaptic(device_id);
if (haptic != null) {
vibrate(haptic.vib, intensity, length);
@@ -499,7 +465,7 @@ class SDLHapticHandler_API31 extends SDLHapticHandler {
}
@Override
public void rumble(int device_id, float low_frequency_intensity, float high_frequency_intensity, int length) {
void rumble(int device_id, float low_frequency_intensity, float high_frequency_intensity, int length) {
InputDevice device = InputDevice.getDevice(device_id);
if (device == null) {
return;
@@ -543,7 +509,7 @@ class SDLHapticHandler_API31 extends SDLHapticHandler {
class SDLHapticHandler_API26 extends SDLHapticHandler {
@Override
public void run(int device_id, float intensity, int length) {
void run(int device_id, float intensity, int length) {
SDLHaptic haptic = getHaptic(device_id);
if (haptic != null) {
if (intensity == 0.0f) {
@@ -575,36 +541,36 @@ class SDLHapticHandler_API26 extends SDLHapticHandler {
class SDLHapticHandler {
static class SDLHaptic {
public int device_id;
public String name;
public Vibrator vib;
int device_id;
String name;
Vibrator vib;
}
private final ArrayList<SDLHaptic> mHaptics;
public SDLHapticHandler() {
SDLHapticHandler() {
mHaptics = new ArrayList<SDLHaptic>();
}
public void run(int device_id, float intensity, int length) {
void run(int device_id, float intensity, int length) {
SDLHaptic haptic = getHaptic(device_id);
if (haptic != null) {
haptic.vib.vibrate(length);
}
}
public void rumble(int device_id, float low_frequency_intensity, float high_frequency_intensity, int length) {
void rumble(int device_id, float low_frequency_intensity, float high_frequency_intensity, int length) {
// Not supported in older APIs
}
public void stop(int device_id) {
void stop(int device_id) {
SDLHaptic haptic = getHaptic(device_id);
if (haptic != null) {
haptic.vib.cancel();
}
}
public void pollHapticDevices() {
void pollHapticDevices() {
final int deviceId_VIBRATOR_SERVICE = 999999;
boolean hasVibratorService = false;
@@ -705,9 +671,14 @@ class SDLGenericMotionListener_API14 implements View.OnGenericMotionListener {
x = event.getX(i);
y = event.getY(i);
float p = event.getPressure(i);
if (p > 1.0f) {
// may be larger than 1.0f on some devices
// see the documentation of getPressure(i)
p = 1.0f;
}
// BUTTON_STYLUS_PRIMARY is 2^5, so shift by 4
int buttons = event.getButtonState() >> 4;
// BUTTON_STYLUS_PRIMARY is 2^5, so shift by 4, and apply SDL_PEN_INPUT_DOWN/SDL_PEN_INPUT_ERASER_TIP
int buttons = (event.getButtonState() >> 4) | (1 << (toolType == MotionEvent.TOOL_TYPE_STYLUS ? 0 : 30));
SDLActivity.onNativePen(event.getPointerId(i), buttons, action, x, y, p);
consumed = true;
@@ -719,31 +690,31 @@ class SDLGenericMotionListener_API14 implements View.OnGenericMotionListener {
return consumed;
}
public boolean supportsRelativeMouse() {
boolean supportsRelativeMouse() {
return false;
}
public boolean inRelativeMode() {
boolean inRelativeMode() {
return false;
}
public boolean setRelativeMouseEnabled(boolean enabled) {
boolean setRelativeMouseEnabled(boolean enabled) {
return false;
}
public void reclaimRelativeMouseModeIfNeeded() {
void reclaimRelativeMouseModeIfNeeded() {
}
public boolean checkRelativeEvent(MotionEvent event) {
boolean checkRelativeEvent(MotionEvent event) {
return inRelativeMode();
}
public float getEventX(MotionEvent event, int pointerIndex) {
float getEventX(MotionEvent event, int pointerIndex) {
return event.getX(pointerIndex);
}
public float getEventY(MotionEvent event, int pointerIndex) {
float getEventY(MotionEvent event, int pointerIndex) {
return event.getY(pointerIndex);
}
@@ -755,23 +726,23 @@ class SDLGenericMotionListener_API24 extends SDLGenericMotionListener_API14 {
private boolean mRelativeModeEnabled;
@Override
public boolean supportsRelativeMouse() {
boolean supportsRelativeMouse() {
return true;
}
@Override
public boolean inRelativeMode() {
boolean inRelativeMode() {
return mRelativeModeEnabled;
}
@Override
public boolean setRelativeMouseEnabled(boolean enabled) {
boolean setRelativeMouseEnabled(boolean enabled) {
mRelativeModeEnabled = enabled;
return true;
}
@Override
public float getEventX(MotionEvent event, int pointerIndex) {
float getEventX(MotionEvent event, int pointerIndex) {
if (mRelativeModeEnabled && event.getToolType(pointerIndex) == MotionEvent.TOOL_TYPE_MOUSE) {
return event.getAxisValue(MotionEvent.AXIS_RELATIVE_X, pointerIndex);
} else {
@@ -780,7 +751,7 @@ class SDLGenericMotionListener_API24 extends SDLGenericMotionListener_API14 {
}
@Override
public float getEventY(MotionEvent event, int pointerIndex) {
float getEventY(MotionEvent event, int pointerIndex) {
if (mRelativeModeEnabled && event.getToolType(pointerIndex) == MotionEvent.TOOL_TYPE_MOUSE) {
return event.getAxisValue(MotionEvent.AXIS_RELATIVE_Y, pointerIndex);
} else {
@@ -794,17 +765,17 @@ class SDLGenericMotionListener_API26 extends SDLGenericMotionListener_API24 {
private boolean mRelativeModeEnabled;
@Override
public boolean supportsRelativeMouse() {
boolean supportsRelativeMouse() {
return (!SDLActivity.isDeXMode() || Build.VERSION.SDK_INT >= 27 /* Android 8.1 (O_MR1) */);
}
@Override
public boolean inRelativeMode() {
boolean inRelativeMode() {
return mRelativeModeEnabled;
}
@Override
public boolean setRelativeMouseEnabled(boolean enabled) {
boolean setRelativeMouseEnabled(boolean enabled) {
if (!SDLActivity.isDeXMode() || Build.VERSION.SDK_INT >= 27 /* Android 8.1 (O_MR1) */) {
if (enabled) {
SDLActivity.getContentView().requestPointerCapture();
@@ -819,25 +790,25 @@ class SDLGenericMotionListener_API26 extends SDLGenericMotionListener_API24 {
}
@Override
public void reclaimRelativeMouseModeIfNeeded() {
void reclaimRelativeMouseModeIfNeeded() {
if (mRelativeModeEnabled && !SDLActivity.isDeXMode()) {
SDLActivity.getContentView().requestPointerCapture();
}
}
@Override
public boolean checkRelativeEvent(MotionEvent event) {
boolean checkRelativeEvent(MotionEvent event) {
return event.getSource() == InputDevice.SOURCE_MOUSE_RELATIVE;
}
@Override
public float getEventX(MotionEvent event, int pointerIndex) {
float getEventX(MotionEvent event, int pointerIndex) {
// Relative mouse in capture mode will only have relative for X/Y
return event.getX(pointerIndex);
}
@Override
public float getEventY(MotionEvent event, int pointerIndex) {
float getEventY(MotionEvent event, int pointerIndex) {
// Relative mouse in capture mode will only have relative for X/Y
return event.getY(pointerIndex);
}

View File

@@ -14,14 +14,14 @@ public class SDLDummyEdit extends View implements View.OnKeyListener
InputConnection ic;
int input_type;
public SDLDummyEdit(Context context) {
SDLDummyEdit(Context context) {
super(context);
setFocusableInTouchMode(true);
setFocusable(true);
setOnKeyListener(this);
}
public void setInputType(int input_type) {
void setInputType(int input_type) {
this.input_type = input_type;
}

View File

@@ -7,12 +7,12 @@ import android.view.*;
import android.view.inputmethod.BaseInputConnection;
import android.widget.EditText;
public class SDLInputConnection extends BaseInputConnection
class SDLInputConnection extends BaseInputConnection
{
protected EditText mEditText;
protected String mCommittedText = "";
public SDLInputConnection(View targetView, boolean fullEditor) {
SDLInputConnection(View targetView, boolean fullEditor) {
super(targetView, fullEditor);
mEditText = new EditText(SDL.getContext());
}

View File

@@ -40,10 +40,10 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
protected float mWidth, mHeight;
// Is SurfaceView ready for rendering
public boolean mIsSurfaceReady;
protected boolean mIsSurfaceReady;
// Startup
public SDLSurface(Context context) {
protected SDLSurface(Context context) {
super(context);
getHolder().addCallback(this);
@@ -66,11 +66,11 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
mIsSurfaceReady = false;
}
public void handlePause() {
protected void handlePause() {
enableSensor(Sensor.TYPE_ACCELEROMETER, false);
}
public void handleResume() {
protected void handleResume() {
setFocusable(true);
setFocusableInTouchMode(true);
requestFocus();
@@ -80,7 +80,7 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
enableSensor(Sensor.TYPE_ACCELEROMETER, true);
}
public Surface getNativeSurface() {
protected Surface getNativeSurface() {
return getHolder().getSurface();
}
@@ -121,14 +121,12 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
float density = 1.0f;
try
{
if (Build.VERSION.SDK_INT >= 17 /* Android 4.2 (JELLY_BEAN_MR1) */) {
DisplayMetrics realMetrics = new DisplayMetrics();
mDisplay.getRealMetrics( realMetrics );
nDeviceWidth = realMetrics.widthPixels;
nDeviceHeight = realMetrics.heightPixels;
// Use densityDpi instead of density to more closely match what the UI scale is
density = (float)realMetrics.densityDpi / 160.0f;
}
DisplayMetrics realMetrics = new DisplayMetrics();
mDisplay.getRealMetrics( realMetrics );
nDeviceWidth = realMetrics.widthPixels;
nDeviceHeight = realMetrics.heightPixels;
// Use densityDpi instead of density to more closely match what the UI scale is
density = (float)realMetrics.densityDpi / 160.0f;
} catch(Exception ignored) {
}
@@ -276,7 +274,7 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
int buttonState = (event.getButtonState() >> 4) | (1 << (toolType == MotionEvent.TOOL_TYPE_STYLUS ? 0 : 30));
SDLActivity.onNativePen(pointerId, buttonState, action, x, y, p);
} else if (toolType == MotionEvent.TOOL_TYPE_FINGER) {
} else { // MotionEvent.TOOL_TYPE_FINGER or MotionEvent.TOOL_TYPE_UNKNOWN
pointerId = event.getPointerId(i);
x = getNormalizedX(event.getX(i));
y = getNormalizedY(event.getY(i));
@@ -299,7 +297,7 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
}
// Sensor events
public void enableSensor(int sensortype, boolean enabled) {
protected void enableSensor(int sensortype, boolean enabled) {
// TODO: This uses getDefaultSensor - what if we have >1 accels?
if (enabled) {
mSensorManager.registerListener(this,
@@ -363,6 +361,7 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
}
// Captured pointer events for API 26.
@Override
public boolean onCapturedPointerEvent(MotionEvent event)
{
int action = event.getActionMasked();
@@ -401,7 +400,7 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
SDLActivity.onNativeMouse(button, action, x, y, true);
return true;
}
}
}
return false;
}

View File

@@ -116,7 +116,7 @@ expression e;
@@
- SDL_JoystickGetDevicePlayerIndex(e)
+ /* FIXME MIGRATION: check for valid instance */
+ SDL_GetJoystickInstancePlayerIndex(GetJoystickInstanceFromIndex(e))
+ SDL_GetJoystickPlayerIndexForID(GetJoystickInstanceFromIndex(e))
@@
expression e;
@@ -130,7 +130,7 @@ expression e;
@@
- SDL_JoystickPathForIndex(e)
+ /* FIXME MIGRATION: check for valid instance */
+ SDL_GetJoystickInstancePath(GetJoystickInstanceFromIndex(e))
+ SDL_GetJoystickPathForID(GetJoystickInstanceFromIndex(e))
@@
expression e;
@@ -144,28 +144,28 @@ expression e;
@@
- SDL_GameControllerMappingForDeviceIndex(e)
+ /* FIXME MIGRATION: check for valid instance */
+ SDL_GetGamepadInstanceMapping(GetJoystickInstanceFromIndex(e))
+ SDL_GetGamepadMappingForID(GetJoystickInstanceFromIndex(e))
@@
expression e;
@@
- SDL_GameControllerNameForIndex(e)
+ /* FIXME MIGRATION: check for valid instance */
+ SDL_GetGamepadInstanceName(GetJoystickInstanceFromIndex(e))
+ SDL_GetGamepadNameForID(GetJoystickInstanceFromIndex(e))
@@
expression e;
@@
- SDL_GameControllerPathForIndex(e)
+ /* FIXME MIGRATION: check for valid instance */
+ SDL_GetGamepadInstancePath(GetJoystickInstanceFromIndex(e))
+ SDL_GetGamepadPathForID(GetJoystickInstanceFromIndex(e))
@@
expression e;
@@
- SDL_GameControllerTypeForIndex(e)
+ /* FIXME MIGRATION: check for valid instance */
+ SDL_GetGamepadInstanceType(GetJoystickInstanceFromIndex(e))
+ SDL_GetGamepadTypeForID(GetJoystickInstanceFromIndex(e))
// SDL_Has3DNow() has been removed; there is no replacement.
@@ -1136,12 +1136,12 @@ typedef SDL_GameControllerButton, SDL_GamepadButton;
@@
@@
- SDL_GameControllerGetNumTouchpadFingers
+ SDL_GetGamepadNumTouchpadFingers
+ SDL_GetNumGamepadTouchpadFingers
(...)
@@
@@
- SDL_GameControllerGetNumTouchpads
+ SDL_GetGamepadNumTouchpads
+ SDL_GetNumGamepadTouchpads
(...)
@@
@@
@@ -1491,6 +1491,51 @@ typedef SDL_GameControllerButton, SDL_GamepadButton;
+ SDL_TextInputShown
(...)
@@
SDL_Event e1;
@@
- e1.key.keysym.mod
+ e1.key.mod
@@
SDL_Event *e1;
@@
- e1->key.keysym.mod
+ e1->key.mod
@@
SDL_KeyboardEvent *e1;
@@
- e1->keysym.mod
+ e1->mod
@@
SDL_Event e1;
@@
- e1.key.keysym.sym
+ e1.key.key
@@
SDL_Event *e1;
@@
- e1->key.keysym.sym
+ e1->key.key
@@
SDL_KeyboardEvent *e1;
@@
- e1->keysym.sym
+ e1->key
@@
SDL_Event e1;
@@
- e1.key.keysym.scancode
+ e1.key.scancode
@@
SDL_Event *e1;
@@
- e1->key.keysym.scancode
+ e1->key.scancode
@@
SDL_KeyboardEvent *e1;
@@
- e1->keysym.scancode
+ e1->scancode
@@
@@
- KMOD_ALT
+ SDL_KMOD_ALT
@@ -2443,6 +2488,11 @@ SDL_Event *e1;
- e1->wheel.mouseX
+ e1->wheel.mouse_x
@@
SDL_MouseWheelEvent *e1;
@@
- e1->mouseX
+ e1->mouse_x
@@
SDL_Event e1;
@@
- e1.wheel.mouseY
@@ -2453,6 +2503,41 @@ SDL_Event *e1;
- e1->wheel.mouseY
+ e1->wheel.mouse_y
@@
SDL_MouseWheelEvent *e1;
@@
- e1->mouseY
+ e1->mouse_y
@@
SDL_Event e1;
@@
- e1.wheel.preciseX
+ e1.wheel.x
@@
SDL_Event *e1;
@@
- e1->wheel.preciseX
+ e1->wheel.x
@@
SDL_MouseWheelEvent *e1;
@@
- e1->preciseX
+ e1->x
@@
SDL_Event e1;
@@
- e1.wheel.preciseY
+ e1.wheel.y
@@
SDL_Event *e1;
@@
- e1->wheel.preciseY
+ e1->wheel.y
@@
SDL_MouseWheelEvent *e1;
@@
- e1->preciseY
+ e1->y
@@
SDL_Event e1;
@@
- e1.tfinger.touchId
@@ -2463,6 +2548,11 @@ SDL_Event *e1;
- e1->tfinger.touchId
+ e1->tfinger.touchID
@@
SDL_TouchFingerEvent *e1;
@@
- e1->touchId
+ e1->touchID
@@
SDL_Event e1;
@@
- e1.tfinger.fingerId
@@ -2473,6 +2563,11 @@ SDL_Event *e1;
- e1->tfinger.fingerId
+ e1->tfinger.fingerID
@@
SDL_TouchFingerEvent *e1;
@@
- e1->fingerId
+ e1->fingerID
@@
expression e1, e2, e3, e4;
@@
- SDL_CreateWindow(e1, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, e2, e3, e4)

View File

@@ -534,6 +534,16 @@ class SourceCollector:
return path_times
class AndroidApiVersion:
def __init__(self, name: str, ints: tuple[int, ...]):
self.name = name
self.ints = ints
def __repr__(self) -> str:
return f"<{self.name} ({'.'.join(str(v) for v in self.ints)})>"
ANDROID_ABI_EXTRA_LINK_OPTIONS = {}
class Releaser:
def __init__(self, release_info: dict, commit: str, revision: str, root: Path, dist_path: Path, section_printer: SectionPrinter, executer: Executer, cmake_generator: str, deps_path: Path, overwrite: bool, github: bool, fast: bool):
self.release_info = release_info
@@ -885,28 +895,25 @@ class Releaser:
self.artifacts["mingw-devel-tar-gz"] = tgz_path
self.artifacts["mingw-devel-tar-xz"] = txz_path
def _detect_android_api(self, android_home: str) -> typing.Optional[int]:
def _detect_android_api(self, android_home: str) -> typing.Optional[AndroidApiVersion]:
platform_dirs = list(Path(p) for p in glob.glob(f"{android_home}/platforms/android-*"))
re_platform = re.compile("android-([0-9]+)")
platform_versions = []
re_platform = re.compile("^android-([0-9]+)(?:-ext([0-9]+))?$")
platform_versions: list[AndroidApiVersion] = []
for platform_dir in platform_dirs:
logger.debug("Found Android Platform SDK: %s", platform_dir)
if not (platform_dir / "android.jar").is_file():
logger.debug("Skipping SDK, missing android.jar")
continue
if platform_dir.match('*/android-*-ext*'):
logger.debug("Skipping SDK, extended version")
continue
if m:= re_platform.match(platform_dir.name):
platform_versions.append(int(m.group(1)))
platform_versions.sort()
platform_versions.append(AndroidApiVersion(name=platform_dir.name, ints=(int(m.group(1)), int(m.group(2) or 0))))
platform_versions.sort(key=lambda v: v.ints)
logger.info("Available platform versions: %s", platform_versions)
platform_versions = list(filter(lambda v: v >= self._android_api_minimum, platform_versions))
logger.info("Valid platform versions (>=%d): %s", self._android_api_minimum, platform_versions)
platform_versions = list(filter(lambda v: v.ints >= self._android_api_minimum.ints, platform_versions))
logger.info("Valid platform versions (>=%s): %s", self._android_api_minimum.ints, platform_versions)
if not platform_versions:
return None
android_api = platform_versions[0]
logger.info("Selected API version %d", android_api)
logger.info("Selected API version %s", android_api)
return android_api
def _get_prefab_json_text(self) -> str:
@@ -930,8 +937,19 @@ class Releaser:
return json.dumps(module_json_dict, indent=4)
@property
def _android_api_minimum(self):
return self.release_info["android"]["api-minimum"]
def _android_api_minimum(self) -> AndroidApiVersion:
value = self.release_info["android"]["api-minimum"]
if isinstance(value, int):
ints = (value, )
elif isinstance(value, str):
ints = tuple(split("."))
else:
raise ValueError("Invalid android.api-minimum: must be X or X.Y")
match len(ints):
case 1: name = f"android-{ints[0]}"
case 2: name = f"android-{ints[0]}-ext-{ints[1]}"
case _: raise ValueError("Invalid android.api-minimum: must be X or X.Y")
return AndroidApiVersion(name=name, ints=ints)
@property
def _android_api_target(self):
@@ -944,7 +962,7 @@ class Releaser:
def _get_prefab_abi_json_text(self, abi: str, cpp: bool, shared: bool) -> str:
abi_json_dict = {
"abi": abi,
"api": self._android_api_minimum,
"api": self._android_api_minimum.ints[0],
"ndk": self._android_ndk_minimum,
"stl": "c++_shared" if cpp else "none",
"static": not shared,
@@ -957,7 +975,7 @@ class Releaser:
xmlns:android="http://schemas.android.com/apk/res/android"
package="org.libsdl.android.{self.project}" android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="{self._android_api_minimum}"
<uses-sdk android:minSdkVersion="{self._android_api_minimum.ints[0]}"
android:targetSdkVersion="{self._android_api_target}" />
</manifest>
""")
@@ -996,6 +1014,7 @@ class Releaser:
android_devel_file_tree = ArchiveFileTree()
for android_abi in android_abis:
extra_link_options = ANDROID_ABI_EXTRA_LINK_OPTIONS.get(android_abi, "")
with self.section_printer.group(f"Building for Android {android_api} {android_abi}"):
build_dir = self.root / "build-android" / f"{android_abi}-build"
install_dir = self.root / "install-android" / f"{android_abi}-install"
@@ -1006,8 +1025,11 @@ class Releaser:
"cmake",
"-S", str(self.root),
"-B", str(build_dir),
f'''-DCMAKE_C_FLAGS="-ffile-prefix-map={self.root}=/src/{self.project}"''',
f'''-DCMAKE_CXX_FLAGS="-ffile-prefix-map={self.root}=/src/{self.project}"''',
# NDK 21e does not support -ffile-prefix-map
# f'''-DCMAKE_C_FLAGS="-ffile-prefix-map={self.root}=/src/{self.project}"''',
# f'''-DCMAKE_CXX_FLAGS="-ffile-prefix-map={self.root}=/src/{self.project}"''',
f"-DCMAKE_EXE_LINKER_FLAGS={extra_link_options}",
f"-DCMAKE_SHARED_LINKER_FLAGS={extra_link_options}",
f"-DCMAKE_TOOLCHAIN_FILE={cmake_toolchain_file}",
f"-DCMAKE_PREFIX_PATH={str(android_deps_path)}",
f"-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH",
@@ -1372,7 +1394,7 @@ def main(argv=None) -> int:
parser.add_argument("--actions", choices=["download", "source", "android", "mingw", "msvc", "dmg"], required=True, nargs="+", dest="actions", help="What to do?")
parser.set_defaults(loglevel=logging.INFO)
parser.add_argument('--vs-year', dest="vs_year", help="Visual Studio year")
parser.add_argument('--android-api', type=int, dest="android_api", help="Android API version")
parser.add_argument('--android-api', dest="android_api", help="Android API version")
parser.add_argument('--android-home', dest="android_home", default=os.environ.get("ANDROID_HOME"), help="Android Home folder")
parser.add_argument('--android-ndk-home', dest="android_ndk_home", default=os.environ.get("ANDROID_NDK_HOME"), help="Android NDK Home folder")
parser.add_argument('--cmake-generator', dest="cmake_generator", default="Ninja", help="CMake Generator")
@@ -1499,17 +1521,27 @@ def main(argv=None) -> int:
if args.android_api is None:
with section_printer.group("Detect Android APIS"):
args.android_api = releaser._detect_android_api(android_home=args.android_home)
else:
try:
android_api_ints = tuple(int(v) for v in args.android_api.split("."))
match len(android_api_ints):
case 1: android_api_name = f"android-{android_api_ints[0]}"
case 2: android_api_name = f"android-{android_api_ints[0]}-ext-{android_api_ints[1]}"
case _: raise ValueError
except ValueError:
logger.error("Invalid --android-api, must be a 'X' or 'X.Y' version")
args.android_api = AndroidApiVersion(ints=android_api_ints, name=android_api_name)
if args.android_api is None:
parser.error("Invalid --android-api, and/or could not be detected")
android_api_path = Path(args.android_home) / f"platforms/android-{args.android_api}"
android_api_path = Path(args.android_home) / f"platforms/{args.android_api.name}"
if not android_api_path.is_dir():
parser.error(f"Android API directory does not exist ({android_api_path})")
logger.warning(f"Android API directory does not exist ({android_api_path})")
with section_printer.group("Android arguments"):
print(f"android_home = {args.android_home}")
print(f"android_ndk_home = {args.android_ndk_home}")
print(f"android_api = {args.android_api}")
releaser.create_android_archives(
android_api=args.android_api,
android_api=args.android_api.ints[0],
android_home=args.android_home,
android_ndk_home=args.android_ndk_home,
)

View File

@@ -0,0 +1,127 @@
#!/bin/bash
progname="${0##*/}"
progname="${progname%.sh}"
# usage: check_elf_alignment.sh [path to *.so files|path to *.apk]
cleanup_trap() {
if [ -n "${tmp}" -a -d "${tmp}" ]; then
rm -rf ${tmp}
fi
exit $1
}
usage() {
echo "Host side script to check the ELF alignment of shared libraries."
echo "Shared libraries are reported ALIGNED when their ELF regions are"
echo "16 KB or 64 KB aligned. Otherwise they are reported as UNALIGNED."
echo
echo "Usage: ${progname} [input-path|input-APK|input-APEX]"
}
if [ ${#} -ne 1 ]; then
usage
exit
fi
case ${1} in
--help | -h | -\?)
usage
exit
;;
*)
dir="${1}"
;;
esac
if ! [ -f "${dir}" -o -d "${dir}" ]; then
echo "Invalid file: ${dir}" >&2
exit 1
fi
if [[ "${dir}" == *.apk ]]; then
trap 'cleanup_trap' EXIT
echo
echo "Recursively analyzing $dir"
echo
if { zipalign --help 2>&1 | grep -q "\-P <pagesize_kb>"; }; then
echo "=== APK zip-alignment ==="
zipalign -v -c -P 16 4 "${dir}" | egrep 'lib/arm64-v8a|lib/x86_64|Verification'
echo "========================="
else
echo "NOTICE: Zip alignment check requires build-tools version 35.0.0-rc3 or higher."
echo " You can install the latest build-tools by running the below command"
echo " and updating your \$PATH:"
echo
echo " sdkmanager \"build-tools;35.0.0-rc3\""
fi
dir_filename=$(basename "${dir}")
tmp=$(mktemp -d -t "${dir_filename%.apk}_out_XXXXX")
unzip "${dir}" lib/* -d "${tmp}" >/dev/null 2>&1
dir="${tmp}"
fi
if [[ "${dir}" == *.apex ]]; then
trap 'cleanup_trap' EXIT
echo
echo "Recursively analyzing $dir"
echo
dir_filename=$(basename "${dir}")
tmp=$(mktemp -d -t "${dir_filename%.apex}_out_XXXXX")
deapexer extract "${dir}" "${tmp}" || { echo "Failed to deapex." && exit 1; }
dir="${tmp}"
fi
RED="\e[31m"
GREEN="\e[32m"
ENDCOLOR="\e[0m"
unaligned_libs=()
unaligned_critical_libs=()
echo
echo "=== ELF alignment ==="
matches="$(find "${dir}" -type f)"
IFS=$'\n'
for match in $matches; do
# We could recursively call this script or rewrite it to though.
[[ "${match}" == *".apk" ]] && echo "WARNING: doesn't recursively inspect .apk file: ${match}"
[[ "${match}" == *".apex" ]] && echo "WARNING: doesn't recursively inspect .apex file: ${match}"
[[ $(file "${match}") == *"ELF"* ]] || continue
res="$(objdump -p "${match}" | grep LOAD | awk '{ print $NF }' | head -1)"
if [[ $res =~ 2\*\*(1[4-9]|[2-9][0-9]|[1-9][0-9]{2,}) ]]; then
echo -e "${match}: ${GREEN}ALIGNED${ENDCOLOR} ($res)"
else
unaligned_libs+=("${match}")
# Check if this is a critical architecture (arm64-v8a or x86_64)
if [[ "${match}" == *"arm64-v8a"* ]] || [[ "${match}" == *"x86_64"* ]]; then
unaligned_critical_libs+=("${match}")
echo -e "${match}: ${RED}UNALIGNED${ENDCOLOR} ($res)"
else
echo -e "${match}: UNALIGNED ($res)"
fi
fi
done
if [ ${#unaligned_libs[@]} -gt 0 ]; then
echo -e "Found ${#unaligned_libs[@]} unaligned libs (only arm64-v8a/x86_64 libs need to be aligned).${ENDCOLOR}"
fi
echo "====================="
# Exit with appropriate code: 1 if critical unaligned libs found, 0 otherwise
if [ ${#unaligned_critical_libs[@]} -gt 0 ]; then
echo -e "${RED}Found ${#unaligned_critical_libs[@]} critical unaligned libs.${ENDCOLOR}"
exit 1
else
echo -e "${GREEN}ELF Verification Successful${ENDCOLOR}"
exit 0
fi

View File

@@ -161,6 +161,7 @@ def find_symbols_in_file(file: pathlib.Path) -> int:
"src/libm",
"src/hidapi",
"src/video/khronos",
"src/video/stb_image.h",
"include/SDL3",
"build-scripts/gen_audio_resampler_filter.c",
"build-scripts/gen_audio_channel_conversion.c",

View File

@@ -90,15 +90,9 @@ foreach my $release (@releases) {
my $tag = $fulltags{$release};
my $blobname = "$tag:src/dynapi/SDL_dynapi_overrides.h";
if ($release =~ /\A3\.(0\.\d+|1\.[0123])/) { # make everything up to the first SDL3 prerelease look like 3.1.3 (ABI lock version).
$release = '3.1.3';
}
# !!! FIXME: REMOVE ME WHEN 3.2.0 SHIPS!
elsif (not $release =~ /\A3\.1\.\d+/) { # a couple of releases after the initial 3.1.3, let them through.
if ($release =~ /\A3\.[01]\.\d+\Z/) { # make everything up to the first SDL3 official release look like 3.2.0.
$release = '3.2.0';
}
# !!! FIXME: REMOVE ME WHEN 3.2.0 SHIPS!
open(PIPEFH, '-|', "git show '$blobname'") or die "Failed to read git blob '$blobname': $!\n";
while (<PIPEFH>) {

View File

@@ -1,7 +1,7 @@
# Using this package
This package contains SDL built for the Android platform.
This package contains @<@PROJECT_NAME@>@ built for the Android platform.
## Gradle integration
@@ -59,7 +59,7 @@ Add `--help` for a list of all available options.
An API reference, tutorials, and additional documentation is available at:
https://wiki.libsdl.org/SDL3
https://wiki.libsdl.org/@<@PROJECT_NAME@>@
# Example code

View File

@@ -1,19 +1,19 @@
# Using this package
This package contains SDL built for the mingw-w64 toolchain.
This package contains @<@PROJECT_NAME@>@ built for the mingw-w64 toolchain.
The files for 32-bit architecture are in i686-w64-mingw32
The files for 64-bit architecture are in x86_64-w64-mingw32
You can install them to another location, just type `make` for help.
To use this package, point your include path at _arch_/include and your library path at _arch_/lib, link with the SDL3 library and copy _arch_/bin/SDL3.dll next to your executable.
To use this package, point your include path at _arch_/include and your library path at _arch_/lib, link with the @<@PROJECT_NAME@>@ library and copy _arch_/bin/@<@PROJECT_NAME@>@.dll next to your executable.
e.g.
```sh
gcc -o hello.exe hello.c -Ix86_64-w64-mingw32/include -Lx86_64-w64-mingw32/lib -lSDL3
cp x86_64-w64-mingw32/bin/SDL3.dll .
gcc -o hello.exe hello.c -Ix86_64-w64-mingw32/include -Lx86_64-w64-mingw32/lib -l@<@PROJECT_NAME@>@
cp x86_64-w64-mingw32/bin/@<@PROJECT_NAME@>@.dll .
./hello.exe
```
@@ -21,7 +21,7 @@ cp x86_64-w64-mingw32/bin/SDL3.dll .
An API reference, tutorials, and additional documentation is available at:
https://wiki.libsdl.org/SDL3
https://wiki.libsdl.org/@<@PROJECT_NAME@>@
# Example code

View File

@@ -1,19 +1,19 @@
# Using this package
This package contains SDL built for Visual Studio.
This package contains @<@PROJECT_NAME@>@ built for Visual Studio.
To use this package, edit your project properties:
- Add the include directory to "VC++ Directories" -> "Include Directories"
- Add the lib/_arch_ directory to "VC++ Directories" -> "Library Directories"
- Add SDL3.lib to Linker -> Input -> "Additional Dependencies"
- Copy lib/_arch_/SDL3.dll to your project directory.
- Add @<@PROJECT_NAME@>@.lib to Linker -> Input -> "Additional Dependencies"
- Copy lib/_arch_/@<@PROJECT_NAME@>@.dll to your project directory.
# Documentation
An API reference, tutorials, and additional documentation is available at:
https://wiki.libsdl.org/SDL3
https://wiki.libsdl.org/@<@PROJECT_NAME@>@
# Example code

View File

@@ -45,7 +45,7 @@
},
"files": {
"": [
"build-scripts/pkg-support/mingw/INSTALL.md",
"build-scripts/pkg-support/mingw/INSTALL.md.in:INSTALL.md",
"build-scripts/pkg-support/mingw/Makefile",
"LICENSE.txt",
"README.md"
@@ -117,7 +117,7 @@
},
"files-devel": {
"": [
"build-scripts/pkg-support/msvc/INSTALL.md",
"build-scripts/pkg-support/msvc/INSTALL.md.in:INSTALL.md",
"LICENSE.txt",
"README.md"
],
@@ -181,9 +181,9 @@
"x86",
"x86_64"
],
"api-minimum": 19,
"api-target": 29,
"ndk-minimum": 21,
"api-minimum": 21,
"api-target": 35,
"ndk-minimum": 28,
"aar-files": {
"": [
"android-project/app/proguard-rules.pro:proguard.txt",

View File

@@ -1,21 +0,0 @@
#!/bin/sh
#
# libtool assumes that the compiler can handle the -fPIC flag
# This isn't always true (for example, nasm can't handle it)
command=""
while [ $# -gt 0 ]; do
case "$1" in
-?PIC)
# Ignore -fPIC and -DPIC options
;;
-fno-common)
# Ignore -fPIC and -DPIC options
;;
*)
command="$command $1"
;;
esac
shift
done
echo $command
exec $command

View File

@@ -32,6 +32,7 @@ my $wikisubdir = '';
my $incsubdir = 'include';
my $readmesubdir = undef;
my $apiprefixregex = undef;
my $apipropertyregex = undef;
my $versionfname = 'include/SDL_version.h';
my $versionmajorregex = '\A\#define\s+SDL_MAJOR_VERSION\s+(\d+)\Z';
my $versionminorregex = '\A\#define\s+SDL_MINOR_VERSION\s+(\d+)\Z';
@@ -43,7 +44,6 @@ my $wikiurl = 'https://wiki.libsdl.org';
my $bugreporturl = 'https://github.com/libsdl-org/sdlwiki/issues/new';
my $srcpath = undef;
my $wikipath = undef;
my $wikireadmesubdir = 'README';
my $warn_about_missing = 0;
my $copy_direction = 0;
my $optionsfname = undef;
@@ -58,6 +58,11 @@ my $quickreftitle = undef;
my $quickrefurl = undef;
my $quickrefdesc = undef;
my $quickrefmacroregex = undef;
my $envvarenabled = 0;
my $envvartitle = 'Environment Variables';
my $envvardesc = undef;
my $envvarsymregex = undef;
my $envvarsymreplace = undef;
my $changeformat = undef;
my $manpath = undef;
my $gitrev = undef;
@@ -111,6 +116,7 @@ if (defined $optionsfname) {
$srcpath = $val, next if $key eq 'srcpath';
$wikipath = $val, next if $key eq 'wikipath';
$apiprefixregex = $val, next if $key eq 'apiprefixregex';
$apipropertyregex = $val, next if $key eq 'apipropertyregex';
$projectfullname = $val, next if $key eq 'projectfullname';
$projectshortname = $val, next if $key eq 'projectshortname';
$wikisubdir = $val, next if $key eq 'wikisubdir';
@@ -136,6 +142,11 @@ if (defined $optionsfname) {
$quickrefurl = $val, next if $key eq 'quickrefurl';
$quickrefdesc = $val, next if $key eq 'quickrefdesc';
$quickrefmacroregex = $val, next if $key eq 'quickrefmacroregex';
$envvarenabled = int($val), next if $key eq 'envvarenabled';
$envvartitle = $val, next if $key eq 'envvartitle';
$envvardesc = $val, next if $key eq 'envvardesc';
$envvarsymregex = $val, next if $key eq 'envvarsymregex';
$envvarsymreplace = $val, next if $key eq 'envvarsymreplace';
}
}
close(OPTIONS);
@@ -342,7 +353,7 @@ sub wikify_chunk {
# Convert obvious API things to wikilinks.
if (defined $apiprefixregex) {
$str =~ s/(\A|[^\/a-zA-Z0-9_])($apiprefixregex[a-zA-Z0-9_]+)/$1\[$2\]\($2\)/gms;
$str =~ s/(\A|[^\/a-zA-Z0-9_\[])($apiprefixregex[a-zA-Z0-9_]+)/$1\[$2\]\($2\)/gms;
}
$str = $codedstr . $str;
@@ -424,7 +435,11 @@ sub dewikify_chunk {
$str .= "\n```$codelang\n$code\n```\n";
}
} elsif ($dewikify_mode eq 'manpage') {
$str =~ s/\./\\[char46]/gms; # make sure these can't become control codes.
# make sure these can't become part of roff syntax.
$str =~ s/\./\\[char46]/gms;
$str =~ s/"/\\(dq/gms;
$str =~ s/'/\\(aq/gms;
if ($wikitype eq 'mediawiki') {
# Dump obvious wikilinks.
if (defined $apiprefixregex) {
@@ -449,33 +464,52 @@ sub dewikify_chunk {
# bullets
$str =~ s/^\* /\n\\\(bu /gm;
} elsif ($wikitype eq 'md') {
# bullets
$str =~ s/^\- /\n\\(bu /gm;
# merge paragraphs
$str =~ s/^[ \t]+//gm;
$str =~ s/([^\-\n])\n([^\-\n])/$1 $2/g;
$str =~ s/\n\n/\n.PP\n/g;
# Dump obvious wikilinks.
if (defined $apiprefixregex) {
$str =~ s/\[(\`?$apiprefixregex[a-zA-Z0-9_]+\`?)\]\($apiprefixregex[a-zA-Z0-9_]+\)/\n.BR $1\n/gms;
my $apr = $apiprefixregex;
if(!($apr =~ /\A\(.*\)\Z/s)) {
# we're relying on the apiprefixregex having a capturing group.
$apr = "(" . $apr . ")";
}
$str =~ s/(\S*?)\[\`?($apr[a-zA-Z0-9_]+)\`?\]\($apr[a-zA-Z0-9_]+\)(\S*)\s*/\n.BR "" "$1" "$2" "$5"\n/gm;
# handle cases like "[x](x), [y](y), [z](z)" being separated.
while($str =~ s/(\.BR[^\n]*)\n\n\.BR/$1\n.BR/gm) {}
}
# links
$str =~ s/\[(.*?)]\((https?\:\/\/.*?)\)/\n.URL "$2" "$1"\n/g;
# <code></code> is also popular. :/
$str =~ s/\s*\`(.*?)\`\s*/\n.BR $1\n/gms;
$str =~ s/\s*(\S*?)\`([^\n]*?)\`(\S*)\s*/\n.BR "" "$1" "$2" "$3"\n/gms;
# bold+italic (this looks bad, just make it bold).
$str =~ s/\s*\*\*\*(.*?)\*\*\*\s*/\n.B $1\n/gms;
$str =~ s/\s*(\S*?)\*\*\*([^\n]*?)\*\*\*(\S*)\s*/\n.BR "" "$1" "$2" "$3"\n/gms;
# bold
$str =~ s/\s*\*\*(.*?)\*\*\s*/\n.B $1\n/gms;
$str =~ s/\s*(\S*?)\*\*([^\n]*?)\*\*(\S*)\s*/\n.BR "" "$1" "$2" "$3"\n/gms;
# italic
$str =~ s/\s*\*(.*?)\*\s*/\n.I $1\n/gms;
# bullets
$str =~ s/^\- /\n\\\(bu /gm;
$str =~ s/\s*(\S*?)\*([^\n]*?)\*(\S*)\s*/\n.IR "" "$1" "$2" "$3"\n/gms;
}
# cleanup unnecessary quotes
$str =~ s/(\.[IB]R?)(.*?) ""\n/$1$2\n/gm;
$str =~ s/(\.[IB]R?) "" ""(.*?)\n/$1$2\n/gm;
$str =~ s/"(\S+)"/$1/gm;
# cleanup unnecessary whitespace
$str =~ s/ +\n/\n/gm;
if (defined $code) {
$code =~ s/\A\n+//gms;
$code =~ s/\n+\Z//gms;
$code =~ s/\\/\\(rs/gms;
if ($dewikify_manpage_code_indent) {
$str .= "\n.IP\n"
} else {
@@ -580,7 +614,7 @@ sub dewikify {
$retval .= dewikify_chunk($wikitype, $1, $2, $3);
}
} elsif ($wikitype eq 'md') {
while ($str =~ s/\A(.*?)\n```(.*?)\n(.*?)\n```\n//ms) {
while ($str =~ s/\A(.*?)\n?```(.*?)\n(.*?)\n```\n//ms) {
$retval .= dewikify_chunk($wikitype, $1, $2, $3);
}
}
@@ -803,21 +837,23 @@ sub print_big_ascii_string {
die("Don't have a big ascii entry for '$ch'!\n") if not defined $rowsref;
my $row = @$rowsref[$rownum];
my $outstr = '';
if ($lowascii) {
my @x = split //, $row;
foreach (@x) {
my $v = ($_ eq "\x{2588}") ? 'X' : ' ';
print $fh $v;
$outstr .= ($_ eq "\x{2588}") ? 'X' : ' ';
}
} else {
print $fh $row;
$outstr = $row;
}
$charidx++;
if ($charidx < $charcount) {
print $fh " ";
if ($charidx == $charcount) {
$outstr =~ s/\s*\Z//; # dump extra spaces at the end of the line.
} else {
$outstr .= ' '; # space between glyphs.
}
print $fh $outstr;
}
print $fh "\n";
}
@@ -1008,10 +1044,58 @@ sub generate_quickref {
}
sub generate_envvar_wiki_page {
my $briefsref = shift;
my $path = shift;
return if not $envvarenabled or not defined $envvarsymregex or not defined $envvarsymreplace;
my $replace = "\"$envvarsymreplace\"";
my $tmppath = "$path.tmp";
open(my $fh, '>', $tmppath) or die("Can't open '$tmppath': $!\n");
print $fh "<!-- DO NOT EDIT THIS PAGE ON THE WIKI. IT WILL BE OVERWRITTEN BY WIKIHEADERS AND CHANGES WILL BE LOST! -->\n\n";
print $fh "# $envvartitle\n\n";
if (defined $envvardesc) {
my $desc = "$envvardesc";
$desc =~ s/\\n/\n/g; # replace "\n" strings with actual newlines.
print $fh "$desc\n\n";
}
print $fh "## Environment Variable List\n\n";
foreach (sort keys %headersyms) {
my $sym = $_;
next if $headersymstype{$sym} != 2; # not a #define? skip it.
my $hint = "$_";
next if not $hint =~ s/$envvarsymregex/$replace/ee;
my $brief = $$briefsref{$sym};
if (not defined $brief) {
$brief = '';
} else {
$brief = "$brief";
chomp($brief);
my $thiswikitype = defined $wikitypes{$sym} ? $wikitypes{$sym} : 'md'; # default to MarkDown for new stuff.
$brief = ": " . dewikify($thiswikitype, $brief);
}
print $fh "- [$hint]($sym)$brief\n";
}
print $fh "\n";
close($fh);
rename($tmppath, $path) or die("Can't rename '$tmppath' to '$path': $!\n");
}
my $incpath = "$srcpath";
$incpath .= "/$incsubdir" if $incsubdir ne '';
my $wikireadmepath = "$wikipath/$wikireadmesubdir";
my $readmepath = undef;
if (defined $readmesubdir) {
$readmepath = "$srcpath/$readmesubdir";
@@ -1343,7 +1427,7 @@ while (my $d = readdir(DH)) {
# update strings now that we know everything pending is to be applied to this declaration. Add pending blank lines and the new text.
# At Sam's request, don't list property defines with functions. (See #9440)
my $is_property = /\A\s*\#\s*define\s+SDL_PROP_/;
my $is_property = (defined $apipropertyregex) ? /$apipropertyregex/ : 0;
if (!$is_property) {
if ($blank_lines > 0) {
while ($blank_lines > 0) {
@@ -2060,18 +2144,15 @@ if ($copy_direction == 1) { # --copy-to-headers
}
if (defined $readmepath) {
if ( -d $wikireadmepath ) {
mkdir($readmepath); # just in case
opendir(DH, $wikireadmepath) or die("Can't opendir '$wikireadmepath': $!\n");
while (readdir(DH)) {
my $dent = $_;
if ($dent =~ /\A(.*?)\.md\Z/) { # we only bridge Markdown files here.
next if $1 eq 'FrontPage';
filecopy("$wikireadmepath/$dent", "$readmepath/README-$dent", "\n");
}
mkdir($readmepath); # just in case
opendir(DH, $wikipath) or die("Can't opendir '$wikipath': $!\n");
while (readdir(DH)) {
my $dent = $_;
if ($dent =~ /\AREADME\-.*?\.md\Z/) { # we only bridge Markdown files here that start with "README-".
filecopy("$wikipath/$dent", "$readmepath/$dent", "\n");
}
closedir(DH);
}
closedir(DH);
}
} elsif ($copy_direction == -1) { # --copy-to-wiki
@@ -2627,12 +2708,6 @@ if ($copy_direction == 1) { # --copy-to-headers
<!-- END CATEGORY DOCUMENTATION -->
## Categories
<!-- DO NOT HAND-EDIT CATEGORY LISTS, THEY ARE AUTOGENERATED AND WILL BE OVERWRITTEN, BASED ON TAGS IN INDIVIDUAL PAGE FOOTERS. EDIT THOSE INSTEAD. -->
<!-- BEGIN CATEGORY LIST: Category$cat, CategoryAPICategory -->
<!-- END CATEGORY LIST -->
## Functions
<!-- DO NOT HAND-EDIT CATEGORY LISTS, THEY ARE AUTOGENERATED AND WILL BE OVERWRITTEN, BASED ON TAGS IN INDIVIDUAL PAGE FOOTERS. EDIT THOSE INSTEAD. -->
@@ -2682,31 +2757,27 @@ __EOF__
# Write out READMEs...
if (defined $readmepath) {
if ( -d $readmepath ) {
mkdir($wikireadmepath); # just in case
mkdir($wikipath); # just in case
opendir(DH, $readmepath) or die("Can't opendir '$readmepath': $!\n");
while (my $d = readdir(DH)) {
my $dent = $d;
if ($dent =~ /\AREADME\-(.*?\.md)\Z/) { # we only bridge Markdown files here.
my $wikifname = $1;
next if $wikifname eq 'FrontPage.md';
filecopy("$readmepath/$dent", "$wikireadmepath/$wikifname", "\n");
if ($dent =~ /\AREADME\-.*?\.md\Z/) { # we only bridge Markdown files here that start with "README-".
filecopy("$readmepath/$dent", "$wikipath/$dent", "\n");
}
}
closedir(DH);
my @pages = ();
opendir(DH, $wikireadmepath) or die("Can't opendir '$wikireadmepath': $!\n");
opendir(DH, $wikipath) or die("Can't opendir '$wikipath': $!\n");
while (my $d = readdir(DH)) {
my $dent = $d;
if ($dent =~ /\A(.*?)\.(mediawiki|md)\Z/) {
my $wikiname = $1;
next if $wikiname eq 'FrontPage';
push @pages, $wikiname;
if ($dent =~ /\A(README\-.*?)\.md\Z/) {
push @pages, $1;
}
}
closedir(DH);
open(FH, '>', "$wikireadmepath/FrontPage.md") or die("Can't open '$wikireadmepath/FrontPage.md': $!\n");
open(FH, '>', "$wikipath/READMEs.md") or die("Can't open '$wikipath/READMEs.md': $!\n");
print FH "# All READMEs available here\n\n";
foreach (sort @pages) {
my $wikiname = $_;
@@ -2721,6 +2792,11 @@ __EOF__
generate_quickref(\%briefs, "$wikipath/QuickReference.md", 0);
generate_quickref(\%briefs, "$wikipath/QuickReferenceNoUnicode.md", 1);
}
if ($envvarenabled and defined $envvarsymregex and defined $envvarsymreplace) {
generate_envvar_wiki_page(\%briefs, "$wikipath/EnvironmentVariables.md");
}
} elsif ($copy_direction == -2) { # --copy-to-manpages
# This only takes from the wiki data, since it has sections we omit from the headers, like code examples.
@@ -2771,7 +2847,6 @@ __EOF__
my $wikitype = $wikitypes{$sym};
my $sectionsref = $wikisyms{$sym};
my $remarks = $sectionsref->{'Remarks'};
my $params = $sectionsref->{'Function Parameters'};
my $returns = $sectionsref->{'Return Value'};
my $version = $sectionsref->{'Version'};
my $threadsafety = $sectionsref->{'Thread Safety'};
@@ -2779,6 +2854,23 @@ __EOF__
my $examples = $sectionsref->{'Code Examples'};
my $deprecated = $sectionsref->{'Deprecated'};
my $headerfile = $manpageheaderfiletext;
my $params = undef;
if ($symtype == -1) { # category documentation block.
# nothing to be done here.
} elsif (($symtype == 1) || (($symtype == 5))) { # we'll assume a typedef (5) with a \param is a function pointer typedef.
$params = $sectionsref->{'Function Parameters'};
} elsif ($symtype == 2) {
$params = $sectionsref->{'Macro Parameters'};
} elsif ($symtype == 3) {
$params = $sectionsref->{'Fields'};
} elsif ($symtype == 4) {
$params = $sectionsref->{'Values'};
} else {
die("Unexpected symtype $symtype");
}
$headerfile =~ s/\%fname\%/$headersymslocation{$sym}/g;
$headerfile .= "\n";
@@ -2845,18 +2937,22 @@ __EOF__
$str .= dewikify($wikitype, $deprecated) . "\n";
}
my $incfile = $mainincludefname;
if (defined $headerfile) {
$str .= ".SH HEADER FILE\n";
$str .= dewikify($wikitype, $headerfile) . "\n";
if($headerfile =~ /Defined in (.*)/) {
$incfile = $1;
}
}
$str .= ".SH SYNOPSIS\n";
$str .= ".nf\n";
$str .= ".B #include \\(dq$mainincludefname\\(dq\n";
$str .= ".B #include <$incfile>\n";
$str .= ".PP\n";
my @decllines = split /\n/, $decl;
foreach (@decllines) {
$_ =~ s/\\/\\(rs/g; # fix multiline macro defs
$_ =~ s/"/\\(dq/g;
$str .= ".BI \"$_\n";
}
$str .= ".fi\n";
@@ -2944,8 +3040,13 @@ __EOF__
}
if (defined $returns) {
# Check for md link in return type: ([SDL_Renderer](SDL_Renderer) *)
# This would've prevented the next regex from working properly (it'd leave " *)")
$returns =~ s/\A\(\[.*?\]\((.*?)\)/\($1/ms;
# Chop datatype in parentheses off the front.
$returns =~ s/\A\(.*?\) //;
$returns = dewikify($wikitype, $returns);
$returns =~ s/\A\(.*?\)\s*//; # Chop datatype in parentheses off the front.
$str .= ".SH RETURN VALUE\n";
$str .= "$returns\n";
}
@@ -2981,6 +3082,8 @@ __EOF__
s/\A\/*//;
s/\A\.BR\s+//; # dewikify added this, but we want to handle it.
s/\A\.I\s+//; # dewikify added this, but we want to handle it.
s/\A\.PP\s*//; # dewikify added this, but we want to handle it.
s/\\\(bu//; # dewikify added this, but we want to handle it.
s/\A\s*[\:\*\-]\s*//;
s/\A\s+//;
s/\s+\Z//;

View File

@@ -0,0 +1,189 @@
if(NGAGESDK)
function(SDL_Preseed_CMakeCache)
set(COMPILER_SUPPORTS_ARMNEON "" CACHE INTERNAL "Test COMPILER_SUPPORTS_ARMNEON")
set(COMPILER_SUPPORTS_FDIAGNOSTICS_COLOR_ALWAYS "" CACHE INTERNAL "Test COMPILER_SUPPORTS_FDIAGNOSTICS_COLOR_ALWAYS")
set(COMPILER_SUPPORTS_SYNC_LOCK_TEST_AND_SET "" CACHE INTERNAL "Test COMPILER_SUPPORTS_SYNC_LOCK_TEST_AND_SET")
set(HAVE_CLANG_COMMENT_BLOCK_COMMANDS "" CACHE INTERNAL "Test HAVE_CLANG_COMMENT_BLOCK_COMMANDS")
set(HAVE_ALLOCA_H "" CACHE INTERNAL "Have include alloca.h")
set(HAVE_LIBM "1" CACHE INTERNAL "Have library m")
set(HAVE_POSIX_SPAWN "" CACHE INTERNAL "Have symbol posix_spawn")
set(HAVE_MALLOC "1" CACHE INTERNAL "Have include malloc.h")
set(LIBC_HAS_ABS "1" CACHE INTERNAL "Have symbol abs")
set(LIBC_HAS_ACOS "1" CACHE INTERNAL "Have symbol acos")
set(LIBC_HAS_ACOSF "" CACHE INTERNAL "Have symbol acosf")
set(LIBC_HAS_ASIN "1" CACHE INTERNAL "Have symbol asin")
set(LIBC_HAS_ASINF "" CACHE INTERNAL "Have symbol asinf")
set(LIBC_HAS_ATAN "1" CACHE INTERNAL "Have symbol atan")
set(LIBC_HAS_ATAN2 "1" CACHE INTERNAL "Have symbol atan2")
set(LIBC_HAS_ATAN2F "" CACHE INTERNAL "Have symbol atan2f")
set(LIBC_HAS_ATANF "" CACHE INTERNAL "Have symbol atanf")
set(LIBC_HAS_ATOF "" CACHE INTERNAL "Have symbol atof")
set(LIBC_HAS_ATOI "" CACHE INTERNAL "Have symbol atoi")
set(LIBC_HAS_BCOPY "1" CACHE INTERNAL "Have symbol bcopy")
set(LIBC_HAS_CALLOC "" CACHE INTERNAL "Have symbol calloc")
set(LIBC_HAS_CEIL "1" CACHE INTERNAL "Have symbol ceil")
set(LIBC_HAS_CEILF "" CACHE INTERNAL "Have symbol ceilf")
set(LIBC_HAS_COPYSIGN "1" CACHE INTERNAL "Have symbol copysign")
set(LIBC_HAS_COPYSIGNF "1" CACHE INTERNAL "Have symbol copysignf")
set(LIBC_HAS_COS "1" CACHE INTERNAL "Have symbol cos")
set(LIBC_HAS_COSF "" CACHE INTERNAL "Have symbol cosf")
set(LIBC_HAS_EXP "1" CACHE INTERNAL "Have symbol exp")
set(LIBC_HAS_EXPF "" CACHE INTERNAL "Have symbol expf")
set(LIBC_HAS_FABS "1" CACHE INTERNAL "Have symbol fabs")
set(LIBC_HAS_FABSF "1" CACHE INTERNAL "Have symbol fabsf")
set(LIBC_HAS_FLOAT_H "1" CACHE INTERNAL "Have include float.h")
set(LIBC_HAS_FLOOR "1" CACHE INTERNAL "Have symbol floor")
set(LIBC_HAS_FLOORF "" CACHE INTERNAL "Have symbol floorf")
set(LIBC_HAS_FMOD "" CACHE INTERNAL "Have symbol fmod")
set(LIBC_HAS_FMODF "" CACHE INTERNAL "Have symbol fmodf")
set(LIBC_HAS_FOPEN64 "" CACHE INTERNAL "Have symbol fopen64")
set(LIBC_HAS_FREE "1" CACHE INTERNAL "Have symbol free")
set(LIBC_HAS_FSEEKO "" CACHE INTERNAL "Have symbol fseeko")
set(LIBC_HAS_FSEEKO64 "" CACHE INTERNAL "Have symbol fseeko64")
set(LIBC_HAS_GETENV "" CACHE INTERNAL "Have symbol getenv")
set(LIBC_HAS_ICONV_H "" CACHE INTERNAL "Have include iconv.h")
set(LIBC_HAS_INDEX "1" CACHE INTERNAL "Have symbol index")
set(LIBC_HAS_INTTYPES_H "1" CACHE INTERNAL "Have include inttypes.h")
set(LIBC_HAS_ISINF "1" CACHE INTERNAL "Have include isinf(double)")
set(LIBC_ISINF_HANDLES_FLOAT "1" CACHE INTERNAL "Have include isinf(float)")
set(LIBC_HAS_ISINFF "1" CACHE INTERNAL "Have include isinff(float)")
set(LIBC_HAS_ISNAN "1" CACHE INTERNAL "Have include isnan(double)")
set(LIBC_ISNAN_HANDLES_FLOAT "1" CACHE INTERNAL "Have include isnan(float)")
set(LIBC_HAS_ISNANF "1" CACHE INTERNAL "Have include isnanf(float)")
set(LIBC_HAS_ITOA "" CACHE INTERNAL "Have symbol itoa")
set(LIBC_HAS_LIMITS_H "1" CACHE INTERNAL "Have include limits.h")
set(LIBC_HAS_LOG "1" CACHE INTERNAL "Have symbol log")
set(LIBC_HAS_LOG10 "" CACHE INTERNAL "Have symbol log10")
set(LIBC_HAS_LOG10F "" CACHE INTERNAL "Have symbol log10f")
set(LIBC_HAS_LOGF "" CACHE INTERNAL "Have symbol logf")
set(LIBC_HAS_LROUND "" CACHE INTERNAL "Have symbol lround")
set(LIBC_HAS_LROUNDF "" CACHE INTERNAL "Have symbol lroundf")
set(LIBC_HAS_MALLOC "1" CACHE INTERNAL "Have symbol malloc")
set(LIBC_HAS_MALLOC_H "" CACHE INTERNAL "Have include malloc.h")
set(LIBC_HAS_MATH_H "1" CACHE INTERNAL "Have include math.h")
set(LIBC_HAS_MEMCMP "1" CACHE INTERNAL "Have symbol memcmp")
set(LIBC_HAS_MEMCPY "" CACHE INTERNAL "Have symbol memcpy")
set(LIBC_HAS_MEMMOVE "" CACHE INTERNAL "Have symbol memmove")
set(LIBC_HAS_MEMORY_H "" CACHE INTERNAL "Have include memory.h")
set(LIBC_HAS_MEMSET "" CACHE INTERNAL "Have symbol memset")
set(LIBC_HAS_MODF "1" CACHE INTERNAL "Have symbol modf")
set(LIBC_HAS_MODFF "" CACHE INTERNAL "Have symbol modff")
set(LIBC_HAS_POW "1" CACHE INTERNAL "Have symbol pow")
set(LIBC_HAS_POWF "" CACHE INTERNAL "Have symbol powf")
set(LIBC_HAS_PUTENV "" CACHE INTERNAL "Have symbol putenv")
set(LIBC_HAS_REALLOC "" CACHE INTERNAL "Have symbol realloc")
set(LIBC_HAS_RINDEX "1" CACHE INTERNAL "Have symbol rindex")
set(LIBC_HAS_ROUND "" CACHE INTERNAL "Have symbol round")
set(LIBC_HAS_ROUNDF "" CACHE INTERNAL "Have symbol roundf")
set(LIBC_HAS_SCALBN "1" CACHE INTERNAL "Have symbol scalbn")
set(LIBC_HAS_SCALBNF "" CACHE INTERNAL "Have symbol scalbnf")
set(LIBC_HAS_SETENV "" CACHE INTERNAL "Have symbol setenv")
set(LIBC_HAS_SIGNAL_H "" CACHE INTERNAL "Have include signal.h")
set(LIBC_HAS_SIN "1" CACHE INTERNAL "Have symbol sin")
set(LIBC_HAS_SINF "" CACHE INTERNAL "Have symbol sinf")
set(LIBC_HAS_SQR "" CACHE INTERNAL "Have symbol sqr")
set(LIBC_HAS_SQRT "1" CACHE INTERNAL "Have symbol sqrt")
set(LIBC_HAS_SQRTF "" CACHE INTERNAL "Have symbol sqrtf")
set(LIBC_HAS_SSCANF "1" CACHE INTERNAL "Have symbol sscanf")
set(LIBC_HAS_STDARG_H "1" CACHE INTERNAL "Have include stdarg.h")
set(LIBC_HAS_STDBOOL_H "1" CACHE INTERNAL "Have include stdbool.h")
set(LIBC_HAS_STDDEF_H "1" CACHE INTERNAL "Have include stddef.h")
set(LIBC_HAS_STDINT_H "1" CACHE INTERNAL "Have include stdint.h")
set(LIBC_HAS_STDIO_H "1" CACHE INTERNAL "Have include stdio.h")
set(LIBC_HAS_STDLIB_H "1" CACHE INTERNAL "Have include stdlib.h")
set(LIBC_HAS_STRCASESTR "" CACHE INTERNAL "Have symbol strcasestr")
set(LIBC_HAS_STRCHR "1" CACHE INTERNAL "Have symbol strchr")
set(LIBC_HAS_STRCMP "1" CACHE INTERNAL "Have symbol strcmp")
set(LIBC_HAS_STRINGS_H "" CACHE INTERNAL "Have include strings.h")
set(LIBC_HAS_STRING_H "1" CACHE INTERNAL "Have include string.h")
set(LIBC_HAS_STRLCAT "" CACHE INTERNAL "Have symbol strlcat")
set(LIBC_HAS_STRLCPY "" CACHE INTERNAL "Have symbol strlcpy")
set(LIBC_HAS_STRLEN "1" CACHE INTERNAL "Have symbol strlen")
set(LIBC_HAS_STRNCMP "1" CACHE INTERNAL "Have symbol strncmp")
set(LIBC_HAS_STRNLEN "" CACHE INTERNAL "Have symbol strnlen")
set(LIBC_HAS_STRNSTR "" CACHE INTERNAL "Have symbol strnstr")
set(LIBC_HAS_STRPBRK "1" CACHE INTERNAL "Have symbol strpbrk")
set(LIBC_HAS_STRRCHR "1" CACHE INTERNAL "Have symbol strrchr")
set(LIBC_HAS_STRSTR "1" CACHE INTERNAL "Have symbol strstr")
set(LIBC_HAS_STRTOD "" CACHE INTERNAL "Have symbol strtod")
set(LIBC_HAS_STRTOK_R "" CACHE INTERNAL "Have symbol strtok_r")
set(LIBC_HAS_STRTOL "" CACHE INTERNAL "Have symbol strtol")
set(LIBC_HAS_STRTOLL "" CACHE INTERNAL "Have symbol strtoll")
set(LIBC_HAS_STRTOUL "" CACHE INTERNAL "Have symbol strtoul")
set(LIBC_HAS_STRTOULL "" CACHE INTERNAL "Have symbol strtoull")
set(LIBC_HAS_SYS_TYPES_H "1" CACHE INTERNAL "Have include sys/types.h")
set(LIBC_HAS_TAN "1" CACHE INTERNAL "Have symbol tan")
set(LIBC_HAS_TANF "" CACHE INTERNAL "Have symbol tanf")
set(LIBC_HAS_TIME_H "1" CACHE INTERNAL "Have include time.h")
set(LIBC_HAS_TRUNC "" CACHE INTERNAL "Have symbol trunc")
set(LIBC_HAS_TRUNCF "" CACHE INTERNAL "Have symbol truncf")
set(LIBC_HAS_UNSETENV "" CACHE INTERNAL "Have symbol unsetenv")
set(LIBC_HAS_VSNPRINTF "" CACHE INTERNAL "Have symbol vsnprintf")
set(LIBC_HAS_VSSCANF "" CACHE INTERNAL "Have symbol vsscanf")
set(LIBC_HAS_WCHAR_H "1" CACHE INTERNAL "Have include wchar.h")
set(LIBC_HAS_WCSCMP "" CACHE INTERNAL "Have symbol wcscmp")
set(LIBC_HAS_WCSDUP "" CACHE INTERNAL "Have symbol wcsdup")
set(LIBC_HAS_WCSLCAT "" CACHE INTERNAL "Have symbol wcslcat")
set(LIBC_HAS_WCSLCPY "" CACHE INTERNAL "Have symbol wcslcpy")
set(LIBC_HAS_WCSLEN "" CACHE INTERNAL "Have symbol wcslen")
set(LIBC_HAS_WCSNCMP "" CACHE INTERNAL "Have symbol wcsncmp")
set(LIBC_HAS_WCSNLEN "" CACHE INTERNAL "Have symbol wcsnlen")
set(LIBC_HAS_WCSSTR "" CACHE INTERNAL "Have symbol wcsstr")
set(LIBC_HAS_WCSTOL "" CACHE INTERNAL "Have symbol wcstol")
set(LIBC_HAS__EXIT "" CACHE INTERNAL "Have symbol _Exit")
set(LIBC_HAS__I64TOA "" CACHE INTERNAL "Have symbol _i64toa")
set(LIBC_HAS__LTOA "" CACHE INTERNAL "Have symbol _ltoa")
set(LIBC_HAS__STRREV "" CACHE INTERNAL "Have symbol _strrev")
set(LIBC_HAS__UI64TOA "" CACHE INTERNAL "Have symbol _ui64toa")
set(LIBC_HAS__UITOA "" CACHE INTERNAL "Have symbol _uitoa")
set(LIBC_HAS__ULTOA "" CACHE INTERNAL "Have symbol _ultoa")
set(LIBC_HAS__WCSDUP "" CACHE INTERNAL "Have symbol _wcsdup")
set(LIBC_IS_GLIBC "" CACHE INTERNAL "Have symbol __GLIBC__")
set(_ALLOCA_IN_MALLOC_H "" CACHE INTERNAL "Have symbol _alloca")
set(HAVE_GCC_WALL "1" CACHE INTERNAL "Test HAVE_GCC_WALL")
set(HAVE_GCC_WUNDEF "1" CACHE INTERNAL "Test HAVE_GCC_WUNDEF")
set(HAVE_GCC_WFLOAT_CONVERSION "" CACHE INTERNAL "Test HAVE_GCC_WFLOAT_CONVERSION")
set(HAVE_GCC_NO_STRICT_ALIASING "1" CACHE INTERNAL "Test HAVE_GCC_NO_STRICT_ALIASING")
set(HAVE_GCC_WDOCUMENTATION "" CACHE INTERNAL "Test HAVE_GCC_WDOCUMENTATION")
set(HAVE_GCC_WDOCUMENTATION_UNKNOWN_COMMAND "" CACHE INTERNAL "Test HAVE_GCC_WDOCUMENTATION_UNKNOWN_COMMAND")
set(HAVE_GCC_COMMENT_BLOCK_COMMANDS "" CACHE INTERNAL "Test HAVE_GCC_COMMENT_BLOCK_COMMANDS")
set(HAVE_GCC_WSHADOW "1" CACHE INTERNAL "Test HAVE_GCC_WSHADOW")
set(HAVE_GCC_WUNUSED_LOCAL_TYPEDEFS "" CACHE INTERNAL "Test HAVE_GCC_WUNUSED_LOCAL_TYPEDEFS")
set(HAVE_GCC_WIMPLICIT_FALLTHROUGH "" CACHE INTERNAL "Test HAVE_GCC_WIMPLICIT_FALLTHROUGH")
set(HAVE_GCC_FVISIBILITY "" CACHE INTERNAL "Test HAVE_GCC_FVISIBILITY")
set(HAVE_ST_MTIM "" CACHE INTERNAL "Test HAVE_ST_MTIM")
#set(HAVE_O_CLOEXEC "" CACHE INTERNAL "Test HAVE_O_CLOEXEC")
#set(COMPILER_SUPPORTS_FDIAGNOSTICS_COLOR "" CACHE INTERNAL "Test COMPILER_SUPPORTS_FDIAGNOSTICS_COLOR")
set(COMPILER_SUPPORTS_GCC_ATOMICS "" CACHE INTERNAL "Test COMPILER_SUPPORTS_GCC_ATOMICS")
set(LINKER_SUPPORTS_VERSION_SCRIPT "" CACHE INTERNAL "Test LINKER_SUPPORTS_VERSION_SCRIPT")
set(LINKER_SUPPORTS_WL_NO_UNDEFINED "" CACHE INTERNAL "Test LINKER_SUPPORTS_WL_NO_UNDEFINED")
set(ICONV_IN_LIBC "" CACHE INTERNAL "Test ICONV_IN_LIBC")
set(ICONV_IN_LIBICONV "" CACHE INTERNAL "Test ICONV_IN_LIBICONV")
#set(LIBC_HAS_WORKING_LIBUNWIND "" CACHE INTERNAL "Test LIBC_HAS_WORKING_LIBUNWIND")
#set(LIBUNWIND_HAS_WORKINGLIBUNWIND "" CACHE INTERNAL "Test LIBUNWIND_HAS_WORKINGLIBUNWIND")
set(HAVE_GETPAGESIZE "" CACHE INTERNAL "Have symbol getpagesize")
set(HAVE_SIGACTION "" CACHE INTERNAL "Have symbol sigaction")
set(HAVE_SA_SIGACTION "" CACHE INTERNAL "Have symbol sa_sigaction")
set(HAVE_SETJMP "" CACHE INTERNAL "Have symbol setjmp")
set(HAVE_NANOSLEEP "" CACHE INTERNAL "Have symbol nanosleep")
set(HAVE_GMTIME_R "" CACHE INTERNAL "Have symbol gmtime_r")
set(HAVE_LOCALTIME_R "" CACHE INTERNAL "Have symbol localtime_r")
set(HAVE_NL_LANGINFO "" CACHE INTERNAL "Have symbol nl_langinfo")
set(HAVE_SYSCONF "" CACHE INTERNAL "Have symbol sysconf")
set(HAVE_SYSCTLBYNAME "" CACHE INTERNAL "Have symbol sysctlbyname")
set(HAVE_GETAUXVAL "" CACHE INTERNAL "Have symbol getauxval")
set(HAVE_ELF_AUX_INFO "" CACHE INTERNAL "Have symbol elf_aux_info")
set(HAVE_POLL "" CACHE INTERNAL "Have symbol poll")
set(HAVE_MEMFD_CREATE "" CACHE INTERNAL "Have symbol memfd_create")
set(HAVE_POSIX_FALLOCATE "" CACHE INTERNAL "Have symbol posix_fallocate")
set(HAVE_DLOPEN_IN_LIBC "" CACHE INTERNAL "Have symbol dlopen")
set(HAVE_GETHOSTNAME "" CACHE INTERNAL "Have symbol gethostname")
set(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR "" CACHE INTERNAL "Have symbol addchdir")
set(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR_NP "" CACHE INTERNAL "Have symbol addchdir_np")
set(HAVE_FDATASYNC "" CACHE INTERNAL "Have symbol fdatasync")
set(HAVE_SDL_FSOPS "1" CACHE INTERNAL "Enable SDL_FSOPS")
set(HAVE_SDL_LOCALE "1" CACHE INTERNAL "Enable SDL_LOCALE")
endfunction()
endif()

View File

@@ -77,6 +77,9 @@ else()
endif()
endif()
if(NOT SDL3_COMPONENTS AND NOT TARGET SDL3::Headers AND NOT TARGET SDL3::SDL3-shared AND NOT TARGET SDL3::SDL3-static)
set(SDL3_FOUND FALSE)
endif()
check_required_components(SDL3)
function(_sdl_create_target_alias_compat NEW_TARGET TARGET)
@@ -93,7 +96,7 @@ endfunction()
if(NOT TARGET SDL3::SDL3)
if(TARGET SDL3::SDL3-shared)
_sdl_create_target_alias_compat(SDL3::SDL3 SDL3::SDL3-shared)
else()
elseif(TARGET SDL3::SDL3-static)
_sdl_create_target_alias_compat(SDL3::SDL3 SDL3::SDL3-static)
endif()
endif()

View File

@@ -362,9 +362,6 @@ function(SDL_PrintSummary)
message(STATUS "")
message(STATUS " Build Shared Library: ${SDL_SHARED}")
message(STATUS " Build Static Library: ${SDL_STATIC}")
if(SDL_STATIC)
message(STATUS " Build Static Library with Position Independent Code: ${SDL_STATIC_PIC}")
endif()
if(APPLE)
message(STATUS " Build libraries as Apple Framework: ${SDL_FRAMEWORK}")
endif()

View File

@@ -1,3 +1,10 @@
macro(check_c_source_compiles_static SOURCE VAR)
set(saved_CMAKE_TRY_COMPILE_TARGET_TYPE "${CMAKE_TRY_COMPILE_TARGET_TYPE}")
set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")
check_c_source_compiles("${SOURCE}" ${VAR} ${ARGN})
set(CMAKE_TRY_COMPILE_TARGET_TYPE "${saved_CMAKE_TRY_COMPILE_TARGET_TYPE}")
endmacro()
macro(FindLibraryAndSONAME _LIB)
cmake_parse_arguments(_FLAS "" "" "LIBDIRS" ${ARGN})
@@ -274,10 +281,11 @@ macro(CheckX11)
set(Xrandr_PKG_CONFIG_SPEC xrandr)
set(Xrender_PKG_CONFIG_SPEC xrender)
set(Xss_PKG_CONFIG_SPEC xscrnsaver)
set(Xtst_PKG_CONFIG_SPEC xtst)
find_package(X11)
foreach(_LIB X11 Xext Xcursor Xi Xfixes Xrandr Xrender Xss)
foreach(_LIB X11 Xext Xcursor Xi Xfixes Xrandr Xrender Xss Xtst)
get_filename_component(_libdir "${X11_${_LIB}_LIB}" DIRECTORY)
FindLibraryAndSONAME("${_LIB}" LIBDIRS ${_libdir})
endforeach()
@@ -310,6 +318,7 @@ macro(CheckX11)
find_file(HAVE_XSYNC_H NAMES "X11/extensions/sync.h" HINTS "${X11_INCLUDEDIR}")
find_file(HAVE_XSS_H NAMES "X11/extensions/scrnsaver.h" HINTS "${X11_INCLUDEDIR}")
find_file(HAVE_XSHAPE_H NAMES "X11/extensions/shape.h" HINTS "${X11_INCLUDEDIR}")
find_file(HAVE_XTEST_H NAMES "X11/extensions/XTest.h" HINTS "${X11_INCLUDEDIR}")
find_file(HAVE_XDBE_H NAMES "X11/extensions/Xdbe.h" HINTS "${X11_INCLUDEDIR}")
find_file(HAVE_XEXT_H NAMES "X11/extensions/Xext.h" HINTS "${X11_INCLUDEDIR}")
@@ -367,7 +376,7 @@ macro(CheckX11)
list(APPEND CMAKE_REQUIRED_LIBRARIES ${X11_LIB})
check_c_source_compiles("
check_c_source_compiles_static("
#include <X11/Xlib.h>
int main(int argc, char **argv) {
Display *display;
@@ -381,7 +390,7 @@ macro(CheckX11)
set(SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1)
endif()
check_symbol_exists(XkbLookupKeySym "X11/Xlib.h;X11/XKBlib.h" SDL_VIDEO_DRIVER_X11_HAS_XKBLOOKUPKEYSYM)
check_include_file("X11/XKBlib.h" SDL_VIDEO_DRIVER_X11_HAS_XKBLIB)
if(SDL_X11_XCURSOR AND HAVE_XCURSOR_H AND XCURSOR_LIB)
set(HAVE_X11_XCURSOR TRUE)
@@ -407,8 +416,19 @@ macro(CheckX11)
endif()
set(SDL_VIDEO_DRIVER_X11_XINPUT2 1)
# Check for multitouch
# Check for scroll info
check_c_source_compiles("
#include <X11/Xlib.h>
#include <X11/Xproto.h>
#include <X11/extensions/XInput2.h>
XIScrollClassInfo *s;
int main(int argc, char **argv) {}" HAVE_XINPUT2_SCROLLINFO)
if(HAVE_XINPUT2_SCROLLINFO)
set(SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_SCROLLINFO 1)
endif()
# Check for multitouch
check_c_source_compiles_static("
#include <X11/Xlib.h>
#include <X11/Xproto.h>
#include <X11/extensions/XInput2.h>
@@ -425,7 +445,7 @@ macro(CheckX11)
# check along with XInput2.h because we use Xfixes with XIBarrierReleasePointer
if(SDL_X11_XFIXES AND HAVE_XFIXES_H_ AND HAVE_XINPUT2_H)
check_c_source_compiles("
check_c_source_compiles_static("
#include <X11/Xlib.h>
#include <X11/Xproto.h>
#include <X11/extensions/XInput2.h>
@@ -472,6 +492,16 @@ macro(CheckX11)
set(SDL_VIDEO_DRIVER_X11_XSHAPE 1)
set(HAVE_X11_XSHAPE TRUE)
endif()
if(SDL_X11_XTEST AND HAVE_XTEST_H AND XTST_LIB)
if(HAVE_X11_SHARED)
set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XTEST "\"${XTST_LIB_SONAME}\"")
else()
sdl_link_dependency(xtst LIBS X11::Xtst CMAKE_MODULE X11 PKG_CONFIG_SPECS ${Xtst_PKG_CONFIG_SPEC})
endif()
set(SDL_VIDEO_DRIVER_X11_XTEST 1)
set(HAVE_X11_XTEST TRUE)
endif()
endif()
endif()
if(NOT HAVE_X11)
@@ -575,6 +605,18 @@ macro(CheckWayland)
sdl_link_dependency(wayland LIBS PkgConfig::PC_WAYLAND PKG_CONFIG_PREFIX PC_WAYLAND PKG_CONFIG_SPECS ${WAYLAND_PKG_CONFIG_SPEC})
endif()
# xkbcommon doesn't provide internal version defines, so generate them here.
if (PC_WAYLAND_xkbcommon_VERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)")
set(SDL_XKBCOMMON_VERSION_MAJOR ${CMAKE_MATCH_1})
set(SDL_XKBCOMMON_VERSION_MINOR ${CMAKE_MATCH_2})
set(SDL_XKBCOMMON_VERSION_PATCH ${CMAKE_MATCH_3})
else()
message(WARNING "Failed to parse xkbcommon version; defaulting to lowest supported (0.5.0)")
set(SDL_XKBCOMMON_VERSION_MAJOR 0)
set(SDL_XKBCOMMON_VERSION_MINOR 5)
set(SDL_XKBCOMMON_VERSION_PATCH 0)
endif()
if(SDL_WAYLAND_LIBDECOR)
set(LibDecor_PKG_CONFIG_SPEC libdecor-0)
pkg_check_modules(PC_LIBDECOR IMPORTED_TARGET ${LibDecor_PKG_CONFIG_SPEC})
@@ -795,7 +837,7 @@ endmacro()
macro(CheckPTHREAD)
cmake_push_check_state()
if(SDL_PTHREADS)
if(ANDROID)
if(ANDROID OR SDL_PTHREADS_PRIVATE)
# the android libc provides built-in support for pthreads, so no
# additional linking or compile flags are necessary
elseif(LINUX)
@@ -823,7 +865,7 @@ macro(CheckPTHREAD)
if(CMAKE_C_COMPILER_ID MATCHES "SunPro")
set(PTHREAD_LDFLAGS "-mt -lpthread")
else()
set(PTHREAD_LDFLAGS "-pthread -lposix4")
set(PTHREAD_LDFLAGS "-pthread")
endif()
elseif(SYSV5)
set(PTHREAD_CFLAGS "-D_REENTRANT -Kthread")
@@ -842,6 +884,9 @@ macro(CheckPTHREAD)
set(PTHREAD_LDFLAGS "-pthread")
elseif(QNX)
# pthread support is baked in
elseif(HURD)
set(PTHREAD_CFLAGS "-D_REENTRANT")
set(PTHREAD_LDFLAGS "-pthread")
else()
set(PTHREAD_CFLAGS "-D_REENTRANT")
set(PTHREAD_LDFLAGS "-lpthread")
@@ -1077,6 +1122,14 @@ endmacro()
# Check for HIDAPI support
macro(CheckHIDAPI)
if(ANDROID)
enable_language(CXX)
sdl_sources("${SDL3_SOURCE_DIR}/src/hidapi/android/hid.cpp")
endif()
if(IOS OR TVOS)
sdl_sources("${SDL3_SOURCE_DIR}/src/hidapi/ios/hid.m")
set(SDL_FRAMEWORK_COREBLUETOOTH 1)
endif()
if(SDL_HIDAPI)
set(HAVE_HIDAPI ON)
if(SDL_HIDAPI_LIBUSB)
@@ -1085,7 +1138,7 @@ macro(CheckHIDAPI)
if(LibUSB_FOUND)
cmake_push_check_state()
list(APPEND CMAKE_REQUIRED_LIBRARIES LibUSB::LibUSB)
check_c_source_compiles("
check_c_source_compiles_static("
#include <stddef.h>
#include <libusb.h>
int main(int argc, char **argv) {
@@ -1109,14 +1162,6 @@ macro(CheckHIDAPI)
endif()
if(HAVE_HIDAPI)
if(ANDROID)
enable_language(CXX)
sdl_sources("${SDL3_SOURCE_DIR}/src/hidapi/android/hid.cpp")
endif()
if(IOS OR TVOS)
sdl_sources("${SDL3_SOURCE_DIR}/src/hidapi/ios/hid.m")
set(SDL_FRAMEWORK_COREBLUETOOTH 1)
endif()
set(HAVE_SDL_HIDAPI TRUE)
if(SDL_JOYSTICK AND SDL_HIDAPI_JOYSTICK)
@@ -1124,6 +1169,7 @@ macro(CheckHIDAPI)
set(HAVE_SDL_JOYSTICK TRUE)
set(HAVE_HIDAPI_JOYSTICK TRUE)
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/joystick/hidapi/*.c")
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/haptic/hidapi/*.c")
endif()
else()
set(SDL_HIDAPI_DISABLED 1)
@@ -1245,7 +1291,21 @@ endmacro()
macro(CheckLibUnwind)
if(TARGET SDL3_test)
set(found_libunwind FALSE)
set(_libunwind_src "#include <libunwind.h>\nint main() {unw_context_t context; unw_getcontext(&context); return 0;}")
set(_libunwind_src [==[
#include <libunwind.h>
int main(int argc, char *argv[]) {
(void)argc; (void)argv;
unw_context_t context;
unw_cursor_t cursor;
unw_word_t pc;
char sym[256];
unw_word_t offset;
unw_getcontext(&context);
unw_step(&cursor);
unw_get_reg(&cursor, UNW_REG_IP, &pc);
unw_get_proc_name(&cursor, sym, sizeof(sym), &offset);
return 0;
}]==])
if(NOT found_libunwind)
cmake_push_check_state()

View File

@@ -1,18 +1,40 @@
add_library(SDL3-collector INTERFACE)
add_library(SDL3_test-collector INTERFACE)
function(sdl_source_group prefix_directory)
set(prefixed_list)
file(TO_CMAKE_PATH ${prefix_directory} normalized_prefix_path)
foreach(file in ${ARGN})
file(TO_CMAKE_PATH ${file} normalized_path)
string(FIND "${normalized_path}" ${normalized_prefix_path} position)
if("${position}" EQUAL 0)
list(APPEND prefixed_list ${file})
endif()
endforeach()
if(prefixed_list)
source_group(TREE ${prefix_directory} FILES ${prefixed_list})
endif()
endfunction()
# Use sdl_glob_sources to add glob sources to SDL3-shared, to SDL3-static, or to both.
function(sdl_glob_sources)
cmake_parse_arguments(ARGS "" "" "SHARED;STATIC" ${ARGN})
file(GLOB shared_sources ${ARGS_SHARED})
file(GLOB static_sources ${ARGS_STATIC})
file(GLOB both_sources ${ARGS_UNPARSED_ARGUMENTS})
if(ARGS_SHARED)
file(GLOB shared_sources CONFIGURE_DEPENDS ${ARGS_SHARED})
endif()
if(ARGS_STATIC)
file(GLOB static_sources CONFIGURE_DEPENDS ${ARGS_STATIC})
endif()
if(ARGS_UNPARSED_ARGUMENTS)
file(GLOB both_sources CONFIGURE_DEPENDS ${ARGS_UNPARSED_ARGUMENTS})
endif()
if(TARGET SDL3-shared)
target_sources(SDL3-shared PRIVATE ${shared_sources} ${both_sources})
endif()
if(TARGET SDL3-static)
target_sources(SDL3-static PRIVATE ${static_sources} ${both_sources})
endif()
sdl_source_group(${PROJECT_SOURCE_DIR} ${shared_sources} ${shared_sources} ${both_sources})
set_property(TARGET SDL3-collector APPEND PROPERTY INTERFACE_SOURCES ${shared_sources} ${static_sources} ${both_sources})
endfunction()
@@ -25,6 +47,7 @@ function(sdl_sources)
if(TARGET SDL3-static)
target_sources(SDL3-static PRIVATE ${ARGS_STATIC} ${ARGS_UNPARSED_ARGUMENTS})
endif()
sdl_source_group(${PROJECT_SOURCE_DIR} ${ARGS_SHARED} ${ARGS_STATIC} ${ARGS_UNPARSED_ARGUMENTS})
set_property(TARGET SDL3-collector APPEND PROPERTY INTERFACE_SOURCES ${ARGS_SHARED} ${ARGS_STATIC} ${ARGS_UNPARSED_ARGUMENTS})
endfunction()

View File

@@ -160,3 +160,63 @@ function(SDL_AddCommonCompilerFlags TARGET)
endif()
endif()
endfunction()
function(check_x86_source_compiles BODY VAR)
if(ARGN)
message(FATAL_ERROR "Unknown arguments: ${ARGN}")
endif()
if(APPLE_MULTIARCH AND (SDL_CPU_X86 OR SDL_CPU_X64))
set(test_conditional 1)
else()
set(test_conditional 0)
endif()
check_c_source_compiles("
#if ${test_conditional}
# if defined(__i386__) || defined(__x86_64__)
# define test_enabled 1
# else
# define test_enabled 0 /* feign success in Apple multi-arch configs */
# endif
#else /* test normally */
# define test_enabled 1
#endif
#if test_enabled
${BODY}
#else
int main(int argc, char *argv[]) {
(void)argc;
(void)argv;
return 0;
}
#endif" ${VAR})
endfunction()
function(check_arm_source_compiles BODY VAR)
if(ARGN)
message(FATAL_ERROR "Unknown arguments: ${ARGN}")
endif()
if(APPLE_MULTIARCH AND (SDL_CPU_ARM32 OR SDL_CPU_ARM64))
set(test_conditional 1)
else()
set(test_conditional 0)
endif()
check_c_source_compiles("
#if ${test_conditional}
# if defined(__arm__) || defined(__aarch64__)
# define test_enabled 1
# else
# define test_enabled 0 /* feign success in Apple multi-arch configs */
# endif
#else /* test normally */
# define test_enabled 1
#endif
#if test_enabled
${BODY}
#else
int main(int argc, char *argv[]) {
(void)argc;
(void)argv;
return 0;
}
#endif" ${VAR})
endfunction()

View File

@@ -4,15 +4,15 @@ function(SDL_DetectTargetCPUArchitectures DETECTED_ARCHS)
if(APPLE AND CMAKE_OSX_ARCHITECTURES)
foreach(known_arch IN LISTS known_archs)
set(SDL_CPU_${known_arch} "0")
set(SDL_CPU_${known_arch} "0" PARENT_SCOPE)
endforeach()
set(detected_archs)
foreach(osx_arch IN LISTS CMAKE_OSX_ARCHITECTURES)
if(osx_arch STREQUAL "x86_64")
set(SDL_CPU_X64 "1")
set(SDL_CPU_X64 "1" PARENT_SCOPE)
list(APPEND detected_archs "X64")
elseif(osx_arch STREQUAL "arm64")
set(SDL_CPU_ARM64 "1")
set(SDL_CPU_ARM64 "1" PARENT_SCOPE)
list(APPEND detected_archs "ARM64")
endif()
endforeach()

View File

@@ -22,8 +22,12 @@ function(SDL_DetectCMakePlatform)
set(sdl_cmake_platform Haiku)
elseif(NINTENDO_3DS)
set(sdl_cmake_platform n3ds)
elseif(NGAGESDK)
set(sdl_cmake_platform ngage)
elseif(PS2)
set(sdl_cmake_platform ps2)
elseif(RISCOS)
set(sdl_cmake_platform RISCOS)
elseif(VITA)
set(sdl_cmake_platform Vita)
elseif(CMAKE_SYSTEM_NAME MATCHES ".*Linux")
@@ -34,8 +38,9 @@ function(SDL_DetectCMakePlatform)
set(sdl_cmake_platform NetBSD)
elseif(CMAKE_SYSTEM_NAME MATCHES "kOpenBSD.*|OpenBSD.*")
set(sdl_cmake_platform OpenBSD)
elseif(CMAKE_SYSTEM_NAME MATCHES ".*GNU.*")
set(sdl_cmake_platform GNU)
elseif(CMAKE_SYSTEM_NAME STREQUAL "GNU")
# GNU/Hurd must be checked AFTER RISCOS
set(sdl_cmake_platform Hurd)
elseif(CMAKE_SYSTEM_NAME MATCHES ".*BSDI.*")
set(sdl_cmake_platform BSDi)
elseif(CMAKE_SYSTEM_NAME MATCHES "DragonFly.*|FreeBSD")

View File

@@ -96,12 +96,14 @@ if(TEST_STATIC)
add_executable(gui-static WIN32 main_gui.c)
target_link_libraries(gui-static PRIVATE SDL3::SDL3-static)
# Assume SDL library has been built with `set(CMAKE_POSITION_INDEPENDENT_CODE ON)`
add_library(sharedlib-static SHARED main_lib.c)
target_link_libraries(sharedlib-static PRIVATE SDL3::SDL3-static)
generate_export_header(sharedlib-static EXPORT_MACRO_NAME MYLIBRARY_EXPORT)
target_compile_definitions(sharedlib-static PRIVATE "EXPORT_HEADER=\"${CMAKE_CURRENT_BINARY_DIR}/sharedlib-static_export.h\"")
set_target_properties(sharedlib-static PROPERTIES C_VISIBILITY_PRESET "hidden")
if(TEST_SHARED)
# Assume SDL library has been built with `set(CMAKE_POSITION_INDEPENDENT_CODE ON)`
add_library(sharedlib-static SHARED main_lib.c)
target_link_libraries(sharedlib-static PRIVATE SDL3::SDL3-static)
generate_export_header(sharedlib-static EXPORT_MACRO_NAME MYLIBRARY_EXPORT)
target_compile_definitions(sharedlib-static PRIVATE "EXPORT_HEADER=\"${CMAKE_CURRENT_BINARY_DIR}/sharedlib-static_export.h\"")
set_target_properties(sharedlib-static PROPERTIES C_VISIBILITY_PRESET "hidden")
endif()
if(TEST_TEST)
add_executable(sdltest-static sdltest.c)

View File

@@ -6,7 +6,7 @@ int main(int argc, char *argv[])
{
SDL_SetMainReady();
if (!SDL_Init(0)) {
SDL_Log("Could not initialize SDL: %s\n", SDL_GetError());
SDL_Log("Could not initialize SDL: %s", SDL_GetError());
return 1;
}
SDL_Delay(100);

View File

@@ -1,24 +1,37 @@
#include <SDL3/SDL.h>
#define SDL_MAIN_USE_CALLBACKS
#include <SDL3/SDL_main.h>
#include <SDL3/SDL.h>
int main(int argc, char *argv[])
static SDL_Window *window;
SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event)
{
return SDL_APP_CONTINUE;
}
SDL_AppResult SDL_AppIterate(void *appstate)
{
SDL_Window *window = NULL;
SDL_Surface *screenSurface = NULL;
if (!SDL_Init(SDL_INIT_VIDEO)) {
SDL_Log("Could not initialize SDL: %s\n", SDL_GetError());
return 1;
}
window = SDL_CreateWindow("Hello SDL", 640, 480, 0);
if (!window) {
SDL_Log("could not create window: %s\n", SDL_GetError());
return 1;
}
screenSurface = SDL_GetWindowSurface(window);
SDL_FillSurfaceRect(screenSurface, NULL, SDL_MapSurfaceRGB(screenSurface, 0xff, 0xff, 0xff));
SDL_UpdateWindowSurface(window);
SDL_Delay(100);
SDL_DestroyWindow(window);
SDL_Quit();
return 0;
return SDL_APP_CONTINUE;
}
SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
{
if (!SDL_Init(SDL_INIT_VIDEO)) {
SDL_Log("Could not initialize SDL: %s", SDL_GetError());
return SDL_APP_FAILURE;
}
window = SDL_CreateWindow("Hello SDL", 640, 480, 0);
if (!window) {
SDL_Log("could not create window: %s", SDL_GetError());
return SDL_APP_FAILURE;
}
return SDL_APP_CONTINUE;
}
void SDL_AppQuit(void *appstate, SDL_AppResult result) {
SDL_DestroyWindow(window);
}

View File

@@ -18,7 +18,7 @@ int MYLIBRARY_EXPORT mylibrary_work(void);
int mylibrary_init(void) {
SDL_SetMainReady();
if (!SDL_Init(0)) {
SDL_Log("Could not initialize SDL: %s\n", SDL_GetError());
SDL_Log("Could not initialize SDL: %s", SDL_GetError());
return 1;
}
return 0;

Some files were not shown because too many files have changed in this diff Show More