Compare commits

...

9146 Commits

Author SHA1 Message Date
Sylvain
b084999d40 testautomation_events: initialize variable to prevent undefined read 2025-09-03 10:15:01 +02:00
Sam Lantinga
437d78499c Don't set SDL_SURFACE_LOCK_NEEDED until a surface is RLE encoded
Reference https://github.com/libsdl-org/sdl2-compat/issues/476
2025-09-02 21:31:51 -07:00
Sam Lantinga
fbbc29159a Leave letterbox borders set to the frame clear color
Fixes https://github.com/libsdl-org/sdl2-compat/issues/483
2025-09-02 20:14:34 -07:00
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
Frank Praznik
b96bb152c2 wayland: Don't redundantly set the border state when showing a window
They are now set before the initial configure.
2025-01-16 13:54:39 -05:00
Frank Praznik
5a564a718d wayland: Add a dummy function for the libdecor dismiss popup callback
This was never added, and we've been lucky that it's never called as libdecor doesn't check the function pointer for null before doing so.
2025-01-16 13:48:16 -05:00
Frank Praznik
9f6eeb1095 wayland: Set the border state before the initial configure
This allows the toplevel bounds to be set correctly on borderless windows.
2025-01-16 13:40:31 -05:00
SDL Wiki Bot
274bc95dfd Sync SDL3 wiki -> header
[ci skip]
2025-01-16 18:29:57 +00:00
SDL Wiki Bot
07f7c40464 Sync SDL3 wiki -> header
[ci skip]
2025-01-16 18:18:47 +00:00
Ryan C. Gordon
22d8e73530 include: filled in category documentation for SDL_messagebox.h.
Reference Issue #11847.
2025-01-16 13:16:18 -05:00
Sam Lantinga
21a42d2b0d Add CategoryAPICategory to the complete API index 2025-01-16 09:26:00 -08:00
Anonymous Maarten
1006236aa6 ci: add summary to release.yml
[ci skip]
2025-01-16 18:24:13 +01:00
Ethan Lee
326ce9bb8d gpu: D3D12 buildfix for Xbox 2025-01-16 12:19:59 -05:00
Ethan Lee
c95b842b30 video: Xbox does not use CreateIconFromSurface 2025-01-16 12:19:46 -05:00
Sam Lantinga
d8e1ad0ebc release: skip extended Android SDK versions 2025-01-16 09:07:00 -08:00
Frank Praznik
7ee2ab3830 wayland: Fix return value check from int-to-bool conversion 2025-01-16 11:52:16 -05:00
Sam Lantinga
1dd8fadca2 Updated to version 3.1.10 for the release candidate 2025-01-16 08:33:18 -08:00
SDL Wiki Bot
9225a421b7 Sync SDL3 wiki -> header
[ci skip]
2025-01-16 13:20:18 +00:00
Ryan C. Gordon
3ffb1a8cbd storage: generic title storage allows override paths without '/' appended.
Fixes #11299.
2025-01-16 08:19:28 -05:00
Ryan C. Gordon
874c07f8de storage: Don't allow "." and ".." paths, enforce '/' dir separators.
Also clarify what characters are valid for Storage paths in the category docs.

Fixes #11079.
Fixes #11370.
Fixes #11369.
2025-01-16 08:19:28 -05:00
Ryan C. Gordon
67664a0427 testfilesystem: test some Storage APIs, too. 2025-01-16 08:19:28 -05:00
Ryan C. Gordon
eb793dede7 filesystem: SDL_GetCurrentDirectory() should add a path separator at the end. 2025-01-16 08:19:28 -05:00
Ryan C. Gordon
87e1b0eb89 filesystem: SDL_EnumerateDirectory() gives dirs with path seperators appended.
Fixes #11065.
Fixes #11427.
2025-01-16 08:19:28 -05:00
Ramez Ragaa
e98ee9bb04 Adjust testgl.c to test gl_release_behavior 2025-01-16 08:19:05 -05:00
Ryan C. Gordon
3424ec948c video: SDL_GL_GetAttribute gets correct SDL_GL_CONTEXT_RELEASE_BEHAVIOR value.
Original patch was from @ramezgerges (thanks!).

Fixes #11697.
2025-01-16 08:19:05 -05:00
Ryan C. Gordon
05877f2cea cmake: Add the IoRing async i/o code to the Windows build.
The Visual Studio projects have been compiling this for awhile, but apparently
we haven't tested this through CMake before. Toolchains without access to
the latest Windows 11 SDK headers have been preprocessing out the dependency
on this code, so we never noticed.
2025-01-16 08:18:40 -05:00
Ryan C. Gordon
4d63a2b882 io: Renamed src/file to src/io
Fixes #11980.
2025-01-16 08:18:40 -05:00
Sam Lantinga
ea642fe9ff cocoa: clear mouse focus based on NSEventTypeMouseExited events (#11991)
We can't directly set the mouse focus since we may get spammed by entered/exited events,
but we can process the current focus later in the mouseMoved handler in line with the
mouse motion event sequence.

Fixes https://github.com/libsdl-org/SDL/issues/8188
2025-01-15 23:34:20 -08:00
Sam Lantinga
5f4696ce63 Updating documentation for the 3.2.0 release
* Simplified and updated the mingw release archive

* Simplified and updated the msvc release archive

* Updated the Xcode release archive

* Updated the Android release archive
2025-01-15 20:38:16 -08:00
Sam Lantinga
2c7b7d1d33 Keep the lifecycle observer active while there are windows active
Fixes https://github.com/libsdl-org/SDL/issues/11627
2025-01-15 17:10:49 -08:00
cosmonaut
355f69ebfe GPU: Ensure thread safety of Vulkan resource creation 2025-01-15 13:45:43 -08:00
Frank Praznik
c9d602307c cocoa: Only process hit tests on left clicks
Otherwise, right-click events over drag areas will be eaten.
2025-01-15 15:44:01 -05:00
Frank Praznik
dd0bdc2561 win32: Pass through non-left mouse button presses when over draggable areas
Returning anything other an HTCLIENT result will cause windows to eat the button press, so ensure that non-left presses are passed through to the client over draggable areas.
2025-01-15 15:44:01 -05:00
Ryan C. Gordon
84d35587ee filesystem: SDL_SYS_EnumerateDirectory inexplicably takes the same arg twice. 2025-01-15 14:09:33 -05:00
Sam Lantinga
fc9b2478d8 windows: don't set focus click pending if SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH is set
Fixes https://github.com/libsdl-org/SDL/issues/11976
2025-01-15 10:54:12 -08:00
Sam Lantinga
18d21b36fe windows: use the initial rect to anchor fixed aspect ratio resizing
Fixes https://github.com/libsdl-org/SDL/issues/11688
2025-01-15 10:33:22 -08:00
Sam Lantinga
1995471927 cocoa: fixed resizing windows with fixed aspect ratio
The existing algorithm works well for min-max ratios, but didn't allow edge expansion of fixed aspect ratio windows. Use NSWindow setContentAspectRatio instead.
2025-01-15 10:05:34 -08:00
Sam Lantinga
67382e9c83 Fixed detection of function keys on Emscripten
Fixes https://github.com/libsdl-org/SDL/issues/11973
2025-01-15 08:07:38 -08:00
Sam Lantinga
23410debf7 SDL_GetKeyboardNameForID(): Set an error message for invalid keyboard IDs 2025-01-15 00:01:06 -08:00
Petar Popovic
8ce176b59a SDL_GetMouseNameForID(): Set an error message for invalid mouse IDs. 2025-01-14 23:59:49 -08:00
Sam Lantinga
51fa076fdc Don't send normal keyboard events if no application window has focus
This can happen if all the windows shown have the SDL_WINDOW_NOT_FOCUSABLE flag. We'll still accept modifier state changes though, so you can do Control-click actions.
2025-01-14 23:44:43 -08:00
Sam Lantinga
a446381ea9 Tooltips and unfocusable windows can't become main windows 2025-01-14 23:44:43 -08:00
Ryan C. Gordon
ebb24eedc8 mouse: Clean up virtual touch devices as appropriate. 2025-01-15 02:19:59 -05:00
Ryan C. Gordon
dabc93a631 pen: Send virtual mouse and touch events for pen input.
Fixes #11948.
2025-01-15 02:19:59 -05:00
ImThour
169c8d5140 Fix incorrect hotspot calculation for cursor positioning
Corrected the calculation of the vertical hotspot position in the `GetCachedCursor` function.

Changed the variable from `data->hot_x` to `data->hot_y` to ensure the correct vertical position of the cursor's hotspot is used when scaling.
2025-01-14 22:37:24 -08:00
Sam Lantinga
8e9c44bc3b Fixed accidental removal of optional delegate interface check
Fixes https://github.com/libsdl-org/SDL/issues/11970
2025-01-14 22:35:13 -08:00
Sam Lantinga
4dd585fb62 coreaudio: convert MPEG channel layout to WAVE channel layout 2025-01-14 22:26:16 -08:00
Sam Lantinga
81e57147f8 Child windows shouldn't take focus if the parent window is in relative mouse mode
Fixes https://github.com/libsdl-org/SDL/issues/11807 on Windows
2025-01-14 21:27:06 -08:00
SDL Wiki Bot
3bea84531d Sync SDL3 wiki -> header
[ci skip]
2025-01-15 03:27:28 +00:00
Sam Lantinga
9ed23a4b79 Updated SDL_SetEventFilter() documentation 2025-01-14 19:25:31 -08:00
Sam Lantinga
e19a56f4d5 Don't send fake key events while processing real ones on Android
Fixes https://github.com/libsdl-org/SDL/issues/11350
2025-01-14 19:05:07 -08:00
Sam Lantinga
1ab61635a9 Use SDL_Log() for keyboard debugging. 2025-01-14 19:05:07 -08:00
Sam Lantinga
29c684c626 Removed debug logging 2025-01-14 18:05:37 -08:00
Sam Lantinga
0eaa6197c5 Removed unnecessary __builtin_available check 2025-01-14 17:00:30 -08:00
Sam Lantinga
ffe194c52e Fixed build when SDL_JOYSTICK_MFI isn't enabled 2025-01-14 17:00:30 -08:00
Sam Lantinga
a4547fe77a Updated weak framework dependencies for new deployment targets 2025-01-14 17:00:30 -08:00
Sam Lantinga
49dd24e195 Fixed potentially overlapping memcpy() to use memmove() 2025-01-14 14:31:20 -08:00
Green Sky
191a6417d5 events: use SDL_memmove instead of SDL_memcpy for overlapping memory 2025-01-14 14:20:32 -08:00
SDL Wiki Bot
bf793bf439 Sync SDL3 wiki -> header
[ci skip]
2025-01-14 21:44:52 +00:00
Ryan C. Gordon
9e60a8994f audio: Allow streams to change the device-side channels maps.
Fixes #11881.
2025-01-14 16:42:53 -05:00
Sam Lantinga
b2793a2ce2 Removed obsolete Raspberry Pi documentation 2025-01-14 12:58:30 -08:00
Sam Lantinga
04e3b67707 Removed outdated Visual Studio instructions 2025-01-14 12:22:15 -08:00
Sam Lantinga
a41f93bd10 Added https://github.com/Ravbug/sdl3-sample as a more complete Android example 2025-01-14 12:22:00 -08:00
Sam Lantinga
5ca735b40f Only use WAVE surround sound channel layouts on macOS 10.15+ 2025-01-14 12:03:07 -08:00
Sam Lantinga
cdde6dd7bb Bumped deployment requirements for Apple platforms
We require at least Xcode 12.2 and macOS SDK 11 to build. We support deploying to macOS 10.13, iOS 11.0, and tvOS 11.0.

This cleans up the code significantly
2025-01-14 12:03:07 -08:00
Sam Lantinga
8f8af918ba Removed CMakeLists.txt example that says you shouldn't use it 2025-01-14 11:15:34 -08:00
Sam Lantinga
8feb21a1d1 Updated README-cmake.md with build instructions for several platforms 2025-01-14 11:15:34 -08:00
cosmonaut
4294c06836 GPU: Check texture format support in pipeline creation 2025-01-14 10:16:20 -08:00
SDL Wiki Bot
31dd4fe81f Sync SDL3 wiki -> header
[ci skip]
2025-01-14 17:58:27 +00:00
Maia
417ed7f35f Fix references in docs 2025-01-14 09:56:39 -08:00
Scrooge86x
0aa319e4f9 Added support for custom tray icon on Windows via SDL hints.
SDL_CreateTray now respects SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL
and SDL_HINT_WINDOWS_INTRESOURCE_ICON hints and uses the specified icon
as the tray icon.
2025-01-13 18:35:49 -08:00
Ozkan Sezer
5815372206 minor update to mingw-w64 build instructions. 2025-01-14 05:04:24 +03:00
cosmonaut
5d079c9a26 GPU: Remove bogus property from header docs 2025-01-13 17:46:31 -08:00
cosmonaut
d590e1f122 GPU: Align D3D12 clear properties to naming convention 2025-01-13 17:38:21 -08:00
SDL Wiki Bot
7098e525d0 Sync SDL3 wiki -> header
[ci skip]
2025-01-14 01:30:53 +00:00
Evan Hemsley
fb6df93384 GPU: Add name properties to resources (#11946) 2025-01-13 17:29:08 -08:00
SDL Wiki Bot
a2b0ddcca6 Sync SDL3 wiki -> header
[ci skip]
2025-01-14 01:19:09 +00:00
Sam Lantinga
d28e953222 Added thread safety documentation for SDL_iostream.h
Fixes https://github.com/libsdl-org/SDL/issues/11942
2025-01-13 17:17:17 -08:00
SDL Wiki Bot
f731741ead Sync SDL3 wiki -> header
[ci skip]
2025-01-14 00:44:57 +00:00
Sam Lantinga
0eaa8c6d81 Added INTRO-emscripten.md 2025-01-13 16:42:50 -08:00
Sam Lantinga
21b433536a Scale up the text for large displays 2025-01-13 16:42:50 -08:00
Sam Lantinga
6bc7e88ca6 Added INTRO-androidstudio.md 2025-01-13 16:42:50 -08:00
Sam Lantinga
e4e76ac72e Added INTRO-xcode.md 2025-01-13 16:42:50 -08:00
Sam Lantinga
1b30a01b44 Added INTRO-visualstudio.md
Also removed out of date Visual C++ documentation
2025-01-13 16:42:50 -08:00
Sam Lantinga
191b9d5021 Added INTRO-cmake.md 2025-01-13 16:42:50 -08:00
Sam Lantinga
7d2a1c5f8f Mention the tests in INSTALL.md 2025-01-13 16:42:50 -08:00
Sam Lantinga
b6b9390444 Simplified INSTALL.md 2025-01-13 16:42:50 -08:00
Sam Lantinga
55e094f7ac Updated INSTALL.md with simple intro breadcrumbs 2025-01-13 16:42:50 -08:00
Sam Lantinga
584c1d5791 Tweaking the README 2025-01-13 16:42:50 -08:00
Sam Lantinga
995a6a0333 Minor readability improvement for README-contributing.md 2025-01-13 16:42:50 -08:00
Sam Lantinga
86b46c678c Removed README-git.md
We're fully hosted on GitHub, no need for additional explanation.
2025-01-13 16:42:50 -08:00
Sam Lantinga
96414fa56a Removed obsolete Raspberry Pi documentation 2025-01-13 16:42:50 -08:00
Sam Lantinga
670db4d248 Made the README links in INSTALL.md markdown links 2025-01-13 16:42:50 -08:00
Sam Lantinga
b08d045811 Added a Discord link to BUGS.txt 2025-01-13 16:42:50 -08:00
Sam Lantinga
2ad0f1e1fe Updated the credits for SDL 3.0 2025-01-13 16:42:50 -08:00
Sam Lantinga
41d48db4ae Removed the runtime README
The main README is suitable for inclusion in redistributable archives and we'll have custom installation instructions for each platform.
2025-01-13 16:42:50 -08:00
Sam Lantinga
922b73195c Simplified the README 2025-01-13 16:42:50 -08:00
Sam Lantinga
5e4a2974aa Removed obsolete warnings about MIT licensed SIMD code
We no longer use the code this was warning about
2025-01-13 16:42:50 -08:00
Ryan C. Gordon
3766a39409 emscripten: double the audio buffer size.
Some systems seem to not keep up with the smaller buffer.

Reference Issue #11930.
2025-01-13 16:26:18 -05:00
SDL Wiki Bot
e10e42c814 Sync SDL3 wiki -> header
[ci skip]
2025-01-13 20:58:20 +00:00
Ryan C. Gordon
2b8fb0bdd4 wikiheaders: Maybe fix perl warning.
Reference Issue #11944.
2025-01-13 15:18:39 -05:00
SDL Wiki Bot
efaf3739c6 Sync SDL3 wiki -> header
[ci skip]
2025-01-13 19:42:26 +00:00
Ryan C. Gordon
4bddf521dd emscripten: Override emscripten's fullscreen button with SDL's implementation.
Fixes #6798.
Fixes #7913.
Fixes #9044.
2025-01-13 14:17:36 -05:00
expikr
569de84907 better numerical precision for playback example 2025-01-13 10:29:51 -08:00
Sam Lantinga
e5a4f09363 Call SDL_UDEV_Quit() if we don't end up using it 2025-01-13 10:22:10 -08:00
SDL Wiki Bot
7d7a76c077 Sync SDL3 wiki -> header
[ci skip]
2025-01-13 17:53:40 +00:00
Sam Lantinga
66408308b8 Added documentation for mouse handling in relative mode
Fixes https://github.com/libsdl-org/SDL/issues/11805
2025-01-13 09:52:21 -08:00
SDL Wiki Bot
438075a83a Sync SDL3 wiki -> header
[ci skip]
2025-01-13 17:38:58 +00:00
Frank Praznik
b4562c0243 cocoa: Add a hint to control menu visibility in fullscreen spaces windows
Adds SDL_HINT_VIDEO_MAC_FULLSCREEN_MENU_VISIBILITY to control whether or not the menu can be accessed when the cursor is moved to the top of the screen when a window is in fullscreen spaces mode.

The three values are true, false, and 'auto' (default), with auto resulting in a hidden menu if fullscreen was toggled programmatically, and the menu being accessible if fullscreen was toggled via the button on the window title bar, so the user has an easy way back out of fullscreen if the client app/game doesn't have a readily available option to toggle it.
2025-01-13 12:37:16 -05:00
Sam Lantinga
611f132fd0 Don't use a hint callback for SDL_HINT_ANDROID_ALLOW_RECREATE_ACTIVITY
This was originally intended to make sure that nativeAllowRecreateActivity() could be called from another thread safely, but the hint system is now thread-safe, so we don't need to use a callback here.

Fixes https://github.com/libsdl-org/SDL/issues/11938
2025-01-13 07:49:09 -08:00
mausimus
03a3c19c27 examples: use doubles to generate sine waves and avoid distortion 2025-01-13 09:50:45 -05:00
Ryan C. Gordon
307e6f2ca6 emscripten: simulate mouse autocapture.
This is just enough to delay MOUSE_LEAVE events until a drag ending outside
the canvas is released, and make sure the MOUSE_UP event has the canvas's
SDL_WindowID, which it wouldn't when mouse focus is was lost by this point.

Fixes #10033.
2025-01-13 02:39:39 -05:00
Anonymous Maarten
f79083d9bb release: don't add test directory to mingw release archives 2025-01-13 04:32:49 +01:00
Anonymous Maarten
4ba4f0a106 release: add Android aar to devel zip archive
[ci skip]
2025-01-12 16:28:00 -08:00
Sam Lantinga
c4f2f7b352 Removed redundant information in example pages
This is large text and is already covered by the header and breadcrumb
2025-01-12 15:57:48 -08:00
SDL Wiki Bot
949ec0c501 Sync SDL3 wiki -> header
[ci skip]
2025-01-12 23:52:58 +00:00
SDL Wiki Bot
839227b4b0 Sync SDL3 wiki -> header
[ci skip]
2025-01-12 22:24:11 +00:00
cosmonaut
c04b739df6 GPU: Note that resource naming functions are not thread safe. 2025-01-12 14:22:26 -08:00
Ethan Lee
3df0767e34 gpu: Initialize Metal stencil format even if stencil test is disabled 2025-01-12 13:05:27 -08:00
Ozkan Sezer
307dac97ac testcontroller.c: fix build errors due to -Wformat after commit b524af1 2025-01-12 22:00:02 +03:00
Sam Lantinga
21cc1878f1 Reset enhanced mode state when closing a controller
Fixes https://github.com/libsdl-org/SDL/issues/11912
2025-01-12 10:45:54 -08:00
Sam Lantinga
b524af1b43 testcontroller: log the ID of gamepads as they are added and removed 2025-01-12 10:02:39 -08:00
expikr
9a83fa026d apply multiplier scale after system scale 2025-01-12 08:24:41 -08:00
SDL Wiki Bot
ea859fba3a Sync SDL3 wiki -> header
[ci skip]
2025-01-12 16:07:12 +00:00
Sam Lantinga
551510c0eb SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE can be combined with SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE 2025-01-12 08:05:51 -08:00
Ryan C. Gordon
95c1584386 README-migration: note SDL2 brightness/gamma ramp APIs that have been removed.
Fixes #11918.
2025-01-12 04:35:56 -05:00
Ryan C. Gordon
f0af6c348a emscripten: Add SDL_EVENT_DISPLAY_ORIENTATION support.
Reference Issue #11389.
2025-01-12 02:23:00 -05:00
Ryan C. Gordon
3ad9c38a46 emscripten: Don't set OpenGL swap intervals until first PumpEvents.
Any requested swap interval will be saved and set on the first PumpEvents.
Once PumpEvents has been called at least once, swap intervals are set
immediately.

This assumes that events won't be pumped until after an Emscripten main loop
has been defined, and so prevents a warning on the javascript console:

"emscripten_set_main_loop_timing: Cannot set timing mode for main loop since
a main loop does not exist! Call emscripten_set_main_loop first to set one
up."

Fixes #9969.
2025-01-11 15:19:09 -05:00
Anonymous Maarten
d42b4ed961 Leave SDL_TriggerBreakpoint undefined on unknown platforms 2025-01-11 17:29:27 +01:00
Anthony
9a7cfbc2d0 Add onNativePen to proguard-rules.pro 2025-01-11 07:44:55 -08:00
Ryan C. Gordon
82125ec1d8 x11: Be more aggressive about finding _any_ usable messagebox font.
Fixes #4800.
Fixes #11910.
2025-01-11 00:35:39 -05:00
Sam Lantinga
4231848791 Revert "Separate android initialization from Activity (#11891)"
This reverts commit d14c93c4b1.

This is a major breaking change for activities that inherit SDLActivity
2025-01-10 15:27:08 -08:00
Ozkan Sezer
61f13b94d1 add a fallback SDL_TriggerBreakpoint() for MSVC after commit ebaa30d3. 2025-01-11 02:11:50 +03:00
Xander
d14c93c4b1 Separate android initialization from Activity (#11891) 2025-01-10 15:05:58 -08:00
SDL Wiki Bot
c64197be1a Sync SDL3 wiki -> header
[ci skip]
2025-01-10 20:56:33 +00:00
Sam Lantinga
042898995c Added SDL_ClickTrayEntry()
Also removed the app delegate from the tray code on Cocoa and folded that into SDL3AppDelegate.

Fixes https://github.com/libsdl-org/SDL/issues/11906
2025-01-10 12:55:50 -08:00
Ryan C. Gordon
fb0f6a1196 cocoa: Display mode changes set Desktop display mode, not current. 2025-01-10 15:35:43 -05:00
Ryan C. Gordon
38176bfe9a cocoa: Implemented display hotplugging support.
Fixes #7764.
2025-01-10 13:25:34 -05:00
Frank Praznik
0e2ca934b5 events: Remove unused function declaration 2025-01-10 11:23:54 -05:00
Sam Lantinga
715897aea7 Added support for displaying XIM composition strings
Fixes https://github.com/libsdl-org/SDL/issues/6437
2025-01-10 03:26:42 -08:00
Sam Lantinga
a8a65b6fca Use XIM for IME input on X11
Tested with fcitx5 and ibus on Xorg and Xwayland
* Used US English with dead keys and verified that ` followed by a results in à
* Used Hangul to enter Korean and got text in the expected order
* Used the mozc IM to enter Japanese and was able to generate candidates and so forth

Fixes https://github.com/libsdl-org/SDL/issues/3907
Fixes https://github.com/libsdl-org/SDL/issues/6164
Fixes https://github.com/libsdl-org/SDL/issues/11894
2025-01-10 03:26:42 -08:00
SDL Wiki Bot
1f3b40797d Sync SDL3 wiki -> header
[ci skip]
2025-01-10 06:39:06 +00:00
Ryan C. Gordon
fb94a79f89 stdinc: define SDL_NOLONGLONG for old Visual Studios, document the symbol.
Reference PR #11900.
2025-01-10 01:37:25 -05:00
Anonymous Maarten
bda90c3cb6 cmake: rename SDL_DISABLE_* CMake options to SDL_xxx 2025-01-10 04:23:32 +01:00
Ethan Lee
90aff306c1 gpu: Show a debug error when pipelines are not given the right shader stages 2025-01-09 20:17:21 -05:00
SDL Wiki Bot
00b23a012c Sync SDL3 wiki -> header
[ci skip]
2025-01-09 22:27:31 +00:00
Frank Praznik
6b776a9989 keyboard: Add some SDL keycodes for common Xkb keys
Add SDL keycodes for keys found commonly found in the default Xkb layout, such as left tab and compose, and keys frequently used for custom modifiers such as Meta, Hyper, and Level5 Shift.

As these keys aren't Unicode code points and don't have associated scancodes (at least on modern keyboards), they are placed in the new extended key code space, with bit 30 set as a flag.
2025-01-09 17:26:41 -05:00
Frank Praznik
e5966bbdb1 x11: Add support for Mod3 and more esoteric Xkb configurations
Adds support for Mod3, which is usually Level 5 shift, as well as not altering the functionality of the more esoteric modifier keys, such as meta and hyper.

Also use the system modifier state instead of setting them based on key presses, which may be incorrect due to remapping, or toggled in some other manner.
2025-01-09 17:26:41 -05:00
Frank Praznik
73ee99978d wayland: Add support for Mod3 and more esoteric Xkb configurations
Adds support for Mod3, which is usually Level 5 shift, but can vary, as well as not altering the functionality of the more esoteric modifier keys, such as meta and hyper.
2025-01-09 17:26:41 -05:00
Anonymous Maarten
ebaa30d339 __debugbreak was introduced in Microsoft Visual Studio 2003 2025-01-09 16:04:14 -05:00
Anonymous Maarten
c8f3f1b461 _BitScanReverse was introduced in Microsoft Visual Studio 2005 2025-01-09 16:04:14 -05:00
Anonymous Maarten
a78104a47f Disable long long support in the headers with SDL_NOLONGLONG
Some older toolchains don't support 'long long'.
2025-01-09 16:04:14 -05:00
Ethan Lee
6cdde10edb gpu: Metal depth write should behave like Vulkan/D3D12 2025-01-09 15:28:26 -05:00
SDL Wiki Bot
dd0dc64d51 Sync SDL3 wiki -> header
[ci skip]
2025-01-09 20:15:17 +00:00
SDL Wiki Bot
c688853a82 Sync SDL3 wiki -> header
[ci skip]
2025-01-09 19:47:47 +00:00
Ryan C. Gordon
507593f485 wikiheaders: Allow symbols to be filtered from manpage generation by regex.
This is specifically to prevent generating a manpage for "Uint32" and friends.

Fixes #11898.
2025-01-09 14:13:00 -05:00
Ethan Lee
7acf78ba92 storage: Trim the title storage root from enumerated paths 2025-01-09 13:50:52 -05:00
Frank Praznik
037cd25a22 win32: Use the pending size during NCCALCSIZE
Non-resizable windows still need to apply the pending size, as they can be resized programmatically.

Fixes programmatically resizing windows without the WS_THICKFRAME style.
2025-01-09 12:27:05 -05:00
Cameron Cawley
e8916b2608 pipewire: Use byte order pixel format aliases 2025-01-09 09:52:30 -05:00
SDL Wiki Bot
d2090d1c80 Sync SDL3 wiki -> header
[ci skip]
2025-01-09 06:38:16 +00:00
Ryan C. Gordon
3f7f632e14 audio: Added SDL_AudioDeviceStreamPaused.
We had the other two wrapper functions to pause and resume, and forgot query.
2025-01-09 01:36:57 -05:00
Ryan C. Gordon
f61860fa93 testautomation: fixed incorrect test.
The test was doing this:

- The output size is 80x60
- The logical size is 40x30
- The viewport is { 10, 7, 40, 30 }
- Draw to fill this whole viewport.

This would offset the filled rectangle a little, as before, but then the
viewport was the size of the entire logical space, so it wasn't a rectangle
centered in the middle of the output, as was expected.

This used to produce the expected output before the fix in
fa7a529912. But it appears the test was
incorrect, so this tweaks the viewport to produce the expected result.
2025-01-08 23:33:39 -05:00
Ryan C. Gordon
4bb3c2a1c7 render: Some cleanups.
Mostly setting NULL pointers to a local struct instead of copying non-NULL
pointers' contents into the local struct.
2025-01-08 14:59:28 -05:00
Ryan C. Gordon
61bdbacdae render: SDL_RenderTextureTiled shouldn't try to drop draw calls, either. 2025-01-08 14:59:28 -05:00
Ryan C. Gordon
f044a3d6ca Revert "render: GetRenderViewportSize shouldn't use scale, just logical presentation."
This reverts commit ef758d05c1.

Turns out the bug in #11076 was that we were dropping texture draws
incorrectly, not that scale shouldn't be applied here. The dropped draw calls
were fixed in bf85320947, and this revert is
making the renderer consistent again.
2025-01-08 14:59:27 -05:00
Ryan C. Gordon
fa7a529912 render: GetRenderViewportSize shouldn't scale viewport dimensions.
These are already scaled for the logical presentation (unless using the pixel
dimensions instead; we still scale those here).

Fixes #11704.
2025-01-08 14:59:27 -05:00
SDL Wiki Bot
1636009511 Sync SDL3 wiki -> header
[ci skip]
2025-01-08 19:57:05 +00:00
Ryan C. Gordon
bf85320947 render: Don't try to drop draws outside of the viewport.
It didn't take scale into account, and the backends would need to do clipping
anyhow, so let the system figure that out for us at the lower level.

Fixes #11318.
2025-01-08 11:55:10 -05:00
Frank Praznik
f2f04e825d tests: Fix get/set window size test being skipped
A return check conversion was missed when the SDL_* functions were converted to return boolean values instead of int, which caused this test to be skipped.
2025-01-08 11:02:45 -05:00
SDL Wiki Bot
cbdbd66e18 Sync SDL3 wiki -> header
[ci skip]
2025-01-08 15:33:53 +00:00
Simon McVittie
ef1fdf11bd tray: Create tray icons for libappindicator securely
If we write directly to filenames in /tmp, we're subject to
time-of-check/time-of-use symlink attacks on most systems (although
recent Linux kernels mitigate these by default). We can avoid these
attacks by securely creating a directory owned by our own uid,
and doing all our file I/O in that directory. Other uids cannot create
symbolic links in that directory, so we are protected from symlink
attacks.

This does not protect us from an attacker that is running with the same
uid, but if such an attacker exists, then we have already lost.

Resolves: https://github.com/libsdl-org/SDL/issues/11887
Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-01-08 07:26:02 -08:00
Sam Lantinga
e6bb50a710 Updated to version 3.1.9 for development 2025-01-07 17:51:00 -08:00
SDL Wiki Bot
6b34c9fe7f Sync SDL3 wiki -> header
[ci skip]
2025-01-08 01:50:36 +00:00
Sam Lantinga
22422f7748 Fixed ABI compatibility with 3.1.6 2025-01-07 17:32:59 -08:00
Sam Lantinga
d7b10d05b1 Updated to version 3.1.8 for the preview release 2025-01-07 17:04:05 -08:00
Simon McVittie
4290fc8bda tray: Load GTK and libappindicator by versioned names, except on OpenBSD
We are expecting a specific ABI (we can see that from the declarations
listed in this file) and the whole point of SONAME versioning is to
say that the library conforms to a specific ABI. If the SONAME is not
the one we expect, then calling its functions is likely to crash.

As usual, an exception to this is that OpenBSD does not use SONAME
versioning.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-01-07 14:02:01 -08:00
Simon McVittie
6b38d250aa tray: Don't try to use GTK 2 versions of libappindicator
We use GTK 3 functions in this file, so we cannot load a libappindicator
whose SONAME indicates that it is using GTK 2.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-01-07 14:02:01 -08:00
Simon McVittie
bba066c44c tray: Don't call g_object_unref(NULL)
g_object_unref() only accepts valid object instances.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-01-07 14:01:08 -08:00
ritalat
0bc370dfba Android doc cleanup 2025-01-07 16:56:29 -05:00
Ryan C. Gordon
6934c910b3 opengl: use GL_UNSIGNED_BYTE instead of GL_UNSIGNED_INT_8_8_8_8_REV.
This seems to be significantly more efficient on some modern platforms, but if
this turns out to be a widespread disaster, we can revert it.
2025-01-07 16:08:56 -05:00
Sam Lantinga
0176a19aee Fixed platform define condition for Windows phone
Fixes https://github.com/libsdl-org/SDL/issues/11876
2025-01-07 08:47:54 -08:00
Ryan C. Gordon
0180ca541e windows: Catch WM_POINTERCAPTURECHANGED events.
Fixes #11844.
2025-01-07 10:22:15 -05:00
Ozkan Sezer
8ec576ddab tray, windows: fix logic error from commit 1167cf54e1 2025-01-07 10:15:40 +03:00
Sam Lantinga
748f0b3201 Improved Steam Controller detection on iOS 2025-01-06 17:16:23 -08:00
Frank Praznik
ba1a980535 wayland: Only apply the toplevel bounds when initially mapping the window
The size shouldn't be clamped to the bounds after the window is mapped, or an explicitly requested user size may be overwritten.
2025-01-06 17:07:16 -05:00
Frank Praznik
28389f1c38 wayland: Apply toplevel bounds to windows
Apply the supplied xdg-toplevel bounds to resizable windows during initial mapping. Libdecor functionality will have to be added separately, as the functionality needs to be added to the library first.
2025-01-06 16:06:03 -05:00
Sam Lantinga
ef52a4d4df Fixed warning C4389: '==': signed/unsigned mismatch 2025-01-06 12:03:45 -08:00
Sam Lantinga
8d8649b33f Fixed error: returning 'SDL_TrayEntry **' from a function with incompatible return type 'const SDL_TrayEntry **' 2025-01-06 11:35:54 -08:00
Sam Lantinga
f8b13dadd7 Enabled warning level 4 on Visual Studio
This catches uninitialized variables, etc. and matches Steam's warning level
2025-01-06 11:30:36 -08:00
Sam Lantinga
1167cf54e1 Fixed warning C4706: assignment within conditional expression 2025-01-06 11:30:28 -08:00
Sam Lantinga
8a9b7ae8d1 Switched nEntries to int, to avoid signed/unsigned comparison warnings
Also standardized memory allocation calls to match SDL style
2025-01-06 11:29:28 -08:00
Sam Lantinga
fb4ec07119 Fixed warning C4701: potentially uninitialized local variable 'previous_context' used 2025-01-06 11:18:45 -08:00
Ryan C. Gordon
b674b715f5 fix integer overflow ub in testautomation_sdltest
(cherry-picked from commit f804293a27)
2025-01-06 13:18:03 -05:00
Ryan C. Gordon
1e1442ed4a README-migration.md: Note the GL/EGL library environment variable removals. 2025-01-06 13:12:31 -05:00
Ryan C. Gordon
d8c7006a42 README-migration.md: Removed obsolete documentation.
Fixes #11434.
2025-01-06 13:07:21 -05:00
Ryan C. Gordon
6473de59b7 SDL_keyboard.h: Note that SDL_GetKeyName() returns uppercase letters.
Reference Issue #11434.
2025-01-06 12:47:44 -05:00
SDL Wiki Bot
c7584df999 Sync SDL3 wiki -> header
[ci skip]
2025-01-06 16:17:26 +00:00
Ryan C. Gordon
1f54b228ff video: Convert some EGL environment variables to SDL hints.
Fixes #10479.
2025-01-06 11:15:26 -05:00
Sam Lantinga
7c9f6c6313 Remove debug logging 2025-01-05 20:06:50 -08:00
SDL Wiki Bot
19ddb29d2d Sync SDL3 wiki -> header
[ci skip]
2025-01-06 02:54:14 +00:00
Ryan C. Gordon
d16f76e3d4 wasapi: Don't crash/hang if transitioning to/from a Remote Desktop Connection.
Fixes #9673.
2025-01-05 21:53:35 -05:00
Ryan C. Gordon
742f2a2fad SDL_render.h: Improve SDL_ConvertEventToRenderCoordinates documentation.
Fixes #9424.
2025-01-05 20:55:42 -05:00
Frank Praznik
2b375d9704 wayland: Don't enable the text-input protocol when using Fcitx
Otherwise, key repeat will be broken. Enabling it under Wayland isn't recommended anyway.
2025-01-05 17:53:58 -05:00
Semphris
dcc645e413 Fix HTML examples template tabs
Tab labels now follow their drawer again. Also, to avoid tabs covering
up code or debugging logs, the tab label that's on top (and therefore
not automatically hidden behind the other drawer when that drawer
opens) will now automatically hide itself when the other drawer is
opened.
2025-01-05 11:39:20 -08:00
SDL Wiki Bot
ece6a6ed8f Sync SDL3 wiki -> header
[ci skip]
2025-01-05 19:12:20 +00:00
Ryan C. Gordon
7f9ee31024 include: Fill in more category documentation.
Reference Issue #11874.
2025-01-05 14:11:11 -05:00
Anonymous Maarten
16ad3e5af6 cmake: consider X11 as not available when xext.h is not found
This is user friendlier than straight up erroring
2025-01-05 16:05:25 +01:00
David Gow
0ae57f1d90 tray: unix: Shutdown the GTK thread when not in use
When using the libappindicator/gtk/unix Tray backend, the background
thread which calls gtk_main() is never destroyed. This means that we
detect a leaked thread as SDL_Quit().

Instead, tell gtk to shut down its main loop when no tray icons are
active. This fixes the issue here: SDL notices no leak, and repeatedly
creating / destroying tray icons seems to work fine.

Signed-off-by: David Gow <david@ingeniumdigital.com>
2025-01-05 02:51:12 -08:00
Ryan C. Gordon
6a0405b933 testautomation: Added a test to stdlib_swprintf that previously would fail. 2025-01-05 02:45:15 -05:00
Kim Giseo
9f2186ad52 Removed outdated comment in AndroidManifest.xml 2025-01-04 19:25:00 -08:00
Ryan C. Gordon
181995b44f stdlib: Reworked SDL_vswprintf to be more efficient and return correct values.
Fixes #11729.
2025-01-04 21:55:07 -05:00
Erik Soma
8509041a09 video: Fix SDL_GL_GetAttribute depth/stencil size when 0 2025-01-04 18:57:48 -05:00
Ryan C. Gordon
344e394bf4 camera: Favor v4l2 over pipewire, for now.
Reference Issue #11473.
Reference Issue #9776.
Reference Issue #11819.
Reference Issue #9989.
Reference Issue #10842.
2025-01-04 16:11:57 -05:00
SDL Wiki Bot
d8c679416b Sync SDL3 wiki -> header
[ci skip]
2025-01-04 19:04:41 +00:00
Semphris
b6dc44b133 Support dark theme for tray menus on Windows 2025-01-04 11:04:21 -08:00
Semphris
7673b84f52 Make SDL_GetTrayEntires() NULL-terminated 2025-01-04 10:56:19 -08:00
Katelyn Gadd
a58bc3eaf4 [GPU] Fix crash in nvidia user-mode win32 driver when game window is minimized during swapchain resize (#11848) 2025-01-04 10:25:08 -08:00
Susko3
0a5d2f3da2 Handle pen eraser button as a second button 2025-01-04 05:27:06 -05:00
Ryan C. Gordon
3519ef3b3b SDL_asyncio.h: Fixed various datatype's \since documentation. 2025-01-04 04:10:15 -05:00
Ryan C. Gordon
56d7cc7a02 SDL_video.h: Added a note about platform quirks to SDL_DestroyWindow docs.
Fixes #10081.
2025-01-04 03:48:10 -05:00
SDL Wiki Bot
04f3bdb118 Sync SDL3 wiki -> header
[ci skip]
2025-01-04 08:24:05 +00:00
Ryan C. Gordon
18c6958cae SDL_vulkan.h: Improve SDL_Vulkan_LoadLibrary/SDL_Vulkan_UnloadLibrary docs.
Fixes #9541.
2025-01-04 03:22:34 -05:00
Daniel Wymark
522682cd6e Add detailed documentation on building with MinGW64 (#11780) 2025-01-03 21:07:38 -08:00
Sam Lantinga
a4cd17cce5 Fixed building on macOS with the dialog subsystem disabled 2025-01-03 16:17:16 -08:00
Anonymous Maarten
efba42a67b tests: avoid undefined signed overflow 2025-01-04 01:06:29 +01:00
Sam Lantinga
156b3b4a8c Fixed language detection on iOS
On iOS you might see traditional Chinese on a US phone as: "zh-Hans_US"
2025-01-03 15:27:08 -08:00
Anonymous Maarten
53aaf8c26b cmake: custom generate-XXX targets must depend on outputs 2025-01-04 00:19:45 +01:00
SDL Wiki Bot
9b40d43b1f Sync SDL3 wiki -> header
[ci skip]
2025-01-03 22:37:37 +00:00
Frank Praznik
85851459d6 docs: Note that using the Wayland display scaling mode can have imprecision when positioning due to unit conversion and rounding 2025-01-03 17:36:36 -05:00
Anonymous Maarten
db97da4ccb ci: bump FreeBSD to 14.2
[sdl-ci-filter netbsd]
[sdl-ci-filter freebsd]
2025-01-03 23:24:41 +01:00
Frank Praznik
5579010b6a wayland: Adjust the scaled popup position even if the dimensions didn't change
Otherwise, the unscaled position will be sent.
2025-01-03 17:17:16 -05:00
Ryan C. Gordon
2d37903323 pen: implement pen support for Windows.
Fixes #10516.
2025-01-03 12:58:49 -05:00
Sam Lantinga
ef21ccf080 Create a separate metal shader for NV12 textures
Also unify the color output function so it works with the various combinations of input and output colorspaces.

Fixes https://github.com/libsdl-org/SDL/issues/11727
2025-01-03 09:30:47 -08:00
Sam Lantinga
49663bfb58 Make Windows dialogs DPI aware
Fixes https://github.com/libsdl-org/SDL/issues/4775
Fixes https://github.com/libsdl-org/SDL/issues/9691
2025-01-03 09:25:10 -08:00
Sam Lantinga
a8c41135aa Enable themed Windows dialogs when building with Visual Studio 2025-01-03 09:25:10 -08:00
Anonymous Maarten
8b83a57847 Check that dll's built by MinGW do not link to unwanted runtime libraries 2025-01-03 16:56:22 +01:00
Ryan C. Gordon
e484182765 testcamera: Log the camera backend in use. 2025-01-03 03:46:22 -05:00
SDL Wiki Bot
011454b237 Sync SDL3 wiki -> header
[ci skip]
2025-01-03 03:10:47 +00:00
Sam Lantinga
efc390d7e2 Don't log SDL errors by default
There are many recoverable errors that may happen internally and can be safely ignored if the public API doesn't return an error code. Seeing them causes lots of developer anxiety and they generally aren't helpful.

Fixes https://github.com/libsdl-org/SDL/issues/11813
2025-01-02 17:32:10 -08:00
Sam Lantinga
c077b7a918 Fixed the version availability of SDL_HINT_JOYSTICK_ENHANCED_REPORTS 2025-01-02 17:28:45 -08:00
SDL Wiki Bot
0b520cd4b4 Sync SDL3 wiki -> header
[ci skip]
2025-01-03 01:18:56 +00:00
Sam Lantinga
9f7b2c3595 Fixed incorrect error message when a joystick can't be opened 2025-01-02 17:18:09 -08:00
Sam Lantinga
2c0a8363a5 Added SDL_HINT_JOYSTICK_ENHANCED_REPORTS
This hint defaults on, enabling advanced controller features.

This replaces SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE and SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE, and is supported by PlayStation and Nintendo Switch controllers.

Fixes https://github.com/libsdl-org/SDL/issues/10086
2025-01-02 17:18:09 -08:00
SDL Wiki Bot
95d44f11c7 Sync SDL3 wiki -> header
[ci skip]
2025-01-02 20:40:15 +00:00
SDL Wiki Bot
16dfaca728 Sync SDL3 wiki -> header
[ci skip]
2025-01-02 20:06:39 +00:00
SDL Wiki Bot
32ab09ba21 Sync SDL3 wiki -> header
[ci skip]
2025-01-02 19:44:57 +00:00
Frank Praznik
1461f893c3 video: Correct the window position property documentation
Windows are only relative to the parent if the "tooltip" or "menu" property is set.
2025-01-02 14:44:08 -05:00
SDL Wiki Bot
a63052db96 Sync SDL3 wiki -> header
[ci skip]
2025-01-02 19:17:51 +00:00
Sam Lantinga
dd6b484359 Document platform gamepad hotplug requirements
Fixes https://github.com/libsdl-org/SDL/issues/11742
2025-01-02 11:16:35 -08:00
Sam Lantinga
ecf8dd054d Show the display content scale in SDLTest_CommonDrawWindowInfo() 2025-01-02 10:58:15 -08:00
Sam Lantinga
4797970bfa Enable SDL_HINT_JOYSTICK_THREAD by default
If you're not using SDL for video you won't get raw input messages without this hint, and this is tripping up enough people it makes sense to have this enabled by default. There isn't much downside to this, other than having another thread processing Xbox controller input.

Fixes https://github.com/libsdl-org/SDL/issues/10576
2025-01-02 10:25:18 -08:00
Sam Lantinga
6b4b9b5f2b Improved XInput controller detection
Sometimes we'll get a Windows.Gaming.Input callback before the raw input device is even in the list, so try some other methods to better detect XInput devices.
2025-01-02 10:25:18 -08:00
Frank Praznik
8ea4b326b3 video: Fix focus when non-focused popup windows are hidden
Fix focus issues when a popup that is the child of a window that does not currently have keyboard focus is hidden or destroyed.
2025-01-02 13:24:24 -05:00
Katelyn Gadd
67ea67f191 Fix mip generation for 2x1 textures on D3D12 2025-01-02 13:17:06 -05:00
Erik Soma
c6b5c21aaf clipboard: Ensure SDL_ClearClipboardData clears data even when no data has been set 2025-01-02 07:23:27 -08:00
Anonymous Maarten
f8f8d87bfa ci: always create binary packages if build succeeded 2025-01-02 01:15:28 +01:00
Anonymous Maarten
b713e7581b stdlib: fix SDL_strtol of "0" with base 0
SDL_strtol("0") skipped the "0" octal prefix
and returned a failure because the remainder of the string was empty.
2025-01-02 01:15:28 +01:00
Ozkan Sezer
54752f8d1c SDL_malloc.c: replace FORCEINLINE usage with SDL_FORCE_INLINE 2025-01-02 01:15:28 +01:00
Anonymous Maarten
3842384a38 dynapi: trigger a breakpoint on a fatal error when SDL is built in debug mode 2025-01-02 01:15:28 +01:00
Anonymous Maarten
6cf6b160cd SDL_hashtable: don't use assert from libc
Co-authored-by: Ozkan Sezer <sezeroz@gmail.com>
2025-01-02 01:15:28 +01:00
Anonymous Maarten
62bc2c4c92 SDL_malloc: don't define FORCEINLINE
The FORCEINLINE macro is also used by Windows SDK headers.
When it is an empty macro, FORCEINLINE-d functions will
get global visibility error and cause duplicate symbol link errors.

HRESULT_FROM_WIN32 is such a function.
2025-01-02 01:15:28 +01:00
Anonymous Maarten
4fccfb142e cmake: avoid security cookies in SDL_uclibc when building with -DSDL_LIBC=ON 2025-01-02 01:15:28 +01:00
Anonymous Maarten
4fbf59ac3a Implement __chkstk for arm64
Lifted from a previously built SDL3.dll
2025-01-02 01:15:28 +01:00
Anonymous Maarten
578ac0ef52 SDL_malloc: disable malloc stats
This avoids bringing in stdio.
2025-01-02 01:15:28 +01:00
Anonymous Maarten
31a4c92ee5 When building with libc enabled, we don't need to provide __chkstk ourselves 2025-01-02 01:15:28 +01:00
Sam Lantinga
02e85a153f Use the expected plane size when capturing Android camera frames
On the Samsung Galaxy A52 the camera plane size is (pitch * (h - 1) + w) instead of (pitch * h). This led to us copying off the end of the plane when uploading the texture, so we pad out to our expected size.
2025-01-01 15:58:27 -08:00
Sam Lantinga
9955e1dc0d Updated the Android gradle plugin to version 8.7.3 2025-01-01 14:33:18 -08:00
Sam Lantinga
0281071243 Lock joysticks when they are connected/disconnected on emscripten
Fixes https://github.com/libsdl-org/SDL/issues/11499
2025-01-01 13:51:47 -08:00
SDL Wiki Bot
c68ed04a06 Sync SDL3 wiki -> header
[ci skip]
2025-01-01 21:27:47 +00:00
Frank Praznik
2b1d809b21 video: Fix positioning and focusing popups parented to child toplevel windows
Find the toplevel parent window, not the absolute highest toplevel window in the hierarchy, when positioning and adjusting the focus of popup windows.

Fixes a leftover case from when toplevel windows couldn't be parented to other toplevels.
2025-01-01 14:40:29 -05:00
SDL Wiki Bot
6d554a9ea3 Sync SDL3 wiki -> header
[ci skip]
2025-01-01 16:06:00 +00:00
Sam Lantinga
9fbc767d4f Fixed formatting of SDL_storage documentation 2025-01-01 08:05:20 -08:00
Sam Lantinga
e43aa12b49 Updated copyright for 2025 2025-01-01 08:01:29 -08:00
Sam Lantinga
c0e5901c42 Reverted accidentally committed work in progress 2025-01-01 07:54:55 -08:00
Sam Lantinga
f2074d7af3 Updated copyright for 2025 2025-01-01 07:45:52 -08:00
Sam Lantinga
3197e27b59 testcamera: fixed return codes 2024-12-31 19:27:11 -08:00
Sam Lantinga
f18e023317 Added testclipboard 2024-12-31 19:27:11 -08:00
Sam Lantinga
54d4e48539 Get the initial clipboard state at startup 2024-12-31 19:27:11 -08:00
Sam Lantinga
6575b8157b Synchronize clipboard mime types with external clipboard updates
Fixes https://github.com/libsdl-org/SDL/issues/8338
Fixes https://github.com/libsdl-org/SDL/issues/9587
2024-12-31 19:27:11 -08:00
Sam Lantinga
30a22d3fed Allow a NULL size parameter to retrieve null terminated text 2024-12-31 19:27:11 -08:00
Sam Lantinga
d666c2d189 Use a consistent error message when video isn't initialized 2024-12-31 19:27:11 -08:00
Sam Lantinga
196e2c6662 Fixed crash if num_mime_types is NULL 2024-12-31 19:27:11 -08:00
Sam Lantinga
b902b0527b Renamed n_mime_types to num_mime_types 2024-12-31 19:27:11 -08:00
Sam Lantinga
a767952617 Fixed spacing 2024-12-31 19:27:11 -08:00
Sam Lantinga
54c555e394 Send supported mime types for external clipboard contents on Windows 2024-12-31 19:27:11 -08:00
Sam Lantinga
8b155708ff Fixed clipboard memory leak on shutdown 2024-12-31 19:27:11 -08:00
Frank Praznik
1d417ab27f win32: Set the WS_THICKFRAME style on popup windows
Without it, programmatically resizing the window seems to fail. As popup windows are implicitly borderless, calculations taking the frame size into account need to be avoided.
2024-12-31 18:29:59 -05:00
Frank Praznik
643281d022 Revert "win32: Use the size in the WINDOWPOS data while handling popup windows in the WM_WINDOWPOSCHANGED message"
This reverts commit 4f0a056b95.
2024-12-31 18:29:59 -05:00
Willem Dinkelspiel
2be89f0dd1 Clarify migration for GetWindowData and SetWindowData 2024-12-31 15:00:39 -08:00
SDL Wiki Bot
a37f993a07 Sync SDL3 wiki -> header
[ci skip]
2024-12-31 22:56:38 +00:00
Ethan Lee
65e0fed5b3 gpu: Document why VertexID/InstanceID builtins are unreliable 2024-12-31 17:56:02 -05:00
Frank Praznik
dd83908109 keyboard: Check for both caps lock and shift when looking up a keycode by name 2024-12-31 15:17:32 -05:00
SDL Wiki Bot
99ad53ec3f Sync SDL3 wiki -> header
[ci skip]
2024-12-31 19:44:29 +00:00
Frank Praznik
df97ccf283 win32: Return 0 from WM_WINDOWPOSCHANGING if a resize is expected
This was accidentally removed while deleting some associated dead code.
2024-12-31 14:02:44 -05:00
Frank Praznik
4f0a056b95 win32: Use the size in the WINDOWPOS data while handling popup windows in the WM_WINDOWPOSCHANGED message
GetClientRect() returns old, incorrect size data for popup windows when called while processing the WM_WINDOWPOSCHANGED message, so use the WINDOWPOS data instead.

Popups can't be maximized or fullscreen, so no need to worry about a move event resizing them.
2024-12-31 13:33:11 -05:00
SDL Wiki Bot
18fc13c20d Sync SDL3 wiki -> header
[ci skip]
2024-12-31 18:00:37 +00:00
SDL Wiki Bot
6d20b65a9e Sync SDL3 wiki -> header
[ci skip]
2024-12-31 17:58:37 +00:00
Ethan Lee
3cd3c9317e storage: Add error messages when ReadIO/WriteIO lengths mismatch 2024-12-31 12:34:12 -05:00
SDL Wiki Bot
6ca2a48595 Sync SDL3 wiki -> header
[ci skip]
2024-12-31 16:20:17 +00:00
Ryan C. Gordon
fa9c3331d5 main: Adjust how SDL_HINT_MAIN_CALLBACK_RATE works.
Now (only in the generic backend, where it is implemented), this hint is
always respected. Previously it would only be used if no windows were created,
to help reduce CPU load on things like loopwave.

Since it's always used now, the default has changed from 60 (Hz) to 0 (run as
fast as possible). Things like loopwave should still likely force this way
lower than the previous default (and already do: loopwave explicitly sets it
to 5).

The hint can now also be set to "waitevent" which will cause SDL_AppIterate
to only be called after new events have arrived, for apps that are entirely
driven by input and want to consume (almost) no power or CPU time until then.

Fixes #11093.
Fixes #11387.
2024-12-31 08:19:38 -08:00
Ethan Lee
cd1bd0ac2e storage: Remove an outdated FIXME.
Woops ended up doing GPU stuff instead, maybe after 3.2!
2024-12-31 10:46:42 -05:00
Végh Márton
0be5b8070d Update SDL_asyncio.c 2024-12-30 23:29:21 -08:00
Sam Lantinga
1c04ebe423 Renamed SDL_ASYNCIO_CANCELLED to SDL_ASYNCIO_CANCELED 2024-12-30 19:13:02 -08:00
Sam Lantinga
d4d5faedab Added SDL_EVENT_FINGER_CANCELED
Fixes https://github.com/libsdl-org/SDL/issues/10528
2024-12-30 19:13:02 -08:00
Sam Lantinga
8704ab8422 Wait for a display resize event before sending orientation changes
Fixes https://github.com/libsdl-org/SDL/issues/9585
2024-12-30 15:49:10 -08:00
Sam Lantinga
60deaf5f0f Send display mode change events when the orientation changes 2024-12-30 15:24:38 -08:00
Sam Lantinga
5340f2e3fe Updated to the latest version of gradle, with support for Android SDK 35 2024-12-30 13:13:52 -08:00
Sam Lantinga
e91c37f4dd Added support for inset handling on Android 15 2024-12-30 12:23:00 -08:00
Petar Popovic
f3cbd04a81 Fix C99 trailing enum comma warning. 2024-12-30 17:21:02 +03:00
Petar Popovic
5f25691c85 Fix C23 empty initializer warning. 2024-12-29 18:17:24 -08:00
Frank Praznik
8cc4735d74 wayland: Don't override the min/max values when scaling to the screen
The point/pixel conversion functions should return zero when passed zero, or the min/max calculations can break.
2024-12-29 18:01:13 -05:00
Semphris
2d91f096ca Remove libc function from Windows tray 2024-12-30 01:20:12 +03:00
SDL Wiki Bot
78c1dc3e2c Sync SDL3 wiki -> header
[ci skip]
2024-12-29 20:32:50 +00:00
Sam Lantinga
0410328b15 Fixed warning: ordered comparison of pointer with integer zero 2024-12-29 12:05:34 -08:00
Anonymous Maarten
d5f08b8f4b stdinc: use __has_include to detect <stdbool.h>
Newer emscripten SDK does an unconditional #include <stdbool.h>,
which clashes with our custom bool.h typedef
2024-12-29 20:54:12 +01:00
Anonymous Maarten
543f244965 tests: include SDL_build_config.h when HAVE_BUILD_CONFIG is defined 2024-12-29 20:08:06 +01:00
Ozkan Sezer
c2121dd9a2 testcamera: fix MSVC build failure due to C4244 warning. 2024-12-29 21:28:02 +03:00
Sam Lantinga
5c84d38822 testcamera: don't pick a frame size larger than the maximum texture size
Ran into this on a Huawei Y6 phone, where the back facing camera can generate 4160x2000 frames, but the maximum texture size was 4096x4096
2024-12-29 09:41:00 -08:00
Sam Lantinga
6e1177ac03 Include tray function prototypes 2024-12-29 08:15:30 -08:00
Ryan C. Gordon
c030e6f782 examples/pen/01-drawing-lines: Match render target size to renderer output.
Otherwise, on HiDPI displays (like a retina iPad), the lines you draw don't
match where the pen is touching.
2024-12-28 15:36:02 -05:00
Ryan C. Gordon
0ad3a18937 uikit: reworked Apple Pencil code.
This manages axes correctly across events, sorts out the math to convert from
Apple's data to what SDL expects, and a few other tweaks and corrections.
2024-12-28 15:36:02 -05:00
Ryan C. Gordon
f6143da617 uikit: Patched to compile, added to Xcode project. 2024-12-28 15:36:02 -05:00
Salman Alshamrani
774e38d073 uikit: Initial Apple Pencil support.
Reference Issue #9911.
Reference Issue #10516.
2024-12-28 15:36:02 -05:00
Frank Praznik
5acd7fe208 wayland: Prevent popup configure events from overwriting the current size with old data
Don't apply the supplied dimensions if they haven't changed from the last configuration event, or a newer size set programmatically can be overwritten by old data.

This check is already being done for toplevel windows, but was never added to the popup configure event.
2024-12-28 14:23:30 -05:00
Sam Lantinga
c714b1a38b Fixed public header inclusion in the Xcode project 2024-12-28 08:47:00 -08:00
Ramez Ragaa
cf439d5c63 Fix dib-to-bmp logic in SDL_windowsclipboard.c
This addresses the issue #11762 by reading the biCompression field to
determine the correct size of the color table, and consequently the
correct bih_size value.
2024-12-28 08:31:52 -08:00
Sam Lantinga
ec29d3fd66 Define NDEBUG in release Xcode builds 2024-12-28 08:25:09 -08:00
Sam Lantinga
92b7054870 Add SDL_tray.h to the public framework headers
Fixes https://github.com/libsdl-org/SDL/issues/11760
2024-12-28 08:15:19 -08:00
SDL Wiki Bot
1a466b5548 Sync SDL3 wiki -> header
[ci skip]
2024-12-28 16:06:09 +00:00
Ozkan Sezer
ec8a780ad4 tray, unix: fix -Wformat warnings
src/tray/unix/SDL_tray.c: In function 'get_tmp_filename':
src/tray/unix/SDL_tray.c:345: warning: format '%ld' expects type 'long int', but argument 2 has type 'size_t'
src/tray/unix/SDL_tray.c: In function 'get_appindicator_id':
src/tray/unix/SDL_tray.c:361: warning: format '%ld' expects type 'long int', but argument 3 has type 'unsigned int'
2024-12-28 18:37:56 +03:00
Anonymous Maarten
cc723c9e4b ci: run emscripten on Ubuntu 22.04
python3-selenium does not seem to work on Ubuntu 24.04
2024-12-28 16:20:59 +01:00
Anonymous Maarten
0cb4a94c88 cmake: really disable xrandr by default on Solaris
Fixes libsdl-org/SDL#10099
2024-12-28 11:55:59 +01:00
SDL Wiki Bot
4ffcb8ebab Sync SDL3 wiki -> header
[ci skip]
2024-12-28 07:58:04 +00:00
Carl Åstholm
49153ebfc4 audio: Add NULL check to SDL_UnbindAudioStreams 2024-12-28 00:10:58 -05:00
Carl Åstholm
1b99467c71 audio: Make SDL_Bind/UnbindAudioStreams take const arrays 2024-12-28 00:10:58 -05:00
Anonymous Maarten
0be6dc5734 cmake: disable xrandr by default on Solaris
Fixes libsdl-org/SDL#10099
2024-12-28 04:01:32 +01:00
Anonymous Maarten
4fbd6cba60 cmake: Solaris' SunPro has alternative way to link to pthread libraries
Fixes libsdl-org/SDL#10096
2024-12-28 03:46:17 +01:00
Anonymous Maarten
e25cc7a88f cmake: cocoa video backend needs IOKit framework
Fixes libsdl-org/SDL#11628
2024-12-28 03:41:36 +01:00
Anonymous Maarten
38dd6bcd32 docs: gradle needs package identifier + change example Activity class path 2024-12-28 03:22:53 +01:00
Anonymous Maarten
f1232de3d2 cmake: add_dependencies must have at least 2 arguments 2024-12-28 02:43:12 +01:00
Anonymous Maarten
2664d36faf cmake: avoid parallel generation of headers through intermediate target
See
https://cmake.org/cmake/help/latest/command/add_custom_command.html#example-generating-files-for-multiple-targets
2024-12-28 02:39:12 +01:00
SDL Wiki Bot
609b147432 Sync SDL3 wiki -> header
[ci skip]
2024-12-28 01:12:59 +00:00
Lucas Murray
cc24518c41 render: Update GPU backend to use the new present workflow 2024-12-27 17:11:55 -08:00
Carl Åstholm
a0e537b9c0 examples: Fix dead links in app metadata 2024-12-27 17:10:52 -08:00
Anonymous Maarten
df1f1c2e12 cmake: don't create relocatable packages by default with non-MSVC toolchains 2024-12-28 02:04:00 +01:00
Anonymous Maarten
af3d97dcac Update build-scripts/build-release.py 2024-12-28 01:41:10 +01:00
Frank Praznik
bc448fa445 win32: Use the nearest monitor size for calculating maximized window dimensions
Default to using the nearest monitor, instead of null, as a null monitor can be sent when restoring from minimized, which results in the restored, maximized window being the wrong size.
2024-12-27 18:17:55 -05:00
Frank Praznik
599b4ef254 win32: Fix maximizing borderless windows
Even if a borderless window doesn't have resizable borders set, the WS_MAXIMIZEBOX property needs to be set on the window, or maximizing it will make it fullscreen and cover the taskbar, instead of only filling the usable desktop space, as is usually expected from a maximized window. This style property needs to be retained until the window is no longer maximized, even if the resize flag is toggled off, or restoring from minimized can fail.
2024-12-27 18:17:55 -05:00
Frank Praznik
1c52e290a3 video: Don't overwrite pending size values when setting the window min/max 2024-12-27 18:08:26 -05:00
Sam Lantinga
9a4d29699d Don't use connection state from the Nintendo Switch Pro report
This isn't reliable for third party controllers like the 8BitDo Pro 2.

Fixes https://github.com/libsdl-org/SDL/issues/10862
2024-12-27 13:58:49 -08:00
Sam Lantinga
75a24116b5 testcontroller: show gamepad connection state 2024-12-27 13:58:49 -08:00
Sam Lantinga
22f6eed1d9 Use the NVIDIA Shield home button as the guide button 2024-12-27 12:42:06 -08:00
Sam Lantinga
c148837546 Added a Bluetooth mapping for the NVIDIA Shield Controller on Linux 2024-12-27 12:18:08 -08:00
Sam Lantinga
82a1e9f6df Fixed the guide button for the NVIDIA Shield Controller on Linux
This works with firmware v1.25 and v1.35
2024-12-27 12:17:51 -08:00
Frank Praznik
ba5cf2b152 x11: Don't overwrite popup window coordinates when changing the size 2024-12-27 12:58:53 -05:00
Frank Praznik
567b828e18 wayland: Use the proper popup coordinates if the position is set while the window is hidden 2024-12-27 12:58:53 -05:00
SDL Wiki Bot
1701208f32 Sync SDL3 wiki -> header
[ci skip]
2024-12-27 17:25:19 +00:00
Sam Lantinga
622c3ebb94 Updated Xcode project with new tray files 2024-12-27 09:24:49 -08:00
Semphris
0461180e25 SDL_EVENT_QUIT when no window nor tray
SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE will not fire if there are active tray icons. This impacts only applications that create tray icons, and that at least one icon outlives the last visible top-level window. SDL_EVENT_QUIT will fire when the last active tray is destroyed if there are no active windows.
2024-12-27 09:22:27 -08:00
SDL Wiki Bot
ff139fe71b Sync SDL3 wiki -> header
[ci skip]
2024-12-27 17:20:36 +00:00
Blaž Tomažič
e9290eeedf Use pthread_setname_np also on Android
Set thread name on Android the same way as we do on Linux.

Acording to Bionic source code this function is available since 2013 [1] and
hase the same signature.

[1] 2a1bb4e646

(cherry picked from commit e79b0ce2e4)
2024-12-27 08:07:47 -08:00
Ozkan Sezer
578509c326 windows/SDL_tray.c, video/windows/SDL_surface_utils.h: use SDL_windows.h 2024-12-27 12:28:02 +03:00
Ozkan Sezer
05932e05da tray, windows: replace ZeroMemory() with SDL_zero() 2024-12-27 12:05:00 +03:00
hwsmm
e2323c1367 Refactor Android input handling and add pen support 2024-12-26 23:50:11 -05:00
hwsmm
f5fbdf7ed5 Make onNativePen available for Android 2024-12-26 23:50:11 -05:00
hwsmm
a5e8fc21b2 Add SDL_androidpen 2024-12-26 23:50:11 -05:00
hwsmm
80c39f2ff4 Expose SDL_GetPenStatus for Android pen buttons 2024-12-26 23:50:11 -05:00
Ryan C. Gordon
e3c99e3bd3 misc: Fixed typo in iOS error message.
(cherry picked from commit 96b4535cc7)
2024-12-26 23:37:16 -05:00
Sam Lantinga
1413bfb185 Don't overwrite non-CRC gamepad mapping with a new mapping that specifies a CRC
Fixes https://github.com/libsdl-org/SDL/issues/11723
2024-12-26 20:18:26 -08:00
Sam Lantinga
948b16533c testcamera: use the first available cameras 2024-12-26 19:23:43 -08:00
Ozkan Sezer
cd1bb6247b video/windows/SDL_surface_utils.c: replace ZeroMemory() with SDL_zero() 2024-12-27 06:03:37 +03:00
SDL Wiki Bot
a773558517 Sync SDL3 wiki -> header
[ci skip]
2024-12-27 02:32:08 +00:00
Ozkan Sezer
50fbae9302 tray, windows: define NOTIFYICON_VERSION_4 and NIF_SHOWTIP, if missing. 2024-12-27 05:30:50 +03:00
Sam Lantinga
c744c8fc0b Document how to check for gamepad capabilities
Fixes https://github.com/libsdl-org/SDL/issues/10593
2024-12-26 17:49:56 -08:00
Sam Lantinga
a8d585aac3 Don't try to enumerate possible texture failure reasons.
This can cause misunderstanding about how texture creation works, as seen in https://github.com/libsdl-org/SDL/issues/9504. Instead let people check the error for more information on why creation may have failed.
2024-12-26 17:17:08 -08:00
Sam Lantinga
ca17d19f90 Updated iOS file path documentation
Fixes https://github.com/libsdl-org/SDL/issues/10290
2024-12-26 17:00:01 -08:00
Ryan C. Gordon
7bbe6025be misc: Make SDL_OpenURL work with VisionOS, tvOS, etc. 2024-12-26 16:50:52 -08:00
Ryan C. Gordon
ffed1c50c0 misc: Fix SDL_OpenURL on newer iOS releases.
Apparently as of iOS 18.2, the deprecated API we were using just refuses to
work at all.

Fixes #11728.
2024-12-26 16:50:52 -08:00
Frank Praznik
1a6e139dde win32: Only recalculate the position on show for popup windows
Regular child windows aren't positioned relative to the parent.
2024-12-26 18:18:46 -05:00
Frank Praznik
cf220ea4f1 win32: Fix popup positioning 2024-12-26 17:12:14 -05:00
Ozkan Sezer
17ef0c1237 SDL_video.c: replace strlcpy with memcpy in SDL_ShowMessageBox() 2024-12-27 00:01:56 +03:00
Ryan C. Gordon
8fde28813e SDL_tray.h: Filled in doxygen for a few minor missing things. 2024-12-26 14:10:53 -05:00
SDL Wiki Bot
17df3fe836 Sync SDL3 wiki -> header
[ci skip]
2024-12-26 18:26:48 +00:00
Sam Lantinga
eb1be89e70 Cleaned up thread state handling and added thread object validation 2024-12-26 10:26:08 -08:00
SDL Wiki Bot
7647f16ae1 Sync SDL3 wiki -> header
[ci skip]
2024-12-26 18:03:51 +00:00
Salman Alshamrani
eadc64973a Reset text field content on text input stop 2024-12-26 10:03:34 -08:00
Lucas Murray
b2c2a483e8 GPU: Rename HDR10_ST2048 to HDR10_ST2084 2024-12-26 09:47:13 -08:00
Lucas Murray
fe39509b85 GPU: Doc touch ups 2024-12-26 09:47:13 -08:00
SDL Wiki Bot
b8036bdd41 Sync SDL3 wiki -> header
[ci skip]
2024-12-25 21:15:58 +00:00
Moritz
ca4f5dd40d Added SDL_GetThreadState 2024-12-25 13:15:18 -08:00
lunasorcery
b7dac5072b correct termination of windows openfiledialog filters 2024-12-25 11:42:32 -08:00
Maia
0becdad392 Add missing includes to SDL_tray.h 2024-12-25 07:54:54 -08:00
Brody Eller
5bf742daa6 Fix documentation for SDL_sinf 2024-12-24 20:41:41 -08:00
Anonymous Maarten
bed16f77d1 cmake: define HAVE_MALLOC_H when malloc.h is found 2024-12-25 02:10:53 +01:00
Sam Lantinga
b2178857dc Corrected CoreAudio surround sound channel layouts
Fixes https://github.com/libsdl-org/SDL/issues/11709
2024-12-24 15:03:25 -08:00
expikr
f40a530fd9 subclass the builtin system message class instead 2024-12-24 12:06:47 -08:00
Semphris
cf946e32ba Fix memory management for Windows dialog title 2024-12-24 12:06:05 -08:00
SDL Wiki Bot
4c70aa33ae Sync SDL3 wiki -> header
[ci skip]
2024-12-24 18:50:21 +00:00
Sam Lantinga
76920a230f Fixed Xcode build 2024-12-24 10:49:58 -08:00
Semphriss
01b9b0edb7 Add system tray support (#10873) 2024-12-24 10:36:39 -08:00
SDL Wiki Bot
17a029502a Sync SDL3 wiki -> header
[ci skip]
2024-12-24 17:37:33 +00:00
Caleb Cornett
a27c139b12 GPU: Explicitly check Metal hardware support on device creation 2024-12-24 12:36:52 -05:00
Caleb Cornett
aa817a67d1 GPU: Document system requirements for each driver 2024-12-24 12:36:52 -05:00
Sam Lantinga
8653a5821b Fixed mingw64 Windows build 2024-12-24 08:58:08 -08:00
Sam Lantinga
60dce94583 Fixed building with older Windows SDKs 2024-12-24 08:26:05 -08:00
L zard
440d5754f8 build_configs: remove unused symbols_to_check, added Windows ones 2024-12-24 07:19:38 -08:00
L zard
052cb5773e build_configs: remove HAVE_LIBUNWIND_H
It is only used in SDL_test, which does not use the config header.
2024-12-24 07:19:38 -08:00
L zard
42c67756cc build_configs: fix spacing
I messed up some spacing, so I thought I might as well strip all those unnecessary spaces.
2024-12-24 07:19:38 -08:00
L zard
286cc2ebd0 build_config: change unnecessary replacement variables to 1
Makes all macros only used in `#ifdef`s defined as `1` when they exist, instead of the CMake value of the corresponding variable.
2024-12-24 07:19:38 -08:00
L zard
c2508d5d99 Fix various #if defineds 2024-12-24 07:19:38 -08:00
L zard
f2b7495adc SDL_camera_pipewire: use SDL_CAMERA_DRIVER_PIPEWIRE_DYNAMIC 2024-12-24 07:19:38 -08:00
L zard
ade829d7ca build_config: fix SDL_DEFAULT_ASSERT_LEVEL
Currently, `SDL_DEFAULT_ASSERT_LEVEL` is commented out by CMake when its value is 0, setting the assertions level to the default value instead of disabling them.
This change:
- defines `SDL_DEFAULT_ASSERT_LEVEL_CONFIGURED` when its value is non-zero.
- defines `SDL_DEFAULT_ASSERT_LEVEL`, regardless of its value, when `SDL_DEFAULT_ASSERT_LEVEL_CONFIGURED` is defined.
2024-12-24 07:19:38 -08:00
L zard
e73d98ad72 build_config: add missing macros
Those are defined in other build_configs files and used elsewhere in SDL.
2024-12-24 07:19:38 -08:00
L zard
7f1c9c9053 build_config: move unconditionally defined macros 2024-12-24 07:19:38 -08:00
L zard
6f462e244f build_config: remove unused SIZEOF_VOIDP 2024-12-24 07:19:38 -08:00
L zard
ddd7d0f927 build_configs: remove unused macros
Those are only used in build_config files that define them themselves, or not used at all.
2024-12-24 07:19:38 -08:00
Sam Lantinga
483e79bf82 Fixed mouse click count for relative mode and multiple mice
We'll track the click count separately for each input source, and the click distance is calculated using a point on an infinite plane that is pushed around by mouse motion deltas, unclamped by the window edge.
2024-12-23 19:00:14 -08:00
Sam Lantinga
ed75d9d22a Document that the mouse ID is only valid in mouse relative mode
Fixes https://github.com/libsdl-org/SDL/issues/11259
2024-12-23 17:12:50 -08:00
Sam Lantinga
024e5da6fb Mouse events only get a mouse ID in relative mode 2024-12-23 17:12:50 -08:00
evertonse
8a0f649363 windows: fix BITMAPINFOHEADER values when getting bitmap from Clipboard 2024-12-23 17:00:47 -08:00
L zard
af2dbbcb53 Merge SDL_wasapi_win32 into SDL_wasapi 2024-12-23 16:54:52 -08:00
SDL Wiki Bot
4d301b88d6 Sync SDL3 wiki -> header
[ci skip]
2024-12-24 00:54:10 +00:00
Sam Lantinga
5a2eb60389 Only save the pending flags we will restore when hiding a window
Fixes https://github.com/libsdl-org/SDL/issues/11564
2024-12-23 16:53:54 -08:00
Sam Lantinga
969f03d9f0 Added SDL_PROP_RENDERER_GPU_DEVICE_POINTER
Fixes https://github.com/libsdl-org/SDL/issues/11600
2024-12-23 16:51:43 -08:00
SDL Wiki Bot
7a22076a7c Sync SDL3 wiki -> header
[ci skip]
2024-12-23 23:58:24 +00:00
Sam Lantinga
3a1810f9a9 Fixed the Linux mapping for the NVIDIA Controller v1.03 2024-12-23 15:43:17 -08:00
Sam Lantinga
49610fd1e8 Leave mouse relative mode when losing focus
Fixes https://github.com/libsdl-org/SDL/issues/7892
2024-12-23 15:23:11 -08:00
Caleb Cornett
62124e2c28 GPU: Enable Metal validation in debug mode (#11691) 2024-12-23 18:08:14 -05:00
SDL Wiki Bot
18115ef6bd Sync SDL3 wiki -> header
[ci skip]
2024-12-23 23:01:15 +00:00
Sam Lantinga
8691408baf Clarify that you shouldn't make any assumptions about the an SDL_FingerID value.
Fixes https://github.com/libsdl-org/SDL/issues/11667
2024-12-23 14:28:54 -08:00
Sam Lantinga
37b87f79fb Fixed Bluetooth Steam Controller detection on iOS and Android 2024-12-23 12:55:25 -08:00
Sam Lantinga
9a43c08146 Allow rendering during the modal resize loop on macOS
Fixes https://github.com/libsdl-org/SDL/issues/11508
2024-12-23 11:46:35 -08:00
Sam Lantinga
225c0e2ad9 Removed unused function declaration 2024-12-23 11:21:00 -08:00
Sam Lantinga
4add7e2005 Round the window size values when using fixed aspect ratio
This won't get you pixel perfect values, since the exact ratio won't necessarily be whole pixel values, but it will be closer, and matches the logic in the other branch.
2024-12-23 09:03:38 -08:00
Eduard Gushchin
3ac28bae6a Removed references to non-existent method SDL_GetAsyncIOTaskResult 2024-12-23 08:02:03 -08:00
SDL Wiki Bot
da37e1541b Sync SDL3 wiki -> header
[ci skip]
2024-12-23 05:32:13 +00:00
SDL Wiki Bot
ecea3471f6 Sync SDL3 wiki -> header
[ci skip]
2024-12-22 20:20:41 +00:00
Anonymous Maarten
f8d8bf8066 SDL_GetNumAllocations returns -1 when allocation counting is disabled 2024-12-22 12:20:04 -08:00
Anonymous Maarten
a33144fbc9 SDL_test: disable memory tracking if SDL does not count allocations 2024-12-22 12:20:04 -08:00
Sam Lantinga
2e4dc9c109 Disable tracking memory allocation counts by default
Fixes https://github.com/libsdl-org/SDL/issues/11099
2024-12-22 12:20:04 -08:00
capehill
80c1b1e1a0 Fix testautomation pixels_saveLoadBMP big endian issue
It seems created surfaces are ARGB8888 format on both BE and LE,
therefore BGRA32 failed.
2024-12-22 12:08:54 -08:00
SDL Wiki Bot
478ac0b9bf Sync SDL3 wiki -> header
[ci skip]
2024-12-22 19:01:42 +00:00
SDL Wiki Bot
03d6e4b69e Sync SDL3 wiki -> header
[ci skip]
2024-12-22 18:53:26 +00:00
Maia
ca4ffc8a00 Fix missing parens in preprocessor defined op 2024-12-22 10:36:03 -05:00
Maia
8475c496b4 Fix typo 2024-12-22 10:35:35 -05:00
SDL Wiki Bot
56cf8d8dc9 Sync SDL3 wiki -> header
[ci skip]
2024-12-22 07:09:56 +00:00
Ryan C. Gordon
f0fad41f2c include: Filled in all remaining missing documentation! 2024-12-22 01:58:13 -05:00
SDL Wiki Bot
4d8f5758cf Sync SDL3 wiki -> header
[ci skip]
2024-12-22 06:18:11 +00:00
Caleb Cornett
c080bb8417 GPU: Fix non-triangle D3D12 primitive topology types 2024-12-21 22:38:40 -05:00
Sam Lantinga
33442701ca Use the monitor as the client rect for maximized borderless windows
Fixes https://github.com/libsdl-org/SDL/issues/9588
2024-12-21 09:19:03 -08:00
Sam Lantinga
7e298f50fe Make windows resizable if we're about to maximize them programmatically 2024-12-21 09:19:03 -08:00
Sam Lantinga
34974d4d2b Don't remove the resizable style for borderless windows
The application may have intended the window to be borderless and resizable
2024-12-21 09:19:03 -08:00
Sam Lantinga
cadeec9cc9 SDL_SoftStretch() doesn't handle large pixel formats
Fixes https://github.com/libsdl-org/SDL/issues/11534
2024-12-21 09:19:03 -08:00
Sam Lantinga
f37eef948c Removed raw mouse events
It's too close the 3.2.0 release for an API change like this.

If/when we re-add these, some things for consideration:
* What use cases does this enable that aren't currently possible?
* What cross-platform API guarantees do we make about the availability of these events? e.g. do we try to simulate them where raw input isn't actually available?
* How is this different from the existing relative mode, and how do we clearly explain when you want these events vs wanting relative mode?

Notes from @expikr:
First observation: the reason I originally passed denominators instead of multipliers was because some rational values cannot be exactly represented by floats (e.g 1/120) so instead let the end-developer decide how to do the dividing themselves. It was the reason why it was using split values with an integer numerator to begin with, instead of having both as floats or even just normalize it in advance.

On the other hand, passing them as multipliers might have hypothetical uses for dynamically passing end-user controlled scaling in a transparent manner without coupling? (Though in that case why not just do that as additional fields appended to `motion` structs in an API-compatible layout?)

So it’s somewhat of a philosophical judgement of what this API of optional availability do we intend for it to present itself as:
- should it be a bit-perfect escape hatch with the absolute minimally-denominal abstraction over platform details just enough to be able to serve the full information (á la HIDPIAPI),
- or a renewed ergonomic API for splitting relative motion from cursor motion (in light of The Great Warping Purge) so that it is unburdened by legacy RelativeMode state machines, in which case it would be more appropriate to just call it `RELATIVE` instead of `RAW` and should be added alongside another new event purely for cursor events?

This alternate API stream was conceived in the context of preserving compatibility of the existing RelativeMode state machine by adding an escape hatch. So given the same context, my taste leans towards the former designation.

However, as The Great Warping Purge has made it potentially viable to do so, if I were allowed to break ABI by nuking the RelativeMode state machine entirely, I would prefer the latter designation unified as one of three separate components split from the old state machine, each independently controlled by platform-dependent availability without any state switching of a leaky melting pot:
- cursor visibility controls (if platform has cursor)
- cursor motion events (if platform has cursor)
- relative motion events (if the platform reports hardware motion)
2024-12-21 05:18:42 -08:00
Sam Lantinga
d07bb0e679 Removed raw key events
They weren't adding any value over the existing keyboard events
2024-12-21 05:18:42 -08:00
Sam Lantinga
c44fa5bb07 Updated raw input events to match SDL style
Also added raw keyboard events, and implemented raw input events on iOS, OpenBSD console, Linux console, and X11
2024-12-21 05:18:42 -08:00
SDL Wiki Bot
1025087c2e Sync SDL3 wiki -> header
[ci skip]
2024-12-21 13:15:56 +00:00
Sam Lantinga
a47b62d1fe Removed PS2 compiler definition
This is already defined as part of the PS2 SDK
2024-12-20 15:51:39 -08:00
Wolfywolfy
f3c194f39a Remove EXTRA_CFLAGS.
(cherry picked from commit 9491389baf)
2024-12-20 15:21:07 -08:00
Ethan Lee
7e8576fd19 gpu: Xbox fixes for swapchain presentation 2024-12-20 14:56:33 -05:00
Ethan Lee
f7580374a1 include: Always declare SDL_GDKSuspendComplete.
This is always defined in the symbol table and the function safely does nothing
on non-GDK targets, so treat it like any other SDL_system function.
2024-12-20 13:14:55 -05:00
SDL Wiki Bot
232c2970d3 Sync SDL3 wiki -> header
[ci skip]
2024-12-20 15:57:39 +00:00
Frank Praznik
5ec5f23fff tests: Print accurate enabled/disabled relative mode status in testrelative 2024-12-20 10:57:12 -05:00
SDL Wiki Bot
b815123cf2 Sync SDL3 wiki -> header
[ci skip]
2024-12-20 07:48:16 +00:00
Ryan C. Gordon
819e1cc95b SDL_stdinc.h: A couple wikiheaders fixes. 2024-12-20 02:45:04 -05:00
Ryan C. Gordon
b2eb23a617 SDL_filesystem.h: Fill in missing documentation. 2024-12-20 02:39:28 -05:00
Ryan C. Gordon
0b401137d2 SDL_stdinc.h: Document more stuff.
There's only a handful of C runtime wrappers left in this header now!
2024-12-20 02:28:34 -05:00
Ryan C. Gordon
b83dd793fd SDL_stdinc.h: Tons of documentation updates.
Almost everything in this header is now documented! The remaining gaps are
literal C runtime wrappers like SDL_strdup, and the analyzer macros like
SDL_INOUT_Z_CAP.
2024-12-20 01:09:40 -05:00
Ethan Lee
a0864799f2 GDK: Fix compile_shaders_xbox.bat build events 2024-12-20 00:57:25 -05:00
Ethan Lee
5d9ccb6296 gpu: Add explicit casts to D3D12 staging descriptor changes 2024-12-20 00:56:48 -05:00
Ethan Lee
e992522cb2 Xbox buildfixes for WarpCursor jitter fix, dark mode 2024-12-20 00:55:54 -05:00
SDL Wiki Bot
b2c15a8c2a Sync SDL3 wiki -> header
[ci skip]
2024-12-20 00:35:23 +00:00
cosmonaut
0f9e86fe1c tests: Fix GPU tests crashing when window is minimized 2024-12-19 16:21:50 -08:00
SDL Wiki Bot
c9e22d4672 Sync SDL3 wiki -> header
[ci skip]
2024-12-20 00:13:34 +00:00
Ryan C. Gordon
ff366fba87 include: Move SDL_HAS_BUILTIN to SDL_begin_code.h, document it.
This macro fits better here, since most of the other macros in this file are
for testing similar compiler/target features, etc.
2024-12-19 19:12:56 -05:00
cosmonaut
e46d8756e5 tests: Update GPU tests to use new swapchain best practice 2024-12-19 15:55:04 -08:00
Ryan C. Gordon
401c8f8e4e SDL_timer.h: Fixed doxygen typo. 2024-12-19 16:46:42 -05:00
SDL Wiki Bot
2f9a45af60 Sync SDL3 wiki -> header
[ci skip]
2024-12-19 21:44:12 +00:00
Ryan C. Gordon
0c42891826 include: Filled in more documentation gaps. 2024-12-19 16:42:14 -05:00
Frank Praznik
3ce68f80bc wayland: Clean up the relative pointer if the seat capability is removed
Also use wl_pointer_release, when available, instead of destroy.
2024-12-19 14:33:06 -05:00
Frank Praznik
7c8171da92 wayland: Handle the relative pointer manager appearing after the seat has been initialized 2024-12-19 14:26:51 -05:00
Frank Praznik
4bfc8f84f7 tests: Add a raw event mode to testrelative
Add a code path to test raw motion events (activated by '--raw').
2024-12-19 14:14:36 -05:00
Frank Praznik
8c849ecc6c wayland: Add support for the MOUSE_RAW_* events
Mouse button numbers are passed through directly, and axis values are passed through as the raw, 32-bit, wl_fixed_t 24.8 fixed-point values, which need to be divided by the denominator to convert to int/float.
2024-12-19 14:10:09 -05:00
Frank Praznik
fce922b66c wayland: Add support for the SDL_MOUSE_RELATIVE_SYSTEM_SCALE hint
The relative pointer protocol sends both the accelerated and unaccelerated deltas, so select between them based on the hint value.
2024-12-19 14:10:08 -05:00
SDL Wiki Bot
d6a95ae198 Sync SDL3 wiki -> header
[ci skip]
2024-12-19 18:54:59 +00:00
Sam Lantinga
42de2ac6a9 Fixed typo 2024-12-19 10:51:02 -08:00
Sam Lantinga
e08f34c3be Removed SDL_HINT_MOUSE_RELATIVE_MODE_WARP
This complicated mouse handling and is a rarely tested path. Real relative mode is much better performance and higher precision.
2024-12-19 10:33:02 -08:00
Sam Lantinga
6e0df0af24 Reduce the possibility of SDL_LockMutex getting called on a destroyed mutex after SDL_StopEventLoop 2024-12-19 09:32:31 -08:00
SDL Wiki Bot
519923ea80 Sync SDL3 wiki -> header
[ci skip]
2024-12-19 17:20:47 +00:00
Ryan C. Gordon
624a4d5f26 include: Documented important SDL_begin_code symbols. 2024-12-19 12:19:46 -05:00
expikr
5c0f8dc179 add alternate raw mouse motion events with windows implementation (#10042) 2024-12-18 17:29:27 -08:00
expikr
345cab1e36 streamline cursor clipping logic on windows (#11237)
This commit does the following:
- add logic in the `WM_MOUSEMOVE` case of the Window to conditionally call `WIN_UpdateClipCursor` upon receiving cursor motion if SDL is expecting the mouse to be clipped in some way (Fixes #7890)
- remove Windows-specific periodic refresh of cursor clipping and its `SDL_HINT_MOUSE_RELATIVE_CLIP_INTERVAL` hint (superceded by the above bullet point)
- streamline the processing logic within `WIN_UpdateClipCursor` for better readability of each branch, and avoid calling the Platform API until it is absolutely necessary.
- move `relative_mouse_center` field from Windows-specific per-window `SDL_WindowData` to the global `SDL_Mouse` struct, and the corresponding hint callbacks to `SDL_mouse.c` instead of `SDL_windowswindow.c`
2024-12-18 17:25:06 -08:00
Marcin Serwin
35a9d156a6 render: convert tmotion vectors to render basis
When using `SDL_ConvertEventToRenderCoordinates` with
`SDL_EVENT_FINGER_MOTION` events it converts `x` and `y` coordinates but
does not convert the the `dx` and the `dy` unlike `xrel` and `yrel` of
mouse motion events. This is means that these are rather useless after
conversion. This change unifies this behavior between touch and mouse
motion events.
2024-12-18 17:17:14 -08:00
pixelsuft‮
3739749404 Improve Win32 darkmode and fix title bar's context menu (#11543)
Use hidden uxtheme.dll and user32.dll functions for darkmode instead of using DwmSetWindowAttribute.
Fixes context menu on title bar.
2024-12-18 17:11:31 -08:00
SDL Wiki Bot
10f868abf4 Sync SDL3 wiki -> header
[ci skip]
2024-12-19 01:06:43 +00:00
Sam Lantinga
f81472d767 Document that you should read from processes before waiting for them to exit.
Fixes https://github.com/libsdl-org/SDL/issues/11645
2024-12-18 16:18:44 -08:00
Frank Praznik
3001c61de0 x11: Use the master pointer device for absolute motion
Slave pointer devices can seemingly lag behind the master for some reason, so use the master pointer coordinates for absolute motion.

Master events are now only filtered out on the pen path.
2024-12-18 18:21:22 -05:00
Sam Lantinga
835b6e0c1a Enable high refresh rates on iOS
Fixes https://github.com/libsdl-org/SDL/issues/7518
2024-12-18 14:36:30 -08:00
Eduard Gushchin
da80b9bce5 Fixed an inaccuracy in the documentation for SDL_ConvertPixelsAndColorspace 2024-12-18 14:20:24 -08:00
Eduard Gushchin
2ce21d1fed Fixed an inaccuracy in the documentation for SDL_CancelGPUCommandBuffer 2024-12-18 14:18:33 -08:00
Eduard Gushchin
0ca8027205 Fixed an inaccuracy in the documentation for SDL_PenProximityEvent and SDL_PenMotionEvent 2024-12-18 13:02:14 -08:00
SDL Wiki Bot
4d9e7a2a68 Sync SDL3 wiki -> header
[ci skip]
2024-12-18 19:09:01 +00:00
cosmonaut
b5eea03d1e GPU: Clarify presentation concerns in SDL_gpu.h 2024-12-18 11:08:14 -08:00
SDL Wiki Bot
7dd523fbb1 Sync SDL3 wiki -> header
[ci skip]
2024-12-18 18:57:45 +00:00
SDL Wiki Bot
48a0adb2ac Sync SDL3 wiki -> header
[ci skip]
2024-12-18 15:41:13 +00:00
Ryan C. Gordon
4d4a2786bb render: Updates to format-string versions of SDL_RenderDebugText.
- Removes SDL_RenderDebugTextV
- Changes SDL_RenderDebugTextF to SDL_RenderDebugTextFormat and tweaks it to
  work in a world without SDL_RenderDebugTextV.
- Tweaked rendering position of formatted text in the example program.
2024-12-18 10:40:31 -05:00
williamist
6abebca943 Fix format string in debug-text example
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
2024-12-18 10:40:31 -05:00
williamistGitHub
1d0e28a5b3 Add SDL_RenderDebugTextF & SDL_RenderDebugTextV
This should make it easier to quickly put important numbers and such on
the screen without having to format them into a string manually.
2024-12-18 10:40:31 -05:00
SDL Wiki Bot
5608bf5866 Sync SDL3 wiki -> header
[ci skip]
2024-12-18 06:22:41 +00:00
Evan Hemsley
0fbcd0d586 GPU: Optimize usage of D3D12 staging descriptors (#11657) 2024-12-17 22:22:22 -08:00
Ryan C. Gordon
e957840d34 include: Filling in some more documentation gaps. 2024-12-18 01:18:40 -05:00
Semphris
684098fac3 Fix possible bug with Windows dialogs
The Windows implementation of dialogs use the Win32 API, which expects the file filters to have null bytes as separator, and two null bytes at the end of the filter list. To help with string manipulation, the internal code uses 0x01 bytes instead of null bytes, and converts all 0x01 bytes into null bytes at the last moment. If someone decides to put two consecutive 0x01 bytes in their filter names, the code might mistakenly pick them up and convert them to null bytes, leading to Windows failing to pick up later filters. In practice, this is probably not so bad, since it requires someone to have control over file filters already, and allows at most ignoring the following file filters. It is also unlikely to happen by accident since 0x01 is not printable. This commit fixes that by replacing all the 0x01 bytes with the space character.
2024-12-17 20:50:39 -08:00
Semphris
bc9c86bcc2 Dialog: Add suffix to filters all the time
For some obscure reason I can't remember, I had made it so the suffix would be added only if the filter list was empty. That isn't the expected behavior and caused a mishandling of memory on Windows, which requires a two-null-bytes suffix.
2024-12-17 20:50:39 -08:00
Ryan C. Gordon
b58e6d7274 .wikiheaders-options: Include CPU intrinsics macros in quick reference. 2024-12-17 23:37:28 -05:00
Ryan C. Gordon
c9ab8ad8d9 SDL_intrin.h: Added missing NEON and Altivec documentation. 2024-12-17 23:33:05 -05:00
SDL Wiki Bot
d38c09e5c4 Sync SDL3 wiki -> header
[ci skip]
2024-12-18 04:26:44 +00:00
Ryan C. Gordon
6730cf7bed SDL_intrin.h: Add documentation. 2024-12-17 23:25:25 -05:00
Ryan C. Gordon
2f68efda83 wikiheaders: Add underscore to the "big ascii" character table. 2024-12-17 23:23:13 -05:00
SDL Wiki Bot
19bdc01b8c Sync SDL3 wiki -> header
[ci skip]
2024-12-17 15:46:19 +00:00
Frank Praznik
eda0261c4e video: Drop size and position requests for windows in a fixed size/position state
It is not uncommon for clients to redundantly set the window size and position, either as a holdover from an SDL 1 port, when this was required, due to any window state change triggering a universal update function that sets all window state, even if unnecessary (e.g. always calling SDL_SetWindowSize(), even if the window is fullscreen), or due to the use of compatability layers. Historically, these clients expect that their behavior won't override the base window state, which is an assumption that the windowing changes in SDL 3 broke by caching size and position changes that can't be applied immediately.

This change drops size and position requests when the window is in the maximized and fullscreen states (fullscreen-desktop windows will be repositioned, but the non-fullscreen floating position will not be overwritten), which is behavior more in line with existing client assumptions, and should ease the porting process, as well as prevent annoying bugs when older software is run via sdl2-compat.

In the process of making these changes, pending window state has been moved to separate variables in the SDL_Window struct, as this fixes bugs regarding fullscreen display selection and centering windows immediately after resize on asynchronous platforms, which had issues due to pending state possibly being overwritten.
2024-12-17 10:45:40 -05:00
Ozkan Sezer
6fa6297441 fix typo from commit b84f150d06 2024-12-17 11:15:56 +03:00
Ozkan Sezer
b84f150d06 fix macOS builds with hidapi disabled
Fixes: https://github.com/libsdl-org/SDL/issues/11647 .
2024-12-17 11:11:56 +03:00
SDL Wiki Bot
c52a96ca8e Sync SDL3 wiki -> header
[ci skip]
2024-12-17 07:29:13 +00:00
Sam Lantinga
080b3002c6 Fixed building with an older Windows SDK 2024-12-16 22:33:31 -08:00
Ryan C. Gordon
d0d1414836 messagebox: Copy title and message up front, to protect SDL_GetError() strings.
It's possible (likely!) someone could just pass a pointer returned by
SDL_GetError for one of these strings, but the message box code has to do a
ton of complicated stuff that might _also_ call SDL_SetError, so you could
end up with the string having different contents by the time you display it.

Just make a copy of the strings unconditionally at the start, so they're safe
no matter where they came from.

Fixes #10932.
2024-12-16 21:58:05 -05:00
SDL Wiki Bot
a92eade183 Sync SDL3 wiki -> header
[ci skip]
2024-12-16 17:20:27 +00:00
Ryan C. Gordon
0bb42cb023 alsa: a few more minor formatting tweaks. 2024-12-16 12:19:48 -05:00
Ryan C. Gordon
483ceb5355 alsa: Reenable SDL's internal channel map support when ALSA can't swizzle. 2024-12-16 12:19:48 -05:00
Ryan C. Gordon
35360ec4d7 alsa: Use more hints for opening default devices. 2024-12-16 12:19:48 -05:00
Ryan C. Gordon
576f13ac7c alsa: Put debug logging back into correct category and logging level. 2024-12-16 12:19:48 -05:00
Ryan C. Gordon
ff96c59df4 alsa: Add back in code to guess the correct ALSA device prefix. 2024-12-16 12:19:48 -05:00
Ryan C. Gordon
b108b54c6a alsa: Bring up to current SDL coding conventions and standards, other tweaks. 2024-12-16 12:19:48 -05:00
Ryan C. Gordon
639855b7e5 alsa: Remove direct calls to memset 2024-12-16 12:19:48 -05:00
Ryan C. Gordon
a4a1dff219 alsa: remove loop macro 2024-12-16 12:19:48 -05:00
Ryan C. Gordon
b9c062c858 alsa: Pulled in latest changes from @sylware 2024-12-16 12:19:48 -05:00
Sam Lantinga
76e7bc4c04 Added support for ALSA dmix audio output (thanks @sylware!)
Fixes https://github.com/libsdl-org/SDL/issues/8577
2024-12-16 12:19:48 -05:00
SDL Wiki Bot
3fa0537565 Sync SDL3 wiki -> header
[ci skip]
2024-12-16 06:13:48 +00:00
Ryan C. Gordon
79316ca36e Heavy work on improving category documentation.
Still more to go!

Reference Issue #9440.
2024-12-16 01:10:37 -05:00
SDL Wiki Bot
9aca97f4e7 Sync SDL3 wiki -> header
[ci skip]
2024-12-16 05:03:54 +00:00
Ryan C. Gordon
c0803f7683 SDL_dialog.h: Improvements and fixes to the documentation. 2024-12-16 00:02:50 -05:00
Ryan C. Gordon
a55686ce61 hints: Clarify when joystick hints should be set.
Fixes #9490.
2024-12-15 21:28:28 -05:00
Frank Praznik
eb3fc0684c wayland: Don't close an externally owned display on init failure 2024-12-15 10:51:51 -05:00
L zard
6cc9ce183d SDL_internal: remove #undef SDL_LEAN_AND_MEAN
I am confused by the "You have to manually edit this file" comment. Does it mean that it is expected to manually remove the previous `#define SDL_LEAN_AND_MEAN 0` ?
In any case I put this part of the change in a separate commit so that it can easily be reverted.
2024-12-14 09:22:29 -08:00
L zard
8b6d3c88cf Fix #ifdefs to have config flags either defined as 1 or undefined
See 387774ab8a
2024-12-14 09:22:29 -08:00
Frank Praznik
313d522f39 wayland: Only require fifo-v1 for Wayland by default
Some compositors may not implement commit-timing-v1 in addition to fifo-v1, at least not immediately, and Mesa doesn't require commit-timing for FIFO behavior. The fifo-v1 protocol alone is enough for the desired behavior.

Only check for fifo-v1 to enable Wayland by default.
2024-12-13 18:40:34 -05:00
Ryan C. Gordon
ac2edad809 audio: Simplify and unify audio stream format updating when devices change.
This used to do different things for recording streams in different parts of
the codebase, not to mention two separate codepaths through
UpdateAudioStreamFormatsPhysical in any case. My hope is this should kill off
a few corner case bugs...for example, this one:

Fixes #8402.
2024-12-13 14:59:16 -05:00
Ryan C. Gordon
9a9616894d wikiheaders: Fix uninitialized variable issue. 2024-12-13 13:52:35 -05:00
Ethan Lee
9628549c7c Xbox buildfixes 2024-12-13 11:34:39 -05:00
Ryan C. Gordon
80b9986418 audio: Fixed potential NULL dereference.
This could happen if you call SDL_BindAudioStreams() when the subsystem isn't
initialized, and possibly in other corner cases.

Thanks to Qianxin CodeSafe Team, @QiAnXinCodeSafe, for discovering this issue!

Fixes #11643.
2024-12-13 10:12:33 -05:00
Sam Lantinga
1944bc7407 Fixed warning C4702: unreachable code 2024-12-12 15:43:42 -08:00
Sam Lantinga
63a498c966 Fixed warning C4189: 'cqe': local variable is initialized but not referenced 2024-12-12 15:43:07 -08:00
Sam Lantinga
ce9dddfde2 Don't free properties while modifying the property hashtable
A property cleanup callback might end up trying to set other properties, so we don't want to have a lock held at that point.

Fixes an assertion in testprocess when cleaning up IO stream properties
2024-12-12 14:39:53 -08:00
Sam Lantinga
43a61fec91 Removed external hashtable locking functions
Read-write locks are not recursive and can't be upgraded from one type to another, so it's not safe to lock the hash table and then call functions that operate on it. If you really want this functionality, we'd need to create unlocked versions of the hashtable functions and you would call those once you've taken a lock on the hashtable, and we'd have to assert that the operations you're doing are compatible with the type of lock you've taken.

All of that complicates working with hashtables, so if you need that type of access, you should probably just use external locking.
2024-12-12 14:39:53 -08:00
Sam Lantinga
61511c48a4 SDL_HashTable is now optionally thread-safe
Fixes https://github.com/libsdl-org/SDL/issues/11635
2024-12-12 14:39:53 -08:00
Ryan C. Gordon
e0cee83a3a emscriptenaudio: Removed comment about Firefox not supporting userActivation.
It does now, and has since Firefox 120 (around November 2023).
2024-12-12 10:48:23 -05:00
Ryan C. Gordon
2635239bbc README-migration: some improvements to the audio section.
Minor edit about default devices, and an explanation of forcing device buffer
size with SDL_HINT_AUDIO_DEVICE_SAMPLE_FRAMES.

Fixes #9857.
2024-12-12 01:29:56 -05:00
Marcin Serwin
ce7cb10541 dialog/unix: create zenity argv on the main thread
Creating `argv` for zenity means we don't have to pass the building
blocks between threads which allows us to avoid deep copying some nested
structures. It also allows us to fail earlier in case of problems with
building the argument vector.
2024-12-11 20:57:07 -08:00
Marcin Serwin
cf59fc797f dialog/unix: deep copy args to avoid data race
SDL properties passed to the `SDL_Zenity_ShowFileDialogWithProperties`
may be destroyed/modified immediately upon the function return.
Therefore, we must copy all the strings and structures passed via
pointers; otherwise, the `SDL_ZenityFileDialog` thread attempting to
read them will cause data race.
2024-12-11 20:57:07 -08:00
Marcin Serwin
af6c641b8c dialog/unix: stricter typing
Introduce `const` where appropriate
2024-12-11 20:57:07 -08:00
Marcin Serwin
4c86511035 dialog/unix: reduce string allocations
Simplifies logic of spawning the zenity process by avoiding allocations
of static strings
2024-12-11 20:57:07 -08:00
Marcin Serwin
ff82238172 dialog/unix: remove /usr/bin/env indirection
SDL process is using `posix_spawnp` which already does the path lookup
so additional indirection via `env` is unnecessary
2024-12-11 20:57:07 -08:00
cosmonaut
c5acbef3bf GPU: Fix D3D12_INTERNAL_StrToWStr returning incorrect length 2024-12-11 16:38:28 -08:00
Ryan C. Gordon
6fe09e3aa4 dynapi: Minor optimization to SDL_SetError wrapper. 2024-12-11 18:04:43 -05:00
SDL Wiki Bot
a1e8d5c327 Sync SDL3 wiki -> header
[ci skip]
2024-12-11 19:17:12 +00:00
Evan Hemsley
3ee39f6c3f GPU: Revise swapchain acquisition (#11633)
---------

Co-authored-by: Lucas Murray <22484+lmurray@users.noreply.github.com>
2024-12-11 11:16:35 -08:00
Ryan C. Gordon
bbd4eeb287 examples/audio/04-multiple-streams: Note about web browser audio in README. 2024-12-11 14:13:52 -05:00
Ryan C. Gordon
f45ce45603 ngage: Remove Nokia N-Gage support.
This can be reverted if a toolchain arrives that can handle C99 features like
variables declared in the middle of a scope, but for now we literally can't
compile SDL3 for this platform.

Fixes #11243.
2024-12-11 13:29:43 -05:00
Ryan C. Gordon
3f425b6f20 examples/audio/04-multiple-streams: Patched to compile on Visual Studio. 2024-12-11 13:25:43 -05:00
Ryan C. Gordon
1fbb8e1824 examples/audio/04-multiple-streams: Remove drag-and-drop support.
I'm going to reuse that code for an actual drag/drop example later, but for
simplicity and accessibility of the examples, this is just going to load two
wavs and loop them, so you get the music with a sword-clinking sound mixed
over it.
2024-12-10 23:10:43 -05:00
SDL Wiki Bot
e6e468d0c4 Sync SDL3 wiki -> header
[ci skip]
2024-12-11 00:28:23 +00:00
Sam Lantinga
962268ca21 Fixed Chinese locales on PSP (thanks @ccawley2011!) 2024-12-10 14:47:31 -08:00
Ryan C. Gordon
ac92af02ea wikiheaders: put a header on the quick reference pages. 2024-12-10 11:36:19 -05:00
Ryan C. Gordon
be5fba963a wikiheaders: optionally generate a Quick Reference page.
Plus some fixes to SDL's headers this brought up.
2024-12-10 11:25:15 -05:00
Frank Praznik
7c5c88a3ad cocoa: Fix conditional coding style 2024-12-09 23:49:17 -05:00
Frank Praznik
d4225070ad cocoa: Toggle the fullscreen menu item to 'leave' when entering a fullscreen space
Only return 'NO' during the menu item validation if the window is fullscreen and not in a fullscreen space.
2024-12-09 23:43:31 -05:00
Anonymous Maarten
48b6b93fb6 cmake: make RelWithDebInfo the default configuration 2024-12-09 18:03:03 +01:00
Frank Praznik
5447cb6d38 video: Prefer the window manager supplied coordinates for selecting a fullscreen display
Unless there are pending client requested window coordinates, such as in the case where the position is set followed by immediately by entering fullscreen, prefer the true window coordinates as sent by the window manager to select a fullscreen display.

Fixes the case where, if the window manager moves an already maximized window to another display, the window would be made fullscreen on the wrong display since the last floating coordinates would be used.
2024-12-09 11:50:26 -05:00
Anonymous Maarten
e4215a04d9 gpu: make macro's function-like using do-while-0 2024-12-09 00:01:16 +01:00
Anonymous Maarten
fb71b44231 gpu: define EXPAND_ARRAY_IF_NEEDED macro once and make it function-like 2024-12-09 00:01:16 +01:00
Anonymous Maarten
0370b92d80 gpu: SDL_ClaimWindowForGPUDevice must set an error message on failure 2024-12-09 00:01:16 +01:00
cosmonaut
5c020b9930 GPU: Enable VK_ERROR_NATIVE_WINDOW_IN_USE_KHR to print 2024-12-08 11:20:06 -08:00
cosmonaut
279836d259 GPU: Swapchain image count respects number of allowed frames in flight 2024-12-08 09:07:50 -08:00
Anonymous Maarten
1d5d948ccf Fix building SDL3 without dialog support 2024-12-08 14:31:19 +00:00
Anonymous Maarten
19cc04a162 Add build-release.py updates from satellite libraries
[ci skip]
2024-12-08 02:16:02 +01:00
Marcin Serwin
b5c05b6e29 wayland: pass actual empty strings to zenity
The double quotes were passed literally to the zenity arguments which
resulted in the message box displaying literal `""` when no text was
given. The empty string is more logical in this case, e.g., the empty
title results in the message box having lesser height.
2024-12-07 15:19:26 -08:00
Marcin Serwin
1e7c7c69c5 wayland: handle 0 extra buttons in message box
When no extra buttons are passed to zenity with `--question --switch`
arguments it fails to show anything, however, SDL3 still reports
success. To handle this case, we pass an additional "OK" button.
2024-12-07 15:19:26 -08:00
Sam Lantinga
09428688b9 Added a reminder to sign the source archives when creating a release 2024-12-07 11:50:42 -08:00
Salman Alshamrani
972c6d0b82 Add SetTextInputProperties to video device API and fix iOS handling 2024-12-07 11:43:35 -08:00
Salman Alshamrani
5d09656afa Refactor iOS text input activation to better work with hardware keyboards 2024-12-07 11:43:35 -08:00
Salman Alshamrani
72895a6994 Remove unused hardwareKeyboard variable 2024-12-07 11:43:35 -08:00
SDL Wiki Bot
f64e9a52dc Sync SDL3 wiki -> header
[ci skip]
2024-12-07 04:33:05 +00:00
Sam Lantinga
ddb1e66d90 Updated the release checklist documentation 2024-12-06 20:18:30 -08:00
Sam Lantinga
caf0348b26 Enable ApplePressAndHoldEnabled
Fixes https://github.com/libsdl-org/SDL/issues/3622
2024-12-06 17:33:10 -08:00
Sam Lantinga
900627f7fc Enable the SDL_HINT_MOUSE_DOUBLE_CLICK_TIME and SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS hints on macOS
Fixes https://github.com/libsdl-org/SDL/issues/4000
2024-12-06 17:07:16 -08:00
Sam Lantinga
6d1dac1404 Removed unused math code from the Visual Studio projects 2024-12-06 16:28:23 -08:00
SDL Wiki Bot
d25cdc0fef Sync SDL3 wiki -> header
[ci skip]
2024-12-07 00:20:38 +00:00
Sam Lantinga
df48af22d4 Removed unused math code from the Xcode project 2024-12-06 16:20:13 -08:00
Sam Lantinga
08de6656fc Document the pixel layout of YUV format surfaces
Fixes https://github.com/libsdl-org/SDL/issues/10530
2024-12-06 16:14:05 -08:00
SDL Wiki Bot
2ac62d8c67 Sync SDL3 wiki -> header
[ci skip]
2024-12-06 22:17:01 +00:00
Sam Lantinga
846eb9a886 Added SDL_RenderTextureAffine() to the exported API 2024-12-06 14:16:16 -08:00
SDL Wiki Bot
7278399366 Sync SDL3 wiki -> header
[ci skip]
2024-12-06 22:15:20 +00:00
expikr
d0f1910918 add SDL_RenderTextureAffine 2024-12-06 14:14:47 -08:00
SDL Wiki Bot
2c4fc2e549 Sync SDL3 wiki -> header
[ci skip]
2024-12-06 21:46:49 +00:00
Sam Lantinga
8d8578785c SDL_asyncio.h is a public header and should be included in the framework 2024-12-06 13:46:31 -08:00
Evan Hemsley
fa5f84fb6e GPU: Add SetGPUAllowedFramesInFlight (#11599) 2024-12-06 11:56:20 -08:00
Ryan C. Gordon
47429227ab examples: Handle newlines in README.txt better. 2024-12-06 13:25:06 -05:00
Ryan C. Gordon
0f228de48a examples: Add some metadata to the generated webpages. 2024-12-06 13:08:26 -05:00
Sam Lantinga
ffb9b30e84 The metal renderer doesn't actually support RGB texture formats
Fixes https://github.com/libsdl-org/SDL/issues/11576
2024-12-06 09:47:50 -08:00
Nicolas Allemand
1a5b0796b4 examples: fix canvas size for small screens 2024-12-06 06:58:10 -08:00
Ozkan Sezer
d1b8fcd692 work around type redefinition errors in SDL_immdevice.h 2024-12-06 17:51:00 +03:00
Lucas Murray
9b82d46259 GPU: Use correct logging category 2024-12-06 07:53:37 -05:00
Lucas Murray
5229b520af GPU: Log D3D12 driver version 2024-12-05 21:49:42 -08:00
Ryan C. Gordon
b79e3ac830 examples: Let the browser handle README.txt word wrapping.
Now it's just inserts BR tags (not P tags atm) to separate paragraphs.
2024-12-06 00:13:30 -05:00
Ryan C. Gordon
90efb63e52 examples: Improve webpage generation in various ways, add thumbnails, etc. 2024-12-05 23:58:23 -05:00
Ryan C. Gordon
e50dc7265b examples: Fix some window titles in the demos. 2024-12-05 23:58:23 -05:00
Semphris
7ddda4fe18 Add system theme support for Emscripten 2024-12-05 20:01:56 -08:00
Sam Lantinga
3060105cfa Don't filter out controllers when launched by Steam under Proton
Fixes https://github.com/libsdl-org/SDL/issues/11579
2024-12-05 19:50:15 -08:00
Frank Praznik
2e5208f353 kmsdrm: Fix Vulkan type redefinition errors from commit 24ed947cc3 2024-12-05 19:52:19 -05:00
SDL Wiki Bot
c49f4ceeb2 Sync SDL3 wiki -> header
[ci skip]
2024-12-06 00:49:29 +00:00
Sam Lantinga
23828b62d4 Added SDL_IsMainThread() and SDL_RunOnMainThread() 2024-12-05 13:53:51 -08:00
Sam Lantinga
bc4185c685 Document that video and input functions should be called on the main thread.
This is a hard requirement on Apple platforms and while most other platforms don't have a concept of main thread, all video and input functions should be called on the same thread.
2024-12-05 13:53:51 -08:00
Sam Lantinga
fffa6c7a2b Add missing include of fcntl.h
Fixes https://github.com/libsdl-org/SDL/issues/11590
2024-12-05 13:45:17 -08:00
Sam Lantinga
235e5c6a6c Fixed crash if a device doesn't have a USB product or manufacturer string
This happens with the Razer Huntsman V3 Pro Tenkeyless keyboard
2024-12-05 10:42:02 -08:00
SDL Wiki Bot
9f8157f42c Sync SDL3 wiki -> header
[ci skip]
2024-12-05 08:29:19 +00:00
Nicolas Allemand
a0b8b57afe examples: add empty placeholder image 2024-12-05 00:29:03 -08:00
Ryan C. Gordon
951ca96dc9 asyncio: Added more category documentation. 2024-12-04 23:08:36 -05:00
Nicolas Allemand
58f8e259d1 examples: fixup URLs for project subfolder 2024-12-04 19:37:50 -05:00
Nicolas Allemand
56da4e81d8 examples: added homepage + categories pages + added CSS (similar to wiki) 2024-12-04 19:37:50 -05:00
Ryan C. Gordon
9784e10a75 audio: Let emscripten update device->sample_frames at device open time.
Fixes #11435.
2024-12-04 19:16:28 -05:00
Ozkan Sezer
5bfece34f9 ran gendynapi.pl after PR/11170. 2024-12-05 02:28:50 +03:00
Sam Lantinga
045e31178f Added SDL_dialog.c to the Xcode project 2024-12-04 15:12:44 -08:00
SDL Wiki Bot
a74693c9a5 Sync SDL3 wiki -> header
[ci skip]
2024-12-04 23:10:49 +00:00
Semphris
a4852f3a10 SDL_ShowFileDialogWithProperties with more options 2024-12-04 15:10:15 -08:00
Lucas Murray
dc5a2ddfd0 GPU: Forward D3D12 validation warnings to the SDL log 2024-12-04 14:34:43 -08:00
Lucas Murray
efb59bd0bf GPU: Fix validation warning in D3D12 blit code 2024-12-04 12:35:36 -08:00
Caleb Cornett
45869d6177 GPU: Vulkan requires drawIndirectFirstInstance feature (#11583) 2024-12-04 15:05:35 -05:00
Caleb Cornett
d8eb68a6c5 GPU: Clean up D3D12 blit shader compilation 2024-12-04 14:56:36 -05:00
Frank Praznik
24ed947cc3 kmsdrm: Fix an LTO type mismatch warning
Include SDL_kmsdrmopengles.h before SDL_kmsdrmvulkan.h, as the Vulkan header can pull in Wayland headers, which pull in EGL headers with EGL types defined as Wayland types, which causes warnings when building with strict-aliasing and LTO.
2024-12-04 12:34:02 -05:00
Frank Praznik
31128b6cdd kmsdrm: Clean up GLES function definitions
Several functions were redundantly declared in both in the general subsystem header and the GLES header, and some signatures didn't match in both locations.

Move them all to the GLES header, as the definitions are in the GLES source file.
2024-12-04 12:34:02 -05:00
numzero
123306b18c X11: support _NET_WM_SYNC_REQUEST 2024-12-04 11:59:46 -05:00
expikr
d320d7143d Fix rawmouse wrong timestamp (#11553)
Currently, the rawinput thread incorrectly spreads the timestamps over idle time if the poll interval is less than 100ms, and abruptly switches to lumping all accumulated inputs to happen simultaneously if it exceeds 100ms.

This means that any game which implements retroactive event handling based on timestamps will jarringly snap between the two polar opposite extremes of incorrect behaviour.

This PR replaces the arbitrary 100ms threshold with logic based on measuring the idle start and end time.

If the thread idled for more than 125000 nanoseconds, it is considered to have not had any input in its queue before it entered idle, and the events are spread over the interval between thread wake-up and pump finish, with the final input aligned to the pump finish time.

If the thread idled for less than 125000 nanoseconds, it is considered to have events entered at some point between last pump finish and thread entering sleep, and the events are spread over the full pump-to-pump interval.
2024-12-03 20:40:34 -08:00
Ozkan Sezer
830b132cd4 SDL_asyncio_liburing.c: replace __kernel_time64_t use with SDL's Sint64 2024-12-03 23:39:11 -05:00
Ozkan Sezer
4ac78706bf SDL_asyncio_liburing.c: replace size_t casts on pointers with intptr_t 2024-12-03 23:39:11 -05:00
SDL Wiki Bot
2ad5836d02 Sync SDL3 wiki -> header
[ci skip]
2024-12-04 00:12:42 +00:00
SDL Wiki Bot
31d09909b6 Sync SDL3 wiki -> header
[ci skip]
2024-12-03 23:04:47 +00:00
Sam Lantinga
1377cdb3f2 Fix the Indonesian language code on Android 2024-12-03 15:04:29 -08:00
Ryan C. Gordon
46f43c2e6e asyncio: Remove SDL_AsyncIOTask from the public API. 2024-12-03 17:32:20 -05:00
Ryan C. Gordon
4745aa3324 asyncio: Windows IoRing support, other tweaks and fixes. 2024-12-03 17:32:20 -05:00
Ryan C. Gordon
3ca629ceb5 asyncio: Allow file closes to request a flush/fsyncdata. 2024-12-03 17:32:20 -05:00
Ryan C. Gordon
022a6a9f97 asyncio: Added Linux io_uring support. 2024-12-03 17:32:20 -05:00
Ryan C. Gordon
e79ce2a200 asyncio: Added async i/o APIs. 2024-12-03 17:32:20 -05:00
Eduard Gushchin
7293c18314 Fixed an inaccuracy in the return parameter information in the SDL_ConvertPixels function 2024-12-03 11:32:04 -08:00
Eduard Gushchin
401187eb6c Removed extra sa in SDL_ConvertSurfaceAndColorspace 2024-12-03 09:38:56 -08:00
Nicolas Allemand
b7a31ead08 added "gpu" to the list of possible values of SDL_HINT_RENDER_DRIVER in SDL_hints.h 2024-12-03 09:06:40 -08:00
Eduard Gushchin
9fb8661684 Fixed an inaccuracy in the return parameter information in the SDL_SurfaceHasAlternateImages function 2024-12-03 08:41:30 -08:00
Sam Lantinga
6aab5a089d Fixed potential buffer overflow 2024-12-03 08:33:51 -08:00
Ryan C. Gordon
65c9a58f5e audio: Make sure a few bitflag checks convert to bools correctly.
This might just be defensive coding, but better safe than sorry on this.
2024-12-03 11:04:52 -05:00
Anonymous Maarten
ec2ef5f9b5 dynapi: order headers for reproducible behavior 2024-12-02 18:25:48 +01:00
Frank Praznik
2762644e96 video: Don't error when setting an unbounded max window size while a minimum is set
If the maximum size was changed to 0 (unbounded) while a minimum was set, the sanity check ensuring that the max size isn't less than the minimum size would incorrectly cause the operation to error out.
2024-12-02 09:55:19 -05:00
SDL Wiki Bot
068d9cc7d6 Sync SDL3 wiki -> header
[ci skip]
2024-12-02 00:37:15 +00:00
Ryan C. Gordon
2f59a1ce44 SDL_audio.h: Fixed a documentation typo (thanks, @JBetz!). 2024-12-01 19:36:03 -05:00
Ryan C. Gordon
acf0f09320 SDL_migration.cocci: Fixed up some SDL3 symbols that had changed. 2024-11-30 20:08:38 -05:00
SDL Wiki Bot
3a1d76d298 Sync SDL3 wiki -> header
[ci skip]
2024-11-29 22:32:15 +00:00
Ryan C. Gordon
ce573b01f8 audio: Added SDL_IsAudioDevicePhysical and SDL_IsAudioDevicePlayback.
Fixes #11529.
2024-11-29 17:31:37 -05:00
Ryan C. Gordon
d53241a299 docs/README-main-functions.md: reformatted Best Practices section. 2024-11-28 00:19:55 -05:00
SDL Wiki Bot
5cd188bdbc Sync SDL3 wiki -> header
[ci skip]
2024-11-28 05:17:28 +00:00
anakin004
7099de4ae8 Update README-main-functions.md 2024-11-28 00:16:55 -05:00
Ryan C. Gordon
bf9fa38920 SDL_audio.h: Fixed two typos. 2024-11-28 00:12:03 -05:00
Ryan C. Gordon
f5ad66ef4b audio: Allow channel maps to specify -1 to mute a channel.
Fixes #11373.
2024-11-28 00:00:30 -05:00
SDL Wiki Bot
3303e9843f Sync SDL3 wiki -> header
[ci skip]
2024-11-28 04:42:44 +00:00
Ryan C. Gordon
f852038384 filesystem: Added SDL_GetCurrentDirectory().
Fixes #11531.
2024-11-27 23:42:11 -05:00
Ryan C. Gordon
16113374ff cmake: Enable POSIX fsops code for PS2 and PSP. 2024-11-27 23:42:11 -05:00
SDL Wiki Bot
c0f1fe8e7f Sync SDL3 wiki -> header
[ci skip]
2024-11-28 04:36:33 +00:00
Ryan C. Gordon
f022501d52 fnsince.pl: Deal with post-3.1.3 releases before 3.2.0. 2024-11-27 23:18:38 -05:00
Ivan Epifanov
b8233aff8e Vita: implement mousewheel and buttons 4/5 2024-11-27 08:23:16 -08:00
SDL Wiki Bot
b8bbd29ce9 Sync SDL3 wiki -> header
[ci skip]
2024-11-27 06:11:04 +00:00
Frank Praznik
bbc9c75618 x11: Fix memory leaks in clipboard event handler
XGetWindowProperty and XGetAtomName return data which must be freed by the client, and was being leaked.
2024-11-26 10:54:59 -05:00
Caleb Cornett
5c8bed3780 GPU: Fix D3D12 tearing query 2024-11-25 22:33:48 -05:00
SDL Wiki Bot
03d15c031b Sync SDL3 wiki -> header
[ci skip]
2024-11-25 22:44:00 +00:00
expikr
d55e6dfc5e hint for which system cursor to use as default
Co-Authored-By: Sam Lantinga <slouken@libsdl.org>
2024-11-25 13:08:37 -08:00
SDL Wiki Bot
3c13bae64f Sync SDL3 wiki -> header
[ci skip]
2024-11-25 19:07:53 +00:00
Susko3
e0e61775b8 Add missing SDL_WindowFlags to SDL_test_common.c
This fixes some flags not printing in testwm.c
2024-11-25 10:56:16 -08:00
Sam Lantinga
6fab61b69d hidapi: check each usage on a device before ignoring it completely 2024-11-25 10:49:05 -08:00
SDL Wiki Bot
e9fdcf6c60 Sync SDL3 wiki -> header
[ci skip]
2024-11-25 17:20:21 +00:00
Ryan C. Gordon
1720fc77fe examples: Added input/02-joystick-events 2024-11-24 22:49:07 -05:00
Ryan C. Gordon
a07a88c1b4 examples: added input/01-joystick-polling 2024-11-24 22:49:06 -05:00
Sam Lantinga
c508396e33 Avoid usage of CreateEventEx in WASAPI code
This also uses FALSE as parameters consistently for CreateEvent()
2024-11-24 17:49:17 -08:00
Starbuck5
7a3f5ef129 Speed up full-surface fills 2024-11-24 17:44:00 -08:00
Ryan C. Gordon
10e2ce9ba4 examples: Added audio/04-multiple-streams 2024-11-24 15:05:44 -05:00
Anonymous Maarten
88926f2b73 emscripten: send drag and drop events 2024-11-24 13:22:46 -05:00
SDL Wiki Bot
e14d939ead Sync SDL3 wiki -> header
[ci skip]
2024-11-24 17:41:07 +00:00
Kai Pastor
bbe843fd80 Full configuration of SDL_INSTALL_CMAKEDIR_ROOT
Let users override also the final `SDL3` subdir for the configuration installation destination.
2024-11-24 02:06:27 +01:00
Clownacy
79f6f766d4 Avoid usage of CreateEventEx in D3D12 GPU backend
Unavailable in Windows XP.
2024-11-24 01:02:06 +00:00
Benjamin Jurk
fdafa266d8 (doc): make cmake build parallel on linux 2024-11-23 12:15:59 +01:00
Ryan C. Gordon
61ba8010d3 examples: Emscripten builds should allow memory growth.
Otherwise you either need to preallocate a bunch or run out of memory fast.

examples/demo/04-bytepusher runs out of memory at startup without this.
2024-11-23 00:01:18 -05:00
Ryan C. Gordon
212f0dcdb1 examples: Fix output name of demos.
Otherwise, build-web-examples.pl will fail.
2024-11-22 17:29:43 -05:00
Ozkan Sezer
41b0d36a6c fix MSVC projects after commit 51637495 2024-11-23 01:22:12 +03:00
Ryan C. Gordon
f9ddb0bdea examples/demo/04-bytepusher: No need to check NULL before destroying things. 2024-11-22 17:12:14 -05:00
Ozkan Sezer
7bf3cae02e examples: fix cmake after commit 51637495 2024-11-23 00:56:40 +03:00
Ryan C. Gordon
51637495e4 examples: Rename "game" to "demo". 2024-11-22 15:56:09 -05:00
Maia
566f3dc138 Add BytePusher example 2024-11-22 15:54:45 -05:00
SDL Wiki Bot
b02285d495 Sync SDL3 wiki -> header
[ci skip]
2024-11-22 20:53:04 +00:00
Maia
97ddc9adf2 Fix outdated references to SDL symbols in docs. Fixes #11503 2024-11-22 15:52:31 -05:00
Ryan C. Gordon
465881d560 android: patched to compile. 2024-11-22 15:01:09 -05:00
Ryan C. Gordon
c135386f58 events: Add render category to SDL_EventCategory. 2024-11-22 15:01:09 -05:00
Ryan C. Gordon
615c935d11 events: Added SDL_RenderEvent.
Fixes #11465.
2024-11-22 15:01:09 -05:00
Anonymous Maarten
848fd1eab4 ci: don't do 'brew install pkg-config' anymore II
Assume it is installed by default
2024-11-22 20:52:57 +01:00
Anonymous Maarten
0007451222 ci: don't do 'brew install pkg-config' anymore
Assume it is installed by default
2024-11-22 20:46:03 +01:00
Wouter Wijsman
3a2b595c4f PSP: Add locale support 2024-11-22 08:37:14 -08:00
SDL Wiki Bot
e94ba6e700 Sync SDL3 wiki -> header
[ci skip]
2024-11-22 03:38:20 +00:00
SDL Wiki Bot
631c30527b Sync SDL3 wiki -> header
[ci skip]
2024-11-22 03:22:50 +00:00
Ryan C. Gordon
2e70944c44 gpu: Added an initial FAQ to the category documentation.
Fixes #11478.
2024-11-21 19:57:14 -05:00
Frank Praznik
df73cae2b0 cocoa: Clear the pending flags on non-spaces fullscreen transitions
Transitions to or from a non-spaces fullscreen state are synchronous, so clear both the enter and leave pending flags when changing the state.
2024-11-21 11:47:21 -05:00
Eduard Gushchin
a4006e654e Fixed typo in the name of the SDL_GetAppMetadataProperty function in the description of the SDL_SetAppMetadataProperty function 2024-11-21 05:53:06 -08:00
Sam Lantinga
5ee4d176f1 Added support for the Razer Wolverine V3 Pro 2024-11-21 05:51:57 -08:00
Ryan C. Gordon
a0591ec4a3 README-documentation-rules.md: Mention not listing types in param/returns docs. 2024-11-20 23:59:24 -05:00
SDL Wiki Bot
fef001cb48 Sync SDL3 wiki -> header
[ci skip]
2024-11-21 04:53:43 +00:00
Ryan C. Gordon
e770b4e266 dialog: Clean up filter param documentation.
The apostrophe was incorrect, but the type is auto linked in the wiki anyhow,
so don't write it out ourselves.
2024-11-20 23:52:49 -05:00
SDL Wiki Bot
795ceae520 Sync SDL3 wiki -> header
[ci skip]
2024-11-21 04:50:57 +00:00
Ryan C. Gordon
ecae3789ab SDL_dialog.h: Remove verbose docs on callback param from several functions.
In the wiki, one can click on SDL_DialogFileCallback for these details, or
grep for the symbol in the headers to find the information.

Fixes #11504.
2024-11-20 23:46:26 -05:00
Marcin Serwin
587384756f render: use nearest pixel scaling for debug text
The debug text font is less legible when scaled linearly.
2024-11-20 18:06:53 -08:00
Ryan C. Gordon
2b744c7df3 cocoa: Refuse to SDL_Init(SDL_INIT_VIDEO) from background thread.
Fixes #11437.
Reference PR #11502.
2024-11-20 20:22:36 -05:00
Sam Lantinga
932bb968d7 Fixed infinite recursion when the microphone is unavailable 2024-11-20 16:07:43 -08:00
Sam Lantinga
1413848f41 Fixed crash if a window ends up without a display 2024-11-20 13:27:43 -08:00
Sam Lantinga
35e6c92c3c Added the ROG Ally X to the list of Xbox controllers
This prevents Steam from opening the DirectInput versions of this controller that are added by installing Zenless Zone Zero.
2024-11-20 12:09:30 -08:00
Anonymous Maarten
4fb955c80b cmake: fix sdlcpu.cmake for C89 compilers 2024-11-20 05:35:50 +01:00
Frank Praznik
aa352837d5 cocoa: Don't sync on a pending fullscreen event if the window is miniaturized
The fullscreen event will be processed after deminiaturization is complete. Fixes a delay when restoring a miniaturized window that will return to fullscreen.
2024-11-19 16:53:31 -05:00
Frank Praznik
18b7a2315c cocoa: Restore fullscreen state on the window regaining key status
Ensure that fullscreen state is restored if a non-minimized fullscreen window regains key status. This can happen if a fullscreen window was requested to minimize on loss of key status, but the minimization didn't actually occur.
2024-11-19 12:10:31 -05:00
Frank Praznik
014196d98d cocoa: Fix minimizing fullscreen windows on Sequoia
Sequoia seems to require that the window briefly be made key when minimizing it after coming out of fullscreen.
2024-11-19 12:10:31 -05:00
Sam Lantinga
7a074f582e Steam Controller handling improvements
* Only handle the controller interfaces on a Steam Controller and wireless dongle
* Wait until we get the connected status when initializing a wireless dongle
2024-11-18 21:36:23 -08:00
SDL Wiki Bot
d2dc0fa920 Sync SDL3 wiki -> header
[ci skip]
2024-11-19 02:19:43 +00:00
Sam Lantinga
0c53d9a1ee Implemented SendEffect for Steam Controllers 2024-11-18 18:26:07 -08:00
Sam Lantinga
d8f8cf3e99 Added SDL_HINT_JOYSTICK_HIDAPI_STEAM_HOME_LED 2024-11-18 14:50:37 -08:00
Sam Lantinga
184da780f5 Fixed a crash when unplugging a Steam Controller dongle 2024-11-18 12:13:42 -08:00
Frank Praznik
70fe38bcb2 wayland: Rename some display related variables to better reflect their purpose
Use the 'logical' prefix for the logical width and height, and clarify that the physical dimensions reflect the width/height in millimeters.
2024-11-18 11:39:27 -05:00
Sam Lantinga
e027b85cc4 Validate that pixel formats have the correct attributes
Also added a test to save and load as BMP format to make sure pixel transformations are working correctly.

Fixes https://github.com/libsdl-org/SDL/issues/11483
2024-11-17 11:58:57 -08:00
Anonymous Maarten
bd57cfdb55 ci: pin MSVC ARM Windows SDK version to 10.0.22621.0 2024-11-17 19:39:28 +01:00
Ozkan Sezer
0f9e551d71 joystick/gdk/SDL_gameinputjoystick.c: fix build errors due to -Wformat 2024-11-17 00:45:02 +03:00
Sam Lantinga
af6ce629c4 Make sure pairing remains enabled for the entire time dongle pairing is active 2024-11-16 13:42:12 -08:00
Sam Lantinga
2b10a040ff Fixed rare case of wireless Steam Controller not being detected at startup 2024-11-16 13:10:02 -08:00
SDL Wiki Bot
572cc7af63 Sync SDL3 wiki -> header
[ci skip]
2024-11-16 04:44:23 +00:00
ChillerDragon
7d7ee43ddb stdinc: document SDL_strnlen and SDL_strlen
See https://github.com/libsdl-org/sdlwiki/issues/635
2024-11-15 23:43:51 -05:00
expikr
e9f7a1b359 fix relative system scale function on Windows
source: https://web.archive.org/web/20161202223814/https://ihme.org/~orbik/random_stuff/donewmouseaccel.png
Co-Authored-By: Sam Lantinga <slouken@libsdl.org>
2024-11-15 16:00:19 -08:00
expikr
25390d6c21 fix relative warp emulation broken by #11460 2024-11-15 15:58:09 -08:00
Cameron Gutman
e0166256ff joystick: Fix connection type for Steam Controller and Xbox 360 dongles 2024-11-15 17:54:14 -06:00
Sam Lantinga
8657fa8b3b Improved reliability of the Steam Controller driver 2024-11-15 15:55:13 -08:00
expikr
f8468d580d add brace for contitional
Co-authored-by: Sam Lantinga <slouken@libsdl.org>
2024-11-15 10:20:17 -08:00
expikr
eaef956a9a fix errenous delta when warping
The following changes do not alter any logic:
- rename x/ydelta fields to x/y_accu to better reflect what it actually is about
- coalesce the logic for modifying internal state to one spot, branch based on whether the input was a move or a warp

The following changes alter the logic:
- put the x/y_accu addition under the relative branch only, warps should not add to the accumulation buffer by any definition
- (MAIN FIX) when the destination window desires relative mode, warp events should be dropped if SDL_MOUSE_RELATIVE_WARP_MOTION is false, or have x/yrel set to zero if true
2024-11-15 10:20:17 -08:00
Sam Lantinga
b54f6044a5 Removed Linux Steam Controller support
The HIDAPI driver has all the functionality we need on Linux
2024-11-15 08:53:40 -08:00
Sam Lantinga
b43b333d25 Moved the GPU renderer to the bottom of the list
We've gotten the feedback we wanted from having it first, so we'll move the other renderers back up for the widest compatibility across devices and platforms.

Fixes https://github.com/libsdl-org/SDL/issues/11468
2024-11-15 08:32:49 -08:00
ChillerDragon
7f14eb33c6 snake: improve comment 2024-11-14 22:40:07 -08:00
Sam Lantinga
b71151a697 Added support for pairing controllers to the Steam Controller dongle 2024-11-14 20:04:31 -08:00
Ryan C. Gordon
e4778d53d3 testautomation_video: Another Emscripten test to be skipped. 2024-11-14 19:34:25 -05:00
Ryan C. Gordon
d48d4c8c48 testautomation_video: Don't test window position on Emscripten.
This _might_ fix GitHub Actions. We'll know once I push this!  :)
2024-11-14 19:00:10 -05:00
Sam Lantinga
f0b61c69e7 Fixed duplicate controllers showing up on the Steam Controller wireless dongle 2024-11-14 14:19:16 -08:00
Sam Lantinga
fe3566ca46 Ignore Steam Controllers in the Linux driver if HIDAPI is handling them 2024-11-14 11:20:52 -08:00
Sam Lantinga
7959b08a4d Fixed spacing 2024-11-14 09:25:57 -08:00
Ryan C. Gordon
6ca8269b96 docs/README-raspberrypi.md: Corrected NEON information (thanks, @cmitu!). 2024-11-14 12:11:29 -05:00
Sam Lantinga
0f9505256d Steam Controller support defaults off on mobile platforms
These platforms require prompting for Bluetooth permissions, so don't enable this by default.
2024-11-14 09:05:16 -08:00
Sam Lantinga
140aba9e5d Enable Steam Controller support by default
It now handles both wired and wireless controllers and Steam will set SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES for Steam Controllers if it's handling them.
2024-11-14 08:18:03 -08:00
Cameron Gutman
68c2cf84f6 hidapi: Add support for the Steam Controller wireless dongle 2024-11-14 06:57:22 -08:00
Cameron Gutman
1a311bc638 hidapi: Add support for Steam controllers connected via USB 2024-11-14 06:57:22 -08:00
Cameron Gutman
e67ae274a5 hidapi: Fix bus type in HIDAPI_IGNORE_DEVICE() on Linux
This bug prevented the Steam Controller's keyboard and mouse
interfaces from being properly ignored by the HIDAPI joystick
driver on Linux.
2024-11-13 22:06:37 -06:00
SDL Wiki Bot
7c5a2cd462 Sync SDL3 wiki -> header
[ci skip]
2024-11-14 01:12:18 +00:00
Ryan C. Gordon
95c8a1cf7c iostream: Update docs about return values and SDL_GetIOStatus().
Fixes #11395.
2024-11-13 20:11:18 -05:00
Ryan C. Gordon
7007b4762b events: Fix a compiler warning.
Fixes #11410.
2024-11-13 20:03:21 -05:00
Ryan C. Gordon
6049ca4fb1 docs/README-raspberrypi.md: Initial updates.
This document needs a _lot_ of modernization! This was just some initial
improvements, and a warning that the rest is probably obsolete.

Fixes #11444.
2024-11-13 19:55:25 -05:00
SDL Wiki Bot
c021c75737 Sync SDL3 wiki -> header
[ci skip]
2024-11-14 00:30:41 +00:00
Ryan C. Gordon
d20936b544 camera: Add some category docs about camera device warmup delays.
Fixes #11454.
2024-11-13 19:29:14 -05:00
SDL Wiki Bot
3877bf55a3 Sync SDL3 wiki -> header
[ci skip]
2024-11-13 20:44:45 +00:00
SDL Wiki Bot
c26dda10e0 Sync SDL3 wiki -> header
[ci skip]
2024-11-13 20:38:45 +00:00
Sam Lantinga
9a4ae4b9ed Fixed crash if SDL_GetVideoDisplayForWindow() returns NULL 2024-11-13 10:45:01 -08:00
SDL Wiki Bot
20cd4290d7 Sync SDL3 wiki -> header
[ci skip]
2024-11-13 04:49:12 +00:00
SDL Wiki Bot
dcf6dd19c3 Sync SDL3 wiki -> header
[ci skip]
2024-11-13 04:41:26 +00:00
SDL Wiki Bot
6c99a4b783 Sync SDL3 wiki -> header
[ci skip]
2024-11-13 04:29:53 +00:00
cosmonaut
a85f0b49f4 GPU: Remove D3D11 shaders from testgpu_spinning_cube 2024-11-12 17:32:25 -08:00
cosmonaut
5a74aadac9 GPU: Null check shader inputs in CreateGPUGraphicsPipeline 2024-11-12 14:31:13 -08:00
Ryan C. Gordon
32cc92dceb pipewire: i/o callbacks should avoid higher-level iteration during device open.
Sometimes these callbacks will fire while we're still waiting on state to
settle down in PIPEWIRE_OpenDevice, which means we're holding the device lock,
but then the i/o callback will fire from a background thread and also try to
grab the device lock, but can't, because PIPEWIRE_OpenDevice is holding it and
waiting for this i/o callback to finish...hence, a deadlock.

So now, if the device is still opening, output callbacks will write silence
and input callbacks will just flush the buffer, without calling the main
iterate function, and thus avoid obtaining the lock.
2024-11-12 15:18:41 -05:00
Evan Hemsley
119b4fa5f5 GPU: Remove D3D11 backend and allow D3D12 to ingest DXBC (#11456) 2024-11-12 10:55:21 -08:00
Fancy2209
fc12cc6dfd ci: add linux-powerpc to test matrix 2024-11-10 14:20:18 +00:00
Kai Pastor
559223ff9d cmake: don't use uninitialized SDL_VERSION and use REVISION.txt
Co-authored-by: Anonymous Maarten <anonymous.maarten@gmail.com>
2024-11-09 17:03:25 +00:00
Andrei Alexeyev
332fd824f0 GPU Vulkan: release submitted command buffer after defrag (#11430) 2024-11-08 09:40:26 -08:00
L zard
1ed1bc1d5d testautomation keyboard: use space instead of a 2024-11-08 07:01:50 -08:00
Zack Middleton
8a2cac7aaa Fix SDL_PRIs64 to use standard PRId64
PRIs64 doesn't exist in C standards.
2024-11-08 12:37:14 +03:00
Sam Lantinga
54ff1f35bd Fixed audio dropouts when plenty of audio is queued on Android 2024-11-07 19:29:51 -08:00
Sam Lantinga
37b49c98dc Fixed setting up surround sound on NVIDIA Shield TV 2024-11-07 19:05:29 -08:00
SDL Wiki Bot
dbe82e685d Sync SDL3 wiki -> header
[ci skip]
2024-11-08 01:55:37 +00:00
Semphris
3e2ef64c98 Add SDL_SaveFile and SDL_SaveFile_IO functions 2024-11-07 17:55:02 -08:00
SDL Wiki Bot
b0140fb1b4 Sync SDL3 wiki -> header
[ci skip]
2024-11-08 00:35:43 +00:00
Sam Lantinga
97dac37373 Added SDL_HINT_ANDROID_LOW_LATENCY_AUDIO 2024-11-07 16:34:34 -08:00
Sam Lantinga
6836ef8fd2 Added logging for low latency audio state 2024-11-07 16:31:35 -08:00
Sam Lantinga
908bd84c5e Fixed reopening a controller on Android 2024-11-07 15:36:32 -08:00
Sam Lantinga
1ea4edddec Fixed Java exception if mConnection is null 2024-11-07 11:54:09 -08:00
capehill
588e32ea5a test: Change LoadContext() return value type from int to bool
It should be then consistent with SDL_SetError().
2024-11-05 14:22:57 -08:00
Sam Lantinga
ecfd143a26 testcontroller: update the controller name when it's opened as a gamepad 2024-11-05 11:43:28 -08:00
Sam Lantinga
908b42f2b9 Fixed 8BitDo M30 mapping to match fighting game conventions and the layout in XInput mode 2024-11-05 11:43:28 -08:00
Sam Lantinga
028194286c Added mappings for the various firmware versions of the 8BitDo SN30 Pro controller
Fixes https://github.com/libsdl-org/SDL/issues/9460
2024-11-05 11:43:28 -08:00
Sam Lantinga
0ef7a1d901 Show the guid of gamepads that are opened 2024-11-05 11:43:28 -08:00
Sam Lantinga
ed943318e2 Support multiple joystick buttons bound to the same gamepad button 2024-11-05 11:43:28 -08:00
Sam Lantinga
27b828754a Use HIDAPI to provide better names for DirectInput controllers
Fixes https://github.com/libsdl-org/SDL/issues/10207
2024-11-05 11:43:28 -08:00
Sam Lantinga
5a7b75607a Added the OpenVR license to openvr_capi.h
License taken from https://github.com/ValveSoftware/openvr/blob/master/LICENSE
2024-11-04 13:32:59 -08:00
Sam Lantinga
c1246e31a4 Added support for the PowerA OPS v1 and v3 Pro wireless controllers 2024-11-04 12:05:57 -08:00
Sam Lantinga
d3b882b4f9 Added support for the PowerA Fusion Pro 4 and Fusion Pro Wireless controllers 2024-11-04 10:48:50 -08:00
SDL Wiki Bot
fb2145f731 Sync SDL3 wiki -> header
[ci skip]
2024-11-04 05:04:44 +00:00
Petar Popovic
96729e745a SDL_GetClosestFullscreenDisplayMode(): Rename parameter mode to closest
Also: Check, if the parameter is NULL inside the function.
2024-11-03 21:03:44 -08:00
Sam Lantinga
683991ab71 Get the full display bounds if the window doesn't fit in the usable bounds. 2024-11-03 20:58:18 -08:00
Sam Lantinga
6823e3f005 Fixed gaps in scaled 9-grid texture rendering 2024-11-03 20:47:45 -08:00
Frank Praznik
458f616c53 wayland: Send a display removed event when a display is disconnected
An event would be dispatched if a display was dynamically added after initialization, but not if one was removed.
2024-11-03 12:43:47 -05:00
Petar Popovic
73e0e8cf5b SDL_GetDisplayForPoint(), SDL_GetDisplayForRect(): Check argument for NULL. 2024-11-03 07:55:07 -08:00
Sam Lantinga
8026866994 wayland: fixed memory leak at shutdown 2024-11-02 22:56:03 -07:00
SDL Wiki Bot
cacfdc8cfa Sync SDL3 wiki -> header
[ci skip]
2024-11-03 05:23:05 +00:00
Sam Lantinga
7031b240df Added SDL_PROP_WINDOW_WAYLAND_VIEWPORT_POINTER 2024-11-02 22:22:29 -07:00
Anonymous Maarten
c56a3f60fe xcode+cmake: use SDL3.framework folder as IMPORTED_LOCATION
[ci skip]
2024-11-02 22:22:35 +01:00
Ryan C. Gordon
615d2dcd5b .wikiheader-options: Treat SDL int types (Uint64, etc) as API prefixes.
This makes any reference to them in the docs link to their wiki pages.
2024-11-01 23:47:32 -04:00
Anonymous Maarten
e001a309be create-release.py: use head of git ref as default commit 2024-11-02 04:20:32 +01:00
Sam Lantinga
27f69c772c Updated the release checklist
This will help me remember to create the archives _after_ tagging the release.
2024-11-01 19:40:47 -07:00
Sam Lantinga
87dade4421 Set SDL_PROP_RENDERER_MAX_TEXTURE_SIZE_NUMBER for the GPU renderer
Fixes https://github.com/libsdl-org/SDL/issues/11393
2024-11-01 18:38:42 -07:00
SDL Wiki Bot
0508f100e2 Sync SDL3 wiki -> header
[ci skip]
2024-11-01 22:50:16 +00:00
Sam Lantinga
927d297161 Updated to version 3.1.7 for development 2024-11-01 15:49:31 -07:00
Sam Lantinga
78cc5c1734 Updated to version 3.1.6 for the preview release 2024-11-01 14:27:01 -07:00
SDL Wiki Bot
19af3a2b34 Sync SDL3 wiki -> header
[ci skip]
2024-11-01 19:42:29 +00:00
Wouter Wijsman
e31e3caece PSP: Fix building examples in parallel 2024-11-01 09:55:20 -07:00
Sam Lantinga
c5f12b135d Fixed the D-pad on wireless Xbox 360 controllers 2024-11-01 09:02:55 -07:00
Wouter Wijsman
780578cd36 PSP: Allow building tests in parallel 2024-11-01 08:57:09 -04:00
Sam Lantinga
8b48b70c6e Fixed return value setting state on combined Joy-Con controllers 2024-10-31 20:37:23 -07:00
Sam Lantinga
77a0411dde Minor cleanup 2024-10-31 15:44:41 -07:00
SDL Wiki Bot
68cc173d92 Sync SDL3 wiki -> header
[ci skip]
2024-10-30 20:47:55 +00:00
expikr
7c968f1510 Update SDL_hints.h 2024-10-30 12:01:51 -07:00
expikr
e2857fc5a2 Update SDL_mouse.c 2024-10-30 12:01:51 -07:00
Maia
5699ba799e Add return to CHECK_VULKAN_ERROR_AND_RETURN macro 2024-10-30 11:52:42 -07:00
M. P. Halpin
6c10446a6c Add version info when building CI/CD for apple platforms 2024-10-30 09:07:30 -07:00
expikr
d6b60bcc53 typo in player spawnpos, mov drawcall out of loop 2024-10-30 11:22:29 -04:00
Sam Lantinga
09495059df Fixed the PS5 controller face buttons on Amazon Fire TV, Android 11 2024-10-30 05:23:00 -07:00
Sam Lantinga
c099d0525e sort_controllers.py: fixed parsing SDL_PRIVATE_GAMEPAD_DEFINITIONS 2024-10-30 05:21:59 -07:00
M. P. Halpin
24bdbb8bf4 Supress Metal warning when compiling against macOS 10.11-10.13 2024-10-29 20:03:18 -07:00
Sam Lantinga
2a05b63580 Mark generate.py as executable 2024-10-29 16:47:26 -07:00
Sam Lantinga
51628034d9 Don't offset the view if there's no text input rect
Otherwise this will shift the entire view upwards, which probably isn't what you want.
2024-10-29 16:42:16 -07:00
Sam Lantinga
c8a04eec06 Autorelease keys should go down when pressed. 2024-10-29 16:24:40 -07:00
Anonymous Maarten
f543faf837 Allow in-tree build 2024-10-30 00:04:17 +01:00
SDL Wiki Bot
6647345be0 Sync SDL3 wiki -> header
[ci skip]
2024-10-29 21:43:56 +00:00
Evan Hemsley
b4dff42dcd GPU: Add SDL_CancelGPUCommandBuffer (#11316)
---------

Co-authored-by: Caleb Cornett <caleb.cornett@outlook.com>
2024-10-29 14:43:22 -07:00
Susko3
94d110edd5 Specify C source file in example VC projects 2024-10-29 14:40:32 -07:00
Susko3
415abf2ea2 Rename variables for readability 2024-10-29 14:40:32 -07:00
Sam Lantinga
bdf16628fb Added 03-infinite-monkeys example game
This isn't really a game, more of an exercise of that age old question...
2024-10-29 13:08:59 -07:00
Sam Lantinga
2b92dc9baa Minor updates to woodeneye-008.c from template.c 2024-10-29 13:08:59 -07:00
Sam Lantinga
a93ec0c679 Added Visual Studio project for 02-woodeneye-008 2024-10-29 13:08:59 -07:00
Sam Lantinga
9a77ee2008 Added instructions for creating Visual Studio projects for examples 2024-10-29 13:08:59 -07:00
cosmonaut
014b473bcc GPU D3D12: Fix depth texture sampling 2024-10-29 12:05:35 -07:00
cosmonaut
ff14a1781f GPU D3D12: Fix indirect buffers not being refcounted 2024-10-29 10:34:54 -07:00
dv-senna
149ecffd6f SDL_vulkan.h: undefine VK_DEFINE_HANDLER and VK_DEFINE_NON_DISPATCHABLE_HANDLE
Allows including vulkan.hpp in user code in C++ before SDL_vulkan.h w/o errors.
Fixes:  https://github.com/libsdl-org/SDL/issues/11328 .
2024-10-29 20:30:10 +03:00
d-musique
35e53f76a9 metal: check success of device creation (#11367)
When macOS runs under a virtual environment, it is possible that
MTLCreateSystemDefaultDevice() does not succeed.
Not checking this failure results in a crash down the road.
This change allows to skip GPU renderer and use an adequate fallback.

Co-authored-by: D.musique <d-musique@users.noreply.github.com>
2024-10-29 12:35:13 -04:00
Caleb Cornett
feb10434a1 Order by subsystem 2024-10-29 08:50:50 -07:00
Caleb Cornett
b2f216f9e2 Add GPU to iOS build config 2024-10-29 08:50:50 -07:00
Caleb Cornett
54836050c9 metal: Add availability checks 2024-10-29 08:13:51 -07:00
Frank Praznik
8f9a562969 wayland: Remove vestigial struct member 2024-10-29 10:51:18 -04:00
Susko3
152bcce85f Add examples to SDL.sln (#11255) 2024-10-29 07:36:38 -07:00
expikr
1e7c186461 Splitcreen FPS example with multiple mouse and keyboard (#11317) 2024-10-29 07:30:10 -07:00
Ethan Lee
5c5235fb51 ci: Add Steam Linux Runtime (Sniper) task 2024-10-28 17:07:31 -04:00
Frank Praznik
36c209080c wayland: Refactor some shell surface related names 2024-10-28 14:30:08 -04:00
Frank Praznik
2b7dc55364 wayland: Check the WM capabilities before sending a minimize event
Wayland gives no feedback to windows regarding whether a minimize request was successful, so we would universally send the minimize event and assume that the request succeeded.

Check the window manager capabilities, if available, for whether window minimization is supported, and don't send the minimized event in the case that it is unsupported.
2024-10-28 14:30:08 -04:00
Frank Praznik
1abbd13414 wayland: Throttle interactive user resize events
Excessive resize events generated during interactive window resizing can cause applications to lag, severely in some cases. Throttle interactive resize events to once per frame callback interval.
2024-10-28 14:30:08 -04:00
SDL Wiki Bot
e0d019c941 Sync SDL3 wiki -> header
[ci skip]
2024-10-28 07:00:30 +00:00
Petar Popovic
cb0c7c9680 SDL_CreateDirectory(): directory tree creation for absolute paths for non-Windows platforms 2024-10-28 01:56:48 -04:00
Petar Popovic
a10578acbd SDL_SYS_RenamePath(): Fix error message. 2024-10-27 16:54:13 -07:00
SDL Wiki Bot
3922bcec95 Sync SDL3 wiki -> header
[ci skip]
2024-10-27 21:42:48 +00:00
Petar Popovic
04a478b6a9 SDL_Enumerate[Storage]Directory() comments: Use enum constant names instead of integers. 2024-10-27 14:41:33 -07:00
Glenn Watson
5c3d42aade Update README-linux.md for openSUSE Tumbleweed dependencies 2024-10-27 08:01:13 -07:00
Petar Popovic
8468c372b2 SDL_EnumerateDirectory(): (posix) Fix return value when directory is invalid 2024-10-25 22:52:56 -07:00
Roman Frołow
97b924f985 typo: maxOS -> macOS 2024-10-26 01:59:44 +02:00
Sam Lantinga
a851c5b648 create-release.py uses python3 2024-10-25 15:08:57 -07:00
Sam Lantinga
47411d8007 build-release.py uses python3 2024-10-25 14:31:49 -07:00
Dan Ginsburg
4f160d69a6 Closes #10318 - implement Android prerotation in the Vulkan renderer 2024-10-25 14:21:29 -07:00
Ozkan Sezer
93471cf78d video/openvr: minor clean-up:
- make all of function pointers static
- make EGLint context_attribs[] static
- comment out unused function pointer ov_wglGetCurrentContext
- remove unused SDL_DisplayMode openvr_dm_default
- move SDL_VideoDisplay openvr_vd_default to OPENVR_VideoInit()
  context and eliminate its C99 initializers
- replace atoi() calls with SDL_atoi()
- replace atof() calls with SDL_atof()
2024-10-25 23:20:24 +03:00
Anonymous Maarten
8bf1a84200 ci: add include headers of build directory to ci artifacts
[sdl-ci-artifacts]
2024-10-25 17:47:26 +02:00
Anonymous Maarten
590e1196d0 snake: check allocated memory before use 2024-10-25 17:47:26 +02:00
Anonymous Maarten
20e01c6fbe android: add (disabled) android.permission.INTERNET to AndroidManifest.xml
It's required for SDL3_net
2024-10-25 17:47:26 +02:00
Sam Lantinga
850158f83f testcontroller: fixed incorrect usage of memcpy() 2024-10-24 18:12:01 -07:00
Ryan C. Gordon
344546b4ea cocoa: Make sure GL context destruction happens on the main thread.
Fixes #10900.
2024-10-24 16:27:58 -04:00
SDL Wiki Bot
dcd4ddb043 Sync SDL3 wiki -> header
[ci skip]
2024-10-24 18:38:45 +00:00
Ryan C. Gordon
8d3bec99a7 audio: Make SDL_GetAudioStreamProperties() thread safe. 2024-10-24 14:37:23 -04:00
Ryan C. Gordon
10e52e1899 docs: Added more '\threadsafety` tags.
Reference Issue #7140.
2024-10-24 14:37:23 -04:00
Frank Praznik
731853077a Send drop complete events when the drop leaves the window on Cocoa, Wayland, and X11
This is already done on win32, however, other platforms were left in a state of limbo if a drop operation began, then never completed due to the drop leaving the window.
2024-10-24 13:36:24 -04:00
Petar Popovic
db4e2ccbac Allow redefinition of only one macro SDL_SINT64_C SDL_UINT64_C 2024-10-24 07:37:44 -07:00
Son Phan Trung
c0bad724a7 README-ios.md: Add info about UIApplicationSupportsIndirectInputEvents on iOS 17 2024-10-24 07:36:45 -07:00
Ryan C. Gordon
4ea26a7771 emscripten: scale mousewheel X coordinates correctly, not just Y coordinates.
Fixes #10454.
2024-10-23 23:35:02 -04:00
Susko3
d0cf2c19d1 Allow defining custom SDL_SINT64_C and SDL_UINT64_C macros (#11315) 2024-10-23 17:03:13 -07:00
Ryan C. Gordon
7108291d0b video: Change SDL_GLattr to SDL_GLAttr. 2024-10-23 18:50:52 -04:00
Ryan C. Gordon
c0e9205a92 video: Change capitalization on various OpenGL attribute typedefs. 2024-10-23 18:50:52 -04:00
Ryan C. Gordon
3c506630c3 video: Turn several OpenGL attribute enums into integer typedefs.
Fixes #11308.
2024-10-23 18:50:52 -04:00
SDL Wiki Bot
a04fda211c Sync SDL3 wiki -> header
[ci skip]
2024-10-23 21:01:26 +00:00
SDL Wiki Bot
4e33440c04 Sync SDL3 wiki -> header
[ci skip]
2024-10-23 20:59:19 +00:00
Anonymous Maarten
e8b69b03fe cmake: fail configuring when no X11 or wayland could be found (#11310)
It's still possible to build SDL by configuring with -DSDL_NO_UNIX_DESKTOP_SANITY_CHECK=ON
2024-10-23 20:19:40 +00:00
Petar Popovic
540db0d164 Bumped version of macro 'main' to 3.1.3 2024-10-23 16:16:07 -04:00
SDL Wiki Bot
370521363a Sync SDL3 wiki -> header
[ci skip]
2024-10-23 19:57:33 +00:00
Frank Praznik
924f719b97 wayland: Get the window content scale from the backend
The window content scale may change independently of the display it is on if scaling or accessibility features are involved, so query it directly from the backend instead of inferring it.
2024-10-23 15:49:26 -04:00
SDL Wiki Bot
299587fa64 Sync SDL3 wiki -> header
[ci skip]
2024-10-23 19:31:40 +00:00
Petar Popovic
5e855d82e3 Manually bump versions of non-function identifiers introduced after 3.1.3 to 3.2.0 2024-10-23 11:17:46 -07:00
kyle-sylvestre
22bc430bbb Set error using function hresult 2024-10-23 10:53:46 -07:00
Sam Lantinga
6eca02a0e7 evdev: correctly handle composite devices
These can be both mouse and keyboard and should be initialized and exposed to the application as both.
2024-10-23 10:52:50 -07:00
Sam Lantinga
ba1412cb9f evdev: fixed devices not being removed on disconnect 2024-10-23 10:52:00 -07:00
Sam Lantinga
370c0426ce testspriteminimal: only quit when escape is pressed 2024-10-23 10:51:14 -07:00
SDL Wiki Bot
acfc223e15 Sync SDL3 wiki -> header
[ci skip]
2024-10-23 16:37:46 +00:00
Evan Hemsley
423337796c GPU Vulkan: Use dedicated allocation for download buffers (#11298) 2024-10-23 09:37:06 -07:00
SDL Wiki Bot
24b376ef18 Sync SDL3 wiki -> header
[ci skip]
2024-10-23 16:30:58 +00:00
Ryan C. Gordon
1c1706a00b fnsince: update \since policy for documentation.
Everything in SDL3 up to the ABI lock is reported as available since 3.1.3.
Everything else will be reported as since 3.2.0 (what will be the first
official release).

Also ran a Perl script over the headers to change everything to 3.1.3 that
wasn't an API function, since fnsince.pl can't manage those. If there's a
macro or datatype that has snuck in that needs to be 3.2.0 instead, we'll
have to manually fix it up, but it shouldn't be a big deal in any case.

Reference PR #11304.
2024-10-23 12:22:43 -04:00
Michael Palomas
21c91d5535 examples now using SDL_ALPHA_OPAQUE(_FLOAT) for opaque alpha value 2024-10-23 07:28:33 -07:00
SDL Wiki Bot
63ef5a2369 Sync SDL3 wiki -> header
[ci skip]
2024-10-23 05:42:03 +00:00
Petar Popovic
fd530d029f Fixed typo in SDL_clipboard.h 2024-10-22 22:41:30 -07:00
SDL Wiki Bot
7b6416add0 Sync SDL3 wiki -> header
[ci skip]
2024-10-23 05:41:03 +00:00
Petar Popovic
af1c165352 Set version of new identifiers after 3.1.3 release to 3.1.6 2024-10-22 22:40:07 -07:00
Sam Lantinga
45584ad73e Simplify get_channel_name() so it's easier for people to read and understand 2024-10-22 18:19:30 -07:00
Sam Lantinga
c134dd6e5e Fixed typo in the channel layout documentation 2024-10-22 17:46:57 -07:00
Ryan C. Gordon
4a8eadf167 include: Fixed typo in SDL_CopyFile's documentation.
Fixes https://github.com/libsdl-org/sdlwiki/issues/623
2024-10-22 20:12:04 -04:00
SDL Wiki Bot
d9e6fe0b7a Sync SDL3 wiki -> header
[ci skip]
2024-10-22 20:03:14 +00:00
Ryan C. Gordon
f5c27a3a2c render: Corrected docs for SDL_SetRenderVSync(). 2024-10-22 16:01:58 -04:00
Ivan Epifanov
1f8b9a320c VITA: fix SDL_ShowMessageBox by using different memory type 2024-10-22 12:19:33 -07:00
SDL Wiki Bot
a42c9ec5f7 Sync SDL3 wiki -> header
[ci skip]
2024-10-22 17:49:11 +00:00
Ryan C. Gordon
2318961b6f docs: Add \threadsafety to some low-hanging fruit across a few headers.
Reference Issue #7140.
2024-10-22 13:48:35 -04:00
Ryan C. Gordon
eed11ad6d6 docs: Fixed example code for SDL_qsort_r() and SDL_bsearch_r(). 2024-10-22 13:48:35 -04:00
Anonymous Maarten
0bec18245d android: fix android.content.Context:getCacheDir JNI prototype 2024-10-22 18:03:34 +02:00
Ryan C. Gordon
e9b5f6749e wikiheaders: add (disabled) code to check for missing \threadsafety tags.
Reference Issue #7140.
2024-10-22 10:48:19 -04:00
Ryan C. Gordon
19a1175c02 include: Updated docs on SDL_TouchFingerEvent.
Fixes #4159.
2024-10-22 10:41:31 -04:00
Ryan C. Gordon
e61f0678ee x11: Remove the "safety net" error handler.
This is an X11 error catcher that lived for the entire life of the program,
which causes problems in itself, but it also tries to make calls into Xlib,
which would cause further panics.

It's goal was to reset video modes if the app was going down, but it often
failed to do so, and caused potentially avoidable crashes instead.

Fixes #7975.
2024-10-22 10:41:30 -04:00
anton-kl
f9bffa31b6 docs: fix window flags in README-migration.md
Use correct SDL macro instead of invalid "flags" string.
Also add a comment about preferred approach.
2024-10-22 00:17:06 -07:00
Ryan C. Gordon
b0982e8982 docs: Updated README-emscripten.md.
This now mentions the main callbacks as a possible option, and removes the
part about prebuilt libraries. The latter can return when Emscripten packages
SDL3.

Fixes #11080.
2024-10-21 23:38:40 -04:00
Sam Lantinga
c56af0d975 Removed unused code 2024-10-21 17:26:14 -07:00
Sam Lantinga
35be8bb7f9 Fixed warning C4456: declaration of 'e' hides previous local declaration
This also fixes incorrect interpretation of OPENVR_SetupJoystckBasedOnLoadedActionManifest() return value.
2024-10-21 15:53:47 -07:00
Emmanuele Bassi
8119568805 x11: Remove text-scaling-factor setting checks
The text-scaling-factor setting is not useful, now that we watch the
Xft/DPI and Gdk/WindowScalingFactor XSETTINGS keys; on the contrary, it
is problematic in mixed environments with both the KDE and GNOME
portals, as they end up stepping on each other's toes, and we end up
with the wrong scaling factor value.

Fixes: https://github.com/libsdl-org/SDL/issues/11142
2024-10-21 15:26:22 -07:00
Sam Lantinga
1c51b8dc33 Only set the OpenGL flag if the OpenVR driver is active 2024-10-21 15:22:56 -07:00
Sam Lantinga
82b3325978 Fixed memory leaks if Windows initialization fails 2024-10-21 15:22:56 -07:00
Sam Lantinga
d199586683 Fixed memory leaks if OpenVR initialization fails 2024-10-21 15:22:56 -07:00
Sam Lantinga
7b492553c4 Allow the OpenVR driver to be enabled on Windows 2024-10-21 15:22:56 -07:00
Sam Lantinga
0aea14cf45 Added logging for additional events 2024-10-21 14:23:29 -07:00
Sam Lantinga
3d47877bb4 Added SDL_EVENT_RENDER_DEVICE_LOST
This is sent when the device is lost and can't be recovered.

Also fixed the vulkan renderer so it returns errors appropriately and will log and break if debug mode is enabled.
2024-10-21 13:28:40 -07:00
SDL Wiki Bot
54e52d055f Sync SDL3 wiki -> header
[ci skip]
2024-10-21 18:06:39 +00:00
Jordan Christiansen
9c848e08e4 docs: Explain events for already plugged in controllers (#11286) 2024-10-21 11:06:05 -07:00
Sam Lantinga
26567df878 Don't treat mouse buttons as focus clicks if the window has mouse capture
This fixes the following sequence:
* Press mouse button down
* Alt-tab away from the window
* Alt-tab back to the window
* Release mouse button

Fixes https://github.com/libsdl-org/SDL/issues/7747
2024-10-21 09:46:07 -07:00
Ryan C. Gordon
ef758d05c1 render: GetRenderViewportSize shouldn't use scale, just logical presentation.
Fixes #11076.
2024-10-21 11:17:16 -04:00
Sam Lantinga
92520c1d9b Improved D3D12 handling of unrecoverable device loss 2024-10-21 00:38:42 -07:00
Sam Lantinga
315842cf71 Fixed crashes handling D3D11/12 device lost in testsprite
You can test this using "dxcap -forcetdr"
2024-10-21 00:29:18 -07:00
Sam Lantinga
e2254b1045 Added color scale info for the GPU renderer TODO item 2024-10-20 18:38:02 -07:00
Petar Popovic
4b54e32231 Tweak android path functions comment tag \sa 2024-10-20 16:38:07 -07:00
mausimus
a6536a9298 RI_KEY_BREAK indicates key is up 2024-10-20 10:26:07 -07:00
Petar Popovic
679dd4b181 SDL_RequestAndroidPermission() comment: Add link to android permissions website 2024-10-20 10:13:03 -04:00
SDL Wiki Bot
eb1451536e Sync SDL3 wiki -> header
[ci skip]
2024-10-20 14:12:45 +00:00
Petar Popovic
5819d4b360 SDL_CreateRenderer() comment: Remove mention of flags 2024-10-20 10:12:14 -04:00
rhett-lee
e0321ca5b6 SDL3: SDL_render_gl(render name: opengl) dose not support transparent on Linux/X11 (Bug #11273) (#11274)
SDL3: SDL_render_gl(render name: opengl) dose not support transparent on Linux/X11:

Create SDL window with SDL_WINDOW_TRANSPARENT flag;
Create "opengl" renderer for the window;
The window can't shown with errors:
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 130 (MIT-SHM)
Minor opcode of failed request: 3 (X_ShmPutImage)
Bug reason:
SDL_x11window.c:490 : bool X11_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesID create_props)
SDL_x11window.c:566 : vinfo = X11_GL_GetVisual(_this, display, screen, transparent);[XVisualInfo *vinfo]
the X11_GL_GetVisual function returns a vinfo dose not support transparent.

Fix:
SDL_x11opengl.c:637 : XVisualInfo *X11_GL_GetVisual(SDL_VideoDevice *_this, Display *display, int screen, bool transparent)
X11_GL_GetVisual should returns a vinfo support transparent when transparent is true.
2024-10-19 20:21:50 -07:00
Sam Lantinga
dcbb2f11a8 Clamp the texture alpha and color modulation values to 0-255 2024-10-19 20:18:57 -07:00
Frank Praznik
541ba33714 Fix SDL_GetClosestFullscreenDisplayMode documentation
It returns false on failure, not NULL.
2024-10-19 16:01:08 -04:00
Cameron Cawley
40070d899d Refactor Blit_RGB555_ARGB1555 to be more generic 2024-10-19 11:11:22 -07:00
Ozkan Sezer
3d2c8c510d add GLES3 headers from Khronos for OpenVR video driver. 2024-10-19 10:23:55 -07:00
SDL Wiki Bot
2668558c5c Sync SDL3 wiki -> header
[ci skip]
2024-10-19 17:21:09 +00:00
Sam Lantinga
153f90a725 Revert "Use the correct return type for SDL_GetAndroidJNIEnv()"
This reverts commit 2d3fa03d53.

Different JDK implementations define JNIEnv differently for C++, so we can't provide the definition here.

Fixes:
/usr/lib/jvm/temurin-11-jdk-amd64/include/jni.h:195:17: error: conflicting declaration ‘typedef struct JNIEnv_ JNIEnv’
/home/runner/work/sdlwiki/sdlwiki/.github/../external/SDL3/include/SDL3/SDL_system.h:266:24: note: previous declaration as ‘typedef struct _JNIEnv JNIEnv’
2024-10-19 10:20:50 -07:00
Sam Lantinga
ffb1d9e4b4 Removed Blit2101010toN and BlitNto2101010
10-bit RGB formats are typically used with the PQ colorspace, which is handled by SDL_Blit_Slow.

Fixes https://github.com/libsdl-org/SDL/issues/11271
2024-10-19 10:07:53 -07:00
华仔
5c1ccaefae Fixed VULKAN_UpdateViewport judgment. 2024-10-19 09:51:12 -07:00
Frank Praznik
4c2d0c422b wayland: Remove kde_output_order_v1 support
This protocol is unstable and not intended for clients, and SDL now sorts the display list into a stable order and selects a primary display suitable for games on its own, so it isn't necessary.

Reverts e71e16950a
2024-10-19 11:16:30 -04:00
SDL Wiki Bot
5f874b60a8 Sync SDL3 wiki -> header
[ci skip]
2024-10-19 14:49:21 +00:00
Anonymous Maarten
1647d36aec docs: document copying shared SDL3 a bit more + document sanitizer/libc incompatibility 2024-10-19 14:48:51 +00:00
Ryan C. Gordon
b6a6a4a7f8 audio: fix incorrect dynCall in Emscripten audio.
This only seemed to cause problems with `-s ASYNCIFY` on the build command
line, but it was incorrect in general.

Fixes #11258.
2024-10-18 23:53:40 -04:00
Sam Lantinga
07bb8f1c4c openvr: added APIENTRY for OpenGL functions (thanks @cnlohr!) 2024-10-18 16:40:36 -07:00
Sam Lantinga
b40ad5428b Fixed assertion at quit when the debug text was the last texture used. 2024-10-18 14:51:40 -07:00
Maia
a48fa675be Fix formatting 2024-10-18 13:45:04 -07:00
Sam Lantinga
1d23d2c3c2 Renamed SDL_SANDBOX_UNKNOWN to SDL_SANDBOX_UNKNOWN_CONTAINER 2024-10-18 12:45:07 -07:00
Frank Praznik
a7da3ad59b x11: Support sorting displays via the priority hint
Store the connector name for displays and use it for sorting them according to priority, if the hint is set.
2024-10-18 13:09:08 -04:00
Frank Praznik
0faf9dc4a4 kmsdrm: Support sorting displays via the priority hint
Use the connector name for displays and sort them according to priority, if the hint is set.
2024-10-18 13:09:08 -04:00
Ozkan Sezer
a6e5ab437f video/openvr: Avoid type redefinition errors.
Also, let SDL handle stdint.h and stdbool.h.
2024-10-18 19:21:32 +03:00
SDL Wiki Bot
2654d5d48b Sync SDL3 wiki -> header
[ci skip]
2024-10-18 02:34:29 +00:00
Sam Lantinga
e81e917c5e Added an OpenVR video driver (thanks @cnlohr!) 2024-10-17 19:38:04 -07:00
Ozkan Sezer
569691797d windows/SDL_systhread.c: fix permissions 2024-10-18 05:00:04 +03:00
Sasha Szpakowski
186c6e5c9d windows: fix race condition with exception-based thread naming. 2024-10-17 18:42:01 -07:00
Sam Lantinga
faa404a652 If we get a newline character, treat it as SDLK_RETURN
Fixes https://github.com/libsdl-org/SDL/issues/10679
2024-10-17 18:18:38 -07:00
Sam Lantinga
a432abf4cc Make sure that we quit if we get a terminating event
This covers the case where the application didn't handle the quit or terminating event, we still need the main loop to finish.
2024-10-17 17:19:49 -07:00
Sam Lantinga
c5e1ae4580 Only free debug_char_texture_atlas if it has been allocated
Fixes https://github.com/libsdl-org/SDL/issues/11254
2024-10-17 17:19:49 -07:00
Sam Lantinga
00f4cb308b Fixed crash if the Vulkan renderer changes swapchain image count 2024-10-17 17:19:49 -07:00
Sam Lantinga
41366f73b2 Don't block in Android USB device open
We might be waiting a long time for a permissions dialog, so let that complete asynchronously. While that's happening, we'll remove the device from the device list so that when we get permission the application sees the device as newly available and can open it again.

Fixes https://github.com/libsdl-org/SDL/issues/6347
2024-10-17 12:02:24 -07:00
Sam Lantinga
60c3eaf5ee Use SDL_GetAndroidJNIEnv() in hid.cpp 2024-10-17 12:02:24 -07:00
Sam Lantinga
2d3fa03d53 Use the correct return type for SDL_GetAndroidJNIEnv()
This prevents application code from having to cast to JNIEnv everywhere.
2024-10-17 12:02:24 -07:00
Sam Lantinga
3d852da806 Requesting Bluetooth permission on Android is now asynchronous
This fixes an ANR at startup if gamepad input comes in while prompting for Bluetooth permissions.

Fixes https://github.com/libsdl-org/SDL/issues/6347
2024-10-17 12:02:24 -07:00
Sam Lantinga
be3d961b47 Treat clicking the right pad as a thumbstick click on a Steam Controller 2024-10-17 12:02:24 -07:00
Ivan Epifanov
6da4d94abf VITA: implement camera subsystem 2024-10-17 10:24:17 -07:00
Ivan Epifanov
f79f21217b VITA: fix yuv texture update 2024-10-17 07:53:26 -07:00
Ozkan Sezer
4612db21a3 SDL_utils.c: restrict gethostname() usage to non-windows
Reference issue: https://github.com/libsdl-org/SDL/issues/11228.
2024-10-17 12:47:02 +03:00
Daniel Ludwig
9a5420118a Define SDL_DIALOG_DUMMY in SDL_build_config_xbox.h 2024-10-17 12:45:37 +03:00
Sam Lantinga
dd955332a2 Removed SDL_build_config_emscripten.h
The Emscripten build uses cmake, so we don't need the standalone config header.

Fixes https://github.com/libsdl-org/SDL/issues/11236
2024-10-16 18:16:46 -07:00
Anonymous Maarten
5492be23a1 ci: test Apple x64 on macos-13 runner
GitHub will remove macos-12 by December 3rd, 2024.
2024-10-17 02:28:20 +02:00
SDL Wiki Bot
c48fbbb067 Sync SDL3 wiki -> header
[ci skip]
2024-10-16 23:48:38 +00:00
Sam Lantinga
c41b2bb855 SDL_ShouldIgnoreGamepad() should take product IDs rather than a guid.
This lets us early out when scanning for new hardware more quickly.
2024-10-16 16:47:29 -07:00
Sam Lantinga
8a30def5f2 Only use Steam Virtual Gamepads if we're running under Steam
Fixes https://github.com/libsdl-org/SDL/issues/11214
Fixes https://github.com/libsdl-org/SDL/issues/11215
2024-10-16 16:47:29 -07:00
Sam Lantinga
28504f5791 Steam virtual gamepad info isn't available in the macOS sandbox 2024-10-16 16:47:29 -07:00
Sam Lantinga
d6981da5a4 Added SDL_GetSandbox()
This adds support for detecting whether you're running in a sandbox on macOS
2024-10-16 16:47:29 -07:00
Sam Lantinga
d7b1ba1bfc Added support for the Steam Virtual Gamepad on macOS Sequoia 2024-10-16 16:47:29 -07:00
Ozkan Sezer
3ebfdb04be SDL_stdinc.h: provide a prototype for strdup for __clang_analyzer__ case
Because strdup is not ANSI but POSIX, and its prototype might be hidden..

... and re-enable clang-tidy in CI for LoongArch64.

Fixes:  https://github.com/libsdl-org/SDL/issues/11219.
2024-10-16 21:50:40 +03:00
Maia
d9df87f19f Fix syntax of trailing doc comments 2024-10-16 11:28:00 -07:00
Sam Lantinga
9cf388f260 Re-added HAVE_FDATASYNC and HAVE_GETHOSTNAME for platforms that have them. 2024-10-16 11:25:57 -07:00
Petar Popovic
6897385623 Add void to run_colorspace_test() function prototype 2024-10-16 11:16:42 -07:00
Anonymous Maarten
69433ee075 doc: explain build-scripts/create-release.py in the release checklist 2024-10-16 18:43:15 +02:00
Ozkan Sezer
18410c03ea cmake: fix checks for fdatasync() and gethostname() 2024-10-16 19:40:51 +03:00
Sam Lantinga
a027ec59ca Make the name of the Steam Deck Controller consistent.
It will be named "Steam Deck Controller" regardless of whether you're running under Steam.
2024-10-16 08:23:29 -07:00
Sylvain
09e3af58b5 Fixed bug #10954: software renderer: examples/renderer/10-geometry missing a triangle
typo when changing return code from int to bool
2024-10-16 16:48:05 +02:00
Ivan Epifanov
860e38a3a2 VITA: fix shader color format 2024-10-16 07:43:14 -07:00
Sam Lantinga
ed1ec236c1 Removed fdatasync and gethostname definitions from platforms that don't have them
As verified by CMake builds in CI
2024-10-16 07:39:30 -07:00
Sam Lantinga
cbbad4051b Treat a button press location as an implicit mouse move
This fixes having the incorrect location for mouse button presses on Steam Deck under gamescope. This works around a bug where the mouse motion appears to come at the next button press, and comes from the xwayland-pointer device instead of the xwayland-relative-pointer device which is delivering mouse button events.
2024-10-15 22:30:38 -07:00
Kyle Sylvestre
e5fa929245 Report win32 last error string windows_file_open (#11224) 2024-10-15 19:47:06 -07:00
SDL Wiki Bot
b4554a8a75 Sync SDL3 wiki -> header
[ci skip]
2024-10-15 22:37:00 +00:00
Sam Lantinga
97f1da73da Rename GPU properties for consistency 2024-10-15 15:36:26 -07:00
Caleb Cornett
9af5ffcfbe Improve support for private platforms (#11220) 2024-10-15 18:02:07 -04:00
Frank Praznik
66d09a1cda wayland: Adjust primary display selection priority
Portrait displays are typically used as secondaries and almost certainly not what a user wants a game or movie initially becoming full screen on if a landscape display is available. Increase the priority of selecting a landscape display over a portrait display.
2024-10-15 15:59:31 -04:00
Ozkan Sezer
638b50b69b CI, LoongArch64: disable clang-tidy
Reference issue: https://github.com/libsdl-org/SDL/issues/11219 .
2024-10-15 21:05:20 +03:00
SDL Wiki Bot
dede2ab86f Sync SDL3 wiki -> header
[ci skip]
2024-10-15 17:53:13 +00:00
Frank Praznik
553fc5fe0e wayland: Expose displays in a deterministic order, and attempt to better handle selecting a primary display.
Wayland can expose displays in any arbitrary order, and doesn't have the native concept of a primary display. However, there are games that presume that the first listed display is the primary, which can lead to problems if that output isn't necessarily the ideal one, as they may use that display to build a resolution list or as the default fullscreen output. This sorts displays by position, then attempts to find the primary display, first by querying the explicit ordering hint, then the GNOME DBus property, then tries to determine the 'best' display according to the criteria that is generally ideal for games and media playback.

The makes the list of displays deterministic, as long as the desktop configuration remains static, with a reasonably appropriate one prioritized as primary, even if there is no explicit way to retrieve the primary display. In the case where a user has a particularly esoteric physical display configuration, the new hint enables explicitly overriding the sorting and selection logic, allowing the entire display order to be customized, if necessary.
2024-10-15 13:52:35 -04:00
Anonymous Maarten
075ae7db7d ci: update LoongArch toolchain to 2023.08.08 2024-10-15 19:10:39 +02:00
Anonymous Maarten
4162bddca7 cmake: fix configuration with -DCMAKE_DISABLE_FIND_PACKAGE_PkgConfig=ON 2024-10-15 19:09:54 +02:00
Caleb Cornett
cdaaabb978 GPU: Fix Metal sampler address mode order 2024-10-15 10:46:04 -04:00
Ivan Epifanov
104dabb9de PSVITA: enable posix fsops 2024-10-15 09:04:07 -04:00
Sam Lantinga
afee27a530 Make sure stdio handles are in blocking mode
Standard I/O doesn't work well with non-blocking handles, so make sure any pipes are in blocking mode before launching child processes.

Fixes https://github.com/libsdl-org/SDL/issues/10998
2024-10-14 22:10:49 -07:00
Sam Lantinga
bb764e3106 Added support for full range BT.709 YUV conversion
Also added simple colorspace testing to testyuv.
2024-10-14 20:36:46 -07:00
SDL Wiki Bot
ce49465b13 Sync SDL3 wiki -> header
[ci skip]
2024-10-15 03:30:54 +00:00
Sam Lantinga
72bae5167e Updated documentation
Fixes https://github.com/libsdl-org/sdlwiki/issues/616
2024-10-14 20:30:22 -07:00
Ryan C. Gordon
e254c99b38 examples/game/01-snake: Update game logic in AppIterate, don't use a timer.
Reference Issue #11210.
2024-10-14 23:17:23 -04:00
Zack Middleton
edb28e79b5 Make SDL_LoadBMP() use true instead of 1 2024-10-14 20:07:03 -07:00
Zack Middleton
f212cb5f92 Don't overwrite the SDL_IOFromConstMem() error in testshape 2024-10-14 20:07:03 -07:00
Zack Middleton
51dc978785 Don't overwrite the SDL_IOFromFile() error in SDL_LoadFile() 2024-10-14 20:07:03 -07:00
Zack Middleton
fb43dc3097 Set error for NULL SDL_IOStream in SDL_LoadWAV_IO() 2024-10-14 20:07:03 -07:00
cosmonaut
00bb81de76 GPU: Allow size queries on depth formats 2024-10-14 14:28:21 -07:00
Anonymous Maarten
817fa9a975 releases: don't add static library to MinGW binary release 2024-10-14 21:30:48 +02:00
Anonymous Maarten
45dfdfbb7b Add parametrized build script
[ci skip]
2024-10-14 21:30:48 +02:00
cosmonaut
57f2577c65 GPU Vulkan: Fix depth-only framebuffer leak 2024-10-14 10:19:07 -07:00
Sam Lantinga
46835650db Added config.xcconfig to the Xcode build 2024-10-14 09:25:23 -07:00
Ozkan Sezer
9fac4b9f5f SDL_windowsmodes.c: Fix MSVC builds against SDKs older than 10.0.17134.0
workaround the missing DISPLAYCONFIG_DEVICE_INFO_GET_SDR_WHITE_LEVEL enum value
and DISPLAYCONFIG_SDR_WHITE_LEVEL struct.

Fixes: https://github.com/libsdl-org/SDL/issues/11193
Closes:  https://github.com/libsdl-org/SDL/pull/11205
2024-10-14 09:04:25 -07:00
SDL Wiki Bot
b865708039 Sync SDL3 wiki -> header
[ci skip]
2024-10-14 16:02:54 +00:00
Sam Lantinga
0b6ad8bf62 Improved the documentation for SDL_SetWindowShape()
Fixes https://github.com/libsdl-org/SDL/issues/11199
2024-10-14 09:02:04 -07:00
Sam Lantinga
f9d490045b Fixed uikit crash when GLES is disabled
Fixes https://github.com/libsdl-org/SDL/issues/11208
2024-10-14 08:58:02 -07:00
SDL Wiki Bot
3733b1d5d8 Sync SDL3 wiki -> header
[ci skip]
2024-10-14 06:46:10 +00:00
Ryan C. Gordon
c20918b0fb render: Add SDL_RenderDebugText().
Fixes #11201.
2024-10-14 02:45:33 -04:00
Ryan C. Gordon
44bc19b592 test: remove testaudio-art.txt (this info is in test/LICENSE.txt now). 2024-10-14 01:52:18 -04:00
Sam Lantinga
1cc85c912b Check return value of SDL_small_alloc()
Fixes https://github.com/libsdl-org/SDL/issues/8959
2024-10-13 14:07:26 -07:00
Sam Lantinga
d7be7fc168 Fixed Cohen-Sutherland out code computation for float line intersection
Fixes https://github.com/libsdl-org/SDL/issues/10866
2024-10-13 13:04:59 -07:00
SDL Wiki Bot
db78c0f563 Sync SDL3 wiki -> header
[ci skip]
2024-10-13 19:15:18 +00:00
Sam Lantinga
a8ca024495 Added SDL_GetDefaultLogOutputFunction()
Fixes https://github.com/libsdl-org/SDL/issues/10603
Closes https://github.com/libsdl-org/SDL/pull/11106
2024-10-13 12:14:46 -07:00
Sam Lantinga
b766c824bd Don't overwrite the SDL_IOFromFile() error in SDL_LoadBMP()
Fixes https://github.com/libsdl-org/SDL/issues/11188
2024-10-13 09:37:44 -07:00
SDL Wiki Bot
aed1f76248 Sync SDL3 wiki -> header
[ci skip]
2024-10-13 16:27:10 +00:00
Sam Lantinga
a567786762 Added SDL_SetErrorV() 2024-10-13 09:26:25 -07:00
Sam Lantinga
d5e02474ac Fixed SDL_oldnames.h to use the correct new names 2024-10-13 09:06:46 -07:00
capehill
1a1e2e9892 Set size parameter in SDL_GetClipboardData()
Update size value in case where platform uses GetClipboardText().
This should fix clipboard_testClipboardDataFunctions on those platforms.
2024-10-13 08:59:50 -07:00
Evan Hemsley
82598e5ca9 GPU Vulkan: Fix frame counter timing (#11189) 2024-10-12 22:02:22 -07:00
Anonymous Maarten
b641c2a0db Refactor gendynapi.py with the final goal to make it re-usable 2024-10-13 02:52:56 +02:00
Anonymous Maarten
173c168ff4 Default functions are already declared by the first SDL_dynapi_procs.h include 2024-10-13 02:52:56 +02:00
SDL Wiki Bot
fd9f2ae5b5 Sync SDL3 wiki -> header
[ci skip]
2024-10-13 00:14:05 +00:00
Maia
01c9c1d0eb Document main callbacks API thread safety 2024-10-12 20:13:30 -04:00
Cameron Cawley
fd9e57b71e 3DS: Support simple message boxes 2024-10-12 16:07:52 -07:00
Cameron Cawley
2bef8852fb testdrawchessboard: Allow using the standard render API 2024-10-12 16:07:16 -07:00
Rusty Moyher
7556c44796 SDL3: Fixed Cocoa_GL_CreateContext() not returning a context on success (#11181) 2024-10-12 14:01:21 -07:00
Cameron Cawley
94c8c170eb 3DS: Only bundle resources with tests that need them 2024-10-12 13:59:00 -07:00
Cameron Cawley
fec006a4f9 Allow for more fine tuning of Duff's device routines 2024-10-12 11:16:46 -07:00
Cameron Cawley
aebb64efa1 Remove leftover ARM SIMD code 2024-10-12 11:13:37 -07:00
Daniel Gibson
9a81892447 Old env vars as fallback for SDL_VIDEO_DRIVER + SDL_AUDIO_DRIVER #11115
especially SDL_VIDEODRIVER is commonly used to use the native Wayland
backend, so I think it's a good idea to keep supporting the old name
instead of forcing users to find out that they now have to add an
underscore..
Not sure how popular SDL_AUDIODRIVER is, but with all the audio backends
that exist on Linux alone I'm sure some people use it to work around
sound issues.

Note: Doing this in the SDL_hints implementation instead of the
call-sites of SDL_GetHint(SDL_HINT_VIDEO_DRIVER) etc ensures that
1. Hint priorities work (env var overriding hint set by application with normal
   priority, but not when application used SDL_HINT_OVERRIDE)
2. SDL_ResetHint() (called by user code) respects the fallback
   environment variable
2024-10-12 08:47:02 -07:00
Cameron Cawley
3e57d996fe Reduce the size of the SDL_blit_0 alpha code 2024-10-12 08:29:11 -07:00
Semphris
05c53b5ab0 Add macro guards for OpenGL <=1.3 function prototypes
- `#define SDL_OPENGL_1_NO_PROTOTYPES` to hide function prototypes
- `#define SDL_OPENGL_1_FUNCTION_TYPEDEFS` to add PFNGL*PROC function types
2024-10-12 11:21:07 -04:00
SDL Wiki Bot
365dba6de8 Sync SDL3 wiki -> header
[ci skip]
2024-10-12 15:08:54 +00:00
Zack Middleton
4898cbb6cf SDL_migration.cocci: Fix renaming SDL_bool 2024-10-12 00:47:04 -07:00
rhett-lee
22566506d0 SDL3: opengles2 render not support window with transparent flag on Linux/X11 (#11167) 2024-10-11 21:59:56 -07:00
Sam Lantinga
c6c195ff88 Always use WaitForSingleObjectEx() as a fallback in SDL_SYS_DelayNS()
That logic isn't specific to the Visual Studio build environment. Also switched it to use CreateEvent(), which works back to Windows XP.
2024-10-11 21:18:31 -07:00
Sam Lantinga
c5904d8710 Improved implementation of SDL_DelayPrecise() (thanks @nightmareci!)
Fixes https://github.com/libsdl-org/SDL/issues/10592
2024-10-11 21:18:31 -07:00
Sam Lantinga
25251a9405 Fixed warning C4723: potential divide by 0 2024-10-11 19:31:22 -07:00
Daniel Gibson
33366b0a4e Fix SDL_MAIN_USE_CALLBACKS with Android, introduce SDL_MAIN_EXPORTED
My simplification of the conditions for including SDL_main_impl.h
had one problem: I forgot that SDL_main_impl.h must be included
even on Android when SDL_MAIN_USE_CALLBACKS is used, because then a
SDL_main() function that makes sure the callbacks get called is needed,
and that function is implemented in SDL_main_impl.h

But OTOH, even when SDL_MAIN_USE_CALLBACKS is used, SDL_main_impl.h
should not implement a standard `int main(...)` function on Android
(because there the SDL-using native code is compiled as a library and
 the entry point is in SDLActivity.java, which calls SDL_main()
 in said library).

So the check for platforms that don't have *any* native main function
but just SDL_main() called from the outside should be handled in
SDL_main_impl.h, so both the normal and the callback case can avoid
generating a standard main() in the same way.
To do this, SDL_MAIN_EXPORTED is defined for platforms like Android,
where the real entry point (main() function) is outside of the code
that uses SDL, so
- SDL_main() must be visibly exported with SDL_DECLSPEC, so the outside
  code can call it
- SDL_main_impl.h must not implement a "real" main() function

Another small change based on this is defining SDLMAIN_DECLSPEC
at a more general place.

If another platform like Android (where the entry point is somewhere
else entirely, possibly implemented in a different programming language)
turns up, defining SDL_MAIN_NEEDED (so the users main() is renamed
to SDL_main()) and SDL_MAIN_EXPORTED should be all that's needed on the
SDL_main.h side - and if not then at least the implementation is
cleaner and clearer now, IMHO.

fixes #11162
2024-10-11 18:54:29 -07:00
Andrei Rafael Brongel
86ef790a23 explicit cast to int in SDL_bits 2024-10-11 18:52:06 -07:00
Sam Lantinga
3cd7e22e8b Fixed converting full range YUV to RGB
Updated from https://kdashg.github.io/misc/colors/from-coeffs.html

I'm not sure where the other formulas came from, but they weren't mathematically correct and resulted in slightly incorrect colors.
2024-10-11 18:12:05 -07:00
Petar Popovic
3086b25c4e Set hint SDL_HINT_MAC_SCROLL_MOMENTUM version to SDL 3.1.4. 2024-10-11 17:33:52 -07:00
SDL Wiki Bot
b676413657 Sync SDL3 wiki -> header
[ci skip]
2024-10-11 20:51:42 +00:00
expikr
48ff3efdb9 Clarify README-highdpi.md (#10083) 2024-10-11 13:50:37 -07:00
SDL Wiki Bot
e31c68427a Sync SDL3 wiki -> header
[ci skip]
2024-10-10 23:35:37 +00:00
Evan Hemsley
6ea4a66451 GPU: Add SDL_CalculateGPUTextureFormatSize (#11146)
---------

Co-authored-by: Sam Lantinga <slouken@libsdl.org>
2024-10-10 16:34:38 -07:00
Petar Popovic
6d85127560 Rename hint string literal SDL_HINT_MAC_SCROLL_MOMENTUM 2024-10-10 16:16:36 -07:00
Caleb Cornett
3db10a6b2c GPU: ASTC block size fixes (#11157) 2024-10-10 15:40:21 -07:00
Ryan C. Gordon
90a3a2359b thread: Rewrote generic Condition Variables.
This replaces the internal mutex with a semaphore, so we're only using a
single synchronization primitive to implement this, and cleans up some logic
around wait timeouts.

This now matches the logic of the originally cited work, from BeOS.

Fixes #3639.

(I think.)
2024-10-10 15:03:53 -04:00
Ozkan Sezer
41dfe2c246 test/testautomation_stdlib.c: fix gcc warning on 32 bit
test/testautomation_stdlib.c:361: warning: integer constant is too large for 'long' type
2024-10-10 21:10:24 +03:00
Sam Lantinga
73b995fbad Don't assume OpenGL on Android
This prevents Vulkan from initializing by default.

Fixes https://github.com/libsdl-org/SDL/issues/10279
2024-10-10 10:53:31 -07:00
SDL Wiki Bot
8aaaeb7560 Sync SDL3 wiki -> header
[ci skip]
2024-10-10 17:02:43 +00:00
SDL Wiki Bot
2a9cb68b91 Sync SDL3 wiki -> header
[ci skip]
2024-10-10 16:43:29 +00:00
Ryan C. Gordon
0babb284dd fnsince.pl: Make fixes now that we've reached ABI lock.
Turns out history is messy, thank god for Perl.  :)

Fixes #11156.
2024-10-10 12:41:46 -04:00
Frank Praznik
40ff6a2785 test: Fix mouse focus test on X11
X11 seems to need a slight delay before warping the pointer to ensure that the window is actually fully visible on the desktop, or the pointer enter event may not be sent.

This also disables the warp focus test on XWayland, as warping the mouse cursor when outside the window on any Wayland desktop usually just doesn't work.
2024-10-10 11:37:45 -04:00
SDL Wiki Bot
e4b1a9f382 Sync SDL3 wiki -> header
[ci skip]
2024-10-10 15:24:38 +00:00
Ozkan Sezer
7ff819141d libm/e_exp.c: fix gcc warning on 32 bit:
src/libm/e_exp.c:105: warning: integer constant is too large for 'long' type
2024-10-10 18:23:20 +03:00
SDL Wiki Bot
ac6b9e2d19 Sync SDL3 wiki -> header
[ci skip]
2024-10-10 15:06:56 +00:00
Sam Lantinga
8262072d91 Fixed possible memset(NULL) call in testautomation's SDL_aligned_alloc() check
Fixes https://github.com/libsdl-org/SDL/issues/11144
2024-10-10 08:06:18 -07:00
Sam Lantinga
4b7c5f561b Fixed warning: ‘new_item.probe_len’ may be used uninitialized in this function 2024-10-10 08:06:18 -07:00
Sam Lantinga
c8f5f6d47a Added SDL_DelayPrecise()
SDL_DelayNS() now passes through to the high precision OS delay function, and SDL_DelayPrecise() tries to busy wait to get as close as possible to the desired wait time.

Fixes https://github.com/libsdl-org/SDL/issues/11141
2024-10-10 08:06:18 -07:00
Sam Lantinga
28a70a5b71 Use the correct version for the \since field 2024-10-10 08:06:18 -07:00
Anthony
bf351b0b0e Add more configChanges to Android Manifest (#11145)
The addition of layoutDirection is required to prevent the forced restart due to a locale change. Also adding grammaticalGender, fontWeightAdjustment & fontScale for good measure.
2024-10-10 07:53:34 -07:00
David Gow
9c322386bf gpu: vulkan: Fix an uninitialised structure in SDL_BlitGPUTexture()
The SDL_GPUColorTargetInfo structure needs to be zeroed, as otherwise we
can end up trying to create a resolve_texture which doesn't exist,
causing a rather difficult-to-debug segfault when calling
SDL_BlitGPUTexture() with a load op of SDL_GPU_LOADOP_CLEAR.
2024-10-10 07:16:02 -07:00
Evan Hemsley
da5a1585cd GPU: Avoid calling SDL_GetWindowSizeInPixels when possible (#11139) 2024-10-09 18:59:07 -07:00
SDL Wiki Bot
4707bb730e Sync SDL3 wiki -> header
[ci skip]
2024-10-10 00:32:39 +00:00
Sam Lantinga
9023a199dd Fixed crash in RLE colorkey blitting
Fixes Maelstrom running over sdl2-compat with SDL3
2024-10-09 12:11:21 -07:00
Sam Lantinga
f946f87f30 Don't rely on event.buttonMask being set in touchesEnded
Fixes https://github.com/libsdl-org/SDL/issues/11131
2024-10-09 11:35:39 -07:00
Sam Lantinga
ee9b6204cf Updated to version 3.1.5 for development
We should bump the version immediately before and after release so the release version corresponds to a fixed snapshot of code.
2024-10-09 11:02:01 -07:00
SDL Wiki Bot
02f3a96476 Sync SDL3 wiki -> header
[ci skip]
2024-10-09 16:49:57 +00:00
Sam Lantinga
f8eac30276 Added SDL_StepBackUTF8() 2024-10-09 09:49:10 -07:00
Sam Lantinga
1f08a03794 Switched drag-n-drop logging to trace level
The logging is extremely verbose and covers the entire data exchange process, which is more suited to the trace level.
2024-10-09 07:35:21 -07:00
Daniel Ludwig
5b6342a00d Default SDL_HINT_JOYSTICK_GAMEINPUT to "1" on GDK platforms 2024-10-09 07:30:13 -07:00
Daniel Ludwig
ed87e7e434 test: enable GameInput driver on GDK platforms
By default, it's the only driver available on Xbox, but disabled.
2024-10-09 07:30:13 -07:00
Daniel Ludwig
acb18e05b5 GPU: fix swapchain buffer size not set on Xbox 2024-10-09 07:30:13 -07:00
Sam Lantinga
ff834f7733 Removed the restrict keyword
It doesn't compile with older Visual Studio and I verified on godbolt.org that the way it was used here doesn't impact code generation at all.
2024-10-08 20:48:13 -07:00
Delta
8e6ead2f7b [GPU] Added ASTC texture format support (#11116) 2024-10-08 18:45:04 -04:00
Ryan C. Gordon
02434cd293 emscripten: Fixes for data addresses above 2gb
This includes both wasm64 and wasm32 when addressing more than 2gb of memory.

Fixes: #9052

(Manually cherry-picked from 3deb07ea395373204462130c1e062bc1f71fe060.)
2024-10-08 17:41:18 -04:00
Sam Lantinga
c34790f9f1 Fixed spacing 2024-10-08 11:49:08 -07:00
Daniel Gibson
312ecc4a52 SDL_main.h: Remove dead code for hypothetical C++ platforms
If WinRT returns after all, or a similarly bad platforms turns up,
the code can still be found in the git history.
But keep in mind that it then will have to be added *before* the
 #if ( defined(SDL_MAIN_USE_CALLBACKS) || defined(SDL_MAIN_NEEDED) ...
case for platforms that support plain C to work correctly
2024-10-08 11:47:33 -07:00
Daniel Gibson
823b218051 Simplify code to include SDL_main_impl.h in SDL_main.h
Basically all platforms where SDL_main.h renames main() to SDL_main()
use the platform-specific main() (or WinMain() or whatever)
implementations in SDL_main_impl.h - and that renaming is enabled with:
  #if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE) \
      || defined(SDL_MAIN_USE_CALLBACKS)
    #define main SDL_main
  #endif

The only exception is Android, where main() *is* renamed, but
SDL_main_impl.h isn't used, because SDL_main() is called from Java.

So I think it's cleaner and less error-prone (for adding additional
platforms that need SDL_main() in the future), to use the same check
for including SDL_main_impl.h as is used for `#define main SDL_main`
and only list the exceptions (currently Android) there explicitly.

If new platforms like Android turn up, they can easily be added there
by inserting "|| defined(SDL_PLATFORM_WEIRDPLATFORM)" right next
to the Android check.

See also https://github.com/libsdl-org/SDL/issues/11068#issuecomment-2399907535
2024-10-08 11:47:33 -07:00
Ryan C. Gordon
cba77834f2 init: Log '<unspecified>' not '(null)' if the app name isn't set.
Reference PR #11103.
2024-10-08 14:30:55 -04:00
Simon McVittie
fb8244d6d9 init: Also log the SDL revision here
This includes the version number, unless the developer is doing
something strange with git tags.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-08 14:29:02 -04:00
Simon McVittie
c24f7d2453 Log app ID as SYSTEM/INFO during initialization
This is not shown by default, but will be shown when using
SDL_LOGGING=system=info or higher, where it will hopefully nudge app
authors towards initializing this information.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-08 14:29:02 -04:00
Sam Lantinga
e7ee92e822 Switched drag-n-drop logging to trace level
The logging is extremely verbose and covers the entire data exchange process, which is more suited to the trace level.
2024-10-08 10:56:27 -07:00
SDL Wiki Bot
d9f8474dd7 Sync SDL3 wiki -> header
[ci skip]
2024-10-08 17:38:17 +00:00
SDL Wiki Bot
95aaaa3232 Sync SDL3 wiki -> header
[ci skip]
2024-10-08 17:06:41 +00:00
Frank Praznik
158ba93d61 Update some window function documentation
Updates some documentation to correspond with changes made since it was originally written, clarifies some function behavior, and includes some assorted typo fixes.
2024-10-08 13:05:20 -04:00
Sam Lantinga
300daf308a Replace SDL_TRUE/FALSE with true/false in the coccinelle script 2024-10-08 09:55:50 -07:00
Anonymous Maarten
95ab38ba15 ci: actions/cache might return a boolean as string
https://github.com/actions/cache/issues/1466
2024-10-08 18:53:29 +02:00
SDL Wiki Bot
7acfdfd3e7 Sync SDL3 wiki -> header
[ci skip]
2024-10-08 16:50:41 +00:00
SDL Wiki Bot
326ab439d7 Sync SDL3 wiki -> header
[ci skip]
2024-10-08 15:09:24 +00:00
Sam Lantinga
fb07ab91c6 Improved SDL_main documentation and remove extern "C" comment.
It turns out that this is incorrect and any C linkage is already taken care of by SDL when redefining SDL_main.

Fixes https://github.com/libsdl-org/SDL/issues/11068
2024-10-08 08:07:54 -07:00
SDL Wiki Bot
03fa9ff0b0 Sync SDL3 wiki -> header
[ci skip]
2024-10-08 13:59:10 +00:00
Sam Lantinga
2000ccb541 Allow linear interpolation of the font textures
With the recent changes to logical presentation, this is necessary for the font to look good when scaled.

Fixes https://github.com/libsdl-org/SDL/issues/11123
2024-10-07 21:43:57 -07:00
Sam Lantinga
f6fa617139 Define SDL_DIALOG_DUMMY in SDL_build_config.h as needed 2024-10-07 19:52:50 -07:00
Sam Lantinga
4627283eca Allow building both Cocoa and dummy dialog implementations
This allows us to remove platformFilters from the Xcode project, which is not supported in Xcode 12.
2024-10-07 18:01:39 -07:00
Sam Lantinga
c8526532de Changed objectVersion to 54 so Xcode 12 can load the projects (thanks @Wohlstand!) 2024-10-07 18:01:39 -07:00
Frank Praznik
2fd12b2e8a keyboard: Note that enabling text input can also enable an IME
An active IME can potentially eat key events, particularly dead keys and parts of a compose sequence, so note this behavior in the documentation.
2024-10-07 19:21:34 -04:00
Sam Lantinga
81b48de3f5 Fixed VID/PID list parsing of SDL_HINT_GAMECONTROLLER_SENSOR_FUSION
Fixes https://github.com/libsdl-org/SDL/issues/11118
2024-10-07 16:14:57 -07:00
Sam Lantinga
5db64300b8 Fixed SDL_GetStringInteger() for values starting with '0' and '1' (thanks @DanielGibson!) 2024-10-07 15:53:38 -07:00
Sam Lantinga
7da728a642 Added support for wired XBox controllers on macOS 15.0 Sequoia
Fixes https://github.com/libsdl-org/SDL/issues/11002
2024-10-07 15:44:42 -07:00
Ryan C. Gordon
659f2f4b04 examples: add basic app metadata to all existing examples. 2024-10-07 17:41:15 -04:00
Ryan C. Gordon
aa534c3ac3 core: Fixed incorrect comment in core/windows/SDL_windows.h. 2024-10-07 16:55:30 -04:00
Simon McVittie
ee7f61fd9a snake: Add extended app metadata
All of these are optional, but nice-to-have, and we have reasonable
values available for all of them.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-07 16:47:36 -04:00
Simon McVittie
ca82405d5a snake: Add basic app metadata
All SDL3 applications and games should ideally have this.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-07 16:47:36 -04:00
rabbit-ecl
6ae5666acf Check for VK_SUBOPTIMAL_KHR also in vkQueuePresentKHR (#11113)
This is already handled for vkAcquireNextImageKHR.
2024-10-07 13:01:10 -07:00
Sam Lantinga
06bd214af6 Fixed warnings building on Android 2024-10-07 11:11:27 -07:00
Green Sky
596fcfa6c4 fix microphone permission and feature flags being spread out 2024-10-07 10:10:18 -07:00
Naman Dixit
54e622c2e6 Use the printf vararg verification macros when compiling with clang 2024-10-06 22:19:52 -07:00
Ryan C. Gordon
fca05fa754 examples: Use SDL_Log() instead of message boxes for errors.
Fixes #11094.
2024-10-06 22:38:04 -04:00
Ryan C. Gordon
9f170286ba test: Replace README with LICENSE.txt
Fixes #11097.
2024-10-06 19:05:18 -04:00
SDL Wiki Bot
d0ef58b442 Sync SDL3 wiki -> header
[ci skip]
2024-10-06 23:03:29 +00:00
SDL Wiki Bot
cbb9a16367 Sync SDL3 wiki -> header
'[ci skip]'
2024-10-06 22:58:06 +00:00
Sam Lantinga
65539bc4f7 Make sure trackpad state is updated when button presses are delivered
Fixes https://github.com/libsdl-org/SDL/issues/11085
2024-10-06 14:28:06 -07:00
Sam Lantinga
03b259893a Fixed return value of SDL_AddGamepadMapping()
Fixes https://github.com/libsdl-org/SDL/issues/11095
2024-10-06 14:20:30 -07:00
Jan Sedivy
bf54eddba9 macOS: Clarify when macOS hints need to be set 2024-10-06 12:36:42 -07:00
Jan Sedivy
c2b98e21ba macOS: Add hint for smooth SDL_EVENT_MOUSE_WHEEL values 2024-10-06 12:36:42 -07:00
Frank Praznik
2fa8acb084 x11: Refresh the global cursor coordinates when confining the pointer
XGrabPointer can warp the cursor into the window when confining, so set the flag to refresh the global coordinates when queried.
2024-10-06 14:48:24 -04:00
SDL Wiki Bot
e59078ac6f Sync SDL3 wiki -> header 2024-10-06 18:31:17 +00:00
Ryan C. Gordon
9e74ada7b8 gpu: fixed formatting in docs. 2024-10-06 14:30:07 -04:00
Sam Lantinga
c358bf3f9b Removed test program list, it's better to just look at the code.
Fixes https://github.com/libsdl-org/SDL/issues/9399
2024-10-06 11:28:29 -07:00
Sam Lantinga
f8dd73fdb9 Fixed build 2024-10-06 08:42:00 -07:00
Sam Lantinga
0f47d3a77b Fixed use after free (thanks @meyraud705!)
Fixes https://github.com/libsdl-org/SDL/issues/11090
2024-10-06 08:34:35 -07:00
capehill
e159bcf5de test: Make blit_testExampleApplicationRender work on big endian
Changed image data pixel format to BGRA32.
2024-10-06 08:27:58 -07:00
Frank Praznik
c9ffa3f9e1 Remove vestiges of the TAKE_FOCUS window event
The event was removed, so remove the rename define and update the coccinelle script.
2024-10-06 10:02:53 -04:00
Sam Lantinga
596ef1ba2e Moved the SDL_ttf IME demo to showfont in the SDL_ttf project 2024-10-06 00:24:01 -07:00
David Fort
e00b1fdd67 clipboard: include mime types in SDL_ClipboarUpdate
This patch modifies the clipboard handling so that when we receive an external
clipboard update, the suppported mime types are included in the SDL_ClipboarUpdate
event. The patch also introduces the owner field that allows to know if the update
is because we own the clipboard (internal update) or if it was an external update.
2024-10-05 18:19:10 -07:00
bubbleguuum
2880b40e33 fix pipewire prototype 2024-10-05 18:16:12 -07:00
Petar Popovic
b6ab7d28f6 Replaced \r\n with \n in SDL root files 2024-10-05 18:15:02 -07:00
Sam Lantinga
b8e72b0969 Note that creating a renderer will fail if the preferred renderer isn't available.
Fixes https://github.com/libsdl-org/SDL/issues/11077
2024-10-05 09:55:26 -07:00
zshoals
1ca45c5891 Fix typo: DiretMedia->DirectMedia 2024-10-05 00:08:01 -04:00
Sam Lantinga
8db3b47482 Just use normal stdio for the child process
Make sure we flush all output so it's seen by the parent as it happens.
2024-10-04 14:13:52 -07:00
Ryan C. Gordon
8c3f88b495 docs: Wrote CategoryVulkan. 2024-10-04 16:55:50 -04:00
SDL Wiki Bot
369b93771b Sync SDL3 wiki -> header 2024-10-04 20:38:03 +00:00
SDL Wiki Bot
deeffaa8d6 Sync SDL3 wiki -> header 2024-10-04 20:36:26 +00:00
Ryan C. Gordon
84ecf7fd3e docs: Add CategorySurface text. 2024-10-04 16:35:49 -04:00
SDL Wiki Bot
e292d1f5ac Sync SDL3 wiki -> header 2024-10-04 20:27:58 +00:00
Sam Lantinga
d5af0c7e09 Added missing parentheses 2024-10-04 13:27:13 -07:00
SDL Wiki Bot
5a60d073c0 Sync SDL3 wiki -> header 2024-10-04 20:24:40 +00:00
SDL Wiki Bot
a3413e050b Sync SDL3 wiki -> header 2024-10-04 20:23:29 +00:00
Ryan C. Gordon
c25423b94c docs: Filled in some category pages. 2024-10-04 16:22:00 -04:00
Sam Lantinga
a57ecad648 Fixed documentation typos 2024-10-04 13:04:27 -07:00
SDL Wiki Bot
37315110c1 Sync SDL3 wiki -> header 2024-10-04 19:50:14 +00:00
Anonymous Maarten
f26dd52090 SDL_GetProcessProperties is missing a SDLCALL 2024-10-04 21:48:27 +02:00
Ryan C. Gordon
d318a4a6b1 .wikiheaders-options: Declare SDL3 to be a stable API! 2024-10-04 15:38:32 -04:00
SDL Wiki Bot
64cbf02dbf Sync SDL3 wiki -> header 2024-10-04 19:35:00 +00:00
Ryan C. Gordon
ffe4e571d1 wikiheaders: regex hack to make a URL not confuse wikilink genertion. 2024-10-04 15:34:18 -04:00
SDL Wiki Bot
a7e4e9219a Sync SDL3 wiki -> header 2024-10-04 19:29:06 +00:00
cosmonaut
e8c852d77c GPU: re-add parens to wiki intro 2024-10-04 12:28:05 -07:00
Sam Lantinga
00385951a1 Use file descriptor I/O for process pipes
Use low level non-blocking I/O for process pipe streams. This may fix issues with data not getting through the pipe occasionally.

Related: https://github.com/libsdl-org/SDL/issues/11006
2024-10-04 12:24:17 -07:00
SDL Wiki Bot
f592a35439 Sync SDL3 wiki -> header 2024-10-04 18:32:44 +00:00
cosmonaut
12d007038c GPU: wiki header link typo 2024-10-04 11:31:52 -07:00
SDL Wiki Bot
f275731e18 Sync SDL3 wiki -> header 2024-10-04 18:30:06 +00:00
cosmonaut
f3285b01c8 GPU: Intro fixes 2024-10-04 11:29:27 -07:00
SDL Wiki Bot
93c7521dd5 Sync SDL3 wiki -> header 2024-10-04 18:22:19 +00:00
Evan Hemsley
c1084bfaa3 GPU Introduction (#11062) 2024-10-04 11:21:36 -07:00
cosmonaut
21e7fa45e8 GPU: fix padding field typo 2024-10-04 10:45:47 -07:00
Anonymous Maarten
bd4cd34a74 Add docs to mingw development archive 2024-10-04 18:19:07 +02:00
SDL Wiki Bot
f859d69c44 Sync SDL3 wiki -> header 2024-10-04 16:14:38 +00:00
Sam Lantinga
6c64c62114 Rename SDL_BUTTON() to SDL_BUTTON_MASK()
Fixes https://github.com/libsdl-org/SDL/issues/11056
2024-10-04 09:13:59 -07:00
SDL Wiki Bot
d529407ce7 Sync SDL3 wiki -> header 2024-10-04 15:58:03 +00:00
Sam Lantinga
fe2880fcda Rename SDL_SetThreadPriority() to SDL_SetCurrentThreadPriority()
Fixes https://github.com/libsdl-org/SDL/issues/11055
2024-10-04 08:57:03 -07:00
Daniel Ludwig
69196ab30d Change evasive library handle to SDL_SharedObject* 2024-10-04 05:18:40 -04:00
Ryan C. Gordon
3a6a3ab64f gpu: Fix memory leak in Vulkan backend. 2024-10-04 04:46:28 -04:00
Sam Lantinga
43e7ce7dfc Updated to version 3.1.3 for the preview release 2024-10-03 23:01:55 -07:00
SDL Wiki Bot
ca0b1eaf5a Sync SDL3 wiki -> header 2024-10-04 05:54:33 +00:00
Sam Lantinga
93c27a6675 Fixed the documentation for consistency. 2024-10-03 22:54:05 -07:00
SDL Wiki Bot
3ae2af8aa1 Sync SDL3 wiki -> header 2024-10-04 05:53:50 +00:00
Ryan C. Gordon
9a5d5a2839 video: Improve the EGL attribute callbacks.
Now it has access to information it needs and it's clear who is reponsible
for memory management.

Fixes #11039.
2024-10-03 22:52:52 -07:00
Petar Popovic
d4143e02d1 Always set checked_monotonic_time when calling CheckMonotonicTime() 2024-10-03 17:11:34 -07:00
Petar Popovic
020fb6889c Removed unnecessary const-qualifiers in src and test files 2024-10-03 17:39:08 -04:00
Petar Popovic
b8e8dcaa9a Add void to openbsd function prototypes 2024-10-03 13:55:21 -07:00
Petar Popovic
0e909d2785 Removed redundant condition in src/events/SDL_pen.c 2024-10-03 13:42:18 -07:00
Ryan C. Gordon
191f3ecbbc render: Restore previous policy for converting window/render coordinates.
Before this commit, it would adjust for the logical presentation settings.
Now, it works as it did before the logical presentation render target was
removed: it takes current viewport and scale into account, as well.

Fixes #10978.
2024-10-03 16:31:56 -04:00
Petar Popovic
3246df8bd3 Remove redundant SDL_Vulkan_GetResultString() declaration 2024-10-03 13:29:53 -07:00
Frank Praznik
07fd88d241 docs: Fix migration documentation for SDL_WINDOWEVENT_SIZE_CHANGED
Mark the event as removed as there is no true direct mapping in SDL3, and inform clients that they should handle the explicit SDL_EVENT_WINDOW_RESIZED and SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED events instead.
2024-10-03 12:34:26 -04:00
Ethan Lee
a0de6c4abf Add properties to SDL_IOStreams returned by IOFromMem 2024-10-02 22:09:09 -07:00
Ryan C. Gordon
1bb7e2b1a8 SDL_migration.cocci: Removed obsolete SDL_CreateWindowWithPosition code.
This won't handle conversion of SDL_CreateWindow calls with arbitrary
positions, but it still will handle the common UNDEFINED scenario.

Fixes #11035.
2024-10-03 01:01:34 -04:00
Petar Popovic
f4cea5e019 Removed const qualifiers from SDL_CreateHashTable() parameter types 2024-10-02 16:29:49 -07:00
Ryan C. Gordon
d287feaddf render: Remove non-pointer args' const qualifiers on SDL_RenderTextureRotated.
Reference Issue #11032.
2024-10-02 15:31:20 -04:00
SDL Wiki Bot
e3757f072b Sync SDL3 wiki -> header 2024-10-02 19:28:35 +00:00
Ryan C. Gordon
8b4f5f09c1 dynapi: It's a Python script now, not a perl script.
Fixes #11032.
2024-10-02 15:27:47 -04:00
Ryan C. Gordon
35b002be82 audio: Clarified SDL_GetAudioStreamQueued docs. 2024-10-02 15:27:46 -04:00
Sam Lantinga
47450425fd Allow iterating just the keys or values in a hashtable 2024-10-02 10:20:00 -07:00
Sam Lantinga
d5fe6dd627 Don't use const for non-pointer API parameters 2024-10-02 09:17:31 -04:00
Ryan C. Gordon
d2b2a752ce SDL_migration.cocci: A few fixes. 2024-10-02 00:56:21 -04:00
Sam Lantinga
91b074beb7 Removed SDL_IPHONE_MAX_GFORCE
We no longer support interpreting the accelerometer as a joystick.

Fixes https://github.com/libsdl-org/SDL/issues/11005
2024-10-01 18:00:22 -07:00
SDL Wiki Bot
34033d5838 Sync SDL3 wiki -> header 2024-10-01 18:45:52 +00:00
Sam Lantinga
eced9f58a9 Added a userdata parameter for EGL attribute callbacks
Fixes https://github.com/libsdl-org/SDL/issues/11013
2024-10-01 11:45:19 -07:00
SDL Wiki Bot
798c9574d0 Sync SDL3 wiki -> header 2024-10-01 17:46:16 +00:00
Sam Lantinga
89e68aa801 Added missing return value documentation for bsearch() 2024-10-01 10:45:32 -07:00
Sam Lantinga
4fa92d233d Include stdbool.h when using Visual Studio 2017+
Also cleaned up some incorrect return values from bool functions.
2024-10-01 09:57:59 -07:00
Frank Praznik
522321b7c9 test: Fix testcustomcursor on high-DPI displays
Use the backbuffer dimensions and scale the chessboard pattern to draw it filling the window on scaled displays.
2024-10-01 12:40:17 -04:00
Sam Lantinga
3b3c4a79b6 Don't close file descriptors already handled by AddFileDescriptorCloseActions()
Fixes https://github.com/libsdl-org/SDL/issues/10997
2024-10-01 09:32:14 -07:00
Anthony
5f5379dc99 Add SDL_IsTV() (#11004)
Moved SDL_IsAndroidTV() out of public API, to match SDL_IsAndroidTablet().

Added SDL_IsTV(), to mirror existing SDL_IsTablet().
2024-10-01 09:20:00 -07:00
SDL Wiki Bot
6bcf2f919a Sync SDL3 wiki -> header 2024-10-01 16:16:44 +00:00
Ryan C. Gordon
0b5e01a305 loadso: library handles are now SDL_SharedObject* instead of void*.
Improved the SDL_loadso.h documentation a little, too.

Fixes #11009.
2024-10-01 12:16:10 -04:00
SDL Wiki Bot
f351395c46 Sync SDL3 wiki -> header 2024-10-01 15:10:40 +00:00
Sam Lantinga
3234a3b902 Simplified internal SDL_Surface structure 2024-10-01 08:10:04 -07:00
Sam Lantinga
1f3a0d12e6 Made texture size and format public in the API
Also added refcount to textures so they can be retained by application code.
2024-10-01 08:10:04 -07:00
Ryan C. Gordon
5136b30652 render: SDL_ConvertEventToRenderCoordinates() now handles pen events.
Reference Issue #10863.
2024-10-01 10:30:36 -04:00
Ryan C. Gordon
b4fcd1f345 pen: Corrected some documentation.
Fixes #10863.
2024-10-01 10:24:17 -04:00
Sam Lantinga
e3dbd74fe7 Improved documentation for SDL_Surface fields 2024-09-30 21:34:00 -07:00
Ozkan Sezer
13c5d1092f hidapi: update hid_write() for windows from mainstream.
Returns bytes_written if WriteFile returns synchronously
Relevant mainstream discussions:
	https://github.com/libusb/hidapi/pull/697
	https://github.com/libusb/hidapi/issues/695
2024-09-30 19:49:44 -07:00
cosmonaut
3eab599977 just force the barrier on UpdateTexture actually 2024-09-30 19:47:27 -07:00
cosmonaut
e17741a6cb Render GPU: Only cycle on update if entire texture is replaced 2024-09-30 19:47:27 -07:00
Sam Lantinga
45ad763de5 Disable backface culling and use a constant rectangle winding order.
This makes it so we don't have to surface the rectangle winding order for applications that want to use the raw geometry API.
2024-09-30 19:12:02 -07:00
cosmonaut
fa14b53273 GPU Vulkan: Clear up some swapchain edge cases 2024-09-30 15:10:27 -07:00
SDL Wiki Bot
c16d7c87d6 Sync SDL3 wiki -> header 2024-09-30 18:18:49 +00:00
Sam Lantinga
ab832f1be0 Added documentation for qsort and bsearch functions 2024-09-30 11:18:17 -07:00
David Fort
818d7d892a x11: store all atoms in a specific struct 2024-09-30 11:13:08 -07:00
David Fort
801870c8cf video: cache some more atoms under X11
This patch adds the caching of some atoms used by the clipboard.
2024-09-30 11:13:08 -07:00
SDL Wiki Bot
dcc7560a5c Sync SDL3 wiki -> header 2024-09-30 17:23:50 +00:00
Evan Hemsley
afdf325fb4 GPU: Add swapchain dimension out params (#11003) 2024-09-30 10:23:19 -07:00
Anonymous Maarten
b3388d5753 Haiku does not have fdatasync, but has fsync
https://dev.haiku-os.org/ticket/17378
2024-09-30 15:10:03 +02:00
Anonymous Maarten
396afa2117 ci: bump haiku to r1beta5 2024-09-30 15:10:03 +02:00
Sam Lantinga
0b64520997 hashtable: fixed unused-parameter warnings
These show up with -Wextra when dropped into other projects.
2024-09-29 23:56:43 -07:00
Ryan C. Gordon
1787d6ca5c main: SDL_AppQuit() now reports the result value.
Fixes #10994.
2024-09-29 23:24:04 -04:00
Ryan C. Gordon
6a7f8b74f1 filesystem: SDL_GlobDirectory shouldn't strip final '/' if the path is "/".
This is common on Emscripten, where the base directory is "/".
2024-09-29 23:09:04 -04:00
Anonymous Maarten
7241dd9ec3 Add more SDL_Process tests 2024-09-30 03:03:33 +02:00
Anonymous Maarten
f6055432c8 Fix null-pointer dereference on failing SDL_SYS_CreateProcess 2024-09-30 03:03:33 +02:00
Anonymous Maarten
e9bfa5bf6a Mitigate BatBadBut vulnerability 2024-09-30 03:03:33 +02:00
RT2
06e122103c Fix window opacity update 2024-09-29 14:08:09 -07:00
Sam Lantinga
c84d825241 Added SDL_HashPointer() and SDL_KeyMatchPointer() 2024-09-29 10:59:18 -07:00
Frank Praznik
d0c9c008e1 wayland: Use high-DPI system cursors on non-DPI aware windows
Using an unscaled buffer just results in the compositor scaling up the low-res cursor image for output, resulting in it appearing blurry. Always use the scaled cursor to ensure that it appears sharp and matches the native system look.
2024-09-29 13:27:46 -04:00
Ozkan Sezer
5f304b3a47 Fix builed error after commit 0e45b824e3 due to -Wunused-variable 2024-09-29 15:40:02 +03:00
Sam Lantinga
0e45b824e3 renderer: always update the output pixel size at startup
Fixes https://github.com/libsdl-org/SDL/issues/10990
2024-09-29 05:22:28 -07:00
Sam Lantinga
2825a682f0 Fixed build errors 2024-09-29 04:42:19 -07:00
Andrei Alexeyev
ba7b346e52 hashtable: reimplement as open-addressed robin hood hashtable
This is mostly ported from Taisei Project
2024-09-29 04:11:14 -07:00
SDL Wiki Bot
62938837c2 Sync SDL3 wiki -> header 2024-09-29 01:10:39 +00:00
Evan Hemsley
fc242abbd2 GPU: recreate swapchain on window pixel size change event (#10985) 2024-09-28 18:09:56 -07:00
Evan Hemsley
66f6b40c92 Render GPU: Don't call GetWindowSizeInPixels during RenderPreset (#10984) 2024-09-28 18:01:16 -07:00
Sam Lantinga
a923771978 Added SDL_murmur3_32() 2024-09-28 17:19:01 -07:00
Sam Lantinga
039148fb0e Updated check for stdbool.h
If you're building in a C99 or newer environment, we'll automatically include stdbool.h.

If you're building in a C89 or C90 environment, we'll assume that stdbool.h isn't available and define bool as an unsigned char. If you have a working stdbool.h and want SDL to use it, you can either include stdbool.h before SDL headers, or define SDL_INCLUDE_STDBOOL_H in your project.

Closes https://github.com/libsdl-org/SDL/pull/10980
2024-09-28 16:55:09 -07:00
Frank Praznik
7ca0e9ede1 wayland: Scale the pointer destination size relative to the theme size
This better matches compositor behavior and avoids slight size jumps when the cursor enters and leaves the window.
2024-09-28 14:32:10 -04:00
Frank Praznik
d2094bd0a2 wayland: Don't query the cursor info with DBus if the cursor shape protocol is present
If the cursor shape protocol is supported, the compositor will handle cursor themes and sizes automatically, so querying the properties with DBus serves no purpose as the values are never used.
2024-09-28 12:18:58 -04:00
Petar Popovic
dee62e1b47 Remove trailing comma in enum 2024-09-28 17:47:37 +03:00
Ryan C. Gordon
7d21a49c9c filesystem: SDL_EnumerateDirectoryCallback uses an enum now, not an int.
Fixes #10955.
2024-09-28 01:33:40 -04:00
Ryan C. Gordon
55bd9f5311 iostream: flush() should attempt to sync file data to physical media. 2024-09-27 20:20:51 -04:00
Ethan Lee
0852307b58 gpu: Check Vulkan device features for IsDeviceSuitable 2024-09-27 19:58:30 -04:00
cosmonaut
fb165a542b GPU Vulkan: add resolve info to framebuffer and render pass lookups 2024-09-27 15:57:57 -07:00
SDL Wiki Bot
0542bbbf1a Sync SDL3 wiki -> header 2024-09-27 22:55:29 +00:00
Ryan C. Gordon
4a296f1bde filesystem: Fixed memory leak on Windows. 2024-09-27 18:54:18 -04:00
Ryan C. Gordon
e944f0fb9d testfilesystem: Added test of creating parent dirs. 2024-09-27 18:54:18 -04:00
Ryan C. Gordon
428f2f35be filesystem: SDL_CreateDirectory should make parent directories.
Fixes #10502.
2024-09-27 18:54:18 -04:00
Ryan C. Gordon
94030131de filesystem: Windows SDL_SYS_CreateDirectory should succeed if dir exists. 2024-09-27 18:54:18 -04:00
Petar Popovic
48c3ee2120 testcolorspace.c: Fix unreachable code warning 2024-09-27 15:22:24 -07:00
SDL Wiki Bot
8d6b397cd8 Sync SDL3 wiki -> header 2024-09-27 21:11:58 +00:00
Sam Lantinga
3f446d8fb5 Minor cleanup 2024-09-27 14:10:46 -07:00
Ozkan Sezer
1088ea55fa SDL_gpu_d3d11.c: define D3D11_FORMAT_SUPPORT2_UAV_TYPED_LOAD for old toolchains 2024-09-27 23:55:02 +03:00
SDL Wiki Bot
8377cad974 Sync SDL3 wiki -> header 2024-09-27 20:50:17 +00:00
cosmonaut
c39e8298b7 GPU: Document swapchain dimensions 2024-09-27 13:49:27 -07:00
cosmonaut
de40d6bae0 GPU Metal: Set texture to NULL even if AcquireSwapchainTexture fails 2024-09-27 13:49:26 -07:00
SDL Wiki Bot
0e5a49542d Sync SDL3 wiki -> header 2024-09-27 20:39:24 +00:00
David Fort
f32e96f5e2 clipboard: add SDL_ClipboardMimeTypes
This function allows to retrieve the available mime types without doing any
synthesizing.
2024-09-27 13:38:40 -07:00
SDL Wiki Bot
0befa7d8e9 Sync SDL3 wiki -> header 2024-09-27 20:27:48 +00:00
cosmonaut
eedd2039f9 GPU: 32-bit component texture formats 2024-09-27 16:26:43 -04:00
SDL Wiki Bot
769ff47461 Sync SDL3 wiki -> header 2024-09-27 19:50:13 +00:00
Evan Hemsley
05d0656bd6 GPU: Simultaneous compute pass read-write (#10965) 2024-09-27 12:49:37 -07:00
Sam Lantinga
d39acc6d1e Fixed warning C4702: unreachable code 2024-09-27 11:19:54 -07:00
Caleb Cornett
5ff6e8d522 GPU: Add enable_depth_clip to RasterizerState (#10964) 2024-09-27 11:18:54 -05:00
Sam Lantinga
04bb105d09 Added header for SDL_ThreadID type 2024-09-27 08:16:49 -07:00
Daniel Ludwig
e98cf3c870 Fix Xbox builds 2024-09-27 08:10:03 -07:00
SDL Wiki Bot
c7442b04f0 Sync SDL3 wiki -> header 2024-09-27 07:30:57 +00:00
Evan Hemsley
be401dd1e3 GPU: More robust error reporting (#10958)
---------

Co-authored-by: Ethan Lee <flibitijibibo@gmail.com>
Co-authored-by: Caleb Cornett <caleb.cornett@outlook.com>
2024-09-27 00:30:18 -07:00
Sam Lantinga
48e213b4cd Fixed SDL_ShouldQuit() returning false during status transitions
We should wait for the state to stabilize before SDL_ShouldQuit() returns.

For example:
Thread A initializes and increments a use refcount
Thread B skips initializing and increments the use refcount
Thread B starts cleaning up and checks the use refcount
Thread A starts cleaning up, returns because SDL_ShouldQuit() returns false (not initialized), not touching the use refcount
Thread B returns because the use refcount isn't zero

Now we have the state where the refcount is greater than one and both thread A and B have attempted to cleanup.

With this change:
Thread A initializes and increments a use refcount
Thread B skips initializing and increments the use refcount
Thread B starts cleaning up and decrements and checks the use refcount
Thread A starts cleaning up, waits for thread B
Thread B returns because the use refcount isn't zero
Thread A continues and decrements and checks the use refcount, and finishes cleaning up because it has reached 0.
2024-09-26 18:08:58 -07:00
Ryan C. Gordon
d8c76d2f34 filesystem: POSIX SDL_SYS_CopyFile shouldn't use a temp file.
Fixes #10957.
2024-09-26 19:34:34 -04:00
SDL Wiki Bot
0d593cf39a Sync SDL3 wiki -> header 2024-09-26 23:29:38 +00:00
Ryan C. Gordon
f267ec7681 filesystem: Improve docs, make some promises about overwrites and file caches.
Note that SDL_FlushIO() doesn't make promises about file data sync but that
is intended to be changed in the IOStream code in a later commit.

Fixes #10886.
2024-09-26 19:29:03 -04:00
SDL Wiki Bot
c1587b1eac Sync SDL3 wiki -> header 2024-09-26 23:26:52 +00:00
Sam Lantinga
125e592844 Added SDL_ShouldInit() and SDL_ShouldQuit()
These are handy functions to support thread-safe initialization and shutdown.
2024-09-26 16:26:12 -07:00
Ryan C. Gordon
0e2c4e407a README-migration: note that logical presentation state is different from SDL2. 2024-09-26 18:49:29 -04:00
Ryan C. Gordon
4e09e58f62 include: Small clarification on directory enumeration documentation. 2024-09-26 16:39:35 -04:00
Ryan C. Gordon
38f971bac5 filesystem: SDL_SYS_EnumerateDirectory() now returns bool. 2024-09-26 16:35:15 -04:00
Ryan C. Gordon
86ea283904 examples: No need to explicitly seed the RNG at startup.
SDL does this for you; explicit seeding is only for reproducing a specific
sequence of numbers (or maybe reseeding at a later point).
2024-09-26 15:01:04 -04:00
Frank Praznik
671a33c2f7 wayland: Raise all touches on a cancel event 2024-09-26 14:45:10 -04:00
Petar Popovic
457d0edeaf Remove some extra semicolons 2024-09-26 20:01:56 +03:00
Anonymous Maarten
345cae361d Document mode parameter of SDL_GetRenderLogicalPresentation 2024-09-26 16:12:13 +02:00
Sam Lantinga
345d9bfe19 A zero source rect is valid for blitting
A zero sized source rect draws pixels sourced from a 0x0 region on the source surface.

Fixes https://github.com/libsdl-org/SDL/issues/8580
2024-09-25 22:36:55 -07:00
Sam Lantinga
1aea43846e Don't use BlitARGBto555PixelAlpha() for SDL_PIXELFORMAT_ARGB1555
This didn't properly take into account destination alpha.

Fixes https://github.com/libsdl-org/SDL/issues/8401
2024-09-25 21:54:05 -07:00
SDL Wiki Bot
59d69a3ba3 Sync SDL3 wiki -> header 2024-09-26 04:21:40 +00:00
Sam Lantinga
d9a7da4fac Optimized SDL_HasEvent() and SDL_HasEvents()
Also document the counting behavior of SDL_PEEKEVENT.

Fixes https://github.com/libsdl-org/SDL/issues/6209
2024-09-25 21:20:00 -07:00
Ryan C. Gordon
3abb213083 opengl: Fixed SDL_RENDERCMD_SETDRAWCOLOR code checking the wrong variable. 2024-09-25 23:14:32 -04:00
Ryan C. Gordon
961cd51611 opengl: Removed a FIXME (this is documented as not-thread-safe now. 2024-09-25 23:14:32 -04:00
Anonymous Maarten
80cf3f7c38 ci: Fix check_stdlib_usage.py and run on ci 2024-09-25 23:59:35 +02:00
Anonymous Maarten
76f28ea120 Fix stdlib usage 2024-09-25 23:59:35 +02:00
Simon McVittie
80da805688 build: Fix testprocess invocation during "as-installed" tests
During build-time testing, we can use `$<TARGET_FILE:childprocess>` to
pass the just-built childprocess executable to it as an argument, but
during "as-installed" testing we need to use the installed path of
the childprocess executable instead.

Signed-off-by: Simon McVittie <smcv@debian.org>
2024-09-25 14:48:26 -07:00
SDL Wiki Bot
81644d260f Sync SDL3 wiki -> header 2024-09-25 20:31:24 +00:00
Ryan C. Gordon
122cd4db2b include: Added \threadsafety notes to all SDL_render.h functions. 2024-09-25 16:30:04 -04:00
SDL Wiki Bot
276969cd58 Sync SDL3 wiki -> header 2024-09-25 20:27:11 +00:00
Ryan C. Gordon
4c48ff51f8 render: SDL_RenderPresent now behaves when a render target is currently set.
It'll temporarily unbind it, draw letterboxing if necessary, present, and
then rebind the previous render target.
2024-09-25 16:26:36 -04:00
Ryan C. Gordon
7a6a0becb8 render: Fixed a FIXME for SDL_SetRenderViewport with a negative size. 2024-09-25 16:26:36 -04:00
Ryan C. Gordon
54459def69 render: Remove the logical presentation render target.
Now we render directly to the window, scaling as appropriate. This fixes some
concerns the render target introduced, like the quality of the final scaled
output, how to step outside of the logical size temporarily to draw some
things sharply at the native resolution, and loss of sub-pixel precision.

Fixes #8736.
2024-09-25 16:26:36 -04:00
Ryan C. Gordon
bf7a48cdcc render/gpu: Change some memcpy calls to SDL_memcpy. 2024-09-25 16:26:36 -04:00
Ryan C. Gordon
b48f29dd9b examples: Fix name of renderer/17-read-pixels binary. 2024-09-25 16:26:36 -04:00
cosmonaut
925e47a077 GPU: Fix backwards LogError and SetError calls 2024-09-25 12:47:40 -07:00
Anonymous Maarten
1561d7c089 Fix warnings in build-scripts/check_stdlib_usage.py 2024-09-25 20:34:32 +02:00
Anonymous Maarten
2070adb262 android: add python script checking Android JNI bindings 2024-09-25 20:34:32 +02:00
Anonymous Maarten
cf4049cfde ci: check versioning on ci 2024-09-25 20:34:32 +02:00
cosmonaut
557c6dfb18 GPU: call SDL_SetError where appropriate 2024-09-25 10:47:14 -07:00
Cameron Gutman
6ec8b1a173 Throttle tickle reports to PS4/PS5 controllers
UpdateDevice() can be called at an arbitrary rate, so we need to
pace ourselves to avoid filling up the rumble queue with these.
2024-09-25 07:20:35 -07:00
Anthony
53bf2baac3 Change JNI calls to comply with recent Boolean changes
Android OpenURL and Toast methods return Booleans now, so let's use the correct interface.
2024-09-24 14:45:24 -07:00
Ryan C. Gordon
fcab6c99fb examples: Fixed some window titles. 2024-09-24 15:36:49 -04:00
Ryan C. Gordon
9881c4e582 examples: Added renderer/17-read-pixels 2024-09-24 15:31:21 -04:00
Ryan C. Gordon
62389ada6f examples/renderer/02-primitives: seed the RNG. 2024-09-24 13:55:29 -04:00
Ryan C. Gordon
95134f6d58 examples: Added renderer/15-cliprect 2024-09-24 13:55:28 -04:00
Frank Praznik
ad3a4c677b wayland: Clean up cursor scaling
Handle named and custom cursor scaling in a cleaner manner, and account for edge cases where named cursor sizes may not exactly match the required size.
2024-09-24 11:46:56 -04:00
Petar Popovic
e5d3a1b6f5 Remove casts from typed pointer to void * for printf %p in test projects 2024-09-24 14:40:32 +03:00
Cameron Gutman
57418475ce kmsdrm: Keep fd around if we can drop master
Modern kernels (v5.8+) allow non-root usage of drmDropMaster(), so
we can hold on to our fd after dropping master on it. This fixes
populating drm_fd in the KMSDRM SysWMinfo when using Vulkan.

Also add a missing error check for open() while we're here
2024-09-24 12:55:02 +03:00
Cameron Gutman
13f88df190 kmsdrm: Fix KMSDRM_Vulkan_CreateSurface() return value 2024-09-23 23:33:15 -05:00
Cameron Gutman
8f55f48337 kmsdrm: Move property initialization a bit further down
KMSDRM_GBMInit() must be called first to set drm_fd and gbm_dev.
2024-09-23 23:00:14 -05:00
Ryan C. Gordon
1ed3dac021 examples: Added renderer/14-viewport
(This intentionally skips a few example numbers, as I intend to fill in some
other topics before this, later.)
2024-09-23 14:16:32 -04:00
Ryan C. Gordon
e00ea27d25 examples/renderer/01-clear: No longer needs vsync.
This now chooses the next color based on time, so it won't go wild if the
framerate is unbounded.
2024-09-23 14:16:32 -04:00
Petar Popovic
004ac40226 Fix warning: no function prototype 2024-09-23 10:03:18 -07:00
Ethan Lee
4a3faf20ac gpu: Replace high-level logs with SetError 2024-09-23 10:57:10 -04:00
Petar Popovic
043c876a15 Move default colorspace aliases into enum 2024-09-23 07:37:02 -07:00
mausimus
0685b96469 GPU: fix build when SDL_GPU_DISABLED is set 2024-09-23 08:09:17 -04:00
Ryan C. Gordon
e973b687cd examples: Added renderer/11-color-mods 2024-09-23 01:21:40 -04:00
Susko3
0478a6ee3b Move endian pixel format aliases into enum
Matches the same thing in `SDL_AudioFormat`.
2024-09-22 16:34:42 -07:00
Ryan C. Gordon
1828bde49f examples/renderer/01-clear: Use the color-cycle code from testvulkan.c
(and testgpu_simple_clear.c, of course!)
2024-09-22 16:10:57 -04:00
Ryan C. Gordon
3bc2bd790c build-web-examples.pl: Added a FIXME. 2024-09-22 10:35:59 -04:00
Ozkan Sezer
b736285053 examples/renderer/08-rotating-textures: Fix compiler warning on MSVC . 2024-09-22 12:02:50 +03:00
Ryan C. Gordon
37d62deca1 examples/renderer/10-geometry: Fixes and cleanups. 2024-09-22 01:15:19 -04:00
Ryan C. Gordon
0758b2a0c4 examples: Added renderer/10-geometry 2024-09-22 01:10:33 -04:00
Ryan C. Gordon
1a90e09262 examples: Added renderer/09-scaling-textures 2024-09-22 01:10:32 -04:00
Ryan C. Gordon
4fdeb6861b examples: a few renderer fixes. 2024-09-22 01:10:32 -04:00
Ryan C. Gordon
66b92e95ac examples: renamed renderer sources to match other example directories. 2024-09-22 01:10:32 -04:00
Ryan C. Gordon
ffcf372d27 examples: Added renderer/08-rotating-textures 2024-09-22 01:10:31 -04:00
Ryan C. Gordon
0c7334cce3 examples: Added renderer/07-streaming-textures 2024-09-22 01:10:31 -04:00
Ryan C. Gordon
2bd3d9cfb7 examples: Added renderer/06-textures 2024-09-22 01:10:30 -04:00
Ryan C. Gordon
9d0b3eded6 examples: added renderer/05-rectangles 2024-09-22 01:10:30 -04:00
Ryan C. Gordon
3413617cb6 examples: added renderer/04-points 2024-09-22 01:10:30 -04:00
Sam Lantinga
b0e528cc88 Switched ifdef from negative to positive 2024-09-21 20:12:54 -07:00
Caleb Cornett
97d1056e16 GPU: MSAA fixes (#10917) 2024-09-21 17:38:10 -05:00
Ozkan Sezer
254b36361e Add SDL_PRILL? format specifiers specifically for long long type. 2024-09-21 23:03:50 +03:00
Sam Lantinga
6f80d47d64 Use hexidecimal code for ± 2024-09-21 10:43:34 -07:00
Petar Popovic
4392233007 Removed tabs from headers 2024-09-21 10:39:53 -07:00
Evan Hemsley
89c6bc5f50 Prefer Vulkan even on Windows (#10912) 2024-09-20 13:42:15 -07:00
Evan Hemsley
980b4ff6db GPU: Vulkan descriptor management rewrite (#10910) 2024-09-20 12:55:39 -07:00
Frank Praznik
fcb8a2c016 wayland: Fix animated cursor timing
Adjust the frame timing so it will still advance if the frame callback fires faster than the frame duration.
2024-09-20 14:19:28 -04:00
Sam Lantinga
ea2e2e451d Better fix for initializing Android environment variables 2024-09-20 11:09:48 -07:00
Sam Lantinga
095fb5f522 Fixed infinite recursion at startup on Android 2024-09-20 10:56:02 -07:00
Ozkan Sezer
88a01fbc96 testautomation_stdlib.c: fix -Wformat warnings from mingw with %lld/%llu
i.e.:  unknown conversion type character 'l' in format
See https://github.com/libsdl-org/SDL/pull/10789#issuecomment-2354011906
2024-09-19 20:37:11 +03:00
Ryan C. Gordon
b4e2777820 examples/renderer/03-lines: Fix compiler warning on Visual Studio. 2024-09-19 13:31:24 -04:00
Ryan C. Gordon
2e3e5abd7d examples/renderer/03-lines: use a gray background. 2024-09-19 12:58:37 -04:00
Frank Praznik
fd0ce75e2e tests: Fix tests when run with the --high-pixel-density flag
Scales pointer coordinates where needed to fix the following tests when run with the --high-pixel-density flag:

- testaudio
- testaudiostreamdynamicresample
- testhittesting
- testintersections
- testmanymouse
- testoverlay
- testwm
2024-09-19 12:54:13 -04:00
Ryan C. Gordon
745d5e4991 examples/renderer/03-lines: Make this less obnoxious to look at. 2024-09-19 12:52:04 -04:00
Ryan C. Gordon
1b266ec13d examples: added renderer/03-lines 2024-09-19 12:16:12 -04:00
Sam Lantinga
6771a6020d testcamera: don't enable verbose logging
Fixes https://github.com/libsdl-org/SDL/issues/10541
2024-09-18 22:26:38 -07:00
T3hD0gg
594edb6bd2 Add Thrustmaster TMX VID & PID to wheel device list. 2024-09-18 22:19:54 -07:00
Sam Lantinga
34c6011360 Fixed Windows build 2024-09-18 14:55:51 -07:00
Sam Lantinga
d29a0e3f31 Fixed warning: no previous prototype for function 2024-09-18 14:34:14 -07:00
Sam Lantinga
7a924b36ae compile_shaders.sh shouldn't be in the SDL framework 2024-09-18 14:31:00 -07:00
SDL Wiki Bot
1f727b61f3 Sync SDL3 wiki -> header 2024-09-18 21:04:36 +00:00
Sam Lantinga
398dff7c25 Added support for the HORI licensed Steam Controller 2024-09-18 14:08:32 -07:00
Sam Lantinga
481203c074 Fixed Xcode warnings 2024-09-18 13:20:53 -07:00
Ozkan Sezer
7edf7fad66 fix bool define when SDL_DEFINE_STDBOOL is defined:
it should be unsigned.
2024-09-18 12:17:22 -07:00
Ozkan Sezer
ff90570a3c define SDL_DEFINE_STDBOOL for gcc < 3 2024-09-18 12:17:22 -07:00
Sam Lantinga
95c3ee77c1 Removed testing code 2024-09-18 11:12:06 -07:00
Sam Lantinga
ea640894d3 Fixed SDL_DEFINE_STDBOOL logic if __bool_true_false_are_defined is defined 2024-09-18 10:50:52 -07:00
Sam Lantinga
46fb2c6f1b Added a script to help with the bool rename 2024-09-18 10:48:11 -07:00
Simon McVittie
23f855a970 render: Integrate fix-shaders.sh into build-shaders.sh
By writing the fxc and dxc output to a temporary file and then
converting that temporary file to the desired filename, we avoid
the incompatible semantics of sed -i on GNU systems (sed -i does not
create a backup filename, and does not take an argument unless it is
"bundled") and macOS (sed -i requires an argument, possibly empty).

Resolves: https://github.com/libsdl-org/SDL/issues/10878
Signed-off-by: Simon McVittie <smcv@debian.org>
2024-09-18 10:38:59 -07:00
Sam Lantinga
d658ef6627 Don't guess about the size of an int, assert it! 2024-09-18 10:37:11 -07:00
Sam Lantinga
32fd1878a0 Provide a definition of bool if needed for your environment 2024-09-18 10:37:11 -07:00
Sam Lantinga
1834c83d5a testplatform: make sure bool is 1 byte 2024-09-18 10:01:15 -07:00
SDL Wiki Bot
026d3c2306 Sync SDL3 wiki -> header 2024-09-18 15:33:11 +00:00
Sam Lantinga
95f7e53233 Added the examples directory to the API renaming tool 2024-09-18 08:32:30 -07:00
Sam Lantinga
a90ad3b0e2 Removed SDL_bool in favor of plain bool
We require stdbool.h in the build environment, so we might as well use the plain bool type.

If your environment doesn't have stdbool.h, this simple replacement will suffice:
typedef signed char bool;
2024-09-18 08:32:30 -07:00
SDL Wiki Bot
9dd8859240 Sync SDL3 wiki -> header 2024-09-18 15:19:01 +00:00
Sam Lantinga
32cf23d392 Added video/x11/edid.h to third party code list 2024-09-18 08:18:26 -07:00
Sam Lantinga
407ccadfd7 Added copyright header to edid.h 2024-09-18 08:18:26 -07:00
Sam Lantinga
bd04459cde Fix typos (thanks @qndel!)
Fix typos in comments and in one case in a returned error ("insuffient -> insufficient" fb273eb)
codespell src/ *.cpp *.h *.hpp --ignore-words-list unknwn,thid,algebric,statics,pixelX,pEvents,caf,ptd,parms,pEvent,parm,TextureRS,TE,HDA,LOD,datas,UE,xwindows,IIF
cd src; git checkout \
    events/imKStoUCS.* \
    hidapi \
    joystick/controller_type.c \
    joystick/controller_type.h \
    joystick/hidapi/steam/controller_constants.h \
    joystick/hidapi/steam/controller_structs.h \
    libm \
    stdlib/SDL_malloc.c \
    stdlib/SDL_qsort.c \
    stdlib/SDL_strtokr.c \
    video/khronos \
    video/x11/edid.h \
    video/x11/edid-parse.c \
    video/x11/xsettings-client.* \
    video/yuv2rgb
2024-09-18 08:18:26 -07:00
Frank Praznik
e4f987f299 tests: Fix testdropfile on high-DPI displays
Convert the window pointer coordinates to buffer coordinates for rendering, so that the cross-hairs align with the cursor on scaled desktops.
2024-09-18 11:00:19 -04:00
Ozkan Sezer
8caf25f7b3 testautomation_stdlib.c (stdlib_strtox): fix warning from gcc-4.9:
test/testautomation_stdlib.c: In function 'stdlib_strtox':
test/testautomation_stdlib.c:1339:9: warning: this decimal constant is unsigned only in ISO C90
         STRTOX_TEST_CASE(SDL_strtoul, unsigned long, "%lu", "4294967295", 10, 4294967295, 10);
         ^
test/testautomation_stdlib.c:1340:9: warning: this decimal constant is unsigned only in ISO C90
         STRTOX_TEST_CASE(SDL_strtoul, unsigned long, "%lu", "4294967296", 10, 4294967295, 10);
         ^
2024-09-18 01:03:10 +03:00
Sam Lantinga
03ae792df3 Fixed the recording field in audio device events
Fixes https://github.com/libsdl-org/SDL/issues/10885
2024-09-17 11:36:55 -07:00
Sam Lantinga
c68e9e157c Fixed typo 2024-09-17 10:59:28 -07:00
Sam Lantinga
bc9780299c Don't define backends if SDL_GPU_DISABLED is set 2024-09-17 09:40:29 -07:00
SDL Wiki Bot
8481d1a12b Sync SDL3 wiki -> header 2024-09-17 15:54:09 +00:00
Sam Lantinga
807b8a9d4d Allow initializing hints and properties from any thread 2024-09-17 08:53:27 -07:00
Sam Lantinga
d0edf68774 Added Uint32 versions of the atomic functions 2024-09-17 08:53:27 -07:00
Sam Lantinga
8d223b3037 Renamed atomic functions to match SDL 3.0 naming convention
This will also allow us to cleanly add atomic operations for other types in the future.
2024-09-17 08:53:27 -07:00
Sam Lantinga
f3e419596b Removed SDL_INIT_TIMER
This is no longer necessary before calling SDL_AddTimer()
2024-09-17 08:53:27 -07:00
Sam Lantinga
9275c533ca Added thread-safe initialization/cleanup support
Also went through and removed inappropriate uses of spinlocks.

Fixes https://github.com/libsdl-org/SDL/issues/10872
2024-09-17 08:53:27 -07:00
Sam Lantinga
7edd43c276 Don't define render_drivers if SDL_RENDER_DISABLED is set
Fixes https://github.com/libsdl-org/SDL/issues/10861
2024-09-17 08:46:05 -07:00
Sam Lantinga
98cd8b34a7 Close the other file descriptors after redirection has taken place
Fixes https://github.com/libsdl-org/SDL/issues/10868
2024-09-17 07:46:48 -07:00
Simon McVittie
4b3058d58d render: Don't try to rebuild D3D11, D3D12, Metal shaders without spirv-cross
Signed-off-by: Simon McVittie <smcv@debian.org>
2024-09-17 07:43:37 -07:00
Simon McVittie
13500bbf50 render: Fix detection of fxc, dxc in build-shaders.sh
We want `$USE_FXC` to default to the result of evaluating the variable
`$HAVE_FXC`, not the literal string `HAVE_FXC`, and the same for dxc.

Signed-off-by: Simon McVittie <smcv@debian.org>
2024-09-17 07:43:37 -07:00
Green Sky
11129761e7 v4l2: return success if the device is ready 2024-09-17 07:41:43 -07:00
Simon McVittie
ab9c68d9ff pipewire: Always destroy hotplug loop during deinitialization
We always need to destroy the hotplug loop and its associated resources
(if created) before we can deinitialize and unload the Pipewire library.

In the happy path where everything worked correctly, this means we will
call hotplug_loop_destroy() twice (once from PIPEWIRE_DeinitializeStart()
and a second time from PIPEWIRE_Deinitialize()), but that's OK, because
it's idempotent and so will do nothing the second time.

In error-handling code paths, this avoids needing to remember to call
hotplug_loop_destroy() explicitly, which should make it easier to avoid
bugs like #10787.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-09-17 07:35:42 -07:00
Anonymous Maarten
1ffb9f22aa build-release.py fixes from SDL2 port 2024-09-17 16:24:02 +02:00
Sam Lantinga
231ea07617 Added SDL_LogTrace() 2024-09-17 02:04:54 -07:00
Sam Lantinga
6180da00e1 Skip a lock/unlock when logging known categories 2024-09-17 02:04:54 -07:00
Caleb Cornett
c499f79fe9 GPU: Fix multisample texture usage validation 2024-09-16 17:55:27 -05:00
SDL Wiki Bot
926d143966 Sync SDL3 wiki -> header 2024-09-16 20:12:52 +00:00
Sam Lantinga
1bbc897e48 Updated documentation for bool return type
Also updated the test CRC functions to return bool.
2024-09-16 13:12:15 -07:00
SDL Wiki Bot
4a2683e2c1 Sync SDL3 wiki -> header 2024-09-16 20:09:54 +00:00
Sam Lantinga
dc639956ba Improve logging performance and make log priorities thread-safe
Fixes https://github.com/libsdl-org/SDL/issues/9679
2024-09-16 13:09:17 -07:00
SDL Wiki Bot
f006d61bd1 Sync SDL3 wiki -> header 2024-09-16 17:57:51 +00:00
SDL Wiki Bot
fd1fcfc951 Sync SDL3 wiki -> header 2024-09-16 17:19:42 +00:00
Caleb Cornett
9416917353 GPU: Rework MSAA (#10859) 2024-09-16 12:19:09 -05:00
Anthony
e59344ad46 Update proguard-rules.pro in-line with commit 9ff3446
A couple of JNI methods changed from returning int to boolean.
2024-09-16 08:47:44 -07:00
Sam Lantinga
0f85fdefc8 Fixed warning: "SDL_VIDEO_RENDER_D3D12" is not defined, evaluates to 0 2024-09-16 07:40:00 -07:00
Caleb Cornett
4f722d372a GPU: Metal vertex buffer indices should grow upward (#10837) 2024-09-15 20:17:43 -05:00
Sam Lantinga
0548050fc5 Verify that the subsystems were successfully initialized 2024-09-15 12:04:10 -07:00
Sam Lantinga
5b5b1a8926 Fixed cleaning up dependent subsystems if initialization fails 2024-09-15 11:40:31 -07:00
Sam Lantinga
97d40b9218 Removed SDL_CleanupEnvironment() 2024-09-15 10:00:21 -07:00
SDL Wiki Bot
a7f1deae8d Sync SDL3 wiki -> header 2024-09-15 16:38:38 +00:00
Sam Lantinga
28b94c4758 Re-added SDL_getenv() as a thread-safe getenv() implementation 2024-09-15 09:37:04 -07:00
Sam Lantinga
718845a33d Fixed warning C4701: potentially uninitialized local variable 'startup_info' used 2024-09-15 09:21:04 -07:00
Sam Lantinga
19243092c6 Renamed SDL_GpuGraphicsPipelineTargetInfo to SDL_GPUGraphicsPipelineTargetInfo
Fixes https://github.com/libsdl-org/SDL/issues/10855
2024-09-15 07:46:26 -07:00
Sam Lantinga
604d0c519e If posix_spawn() is available, so is sigaction 2024-09-14 22:54:18 -07:00
Sam Lantinga
ec5d280c90 Make sure we ignore SIGPIPE so we don't crash if we write when the pipe is closed 2024-09-14 22:15:18 -07:00
Sam Lantinga
34b2f4ffca Use non-blocking pipes for process I/O on Windows
Fixes https://github.com/libsdl-org/SDL/issues/10846
2024-09-14 21:16:35 -07:00
Anonymous Maarten
dd07cc8991 SDL_Process: WAIT_TIMEOUT means the process has not exited yet 2024-09-14 21:16:29 -07:00
Carl Åstholm
1f3fd65c4c cpuinfo: Rename SDL_GetCPUCount to SDL_GetNumLogicalCPUCores
This was the only API that broke the "GetNumThings" convention
used elsewhere, so renaming it helps with consistency.
Adding "logical cores" to the name also makes it a bit
more immediately obvious what the count actually represents.
2024-09-14 19:33:30 -07:00
Ryan C. Gordon
93bf534268 testgpu_simple_clear: Fixed AppInit return values. 2024-09-14 19:19:27 -04:00
Maia
e5bd3bbcd6 add missing includes 2024-09-14 14:38:44 -07:00
Sam Lantinga
8569bde053 Fixed typo 2024-09-14 14:35:57 -07:00
SDL Wiki Bot
706aaaf280 Sync SDL3 wiki -> header 2024-09-14 20:23:16 +00:00
Ryan C. Gordon
3bc0347761 Revert "Sync SDL3 wiki -> header"
This reverts commit 35427ff9ec.
2024-09-14 16:22:16 -04:00
Ryan C. Gordon
c2e4b14a82 Revert "stdinc: Added missing \param to SDL_CreateEnvironment."
This reverts commit 919f8d3e2b.
2024-09-14 16:22:09 -04:00
Ryan C. Gordon
11c9975caa Revert "Sync SDL3 wiki -> header"
This reverts commit ba65767afa.
2024-09-14 16:22:00 -04:00
SDL Wiki Bot
ba65767afa Sync SDL3 wiki -> header 2024-09-14 20:18:20 +00:00
Ryan C. Gordon
919f8d3e2b stdinc: Added missing \param to SDL_CreateEnvironment. 2024-09-14 16:17:29 -04:00
SDL Wiki Bot
35427ff9ec Sync SDL3 wiki -> header 2024-09-14 20:11:24 +00:00
Sam Lantinga
dcb2a8c2fe Use CreateProcessW() to handle non-ASCII file paths and arguments 2024-09-14 12:27:22 -07:00
Sam Lantinga
e97f636590 SDL_PROP_PROCESS_CREATE_ENVIRONMENT_POINTER is an SDL_Environment pointer 2024-09-14 12:27:22 -07:00
Sam Lantinga
56fc4b790c Reduce strcmp() calls in hashtable lookup 2024-09-14 11:46:40 -07:00
Sam Lantinga
e673479449 Removed SDL_WriteProcess()
This had the unfortunate side-effect of blocking if you tried to write too much. Instead you can use SDL_GetProcessInput() and handle SDL_IO_STATUS_NOT_READY as needed.

Fixes https://github.com/libsdl-org/SDL/issues/10834
2024-09-14 11:15:50 -07:00
Ozkan Sezer
a833ee2e63 SDL_gpu.c: fixed build when SDL_GPU_DISABLED is defined. 2024-09-14 20:40:56 +03:00
ritalat
f6f49de134 Add convenience functions to get process IOStreams 2024-09-14 10:33:29 -07:00
Sam Lantinga
7ff015ceae Close file descriptors not used by the child process 2024-09-14 10:29:02 -07:00
Sam Lantinga
fed0149172 Switched wayland messageboxes to use the new process API 2024-09-14 10:29:02 -07:00
Sam Lantinga
aa7357a14d SDL_CreateEnvironment() fills the environment with a non-zero parameter 2024-09-14 10:29:02 -07:00
Sam Lantinga
76c469910e Added SDL_PROP_PROCESS_CREATE_BACKGROUND_BOOLEAN 2024-09-14 10:29:02 -07:00
Sam Lantinga
44c6cfda05 Switched zenity dialogs to use the new process API 2024-09-14 10:29:02 -07:00
Anonymous Maarten
3166a05c18 cmake: don't prepend absolute CMAKE_INSTALL_{INCLUDE,LIB}DIR with ${prefix} 2024-09-14 16:21:42 +02:00
Semphriss
27862907c6 Update src/process/windows/SDL_windowsprocess.c
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
2024-09-13 22:15:56 -07:00
Semphriss
82b33a7d3f Update src/process/windows/SDL_windowsprocess.c
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
2024-09-13 22:15:56 -07:00
Semphris
3cf54675bb Windows process: escape backslashes before quotes 2024-09-13 22:15:56 -07:00
Sam Lantinga
90e01040c5 Added thread-safe environment functions
Also marked the existing functions as unsafe, as they can cause crashes if used in multi-threaded applications.

As a bonus, since the new functions are hashtable based, hint environment lookups are much faster.
2024-09-13 22:14:54 -07:00
Ethan Lee
16ff7503b7 gpu: Update GPU support queries to better match naming conventions 2024-09-13 23:08:44 -04:00
SDL Wiki Bot
d21c1de651 Sync SDL3 wiki -> header 2024-09-13 22:20:35 +00:00
Semphris
9eea8234e6 Add SDL_Process subsystem 2024-09-13 15:19:32 -07:00
Sam Lantinga
6c83491116 Added SDL_FlushIO()
Also added SDL_PROP_IOSTREAM_FILE_DESCRIPTOR_NUMBER and refactored the internal API to be able to create SDL_IOStream objects from native file handles.
2024-09-13 15:19:32 -07:00
Sam Lantinga
93caf1cd21 Fixed typo 2024-09-13 14:59:52 -07:00
SDL Wiki Bot
1c5b063ade Sync SDL3 wiki -> header 2024-09-13 20:56:16 +00:00
Sam Lantinga
f1d0a71629 Fixed the documentation for SDL_SetError() 2024-09-13 13:54:54 -07:00
SDL Wiki Bot
d483886ec5 Sync SDL3 wiki -> header 2024-09-13 19:32:14 +00:00
Carl Åstholm
84361bcf0a stdlib: Remove test cases with impl-defined results 2024-09-13 12:30:58 -07:00
Carl Åstholm
eb199176e6 stdlib: Conditionally undef some SDL_strtox tests
Some test cases have implementation-defined results,
so we should only test these when we know SDL's own
implementations of the functions are used.
2024-09-13 12:30:58 -07:00
Carl Åstholm
59ec034412 stdlib: Use macros to define SDL_strtox tests 2024-09-13 12:30:58 -07:00
Carl Åstholm
7d94bf528d stdlib: Document SDL_strtox functions 2024-09-13 12:30:58 -07:00
Carl Åstholm
8092e35287 stdlib: Improve SDL_strtod
- Handle leading whitespace
- Handle positive sign
- Parse integer part as unsigned long long
- Handle signed zero (this also applies to printf)
2024-09-13 12:30:58 -07:00
Carl Åstholm
a78f612d4b stdlib: Add some tests for SDL_strtod 2024-09-13 12:30:58 -07:00
Carl Åstholm
56a48763cd stdlib: Bring SDL_wcstol in line with SDL_strtol 2024-09-13 12:30:58 -07:00
Carl Åstholm
61bc856b04 stdlib: Use new parser for scanf %p specifier 2024-09-13 12:30:58 -07:00
Carl Åstholm
e109aa09aa stdlib: Rewrite SDL_strto(ll?|ul) impl 2024-09-13 12:30:58 -07:00
Carl Åstholm
e326540a45 stdlib: Add failing tests for SDL_strto(ll?|ul) 2024-09-13 12:30:58 -07:00
Carl Åstholm
fb82772fb3 stdlib: Rewrite SDL_strtoull impl 2024-09-13 12:30:58 -07:00
Carl Åstholm
5331f36789 stdlib: Add failing tests for SDL_strtoull 2024-09-13 12:30:58 -07:00
Carl Åstholm
88d3cb4f90 Remove unnecessary include from SDL_pen_c.h 2024-09-13 12:30:58 -07:00
Carl Åstholm
4efbe1ca28 stdlib: Assert that signed integers use two's complement arithmetic 2024-09-13 12:30:58 -07:00
Carl Åstholm
fd53b3e112 stdlib: Rewrite SDL_wcstol impl
SDL_wcstol should now fully adhere to the libc spec.
2024-09-13 12:30:58 -07:00
Carl Åstholm
5d30980df4 stdlib: Add failing tests for SDL_wcstol
These help illustrate some key differences between a specs-compliant
libc wcstol and SDL's own implementation.
2024-09-13 12:30:58 -07:00
Anders Jenbo
ee377793fe Spell "unknown" correctly 2024-09-13 12:29:25 -07:00
Anonymous Maarten
ee65176eec SDL_test: add SDLTest_LogEscapedString 2024-09-13 20:52:32 +02:00
Anonymous Maarten
6a305e1532 SDL_test: fix SDLTest_CommonQuit with NULL state 2024-09-13 20:52:32 +02:00
Ethan Lee
0160e9eac6 gpu: Add SDL_QueryGPUSupport 2024-09-13 13:42:07 -04:00
SDL Wiki Bot
262ffa27e7 Sync SDL3 wiki -> header 2024-09-13 16:30:11 +00:00
Ethan Lee
96e147b2b9 gpu: Rework driver name queries, add GetGPUShaderFormats 2024-09-13 12:29:40 -04:00
Frank Praznik
6d92de5d3a wayland: Ensure that a NULL internal structure isn't dereferenced when destroying a window
In some cases, such as when recreating a window during renderer initialization, a failure can leave the window in a state where the internal structure has already been freed, but the higher level window object needs to be destroyed separately. Check that the internal handle is valid before attempting to access any data during destruction.

Allows for graceful failure instead of a crash during cleanup if renderer creation fails.
2024-09-13 11:38:48 -04:00
Frank Praznik
9d9721cd4c wayland: Fix some incorrect buffer scale calculations
Use doubles and apply an offset to account for rounding errors due to Wayland scale increments being in units of 1/120. This fixes the backbuffer size calculations with certain combinations of size/scale values, and future-proofs the Wayland backend, as 32-bit floats become increasingly error-prone with larger dimensions and/or scale factors.

The conversion formula is now point->pixel->point round trip safe as well.
2024-09-13 11:18:12 -04:00
Caleb Cornett
94436a938d GPU: Remove unused and incorrect D16 format checks from Vulkan driver 2024-09-13 10:16:02 -05:00
Caleb Cornett
5771b502f8 GPU: Fix D3D11/D3D12 vertex strides for multiple vertex buffers (#10818) 2024-09-13 09:57:55 -05:00
Ethan Lee
371cfaf8fe gpu: Implement support for SDL_GPU_DISABLED 2024-09-13 10:32:12 -04:00
SDL Wiki Bot
d3932b1ba2 Sync SDL3 wiki -> header 2024-09-12 23:03:48 +00:00
Caleb Cornett
a45a2caf49 GPU: Rename VertexBinding to VertexBufferDescription (#10811) 2024-09-12 18:02:39 -05:00
poleonek
446ee3e7c5 Fix bug with SDL_ShowMessageBox not working with wayland (#10810) 2024-09-12 15:12:17 -07:00
Ryan C. Gordon
b7dc30ca24 pulseaudio: Hotplug thread fixes.
This used a tiny stack, which apparently upsets Blender for various
technical reasons. Instead, just use the default stack size, which should
give it plenty of space to work.

If the thread failed to create, we would then wait on a semaphore that would
never trigger, so don't do that anymore!

Fixes #10806.
2024-09-12 17:44:14 -04:00
Ethan Lee
c36982d45c vulkan: Avoid redundant commands for dynamic states 2024-09-12 16:51:32 -04:00
Evan Hemsley
66489f91bb GPU: Cube Arrays (#10800)
---------

Co-authored-by: Caleb Cornett <caleb.cornett@outlook.com>
2024-09-12 13:41:46 -07:00
Ethan Lee
9ea0a837ae vulkan: Use a spinlock instead of a mutex for descriptor pools 2024-09-12 15:23:37 -04:00
SDL Wiki Bot
f8d4c49264 Sync SDL3 wiki -> header 2024-09-12 14:11:07 +00:00
Caleb Cornett
d5e1385c91 Fixed typos in SDL_gpu.h 2024-09-12 09:10:20 -05:00
SDL Wiki Bot
6e2f2428ba Sync SDL3 wiki -> header 2024-09-12 06:31:07 +00:00
Caleb Cornett
ddd5723e2e GPU: Remove pitch parameters from indirect draw calls (#10803) 2024-09-11 23:30:14 -07:00
hwsmm
3d7e8c9bb7 Add missing SDL_WPRINTF_VARARG_FUNCV in gendynapi.py 2024-09-11 21:12:26 -07:00
Petar Popovic
d03c7cdf17 Removing extra semicolons 2024-09-11 19:45:22 -07:00
Petar Popovic
fd2a266549 Adding void to empty function prototype parenthesis 2024-09-11 19:44:52 -07:00
Sam Lantinga
b15fab0207 Fixed typo in SDL_dialog.h 2024-09-11 17:35:23 -07:00
cosmonaut
d62e3c3791 Fix SDL_GPUShaderFormat flag values
Fixes #10797
2024-09-11 15:40:13 -07:00
Sam Lantinga
4d135fb696 Fixed color scale when rendering to an sRGB render target 2024-09-11 14:23:58 -07:00
Sam Lantinga
3f7f6f624b testcolorspace: don't tonemap from HDR to SDR when reading pixels
Our source content is in the SDR range, so we don't need to tonemap when reading it back.
2024-09-11 14:23:58 -07:00
Sam Lantinga
4e43da684c Added texture colorspace testing 2024-09-11 14:23:58 -07:00
Sam Lantinga
86e393b523 Clarify that INPUTTYPE_UNSPECIFIED is correct for RGB textures 2024-09-11 14:23:58 -07:00
Sam Lantinga
92255d36d4 We already have functions for converting between sRGB and linear space 2024-09-11 14:23:58 -07:00
Sam Lantinga
667a3e40e9 Use the correct namespace for structures
Otherwise the debugger may use the wrong structure definition at runtime.
2024-09-11 14:23:58 -07:00
Sam Lantinga
77c569496d SDL_GPUShaderFormat isn't an enum anymore 2024-09-11 09:32:17 -07:00
Sam Lantinga
37c9fb490e Changed enums to use XXX_COUNT for the count or number of values
Fixes https://github.com/libsdl-org/SDL/issues/10763
2024-09-11 09:32:17 -07:00
Andrei Alexeyev
64f12bea4a GPU: Remove unnecessary texture format swizzles in Vulkan (#10693) 2024-09-11 09:01:06 -07:00
Sam Lantinga
4123023d3e Renamed sdlgpu to gpu 2024-09-11 08:34:51 -07:00
Sam Lantinga
c77e51c084 Use SDL_unsetenv() 2024-09-11 07:42:17 -07:00
cosmonaut
3166f91282 GPU: Defer setting blend state on D3D11 2024-09-11 00:27:36 -07:00
Petar Popovic
6fca867ffe Fix testoffscreen.c: bool literal returned from 'main' 2024-09-11 01:49:45 -04:00
SDL Wiki Bot
eeb465e2fc Sync SDL3 wiki -> header 2024-09-11 02:20:48 +00:00
Evan Hemsley
2b8a349b26 Add SDL_BindGPUComputeSamplers (#10778)
---------

Co-authored-by: Caleb Cornett <caleb.cornett@outlook.com>
2024-09-10 19:20:14 -07:00
Petar Popovic
323b60abf1 SDL_test_harness.c: Fix warning -Wcast-function-type-strict 2024-09-10 18:22:54 -07:00
Evan Hemsley
0b6f993dea GPU: Zero-init handling (#10786) 2024-09-10 18:17:08 -07:00
Sam Lantinga
b8dbc7086d Disable GameInput mouse and keyboard support
GameInput currently has a bug with keys stuck on focus change, and crashes on initialization on some systems, so we'll disable it until these issues are fixed.
2024-09-10 15:29:52 -07:00
Sam Lantinga
76ce83801a Removed pipewire client version check
@smcv may have found the root cause of the pipewire thread crash, so removing the pipewire client version check to re-enable use of pipewire in older container runtimes.
2024-09-10 13:05:48 -07:00
Simon McVittie
9c8c6da476 pipewire: If hotplug initialization fails, clean up any partial success
hotplug_loop_init() calls pw_context_new(), which creates a thread
internally (for the "data loop"). It also creates a thread of its own,
the `hotplug_loop`.

Both of these threads are running code from libpipewire, so before we
can allow the Pipewire library to be unloaded, we need to destroy
the context with pw_context_destroy() and destroy the `hotplug_loop`
with pw_thread_loop_destroy().

Resolves: https://github.com/libsdl-org/SDL/issues/10787
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-09-10 13:04:16 -07:00
Sam Lantinga
817f1b3da8 Revert "Changed SDL_GPU_TEXTUREFORMAT_INVALID to 0"
This reverts commit b51c6551d6.
2024-09-10 09:22:49 -07:00
Sam Lantinga
b51c6551d6 Changed SDL_GPU_TEXTUREFORMAT_INVALID to 0
This is more in line with SDL's convention and makes it easier to do zero-based structure initialization.
2024-09-10 08:37:52 -07:00
Andrei Alexeyev
1e9ff723ad GPU: fix SDL_GetGPUSwapchainTextureFormat error return value 2024-09-10 08:36:57 -07:00
Sam Lantinga
640559eba6 Added migration documentation for SDL_strtoll(), SDL_strtoull(), SDL_lltoa(), and SDL_ulltoa(). 2024-09-09 15:56:42 -07:00
Sam Lantinga
4eb4370500 SDL_strtoll(), SDL_strtoull(), SDL_lltoa(), and SDL_ulltoa() use long long values 2024-09-09 15:46:26 -07:00
SDL Wiki Bot
68c61ff3a8 Sync SDL3 wiki -> header 2024-09-09 21:01:45 +00:00
Sam Lantinga
6fc6e3dc7e Use SDL_bool where appropriate in SDL events
This involved changing button state from Uint8 to SDL_bool, and made SDL_PRESSED and SDL_RELEASED unnecessary.

Fixes https://github.com/libsdl-org/SDL/issues/10069
2024-09-09 14:00:19 -07:00
SDL Wiki Bot
7d1bbae6b2 Sync SDL3 wiki -> header 2024-09-09 20:51:57 +00:00
Carl Åstholm
af37056c0d stdinc: Fix typos and reword comments about aliasing 2024-09-09 13:51:16 -07:00
Carl Åstholm
8eb194b6f8 stdinc: Document number parsing APIs 2024-09-09 13:51:16 -07:00
Carl Åstholm
eda459ac49 stdinc: Fix up some printf definitions 2024-09-09 13:51:16 -07:00
Carl Åstholm
d6caf2abe7 Remove SDL_RESTRICT in favor of doc comments 2024-09-09 13:51:16 -07:00
Carl Åstholm
731939fca1 stdinc: Document memcpy APIs 2024-09-09 13:51:16 -07:00
Carl Åstholm
8cea4bd3c9 stdinc: Document memory allocation APIs 2024-09-09 13:51:16 -07:00
Ryan C. Gordon
f4c2c09f78 examples: Link to SDL integer types in code examples, too. 2024-09-09 15:41:28 -04:00
Simon McVittie
7713a7eec7 x11vulkan: Use the correct SONAME of libX11-xcb.so.1 on Linux, etc.
On most Unix platforms supported by SDL, the canonical name used to load
a library at runtime includes its ABI major version, and the name
without a version is not guaranteed to exist on non-developer systems.
libX11-xcb.so.1 is correct on Linux, and probably on other Unix
platforms like FreeBSD.

A notable exception is OpenBSD, which apparently does not use
ABI-suffixed names, so continue to use libX11-xcb.so there.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-09-09 12:27:54 -07:00
Ryan C. Gordon
412a8244b6 audio: Make system-specific audio format types part of SDL_AudioFormat.
This keeps them all in the same place, and merges them into the documentation.
2024-09-09 15:17:18 -04:00
cosmonaut
d3091b9538 Remove SDL_GPUDepthStencilValue struct 2024-09-09 10:55:05 -07:00
Sam Lantinga
80e541d1fc Fixed calling SDL_utf8strlcpy() with dst_bytes of 0 2024-09-09 10:42:25 -07:00
Evan Hemsley
668e2f82d2 Add load op and clear color to SDL_BlitGPUTexture (#10767) 2024-09-09 10:19:52 -07:00
Simon McVittie
4728325044 pipewire: Give hotplug threads a more indicative name
When debugging crash reports, it's helpful to know which thread is
associated with which external library.

Linux limits the length of a thread name to 15 bytes (not including the
zero-termination), so abbreviate Pipewire to "pw" and hotplug to "plug"
to fit the desired information into the allowed space.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-09-09 11:22:05 -04:00
Anonymous Maarten
c797ae1619 Fix -Wtype-limits warning
actual has type Uint8, so there's no need to compare against 0.
2024-09-09 14:40:50 +02:00
SDL Wiki Bot
6e885d9619 Sync SDL3 wiki -> header 2024-09-09 06:56:45 +00:00
SDL Wiki Bot
301f3ffa9d Sync SDL3 wiki -> header 2024-09-09 06:50:28 +00:00
Ryan C. Gordon
050aa4d084 include: Filling in more documentation gaps. 2024-09-09 02:49:43 -04:00
Petar Popovic
a57f6c4af3 Fix additional calloc-transposed-args warnings 2024-09-08 19:28:11 -07:00
Petar Popovic
d2ef15d8e6 Fix warnings: calloc-transposed-args 2024-09-08 19:28:11 -07:00
Maia
0da2bd49c8 Remove unused includes. This only removes includes that aren't used at all, not even in comments. 2024-09-08 17:11:23 -07:00
Petar Popovic
aa6a0be7a8 Fix warning: redefinition of typedef 'SDLTest_TestSuiteRunner' 2024-09-08 15:36:51 -07:00
Sam Lantinga
7df1caba7c Clarified that the contents of new textures aren't defined. 2024-09-08 07:23:17 -07:00
Anonymous Maarten
ac0b1b207f SDL_hints: fix gpu direct3d11 driver name in documentation
This was renamed in b17ca32d8c
2024-09-08 15:56:17 +02:00
Petar Popovic
257385277d SDL_realloc() with size 0 now always defaults to size 1 2024-09-08 06:39:37 -07:00
Anonymous Maarten
4c0cb94b96 vulkan: VULKAN_CreateTexture returns a boolean
Fixes regression introduced by 9ff3446f03
VK_SUCCESS == 0, where failure needs to return false (0).
2024-09-08 13:14:18 +02:00
Anonymous Maarten
3eb49ac862 vulken: VULKAN_CreateTexture returns a boolean
Fixes regression introduced by 9ff3446f03
VK_SUCCESS == 0, where success needs to return true (1).
2024-09-08 12:42:55 +02:00
SDL Wiki Bot
1ba99c53d4 Sync SDL3 wiki -> header 2024-09-08 04:22:26 +00:00
SDL Wiki Bot
2b77b2e4ef Sync SDL3 wiki -> header 2024-09-08 04:18:26 +00:00
Ryan C. Gordon
4f6e81cf62 include: Fixed up some minor documentation gaps. 2024-09-08 00:17:53 -04:00
SDL Wiki Bot
7ec998819d Sync SDL3 wiki -> header 2024-09-07 23:13:46 +00:00
Ryan C. Gordon
090e30dbca docs: Remove README-winrt.md, again.
Fixes #10737.
2024-09-07 14:14:43 -04:00
Maia
fd6056307f fix trailing doc comments 2024-09-07 09:11:13 -07:00
cosmonaut
1a13acac09 Always blit to the swapchain in GPU_RenderPresent
Fixes #10744
2024-09-07 08:43:02 -07:00
Maia
fa892d15b7 include files with required types directly 2024-09-07 08:37:46 -07:00
SDL Wiki Bot
e9c7b36fbd Sync SDL3 wiki -> header 2024-09-07 15:30:40 +00:00
Evan Hemsley
68a9991ec9 GPU: Document structs (#10742) 2024-09-07 08:29:14 -07:00
Sam Lantinga
cf9613fe63 The GPU log category ate one of the SDL reserved categories 2024-09-07 07:57:29 -07:00
Sam Lantinga
a01e8a5e10 The GPU log category ate one of the SDL reserved categories
Fixes https://github.com/libsdl-org/SDL/issues/10739
2024-09-07 07:54:13 -07:00
Daniel Ludwig
1849205733 Fix GDK builds after renames done in #10730 2024-09-07 11:50:40 +03:00
Daniel Ludwig
0a44ea1b0b Amend use of non-standard compiler syntax 2024-09-07 11:50:40 +03:00
Daniel Ludwig
0a8bf663b7 Fix VisualC project filter 2024-09-07 11:50:40 +03:00
Sam Lantinga
1d59be67fc Fixed crash if PIPEWIRE_PREFERRED_Init() fails and then pipewire is used anyway
The symbols were unloaded, but not reloaded because pipewire_initialized was still true.
2024-09-06 17:26:45 -07:00
SDL Wiki Bot
f42da35ef9 Sync SDL3 wiki -> header 2024-09-06 23:39:48 +00:00
Caleb Cornett
9730f62e8c GPU: Rename struct members and parameters for SDL3 naming conventions (#10730)
---------

Co-authored-by: Evan Hemsley <2342303+thatcosmonaut@users.noreply.github.com>
2024-09-06 16:38:23 -07:00
Timothee Besset
e21f70c593 pipewire : check minimum client library version early 2024-09-06 14:52:46 -07:00
Ryan C. Gordon
845855d657 Revert "stdinc: Document more symbols."
This reverts commit c93f76436f.

This looked better with the #defines attached to the typedef symbols.
2024-09-06 15:33:27 -04:00
Ryan C. Gordon
c93f76436f stdinc: Document more symbols. 2024-09-06 15:30:56 -04:00
Ryan C. Gordon
73b294cb1c SDL_platform_defines.h: Added documentation, and a little whitespace.
wikiheaders needs the documentation in the first row of the line, at least
currently, so I've only indented things I could get away with, but it might
be a little easier to follow the preprocessor logic now.
2024-09-06 15:09:29 -04:00
Sam Lantinga
4c8357a37d Clarified why the WINDOWS driver is lower than the RAWINPUT driver 2024-09-06 11:27:51 -07:00
Sam Lantinga
66b4c080c0 Clarified why the WGI driver is lower than the WINDOWS driver 2024-09-06 11:25:57 -07:00
Sam Lantinga
8f46cb771c SDL_XINPUT_Enabled() returns false until XInput DLL is successfully loaded
We make sure we initialize XInput first, so that anything checking whether it's enabled gets a valid result based on whether we were able to load it or not.
2024-09-06 11:21:06 -07:00
SDL Wiki Bot
6da97c63da Sync SDL3 wiki -> header 2024-09-06 17:29:28 +00:00
Ryan C. Gordon
ac08dde1b2 windows: Clean out things that should be using defined(SDL_PLATFORM_WINDOWS). 2024-09-06 13:28:39 -04:00
Ryan C. Gordon
154452a726 winrt: Removed WinRT/Windows Phone/UWP support.
Fixes #10724.
2024-09-06 13:28:39 -04:00
Sam Lantinga
6d7c211faf Fixed race condition at startup that could cause a crash in the XInput driver 2024-09-06 10:15:16 -07:00
Sam Lantinga
6e5bd58c4c Include the Steam controller driver on Android 2024-09-06 09:14:42 -07:00
Sam Lantinga
1381cc8554 Add a step to fix generated shader code 2024-09-06 09:09:01 -07:00
Sam Lantinga
104642ffe7 Sorted API symbols 2024-09-06 08:57:40 -07:00
Sam Lantinga
4c382aafcd Fixed building on Raspberry Pi 2024-09-06 08:54:05 -07:00
Anonymous Maarten
360bc667a8 SDL_Log: restore SDL2's SDL_LogCategory order 2024-09-06 17:40:59 +02:00
Anonymous Maarten
26728c321f SDL_test: add include for SDLTest_CommonState 2024-09-06 14:23:08 +02:00
Anonymous Maarten
b4c3df1189 SDL_test: whitespace header fixes 2024-09-06 14:19:05 +02:00
Anonymous Maarten
db96ddca34 SDL_test: use SDLCALL calling convention
This is needed when using a pre-built static SDL3_test library.
2024-09-06 14:19:05 +02:00
Sam Lantinga
379aea5c2d Fixed warnings building with Visual Studio 2024-09-05 20:24:30 -07:00
Sam Lantinga
8edb901724 Fixed crashes in Metal renderer due to ARC releasing references on random memory in newly allocated structs 2024-09-05 19:48:33 -07:00
SDL Wiki Bot
e7969553f8 Sync SDL3 wiki -> header 2024-09-06 02:17:29 +00:00
Sam Lantinga
702ed83f72 Initialize interface structures so they can be extended in the future
We guarantee that we will only add to the end of these interfaces, and any new fields will be optional.
2024-09-05 19:16:00 -07:00
Anonymous Maarten
434193d153 testmultiaudio: initialize audio through SDL_test framework 2024-09-06 03:06:40 +02:00
Anonymous Maarten
102b3b480b SDL_test: move argument parsing into SDL_test 2024-09-06 03:06:40 +02:00
Anonymous Maarten
09af4a8086 SDL_test: make argument parsing extendable 2024-09-06 03:06:40 +02:00
Anonymous Maarten
396dd16471 SDL_test: Remove unused common_usage_* static char pointers 2024-09-06 03:06:40 +02:00
Anonymous Maarten
872608b8af Don't allocate in SDLTest_GenerateRunSeed 2024-09-06 03:06:40 +02:00
Anonymous Maarten
2f4b2df595 SDL_test: pass data pointer to unit tests 2024-09-06 03:06:40 +02:00
SDL Wiki Bot
741c04b339 Sync SDL3 wiki -> header 2024-09-05 23:36:17 +00:00
Anonymous Maarten
baa1a5e2f4 Add SDL_strpbrk 2024-09-06 01:35:43 +02:00
Anonymous Maarten
55934bc85e include: add SDL_RESTRICT for restricted pointer aliasing 2024-09-06 01:35:43 +02:00
Caleb Cornett
2d4eb29c37 Add SDL_SetGPUBlendConstants, SDL_SetGPUStencilReference (#10704) 2024-09-05 17:41:23 -05:00
Sam Lantinga
04a732881a Add a test to verify structure alignment 2024-09-05 15:27:56 -07:00
Frank Praznik
9e850bdcfa docs: Update the migration doc with SDL_SetWindowModalFor() changes 2024-09-05 16:20:16 -04:00
Ozkan Sezer
c0b15e57f4 cmake: disable GPU backends for winrt 2024-09-05 22:39:02 +03:00
Ozkan Sezer
f494658f9c SDL_gpu.c: remove BOM. 2024-09-05 22:39:02 +03:00
Ozkan Sezer
cb2919ac55 [GPU] MinGW build fixes:
- CreateEventEx() is guarded by _WIN32_WINNT >= 0x0600:
  In SDL_gpu_d3d12.c, include core/windows/SDL_windows.h
  that defines _WIN32_WINNT properly to account for that
- DXGIInfoQueue stuff is not available in all toolchains
  such as mingw-w64 version 8.0.3
- SDL_gpu_d3d11.c: _WIN32 is always defined by MinGW, as
  is the case for all windows-targeting compilers, so it
  doesn't guarantee absence of DXGIInfoQueue stuff:
  rely on __IDXGIInfoQueue_INTERFACE_DEFINED__, as it is
  done elsewhere.

Fixes: https://github.com/libsdl-org/SDL/issues/10705 .
2024-09-05 22:39:02 +03:00
SDL Wiki Bot
22aeb1bbba Sync SDL3 wiki -> header 2024-09-05 19:23:35 +00:00
Frank Praznik
a46e7027ce video: Allow setting the parents of toplevel windows
Allow setting a parent/child relationship on toplevel windows, which allows raising sets of windows together, and allows child windows to always float above their parents.

Modal windows are now set by setting the parent, then toggling modal status, as the previous interface duplicated functionality now handled by SDL_SetWindowParent().
2024-09-05 15:22:23 -04:00
SDL Wiki Bot
af4c6682ce Sync SDL3 wiki -> header 2024-09-05 16:59:20 +00:00
cosmonaut
cba5ccb9cf GPU: Fix documentation formatting 2024-09-05 09:57:54 -07:00
Evan Hemsley
42a0df91bf Add padding for non-32-bit-aligned types in structs (#10701) 2024-09-05 09:52:57 -07:00
Sam Lantinga
387774ab8a Build config flags are either defined or undefined, never 0
This is for consistency with CMake build configuration

Also added SDL_VIDEO_RENDER_GPU to the non-CMake build configurations
2024-09-05 09:52:40 -07:00
David Gow
e3fd581aca GPU: vulkan: Respect swapchain minImageCount
The default value of MAX_FRAMES_IN_FLIGHT (3) may be less than the
minImageCount returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR() on
some setups. For example, the Intel IVB Vulkan driver on Wayland returns
a minImageCount of 4, resulting in the following validation warning:

VUID-VkSwapchainCreateInfoKHR-presentMode-02839(ERROR / SPEC): msgNum: -76493605 - Validation Error: [ VUID-VkSwapchainCreateInfoKHR-presentMode-02839 ] | MessageID = 0xfb70ccdb | vkCreateSwapchainKHR(): pCreateInfo->minImageCount 3, which is outside the bounds returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR() (i.e. minImageCount = 4, maxImageCount = 0). The Vulkan spec states: If presentMode is not VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR nor VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR, then minImageCount must be greater than or equal to the value returned in the minImageCount member of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-presentMode-02839)
    Objects: 0

Use the minimum image count in that case, as it's as close as we'll get
to our preferred value. Note also that, unlike maxImageCount,
minImageCount is never 0 (the spec states it is always at least 1), so
we don't need a similar check to see if it applies.

Signed-off-by: David Gow <david@ingeniumdigital.com>
2024-09-05 08:10:18 -07:00
Sam Lantinga
b00bb21507 Added -Wl,--no-undefined-version to Android.mk
Make sure we aren't missing any API entry points
2024-09-05 06:52:45 -07:00
Sylvain
5db00cef96 Android.mk: allow to compile with storage functions 2024-09-05 06:52:26 -07:00
Sam Lantinga
a0f36fb85b Use atomic variables for thread communication
Fixes https://github.com/libsdl-org/SDL/issues/10711
2024-09-05 06:05:49 -07:00
Sylvain
41810c823d Compilation without vulkan: SDL_GPU_VULKAN is always defined for some plateform (at android, macos), test against 0 or 1 2024-09-05 05:36:21 -07:00
Sylvain
defbf67306 SDL_migration.cocci: add SDL_TTF/mixer/image function names to be upgraded from int returned type to bool. 2024-09-05 05:24:19 -07:00
Quinn X. J.
f61d4db39a GPU: colorAttachmentDescriptions should be const
The `colorAttachmentDescriptions` field of `SDL_GPUGraphicsPipelineAttachmentInfo` should be marked `const`,
similarly to the `vertexBindings` and `vertexAttributes` fields of `SDL_GPUVertexInputState`.
2024-09-05 05:22:52 -07:00
SDL Wiki Bot
249a74e436 Sync SDL3 wiki -> header 2024-09-05 01:25:36 +00:00
Evan Hemsley
1c8c014481 GPU: Document opaque handles and enums (#10700) 2024-09-04 18:24:11 -07:00
Sam Lantinga
20d0a1a3d1 Added a defensive check against XINPUTGETCAPABILITIES being NULL
This should never happen, but it does, possibly due to a data segment overwrite elsewhere.
2024-09-04 16:30:27 -07:00
Anonymous Maarten
ff1e252413 testautomation: remove SDLTest_TestCaseFp casts 2024-09-04 23:54:56 +02:00
Sam Lantinga
abd2ac5992 Set the desired channel count when opening audio on Android 2024-09-04 13:59:48 -07:00
Sam Lantinga
e2c9a0a427 Updated Android audio log messages 2024-09-04 13:59:48 -07:00
Evan Hemsley
1788be8547 GPU: Add const to some function parameters (#10694) 2024-09-04 13:53:41 -07:00
Ozkan Sezer
f317581c91 SDL_log.h: Use ASCII characters.
(was missed in commit 7ca676aeed for issue #10636)
2024-09-04 14:56:40 +03:00
Sam Lantinga
c9387bcca5 pipewire: spa_list_is_empty() returns bool 2024-09-03 13:45:00 -07:00
Sam Lantinga
0fd275e16e pulseaudio: fixed cleanup if couldn't connect to pulseaudio server 2024-09-03 13:34:19 -07:00
Sam Lantinga
a56315cd48 Fixed return value failing to load pulseaudio functions 2024-09-03 13:24:27 -07:00
Sam Lantinga
7ca676aeed Use ASCII characters in SDL source and headers
Fixes https://github.com/libsdl-org/SDL/issues/10636
2024-09-03 12:52:27 -07:00
Sam Lantinga
575d9cda6f The parameter to SDL_AppEvent() should be non-const
This allows functions like SDL_ConvertEventToRenderCoordinates() to work without having to copy the event.

Fixes https://github.com/libsdl-org/SDL/issues/10691
2024-09-03 08:18:36 -07:00
Daniel Ludwig
b1b4a9cd1b GDK build: PFN_D3D12_XBOX_CREATE_DEVICE not defined for Xbox One (#10690) 2024-09-03 08:09:00 -05:00
Sam Lantinga
73898a0a64 Renamed NDA platform constants to "PRIVATE" 2024-09-02 21:00:34 -07:00
Caleb Cornett
b233beca47 GPU: Minor documentation cleanup 2024-09-02 18:01:43 -07:00
SDL Wiki Bot
19fb43b94f Sync SDL3 wiki -> header 2024-09-03 00:19:03 +00:00
Sam Lantinga
46ffa82f4e Added SDL_ALPHA_OPAQUE_FLOAT and SDL_ALPHA_TRANSPARENT_FLOAT
Fixes https://github.com/libsdl-org/SDL/issues/10684
2024-09-02 17:17:48 -07:00
Sam Lantinga
18c46a3313 Fixed SDL_pen.h for SDL3 bit flag conventions 2024-09-02 17:17:48 -07:00
Sam Lantinga
35dadda327 Fixed build warnings 2024-09-02 17:17:48 -07:00
Sam Lantinga
f11e7cd06f Add annotations to README-migration.md for functions that changed return type 2024-09-02 17:17:48 -07:00
Sam Lantinga
eacf119923 Renamed SDL_size_add_overflow() and SDL_size_mul_overflow() 2024-09-02 17:17:48 -07:00
Andrei Alexeyev
fb7245fb93 GPU: Add support for more texture formats (#10641) 2024-09-02 19:14:48 -05:00
Caleb Cornett
f405def691 Change GPU flag enums to defines (#10681) 2024-09-02 15:19:43 -07:00
Sam Lantinga
d501f6db07 Make newer DRM and GBM functions optional
Fixes https://github.com/libsdl-org/SDL/issues/10675
2024-09-02 10:37:50 -07:00
Sam Lantinga
8371114009 Fixed error: multiple storage classes in declaration specifiers 2024-09-02 09:50:19 -07:00
Sam Lantinga
93423c1c46 spin_acquire_lock() takes a volatile pointer parameter 2024-09-02 09:50:19 -07:00
Sam Lantinga
01fa9cad80 Fixed error: conflicting types for 'getpagesize' 2024-09-02 09:50:19 -07:00
Sam Lantinga
8b0798a3da Fixed error: variable 'nfences' set but not used 2024-09-02 09:50:19 -07:00
Sam Lantinga
b5700ccc02 Updated dlmalloc to version 2.8.6
From https://gee.cs.oswego.edu/pub/misc/malloc-2.8.6.c
2024-09-02 09:50:19 -07:00
Davis Gallinghouse
deb313dd99 GPU: Compile Metal shader source from NSString
Using the @() syntax to construct an NSString assumes the parenthesized
pointer is null-terminated, but the Metal shader source included in
render/sdlgpu/shaders/metal.h is not null-terminated.

Quoting the clang documentation on Objective-C literals:

    When the type of the parenthesized expression is (char *) or (const
    char *), the result of the boxed expression is a pointer to an
    NSString object containing equivalent character data, which is
    assumed to be ‘\0’-terminated and UTF-8 encoded.

Because the @() syntax assumes null-termination, it may read garbage
data after the shader source (up to the next null byte), which can then
cause the Metal shader compiler to fail. To prevent this, instead of
using the @() boxing syntax, we explicitly construct an NSString using
the string length passed by the caller.
2024-09-02 07:20:36 -07:00
Sam Lantinga
df501040fd Fixed random seed not affecting SDLTest_RandomIntegerInRange() 2024-09-01 14:05:27 -07:00
Sam Lantinga
be341bc078 Make sure we put more than RESAMPLER_MAX_PADDING_FRAMES into an audio stream
It's not an error if we don't, but we'll get 0 bytes out of the stream if we don't flush, which the audio_resampleLoss test treats as a failure.

Fixes https://github.com/libsdl-org/SDL/issues/10613
2024-09-01 14:05:27 -07:00
Zero
2c0ffdc6d5 GPU: Pass the new window size when resizing the swapchain for d3d12 (#10665) 2024-09-01 08:48:29 -07:00
Petar Popovic
1751e127c8 Removed trailing commas in enums 2024-09-01 06:23:20 -07:00
Andrei Alexeyev
d4b8072614 GPU: Fix and generalize BytesPerRow() and BytesPerImage() (#10663)
These functions had special cases for a few BC formats, but all
block-compressed formats should need the same logic. Furthermore they
weren't handling the sRGB variants of those formats.
2024-08-31 23:07:38 -07:00
coffeechriph
b15d79a35a Fix texture_rgba_frag for metal in SDL_shaders_gpu.c 2024-08-31 20:09:11 -07:00
Maia
35ebaf4a45 Fix multiple definitions of SDL_assert* when SDL_WIKI_DOCUMENTATION_SECTION is defined 2024-08-31 20:08:36 -07:00
Petar Popovic
0f59d2f8c9 SDL_test_memory.h: Added void to function prototype 2024-08-31 20:03:25 -07:00
Ryan C. Gordon
88125e4d2d test: added testgpu_simple_clear.c, for direct comparison to testvulkan.c. 2024-08-31 20:45:41 -04:00
Anonymous Maarten
c11b58ead7 Increase maximum line length of SDLTest_LogAllocations 2024-09-01 02:19:39 +02:00
Petar Popovic
d1739ce3a8 Added headers to some SDL_test_*.h files 2024-08-31 11:56:27 -07:00
Sam Lantinga
b17ca32d8c Changed GPU driver names to match renderer driver names
Fixes https://github.com/libsdl-org/SDL/issues/10650
2024-08-31 10:06:27 -07:00
Sam Lantinga
92d1689eb4 Added missing SDL_begin_code.h and SDL_close_code.h to SDL_gpu.h 2024-08-31 10:02:46 -07:00
Sam Lantinga
60760b9abb Sort headers in SDL_gpu.h 2024-08-31 10:00:11 -07:00
Petar Popovic
3f05e9cd58 Added includes to SDL_gpu.h 2024-08-31 09:59:17 -07:00
Sam Lantinga
51a0b58f75 GPU logging should be quiet by default 2024-08-31 09:52:21 -07:00
Sam Lantinga
6c30a0f60b Added scaleMode validation to SDL_SetTextureScaleMode() 2024-08-31 09:43:02 -07:00
Anonymous Maarten
63e58e5d66 SDL_Log: always use WriteFile/WriteConsole on Windows
OutputDebugString and fprintf(stderr) (of mslibc) both output
to the debug window of Visual Studio.
In other debuggers (e.g. RAD), this does not happen.

To avoid double output, this commit always uses WriteFile/WriteConsole.
2024-08-31 17:48:57 +02:00
Anonymous Maarten
8ffc1c2705 SDL_Log: don't rely on printf to forward stderr to the debug stream
This partially reverts 125ce71379
2024-08-31 17:48:57 +02:00
Sam Lantinga
f827c1322c Renamed SDL_Del* to SDL_Remove* 2024-08-31 07:46:28 -07:00
Sam Lantinga
cf1d8e2dfd Renamed SDL_AtomicSetPtr() and SDL_AtomicGetPtr()
Fixes https://github.com/libsdl-org/SDL/issues/10601
2024-08-31 07:46:28 -07:00
Jan Sedivy
00708b976a GPU Metal: Fix uninitialized memory 2024-08-31 07:29:32 -07:00
Sam Lantinga
2010a22f44 Removed unneeded separate return statement. 2024-08-31 07:26:13 -07:00
Sam Lantinga
4759a97c09 Fixed return value from D3D12_UpdateVertexBuffer()
Fixes https://github.com/libsdl-org/SDL/issues/10649
2024-08-31 07:26:13 -07:00
Anonymous Maarten
31a5f3b833 Fix C4090: 'function': different 'const' qualifiers 2024-08-31 06:49:33 -07:00
Frank Praznik
5d5a685a80 wayland: Add support for setting window icons via the xdg-toplevel-icon-v1 protocol 2024-08-31 09:38:43 -04:00
Anonymous Maarten
c57cf716af Document the SDL-specific custom ci commands 2024-08-31 13:16:51 +02:00
Anonymous Maarten
ea0ab2647a SDL_test: print no procname when SDL_TRACKMEM_SYMBOL_NAMES is false
On ci, by default this variable is set to a false value.
By adding [sdl-ci-trackmem] to the commit message,
it will become true.
2024-08-31 13:16:51 +02:00
Anonymous Maarten
36b84e7e00 blit_testRandomToRandomSVGAMultipleIterations: avoid 250000 allocations 2024-08-31 13:16:51 +02:00
Anonymous Maarten
f5f10a8cd1 ci: increase timeout multiplier on Linux 2024-08-31 13:16:51 +02:00
Anonymous Maarten
384afa378c SDL_test: fix proc names on older libunwind
Older libunwind does not have unw_get_proc_name_by_ip.
Instead, use unw_get_proc_name.

Reference: 4c00433b69
2024-08-31 13:16:51 +02:00
Anonymous Maarten
9ca8a6e50b ci: install libunwind for printing traces of leaks 2024-08-31 13:16:51 +02:00
kanjitalk755
1bc81c7e30 Add GPU files to xcodeproj 2024-08-31 12:32:38 +02:00
Anonymous Maarten
a724aae728 ci: build xcode project targeting macos 2024-08-31 11:45:39 +02:00
Andrei Alexeyev
0e08d15cca GPU: Fix unhandled R16G16_UNORM in SDL_GPUTextureFormatTexelBlockSize() (#10638) 2024-08-30 17:05:17 -07:00
Sam Lantinga
f13dc502c6 Sort exported functions 2024-08-30 15:45:30 -07:00
Evan Hemsley
12ecdb9dde GPU: Rename some awkwardly named functions (#10642) 2024-08-30 15:31:10 -07:00
Sam Lantinga
bef07023d6 Fixed memory leak if the GPU renderer can't be initialized
DestroyRenderer needs to be set before we return false from GPU_CreateRenderer()
2024-08-30 14:49:49 -07:00
Ryan C. Gordon
c38d3f0fe4 examples/game/01-snake: Remove RNG abstraction. 2024-08-30 17:13:51 -04:00
Ryan C. Gordon
29b9b163b9 example/game/01-snake: Make the "food" rectangles lighter blue. 2024-08-30 15:12:22 -04:00
Ryan C. Gordon
f6fc5e2881 examples: Smush game/01-snake into one source file, clean up some things. 2024-08-30 13:47:41 -04:00
cosmonaut
906044569d GPU D3D12: Fix command buffer leak 2024-08-30 10:46:41 -07:00
Sam Lantinga
b602c449e5 Remove SDL_SCALEMODE_BEST
Fixes https://github.com/libsdl-org/SDL/issues/10619
2024-08-30 10:30:14 -07:00
Evan Hemsley
4bbf0d45fd GPU D3D12: Fix teardown and leaks on device creation failure (#10639) 2024-08-30 10:24:02 -07:00
Sam Lantinga
40d85109ac Fixed crash when using the dummy video driver
The higher level code will clean up the renderer if initialization fails.
2024-08-30 07:16:47 -07:00
Sam Lantinga
580a496391 Adjust rounding when calculating resampled output frames
Fixes https://github.com/libsdl-org/sdl2-compat/issues/95
2024-08-30 07:16:47 -07:00
SDL Wiki Bot
04845bd39c Sync SDL3 wiki -> header 2024-08-30 13:27:33 +00:00
Sam Lantinga
138f3a3c91 Fixed documentation for SDL_SetAudioStreamGetCallback()
Fixes https://github.com/libsdl-org/SDL/issues/10633
2024-08-30 06:26:23 -07:00
Anonymous Maarten
ec85d2f74f sdlprocdump: fix minidump filename 2024-08-30 14:18:03 +02:00
Anonymous Maarten
88fe52df7b SDL_test: add --gpu option 2024-08-30 13:43:38 +02:00
Anonymous Maarten
8ce2074d08 cmake: fix SDL_RENDER_GPU report at end of configuration 2024-08-30 13:35:13 +02:00
Andrei Alexeyev
d1a2c57fb9 GPU: Fix memory leak in VULKAN_CreateDevice (#10631) 2024-08-29 22:15:08 -07:00
Sam Lantinga
16fb8e54cb Fixed the colorspace for YUV textures using native RGB representations
Fixes https://github.com/libsdl-org/SDL/issues/10624
2024-08-29 20:55:09 -07:00
Sam Lantinga
efc98062af Fixed warning C4310: cast truncates constant value 2024-08-29 19:31:23 -07:00
Sam Lantinga
5518aca054 Use stdbool internally in SDL 2024-08-29 18:54:05 -07:00
Sam Lantinga
dfcabc3db8 Fixed drawing debug text 2024-08-29 18:21:48 -07:00
Sam Lantinga
f1b4c2bbbb Removed Unicode BOM from SDL_gpu.h 2024-08-29 18:03:59 -07:00
Sam Lantinga
980a67d5e2 Added configuration dependencies for SDL_RENDER_GPU (#10627) 2024-08-29 17:58:54 -07:00
SDL Wiki Bot
9f0b23d3ad Sync SDL3 wiki -> header 2024-08-30 00:35:24 +00:00
Sam Lantinga
683e5b8d52 Removed Unicode BOM 2024-08-29 17:33:52 -07:00
Sam Lantinga
858589919a Temporarily use the GPU renderer by default so we get testing feedback 2024-08-29 17:33:52 -07:00
Sam Lantinga
d86f504637 Fix potential cases where we define SDL_GPU_* as an undefined symbol 2024-08-29 17:33:52 -07:00
Sam Lantinga
b356c65005 Sort exported symbols 2024-08-29 17:33:52 -07:00
Sam Lantinga
62f6e6b701 Removed the preferLowPower parameter from SDL_CreateGPUDevice() 2024-08-29 17:33:52 -07:00
Sam Lantinga
3046335f28 Fixed device creation property documentation formatting 2024-08-29 17:33:52 -07:00
Sam Lantinga
b8e7ef27f3 Renamed GPU device creation properties 2024-08-29 17:33:52 -07:00
Sam Lantinga
d70578b9aa Renamed Gpu to GPU 2024-08-29 17:33:52 -07:00
SDL Wiki Bot
717f4f6fb4 Sync SDL3 wiki -> header 2024-08-29 23:54:57 +00:00
Ryan C. Gordon
8ea38ebedc gpu: Fix wiki category capitalization. 2024-08-29 19:45:03 -04:00
SDL Wiki Bot
68038394d1 Sync SDL3 wiki -> header 2024-08-29 22:58:01 +00:00
cosmonaut
2e7d5bb429 Add the SDL_GPU API
Project Lead: Evan Hemsley <evan@moonside.games>

Co-designer, Metal Port, Console Ports:

Co-authored-by: Caleb Cornett <caleb.cornett@outlook.com>

Production, QA, Debug:

Co-authored-by: Ethan Lee <flibitijibibo@gmail.com>

SDL_Render Driver, Bugfixes:

Co-authored-by: Andrei Alexeyev <akari@taisei-project.org>

Additional D3D12 Programming, Bugfixes:

Co-authored-by: Bart van der Werf <bluelive@gmail.com>

Bugfixes and Feedback:

Co-authored-by: Zakary Strange <zakarystrange@gmail.com>
Co-authored-by: meyraud705 <meyraud705@gmail.com>
Co-authored-by: Joshua T. Fisher <playmer@gmail.com>
Co-authored-by: Topi Ritala <ritalat@fastmail.com>
Co-authored-by: David Gow <david@ingeniumdigital.com>

Original API Proposal:

Co-authored-by: Ryan C. Gordon <icculus@icculus.org>
2024-08-29 15:57:29 -07:00
Sam Lantinga
8ddb099d3e testautomation: use a larger destination buffer than needed in audio_resampleLoss
This is a common way to use the API and tickles the same automation failure that sdl2-compat runs into.
2024-08-29 10:59:18 -07:00
Anonymous Maarten
d6ad28a4cb Dynamically generate __main__.py of Android aar package 2024-08-29 13:57:29 +02:00
Anonymous Maarten
a5866809bb cmake: also test ARM neon on non-gcc compilers 2024-08-29 12:38:56 +02:00
Mārtiņš Možeiko
d9b3b9ad91 Add neon SIMD alpha blending blitter 2024-08-28 21:37:55 -07:00
Ethan Lee
9ab140fad8 offscreen: Fix bogus surface pointer assignment 2024-08-28 21:31:24 -04:00
Sam Lantinga
1a007ab88d Fixed SDL_GetDisplayIndex() 2024-08-28 16:30:21 -07:00
Sam Lantinga
7055001d85 Fixed SDL_GetPrimaryDisplay() 2024-08-28 15:59:13 -07:00
Sam Lantinga
0cdb4833d5 Removed unnecessary inclusion of stdint.h 2024-08-28 15:54:56 -07:00
Sam Lantinga
37b4aac3ac Removed unnecessary inclusion of stdbool.h 2024-08-28 13:58:03 -07:00
Sam Lantinga
91eabf1b4d Fixed SDL_EGL_ChooseConfig() 2024-08-28 13:37:00 -07:00
Sam Lantinga
3bf7b4ff31 Fixed SDL_EGL_LoadLibrary() 2024-08-28 13:21:02 -07:00
Mārtiņš Možeiko
8d65942b9c Faster sse4 and avx2 SIMD blitters 2024-08-28 10:40:44 -07:00
Sam Lantinga
c4b35488c2 Fixed warning C6385: Reading invalid data from 'one_blitkey'. 2024-08-28 10:40:14 -07:00
Sam Lantinga
abd8ea09de Fixed warning C6001: Using uninitialized memory 'devices'. 2024-08-28 10:34:34 -07:00
hwsmm
940f7535ef Remove SDL_PEN hints that are no longer used 2024-08-28 07:04:48 -07:00
Sam Lantinga
ace6920d44 Fixed returning -1 in a function returning bool 2024-08-27 22:35:09 -07:00
Sam Lantinga
36a091cc43 Use SDL_GetError() for SDL_ttf errors 2024-08-27 19:02:28 -07:00
Ryan C. Gordon
5dc5b4b83c pthread: Fixed logic bug in SDL_WaitConditionTimeoutNS due to boolization work. 2024-08-27 17:00:47 -04:00
Maia
a24c164956 Fix trailing doc comments 2024-08-27 13:23:26 -07:00
SDL Wiki Bot
85bbc6028a Sync SDL3 wiki -> header 2024-08-27 17:33:28 +00:00
Sam Lantinga
47926d7bd0 Added a cleanup function for virtual joysticks 2024-08-27 10:31:46 -07:00
Sam Lantinga
00c409cff8 Additional cleanup exposed by building with a C++ compiler 2024-08-27 10:31:46 -07:00
Sam Lantinga
f08ac438ed Use stdbool for SDL_bool
This helps the compiler warn people when they're doing something like "if (SDL_Init(0) < 0)"
2024-08-27 10:31:46 -07:00
Sam Lantinga
9ff3446f03 Use SDL_bool instead an int return code in the SDL API
Most SDL functions used to indicate success or failure using an int return code. These functions have been changed to return SDL_bool.

Here is a coccinelle patch to change code that previously compared the return value to 0 and changes it to a boolean test:
@ bool_return_type  @
identifier func =~ "^(SDL_AddEventWatch|SDL_AddHintCallback|SDL_AddSurfaceAlternateImage|SDL_AddVulkanRenderSemaphores|SDL_BindAudioStream|SDL_BindAudioStreams|SDL_BlitSurface|SDL_BlitSurface9Grid|SDL_BlitSurfaceScaled|SDL_BlitSurfaceTiled|SDL_BlitSurfaceTiledWithScale|SDL_BlitSurfaceUnchecked|SDL_BlitSurfaceUncheckedScaled|SDL_CaptureMouse|SDL_ClearAudioStream|SDL_ClearClipboardData|SDL_ClearComposition|SDL_ClearError|SDL_ClearProperty|SDL_ClearSurface|SDL_CloseIO|SDL_CloseStorage|SDL_ConvertAudioSamples|SDL_ConvertEventToRenderCoordinates|SDL_ConvertPixels|SDL_ConvertPixelsAndColorspace|SDL_CopyFile|SDL_CopyProperties|SDL_CopyStorageFile|SDL_CreateDirectory|SDL_CreateStorageDirectory|SDL_CreateWindowAndRenderer|SDL_DateTimeToTime|SDL_DestroyWindowSurface|SDL_DetachVirtualJoystick|SDL_DisableScreenSaver|SDL_EnableScreenSaver|SDL_EnumerateDirectory|SDL_EnumerateProperties|SDL_EnumerateStorageDirectory|SDL_FillSurfaceRect|SDL_FillSurfaceRects|SDL_FlashWindow|SDL_FlipSurface|SDL_FlushAudioStream|SDL_FlushRenderer|SDL_GL_DestroyContext|SDL_GL_GetAttribute|SDL_GL_GetSwapInterval|SDL_GL_LoadLibrary|SDL_GL_MakeCurrent|SDL_GL_SetAttribute|SDL_GL_SetSwapInterval|SDL_GL_SwapWindow|SDL_GetAudioDeviceFormat|SDL_GetAudioStreamFormat|SDL_GetCameraFormat|SDL_GetClosestFullscreenDisplayMode|SDL_GetCurrentRenderOutputSize|SDL_GetCurrentTime|SDL_GetDXGIOutputInfo|SDL_GetDateTimeLocalePreferences|SDL_GetDisplayBounds|SDL_GetDisplayUsableBounds|SDL_GetGDKDefaultUser|SDL_GetGDKTaskQueue|SDL_GetGamepadSensorData|SDL_GetGamepadTouchpadFinger|SDL_GetHapticEffectStatus|SDL_GetJoystickBall|SDL_GetMasksForPixelFormat|SDL_GetPathInfo|SDL_GetRectUnion|SDL_GetRectUnionFloat|SDL_GetRenderClipRect|SDL_GetRenderColorScale|SDL_GetRenderDrawBlendMode|SDL_GetRenderDrawColor|SDL_GetRenderDrawColorFloat|SDL_GetRenderLogicalPresentation|SDL_GetRenderLogicalPresentationRect|SDL_GetRenderOutputSize|SDL_GetRenderSafeArea|SDL_GetRenderScale|SDL_GetRenderVSync|SDL_GetRenderViewport|SDL_GetSensorData|SDL_GetStorageFileSize|SDL_GetStoragePathInfo|SDL_GetSurfaceAlphaMod|SDL_GetSurfaceBlendMode|SDL_GetSurfaceClipRect|SDL_GetSurfaceColorKey|SDL_GetSurfaceColorMod|SDL_GetTextInputArea|SDL_GetTextureAlphaMod|SDL_GetTextureAlphaModFloat|SDL_GetTextureBlendMode|SDL_GetTextureColorMod|SDL_GetTextureColorModFloat|SDL_GetTextureScaleMode|SDL_GetTextureSize|SDL_GetWindowAspectRatio|SDL_GetWindowBordersSize|SDL_GetWindowMaximumSize|SDL_GetWindowMinimumSize|SDL_GetWindowPosition|SDL_GetWindowRelativeMouseMode|SDL_GetWindowSafeArea|SDL_GetWindowSize|SDL_GetWindowSizeInPixels|SDL_GetWindowSurfaceVSync|SDL_HideCursor|SDL_HideWindow|SDL_Init|SDL_InitHapticRumble|SDL_InitSubSystem|SDL_LoadWAV|SDL_LoadWAV_IO|SDL_LockAudioStream|SDL_LockProperties|SDL_LockSurface|SDL_LockTexture|SDL_LockTextureToSurface|SDL_MaximizeWindow|SDL_MinimizeWindow|SDL_MixAudio|SDL_OpenURL|SDL_OutOfMemory|SDL_PauseAudioDevice|SDL_PauseAudioStreamDevice|SDL_PauseHaptic|SDL_PlayHapticRumble|SDL_PremultiplyAlpha|SDL_PremultiplySurfaceAlpha|SDL_PushEvent|SDL_PutAudioStreamData|SDL_RaiseWindow|SDL_ReadStorageFile|SDL_ReadSurfacePixel|SDL_ReadSurfacePixelFloat|SDL_RegisterApp|SDL_ReloadGamepadMappings|SDL_RemovePath|SDL_RemoveStoragePath|SDL_RemoveTimer|SDL_RenamePath|SDL_RenameStoragePath|SDL_RenderClear|SDL_RenderCoordinatesFromWindow|SDL_RenderCoordinatesToWindow|SDL_RenderFillRect|SDL_RenderFillRects|SDL_RenderGeometry|SDL_RenderGeometryRaw|SDL_RenderLine|SDL_RenderLines|SDL_RenderPoint|SDL_RenderPoints|SDL_RenderPresent|SDL_RenderRect|SDL_RenderRects|SDL_RenderTexture|SDL_RenderTexture9Grid|SDL_RenderTextureRotated|SDL_RenderTextureTiled|SDL_RequestAndroidPermission|SDL_RestoreWindow|SDL_ResumeAudioDevice|SDL_ResumeAudioStreamDevice|SDL_ResumeHaptic|SDL_RumbleGamepad|SDL_RumbleGamepadTriggers|SDL_RumbleJoystick|SDL_RumbleJoystickTriggers|SDL_RunHapticEffect|SDL_SaveBMP|SDL_SaveBMP_IO|SDL_SendAndroidMessage|SDL_SendGamepadEffect|SDL_SendJoystickEffect|SDL_SendJoystickVirtualSensorData|SDL_SetAppMetadata|SDL_SetAppMetadataProperty|SDL_SetAudioDeviceGain|SDL_SetAudioPostmixCallback|SDL_SetAudioStreamFormat|SDL_SetAudioStreamFrequencyRatio|SDL_SetAudioStreamGain|SDL_SetAudioStreamGetCallback|SDL_SetAudioStreamInputChannelMap|SDL_SetAudioStreamOutputChannelMap|SDL_SetAudioStreamPutCallback|SDL_SetBooleanProperty|SDL_SetClipboardData|SDL_SetClipboardText|SDL_SetCursor|SDL_SetFloatProperty|SDL_SetGamepadLED|SDL_SetGamepadMapping|SDL_SetGamepadPlayerIndex|SDL_SetGamepadSensorEnabled|SDL_SetHapticAutocenter|SDL_SetHapticGain|SDL_SetJoystickLED|SDL_SetJoystickPlayerIndex|SDL_SetJoystickVirtualAxis|SDL_SetJoystickVirtualBall|SDL_SetJoystickVirtualButton|SDL_SetJoystickVirtualHat|SDL_SetJoystickVirtualTouchpad|SDL_SetLinuxThreadPriority|SDL_SetLinuxThreadPriorityAndPolicy|SDL_SetLogPriorityPrefix|SDL_SetMemoryFunctions|SDL_SetNumberProperty|SDL_SetPaletteColors|SDL_SetPointerProperty|SDL_SetPointerPropertyWithCleanup|SDL_SetPrimarySelectionText|SDL_SetRenderClipRect|SDL_SetRenderColorScale|SDL_SetRenderDrawBlendMode|SDL_SetRenderDrawColor|SDL_SetRenderDrawColorFloat|SDL_SetRenderLogicalPresentation|SDL_SetRenderScale|SDL_SetRenderTarget|SDL_SetRenderVSync|SDL_SetRenderViewport|SDL_SetScancodeName|SDL_SetStringProperty|SDL_SetSurfaceAlphaMod|SDL_SetSurfaceBlendMode|SDL_SetSurfaceColorKey|SDL_SetSurfaceColorMod|SDL_SetSurfaceColorspace|SDL_SetSurfacePalette|SDL_SetSurfaceRLE|SDL_SetTLS|SDL_SetTextInputArea|SDL_SetTextureAlphaMod|SDL_SetTextureAlphaModFloat|SDL_SetTextureBlendMode|SDL_SetTextureColorMod|SDL_SetTextureColorModFloat|SDL_SetTextureScaleMode|SDL_SetThreadPriority|SDL_SetWindowAlwaysOnTop|SDL_SetWindowAspectRatio|SDL_SetWindowBordered|SDL_SetWindowFocusable|SDL_SetWindowFullscreen|SDL_SetWindowFullscreenMode|SDL_SetWindowHitTest|SDL_SetWindowIcon|SDL_SetWindowKeyboardGrab|SDL_SetWindowMaximumSize|SDL_SetWindowMinimumSize|SDL_SetWindowModalFor|SDL_SetWindowMouseGrab|SDL_SetWindowMouseRect|SDL_SetWindowOpacity|SDL_SetWindowPosition|SDL_SetWindowRelativeMouseMode|SDL_SetWindowResizable|SDL_SetWindowShape|SDL_SetWindowSize|SDL_SetWindowSurfaceVSync|SDL_SetWindowTitle|SDL_SetiOSAnimationCallback|SDL_ShowAndroidToast|SDL_ShowCursor|SDL_ShowMessageBox|SDL_ShowSimpleMessageBox|SDL_ShowWindow|SDL_ShowWindowSystemMenu|SDL_StartTextInput|SDL_StartTextInputWithProperties|SDL_StopHapticEffect|SDL_StopHapticEffects|SDL_StopHapticRumble|SDL_StopTextInput|SDL_SyncWindow|SDL_TimeToDateTime|SDL_TryLockMutex|SDL_TryLockRWLockForReading|SDL_TryLockRWLockForWriting|SDL_TryWaitSemaphore|SDL_UnlockAudioStream|SDL_UpdateHapticEffect|SDL_UpdateNVTexture|SDL_UpdateTexture|SDL_UpdateWindowSurface|SDL_UpdateWindowSurfaceRects|SDL_UpdateYUVTexture|SDL_Vulkan_CreateSurface|SDL_Vulkan_LoadLibrary|SDL_WaitConditionTimeout|SDL_WaitSemaphoreTimeout|SDL_WarpMouseGlobal|SDL_WriteStorageFile|SDL_WriteSurfacePixel|SDL_WriteSurfacePixelFloat)$";
@@
(
  func(
  ...
  )
- == 0
|
- func(
+ !func(
  ...
  )
- < 0
|
- func(
+ !func(
  ...
  )
- != 0
|
- func(
+ !func(
  ...
  )
- == -1
)
2024-08-27 10:31:46 -07:00
Caleb Cornett
d9a5ed75b9 GDK: Xbox should have input focus by default 2024-08-25 22:12:02 -04:00
Ryan C. Gordon
d118af53a1 dummyaudio: single-threaded Emscripten support.
On Emscripten without pthreads, this would fail because SDL can't spin the
audio device thread, and the dummy backend didn't manage a thread itself.

With this patch, we use setInterval to fire the usual audio thread iterators
between iterations of the Emscripten mainloop on the main thread.

Fixes #10573.
2024-08-25 15:23:21 -04:00
Ozkan Sezer
845212388e RAWINPUT_JoystickOpen: add missing SDL_stack_free() calls.
Fixes https://github.com/libsdl-org/SDL/issues/10574.
2024-08-25 11:05:40 +03:00
Anonymous Maarten
38815c22cd cmake: build uclibc as a static library 2024-08-24 05:21:02 +03:00
Francisco Javier Trujillo Mata
aa527dd0c2 Allow MessageBox to work without window 2024-08-23 11:52:19 -07:00
Sam Lantinga
fa2c9c46c5 Default SDL_HINT_JOYSTICK_GAMEINPUT to SDL_FALSE
This was causing crashes in IGameInput_RegisterSystemButtonCallback(), presumably on older systems with runtimes using a different function signature. We'll just disable it for now until the GameInput runtime has stabilized and we can tell when it's safe to use.
2024-08-23 11:34:15 -07:00
Anonymous Maarten
8bcfdb0c92 cmake: fix SDL3-x.y.z.jar installation on Windows 2024-08-23 03:20:39 +02:00
Anonymous Maarten
c298d2024a Include SDL_build_config.h without a 'build_config/' prefix 2024-08-23 00:51:35 +00:00
Anonymous Maarten
702abfe7d5 cmake: only build uclibc when building without external libc 2024-08-23 00:40:19 +00:00
Sam Lantinga
3e60fb4223 VULKAN_UpdateVertexBuffer() should return true if there's nothing to do 2024-08-22 13:30:02 -07:00
Sam Lantinga
8f546bb3c9 Use C99 bool internally in SDL 2024-08-22 13:30:02 -07:00
Sam Lantinga
6501e90018 Use C++ style comments consistently in SDL source code
Implemented using this script:

find . -type f -exec sed -i'' -e 's,/\* *\([^*]*\)\*/ *$,// \1,' -e 's, \+$,,' {} \;
git checkout \
    core/linux/SDL_evdev_kbd_default_keymap.h \
    events/imKStoUCS.* \
    hidapi \
    joystick/controller_type.c \
    joystick/controller_type.h \
    joystick/hidapi/steam/controller_constants.h \
    joystick/hidapi/steam/controller_structs.h \
    joystick/SDL_gamepad_db.h \
    libm \
    render/*/*Shader*.h \
    render/vitagxm/SDL_render_vita_gxm_shaders.h \
    render/metal/SDL_shaders_metal_*.h \
    stdlib/SDL_malloc.c \
    stdlib/SDL_qsort.c \
    stdlib/SDL_strtokr.c \
    test/ \
    video/directx/SDL_d3d12_xbox_cmacros.h \
    video/directx/d3d12.h \
    video/directx/d3d12sdklayers.h \
    video/khronos \
    video/x11/edid-parse.c \
    video/x11/xsettings-client.* \
    video/yuv2rgb
sed -i'' -e 's,/\* *\([^*]*\)\*/ *$,// \1,' -e 's, \+$,,' hidapi/SDL_hidapi.c
2024-08-22 13:30:02 -07:00
Sam Lantinga
658fc3db0f Updated list of third party code and generated files 2024-08-22 13:30:02 -07:00
Anonymous Maarten
46903e61e6 Fix typo in the Android archive's INSTALL.md documentation 2024-08-22 18:11:28 +02:00
Anonymous Maarten
2b8ebf08d1 The SDL3 MSVC SDK does not provide ARM64EC binaries
(X64 is compatible)
2024-08-22 18:10:48 +02:00
Sam Lantinga
9c7c0646c9 Fixed typo 2024-08-22 09:04:30 -07:00
Sam Lantinga
037541a0e0 Check standard error code return values as < 0 instead of == -1 2024-08-22 09:04:30 -07:00
Anonymous Maarten
46d9066a69 Fix warnings shown when making SDL_bool a typedef of bool 2024-08-22 16:03:39 +00:00
Sam Lantinga
03ace96e5b Document that new surfaces are initialized to zero.
Fixes https://github.com/libsdl-org/SDL/issues/10577
2024-08-22 06:27:56 -07:00
Anonymous Maarten
9eac3a434e ctest/emscripten: make audio and video driver configurable 2024-08-21 20:14:55 +02:00
Sam Lantinga
ef2a30e415 testffmpeg: don't use the OES texture path for NV12 video frames 2024-08-20 15:45:09 -07:00
Sam Lantinga
0e7ae3d843 testffmpeg: fixed crash if DRM frame doesn't have hw_frames_ctx 2024-08-20 14:10:57 -07:00
Anonymous Maarten
1f89e05dcf testautomation: skip window resize and repositioning tests on Emscripten 2024-08-20 16:04:58 +00:00
Anonymous Maarten
430f448ea1 testautomation: skip timerTestCallback on Emscripten
Timer callbacks on Emscripten require a main event loop
2024-08-20 16:04:58 +00:00
Anonymous Maarten
937c41eb1c testautomation/mouse: add SDLTest_AssertPass before SDL_DestroyCursor's 2024-08-20 16:04:58 +00:00
Anonymous Maarten
08661166e9 ci: verify SDL_REVISION 2024-08-20 16:04:58 +00:00
Anonymous Maarten
161761653f test: use Selenium to run Emscripten tests 2024-08-20 16:04:58 +00:00
Anonymous Maarten
46bafda7ab testshader: add -sLEGACY_GL_EMULATION for emscripten 2024-08-20 16:04:58 +00:00
Anonymous Maarten
6052136ced tests/emscripten: add link-time dependency on the resources 2024-08-20 16:04:58 +00:00
Anonymous Maarten
5415909f2d docs/emscripten: --embed-file does not accept a '=' 2024-08-20 16:04:58 +00:00
Anonymous Maarten
2eaf73d9e0 Errors on non-threaded platforms are limited to 128 bytes 2024-08-20 16:04:58 +00:00
Anonymous Maarten
29ca5b5dcd SDLTest_CompareMemory: print header 2024-08-20 16:04:58 +00:00
Anonymous Maarten
c66a09ce26 Make main_testSetError test more verbose 2024-08-20 16:04:58 +00:00
Anonymous Maarten
c054435f37 Add verbose logging to TestVirtualJoystick 2024-08-20 16:04:58 +00:00
Anonymous Maarten
50f50df8b1 tests: add --no-threads argument to disable threads
This is useful for Emscripten that can be built without threads support
2024-08-20 16:04:58 +00:00
Anonymous Maarten
3fccb77da6 test: map URL to other directories
This allows to 'mount' the SDL source directory on http://localhost:8080/SDL.
This is useful for debugging emscripten applications in the browser.

Build SDL with "-gsource-map -ffile-prefix-map=/path/to/SDL:/SDL" to
configure the URL where the source code must be available.
2024-08-20 16:04:58 +00:00
Sam Lantinga
d29276e625 Include SDL_events.h in SDL_init.h for SDL_AppEvent_func() 2024-08-20 07:53:07 -07:00
Anthony
459d3a8bbd Add messageBox to proguard-rules.pro (#10570)
I missed this out from the previous update, oops!
2024-08-20 07:41:52 -07:00
Sam Lantinga
61b024766a Fixed crash when quitting after a joystick has been disconnected on Android
Fixes https://github.com/libsdl-org/SDL/issues/10567
2024-08-20 07:26:09 -07:00
Ryan C. Gordon
423d6ec15a emscripten: Make sure SDL_malloc and friends are marked KEEPALIVE.
Reference PR #9937.
2024-08-19 23:50:52 -04:00
Sam Lantinga
e75175129f Added support for the Retro-bit Controller in PS3 mode
Fixes https://github.com/libsdl-org/SDL/issues/10557
2024-08-19 16:40:50 -07:00
Jan Engelhardt
92c4734666 Resolve build failures in pipewire code
g++-13 complains:

```
SDL_pipewire.c:129:42: warning: assignment to "struct pw_main_loop *
(*)(struct pw_main_loop *)" from incompatible pointer type "struct
pw_main_loop * (*)(const struct spa_dict *)"
[-Wincompatible-pointer-types]
 129 | #define SDL_PIPEWIRE_SYM(x) PIPEWIRE_##x = x
SDL_pipewire.c:148:5: note: in expansion of macro "SDL_PIPEWIRE_SYM"
 148 |     SDL_PIPEWIRE_SYM(pw_main_loop_new);
```

g++-14 complains:

```
SDL_pipewire.c:129:42: error: assignment to "struct pw_main_loop *
(*)(const struct pw_main_loop *)" from incompatible pointer type
"struct pw_main_loop * (*)(const struct spa_dict *)"
[-Wincompatible-pointer-types]
```
2024-08-19 14:26:08 -07:00
Ryan C. Gordon
85ca516735 examples: Added a simple camera example. 2024-08-19 14:48:25 -04:00
Ryan C. Gordon
405693175d camera: Fixed Emscripten support. 2024-08-19 14:15:47 -04:00
Ryan C. Gordon
eb212ac4ed main: Emscripten needs SDL_main_impl.h now that it has its own SDL_RunApp.
Reference PR #10171.
2024-08-18 23:54:55 -04:00
SDL Wiki Bot
1f34f35b25 Sync SDL3 wiki -> header 2024-08-19 00:55:27 +00:00
Ryan C. Gordon
9c5bd98a0f assert: Added SDL_HINT_ASSERT.
Same environment variable, but now accessible as a formal SDL hint.

Reference PR #10171.
2024-08-18 20:53:55 -04:00
Sam Lantinga
59ac561062 PSP: Throw SDL_EVENT_QUIT event upon exit (thanks @sharkwouter!)
Closes https://github.com/libsdl-org/SDL/pull/10565
2024-08-18 08:25:44 -07:00
SDL Wiki Bot
a7bed810b3 Sync SDL3 wiki -> header 2024-08-17 06:30:02 +00:00
Ryan C. Gordon
42e43697cf include: Minor SDL_AppResult documentation tweak. 2024-08-17 00:42:33 -04:00
SDL Wiki Bot
4147ff6a4e Sync SDL3 wiki -> header 2024-08-17 04:39:06 +00:00
Ryan C. Gordon
4c30e555fe include: Clean up SDL_AppResult documentation. 2024-08-17 00:37:56 -04:00
Ryan C. Gordon
abdd8b4929 wikiheaders: generate wiki redirect pages for individual enumerators. 2024-08-16 23:45:14 -04:00
Sam Lantinga
156aab2147 Added documentation for SDL_DisplayID and SDL_WindowID for consistency. 2024-08-16 15:46:43 -07:00
SDL Wiki Bot
4fbdbbbde6 Sync SDL3 wiki -> header 2024-08-16 22:22:07 +00:00
Sam Lantinga
cb85894e94 Clarified device ID documentation
Fixes https://github.com/libsdl-org/SDL/issues/10558
2024-08-16 15:20:34 -07:00
ds-sloth
7d78835f87 SDL_iostream.c: stdio_seek - skip API call for SEEK_CUR with 0 offset
Fixes #10556.
2024-08-16 17:13:49 -04:00
SDL Wiki Bot
ab53ff77bb Sync SDL3 wiki -> header 2024-08-16 18:17:21 +00:00
Sam Lantinga
438a214420 Changed main callback return values to an enumeration
Fixes https://github.com/libsdl-org/SDL/issues/10515
2024-08-16 11:16:05 -07:00
Sam Lantinga
83adcb9d38 Added SDL_PROP_WINDOW_CREATE_FLAGS_NUMBER
This is undocumented since the individual flags are separate window creation properties, but it's useful to have a shared definition for this, which is used internally and for migrating code from SDL2.
2024-08-15 13:33:06 -07:00
Sam Lantinga
d7b027a241 Namespace the object creation properties
Fixes https://github.com/libsdl-org/SDL/issues/10543
2024-08-15 12:56:04 -07:00
Sam Lantinga
8e99ec34bb Use drmModeAddFB() if drmModeAddFB2WithModifiers() fails
Fixes https://github.com/libsdl-org/SDL/issues/10276
2024-08-15 11:51:46 -07:00
Sam Lantinga
41f1c83caa If scaling fails, fall back to the closest image available in SDL_GetSurfaceImage() 2024-08-15 07:38:43 -07:00
SDL Wiki Bot
0822d94631 Sync SDL3 wiki -> header 2024-08-15 14:29:23 +00:00
Kaktus514
3586df3151 Prefer downscaling in SDL_GetSurfaceImage.
This implements the ideas described in  #10536
2024-08-15 07:28:31 -07:00
Anonymous Maarten
4ac5d4506b testcamera: always render current texture 2024-08-15 09:20:34 -04:00
Anonymous Maarten
612b41c451 camera: use cdevice SDL_Event union member 2024-08-15 09:20:34 -04:00
Anonymous Maarten
f95027e3d7 sdlprocdump: skip parsed arguments 2024-08-15 12:17:52 +02:00
Qiu Qiang
d60e6e2558 testcamera: Add logging for camera FPS (#10525)
Add frequency logging in SDL_AppIterate.
Log camera specs upon approval.
2024-08-14 08:39:18 -07:00
Sam Lantinga
efdcfef4b9 Fixed Android build warnings 2024-08-13 10:52:50 -07:00
Ilya Mizus
ce98550cbb Fixed secondary screens on KMSDRM (#10535)
* Removed window movement to left top corner that breaks secondary screens on KMSDRM
2024-08-13 07:15:12 -07:00
Frank Praznik
76b35ae76f wayland: Minor code-style cleanups 2024-08-13 09:56:03 -04:00
Anonymous Maarten
01c42f1399 testautomation: test palettization using SDL_ConvertSurfaceAndColorspace 2024-08-13 10:56:09 +02:00
Sam Lantinga
375f303d97 Improved color accuracy blitting floating point surfaces to 8-bit indexed surfaces 2024-08-12 11:50:32 -07:00
Dragon-Baroque
e87647c351 Support SDL_EVENT_DROP_TEXT in Wayland
src/video/wayland/SDL_waylanddatamanager.c
    Log data + primary_selection _offer_receive
  src/video/wayland/SDL_waylandevents.c + SDL_waylanddatamanager.h
    Log data + primary_selection events
    Split FILE vs TEXT events : booleans has_mime_ text + file
    Handle text/plain;charset=utf-8 data offer
2024-08-12 14:16:38 -04:00
Sam Lantinga
755e201aa5 Improved color accuracy blitting to 8-bit indexed surfaces
Fixes https://github.com/libsdl-org/SDL/issues/10519
2024-08-12 09:22:59 -07:00
Sam Lantinga
1a729251ad Added references to SDL_GetPixelFormatDetails() from the SDL_*RGB functions 2024-08-12 09:22:59 -07:00
Ryan C. Gordon
871d0074d2 SDL_GLattr: Added some documentation from SDL2. 2024-08-12 01:33:05 -04:00
Ryan C. Gordon
67e0156346 pen: Fixed a comment about Web APIs.
(Emscripten has nothing to do with this limitation, as this is what the
Javascript Pointer Events API offers.)
2024-08-12 00:58:27 -04:00
Ryan C. Gordon
3d3f611965 examples: Fixed web build. 2024-08-12 00:46:42 -04:00
Anonymous Maarten
b9ad5fc589 ci: build tvOs/iOs CMake project 2024-08-12 06:44:35 +02:00
Ryan C. Gordon
6140f567ba examples: added a basic pen example. 2024-08-12 00:25:10 -04:00
Ryan C. Gordon
b975babfa5 pen: Emscripten support!
Reference Issue #10516.
2024-08-11 18:00:13 -04:00
Ryan C. Gordon
bec701dd04 pen: Add support for tangential pressure axis. 2024-08-11 18:00:13 -04:00
Anonymous Maarten
dc67a51782 sdlprocdump: fix clang -Wincompatible-pointer-types warning 2024-08-11 21:23:57 +02:00
Anonymous Maarten
35b61f70da sdlprocdump: add option to print debug stream 2024-08-11 21:00:08 +02:00
Mathieu Eyraud
5de3d1e9cc Fix error handling of SDL_AddHintCallback 2024-08-11 06:59:10 -07:00
Mathieu Eyraud
45bfa8e5e7 Fix xsettings list copy
If there is only 1 element in the list or memory allocation fails on the 2nd iteration then new->next is uninitialised.
2024-08-11 06:58:03 -07:00
Mathieu Eyraud
dcc3dd4c7c Remove stray return statement 2024-08-11 06:57:01 -07:00
Sam Lantinga
15a19bd69f Convert bitmap surface to RGBA for scaling
Scaling bitmaps isn't currently supported, so we convert to RGBA for now.
2024-08-10 16:43:27 -07:00
Ozkan Sezer
f93920a4f1 video, x11: fix linkage if SDL_VIDEO_DRIVER_X11_XINPUT2 isn't defined. 2024-08-10 15:55:00 +03:00
Anthony
8a6fd058b4 Update proguard-rules.pro in line with recent changes
Also sort methods and add a note about preserving unused native method nativeGetHint.
2024-08-09 19:18:29 -07:00
SDL Wiki Bot
a7fa375275 Sync SDL3 wiki -> header 2024-08-10 02:09:54 +00:00
Ryan C. Gordon
b4ca15b654 pen: Added Cocoa backend. 2024-08-09 22:09:23 -04:00
Ryan C. Gordon
a9d70dbacb pen: Rework public API.
This changes the API in various ways, and updates the backends for this.

Overall, this is a massive simplification of the API, as most future backends
can't support the previously-offered API.

This also removes the testautomation pen code (not only did these interfaces
change completely, it also did something no other test did: mock the internal
API), and replaces testpen.c with a different implementation (the existing
code was fine, it was just easier to start from scratch than update it).
2024-08-09 22:09:23 -04:00
Sam Lantinga
2b853121fe Allow environment hint overrides before hints are initialized
Fixes https://github.com/libsdl-org/SDL/issues/10514
2024-08-09 13:26:49 -07:00
SDL Wiki Bot
78b1e0e299 Sync SDL3 wiki -> header 2024-08-09 16:57:18 +00:00
Sam Lantinga
c2085dad8f Added SDL_HINT_JOYSTICK_GAMEINPUT 2024-08-09 09:56:47 -07:00
Sam Lantinga
0acf8343bb Fixed crash if pipewire doesn't detect any devices and doesn't end up being used.
Fixes https://github.com/libsdl-org/SDL/issues/10511
2024-08-09 08:08:32 -07:00
KaJe
e1571d704d Add Cammus C12 VID & PID to wheel device list.
Add Cammus C12 in the SDL wheel list to enable wheel detection for them.
2024-08-09 06:48:14 -07:00
Sam Lantinga
4cc3410dce Added SDL_GetAudioFormatName()
Fixes https://github.com/libsdl-org/SDL/issues/10489
2024-08-08 15:05:37 -07:00
Sam Lantinga
74504e0965 cocoa: removed relative mode handling on focus change
This is now being done at a higher level, so we don't want to duplicate it here.

Fixes the mouse cursor staying hidden if you enable relative mode, alt-tab away and then alt-tab back.
2024-08-08 13:26:50 -07:00
SDL Wiki Bot
d2bdfd7792 Sync SDL3 wiki -> header 2024-08-08 17:56:53 +00:00
Frank Praznik
ae8065e1ec Use more stringent criteria for entering warp emulation mode
Require more than one warp to the window center within a certain timespan (currently 30ms, but can be tweaked) to better avoid erroneously entering warp emulation mode.

This also correctly resets the warp emulation mode activation if the window loses and regains focus.
2024-08-08 10:56:20 -07:00
Sam Lantinga
1a57ea7fba kmsdrm: free the connector when looking for available devices
Fixes https://github.com/libsdl-org/SDL/issues/10499
2024-08-08 09:28:45 -07:00
Sam Lantinga
058781f514 Include GameInput.h as gameinput.h for compatibility with non-MSVC toolchains 2024-08-08 09:14:38 -07:00
Anonymous Maarten
00b59c96f1 Fix /W3 warnings in examples 2024-08-08 10:11:39 +00:00
Anonymous Maarten
8714de9f46 SDL_GetAudioStreamAvailable and SDL_GetAudioStreamAvailable return error codes 2024-08-08 10:11:39 +00:00
Anonymous Maarten
6e6c2b8e7d cmake: build SDL with /W3 on MSVC
The Visual Studio projects also did this.
2024-08-08 10:11:39 +00:00
Anonymous Maarten
5cd6923298 Assert a valid window pointer instead of dismissing an invalid pointer
Throwing an assertion and breaking the program should allow developers
to catch wrong usage of the API faster.

Follow-up of 9493e6974f
2024-08-08 10:11:39 +00:00
Anonymous Maarten
125ce71379 SDL_Log: avoid sending text to the debug stream twice
When debugging a GUI application in Visual Studio,
text printed with fprintf(stderr) will also be sent to the debug stream.

When buiding SDL with SDL_LIBC=ON, this patch makes logging skip
OutputDebugString and rely on fprintf(stderr) to send the text to
the debugger.
2024-08-08 10:11:39 +00:00
Sylvain
bd7d4a3752 Add comment about randomOrder and random seed 2024-08-08 10:21:42 +02:00
Sam Lantinga
b5b868044f Include GameInput.h as gameinput.h for compatibility with non-MSVC toolchains 2024-08-07 17:57:33 -07:00
Sam Lantinga
4c3f9159e9 Allow building with older versions of GameInput.h 2024-08-07 17:57:33 -07:00
Sam Lantinga
889a788913 Fixed build warnings 2024-08-07 17:57:33 -07:00
Sam Lantinga
a38cd7a067 Added checks for GameInput.h to the build system 2024-08-07 17:57:33 -07:00
Sam Lantinga
ae076bdc2a Take the joystick lock when processing GameInput device callbacks 2024-08-07 17:57:33 -07:00
Sam Lantinga
28ef6bcc38 Use the correct timestamp from the GameInput controller reading 2024-08-07 17:57:33 -07:00
Sam Lantinga
5cab979f21 Added support for the Guide and Share buttons on GameInput controllers 2024-08-07 17:57:33 -07:00
Sam Lantinga
3ec19b2a89 Removed duplicate call to SDL_AssertJoysticksLocked() 2024-08-07 17:57:33 -07:00
Sam Lantinga
9493e6974f Validate window pointer before sending events for it
If there are bugs it's possible that the window pointer is invalid. Double check it before sending the application events and potentially dereferencing it.

This showed up in https://github.com/libsdl-org/SDL/issues/10494 as a window getting mouse focus as it was being destroyed and then crashing later when mouse focus was set to a different window.
2024-08-07 12:28:10 -07:00
Sam Lantinga
91d97a367e Fixed crash when the current mouse capture window is destroyed
Fixes https://github.com/libsdl-org/SDL/issues/10494
2024-08-07 12:28:10 -07:00
SDL Wiki Bot
212f7cc355 Sync SDL3 wiki -> header 2024-08-07 19:19:43 +00:00
Sam Lantinga
a7e425497b Added a FIXME to lock the joystick list and update the GameInput joystick support 2024-08-07 12:19:09 -07:00
Sam Lantinga
001dbc5da8 Added support for raw mouse and keyboard using GameInput on Windows
Fixes https://github.com/libsdl-org/SDL/issues/10442
2024-08-07 12:19:09 -07:00
Sam Lantinga
8fdca9c691 Clear intermediate errors if we successfully create a window. 2024-08-07 12:17:52 -07:00
Sam Lantinga
66ddabde86 Added an automated test to check creation of minimized and maximized windows 2024-08-07 12:17:52 -07:00
Sylvain
2428d906f1 Remove extra ';' 2024-08-07 19:14:09 +02:00
Anonymous Maarten
7b97fd3b44 SDLDropTarget_Drop: use SDL_strlen instead of strlen 2024-08-07 11:50:22 +02:00
Sylvain
a57c566988 Add internal SDL_UpdateTextureFromSurface(), making SDL_CreateTextureFromSurface() lighter 2024-08-07 10:42:47 +02:00
Sylvain
20a6193eaa Run test suites and test cases in non-linear order (see libsdl-org#9303) 2024-08-07 10:25:30 +02:00
Anonymous Maarten
27bb5bcef6 sdlprocdump: fix stacktrace 2024-08-07 06:51:35 +02:00
Sam Lantinga
fe5dcf79be Reset log prefixes on SDL_Quit() 2024-08-06 13:55:40 -07:00
Ethan Lee
15bfef57cd d3d12: Generate Xbox C macros, adjust SDL_Render files accordingly 2024-08-06 16:05:10 -04:00
hsnovel
83d1d1c053 add failsafe for querying cache line size on linux 2024-08-06 10:26:09 -07:00
SDL Wiki Bot
8a3bb11024 Sync SDL3 wiki -> header 2024-08-06 17:17:11 +00:00
SDL Wiki Bot
1ecf05be93 Sync SDL3 wiki -> header 2024-08-06 17:12:54 +00:00
Anonymous Maarten
0fa2049fef Document iconv functions + add testautomation (#10131)
* stdinc: document SDL_iconv* functions
* iconv: add automation tests
* iconv: don't potentially crash on invalid inputs
2024-08-06 10:12:25 -07:00
Ivan Mogilko
75d89f8e12 Fix potential access violation in testautomation_clipboard.c 2024-08-06 09:34:04 -07:00
Frank Praznik
0e37bc7c3f wayland: Bail out if a null cached cursor is returned 2024-08-06 11:17:13 -04:00
Frank Praznik
10abe1a75b wayland: Free the scaled cursor surface if SHM allocation fails 2024-08-06 11:15:15 -04:00
SDL Wiki Bot
57fa3bc08e Sync SDL3 wiki -> header 2024-08-06 15:00:23 +00:00
Sam Lantinga
627cb8acd0 SDL_EventFilter functions now return SDL_bool 2024-08-06 07:59:45 -07:00
Sam Lantinga
57f9c6f7bb Renamed SDL_Get/SetRelativeMouseMode to SDL_Get/SetWindowRelativeMouseMode()
Fixes https://github.com/libsdl-org/SDL/issues/10041
2024-08-06 07:59:45 -07:00
Frank Praznik
e612ce511b wayland: Add support for high-DPI custom cursors
Add a cursor caching system and viewport support, to allow for high-DPI, fractionally-scaled, custom cursors.
2024-08-06 10:55:13 -04:00
Dragon-Baroque
ca127106ee Add MIME targets to SDL_EVENT_DROP_TEXT in X11
src/video/x11/SDL_x11events.c
    Add Text targets "text/plain;charset=utf-8",
      "UTF8_STRING", "TEXT" to "text/plain".
2024-08-06 05:49:38 -07:00
Sam Lantinga
44927fe5e3 Added detail about why a file couldn't be opened (thanks mgerhardy!)
Fixes https://github.com/libsdl-org/SDL/issues/10484

(cherry picked from commit 1512013320)
2024-08-06 05:48:26 -07:00
Sam Lantinga
a1998d106d Putting the simple back into Simple DirectMedia Layer 2024-08-05 21:20:26 -07:00
SDL Wiki Bot
0d3db8390d Sync SDL3 wiki -> header 2024-08-06 02:47:18 +00:00
Sam Lantinga
725b95dc84 Fixed SDL_GetDefaultScancodeFromKey() 2024-08-05 19:46:45 -07:00
Sam Lantinga
afec46dbee Re-added SDL_GetScancodeFromKey() 2024-08-05 19:46:45 -07:00
Sam Lantinga
4f7c0e7c46 Fixed key names for non-latin keyboard layouts 2024-08-05 19:46:45 -07:00
Sam Lantinga
ac7df9d01f Removed acquire/release of keymaps, which isn't needed internally. 2024-08-05 19:46:45 -07:00
Sam Lantinga
a13c993e40 Removed keymaps from the API
This is unnecessary complication for applications. We can always add it again later if we find that it's really useful.
2024-08-05 19:46:45 -07:00
SDL Wiki Bot
1966472f73 Sync SDL3 wiki -> header 2024-08-06 00:02:59 +00:00
Sam Lantinga
c298a3749b Expose the keymap separately from the event keycode
This adds functions to query the keymap:
* SDL_GetCurrentKeymap()
* SDL_GetKeymapKeycode()
* SDL_GetKeymapScancode()
* SDL_ReleaseKeymap()

and these are distinct from the function to query the event keycode associated with a scancode, which might be affected by SDL_HINT_KEYCODE_OPTIONS.

Also added an SDL_bool parameter to SDL_GetKeyName() and SDL_GetKeyFromName() to enable upper case handling of the name.
2024-08-05 17:02:25 -07:00
Sam Lantinga
d68d32e12c Revert "Removing a timer that isn't running is a success."
This reverts commit 795499a529.

This breaks compatibility with SDL2 and there isn't a compelling reason to make this change.
2024-08-05 10:39:33 -07:00
Sam Lantinga
d223264f17 Updated the documentation for SDL_HINT_KEYCODE_OPTIONS 2024-08-05 10:17:48 -07:00
Sam Lantinga
4073c4910e Enable KEYCODE_OPTION_LATIN_LETTERS by default
It turns out that the non-Latin keyboards (Russian, Thai, Greek, etc.) are almost all QWERTY layout plus native language labels. Feedback from users is that they expect to see the ASCII keycodes and key names when using those keyboards, so we'll enable this option by default.
2024-08-05 10:00:02 -07:00
Sam Lantinga
d7256a77db The KEYCODE_OPTION_LATIN_LETTERS uses the full QWERTY layout
This makes sure we use ']' instead of 'ъ' for the ']' key on the Russian keyboard layout, for example.
2024-08-05 10:00:02 -07:00
Sam Lantinga
eac8e858d5 Fixed key names for Thai keyboards
Using the shifted versions of keys for the key names doesn't make any sense on the Thai keyboard. Thai keyboards are QWERTY plus Thai characters, so let's use the ASCII key names.
2024-08-05 10:00:02 -07:00
Sam Lantinga
b7aca89466 Fixed key names when KEYCODE_OPTION_LATIN_LETTERS is enabled 2024-08-05 10:00:02 -07:00
Sam Lantinga
a82f19f690 Use the shifted version of the letter as the key name
SDL_Keycode is defined as the unshifted key on the keyboard, but the key name is defined as the letter printed on that key, which is usually the shifted capital letter.

Fixes https://github.com/libsdl-org/SDL/issues/5836
2024-08-05 10:00:02 -07:00
SDL Wiki Bot
ad27d73a19 Sync SDL3 wiki -> header 2024-08-05 16:03:59 +00:00
Sam Lantinga
6161c437c7 Added SDL_SetLogPriorityPrefix()
SDL_Log() no longer prints a log prefix by default for SDL_LOG_PRIORITY_INFO and below. The log prefixes can be customized with SDL_SetLogPriorityPrefix().
2024-08-05 09:02:50 -07:00
Ryan C. Gordon
074dd8c35f hints: Change hints to be backed by Properties, add documentation. (#9892)
This makes the subsystem thread-safe, more performant, and cleans up the code a little.

Also removed SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS, since setting this hint programmatically initializes properties, which creates a lock, so we can't check hints while creating locks. The slim reader-writer locks have been the default for ages and are solid, so we'll just use those when available.
2024-08-05 09:02:28 -07:00
SDL Wiki Bot
e3682995f5 Sync SDL3 wiki -> header 2024-08-05 15:54:41 +00:00
Sam Lantinga
dfd96ff50f Updated SDL_HINT_VIDEODRIVER documentation 2024-08-05 08:54:10 -07:00
Sam Lantinga
746b8eb14b Added SDL_HINT_MUTE_CONSOLE_KEYBOARD 2024-08-05 08:54:10 -07:00
Sam Lantinga
afde1cc9c2 Added SDL_HINT_EVDEV_DEVICES 2024-08-05 08:54:10 -07:00
Sam Lantinga
6f399c3beb Note that SDL_HAPTIC_GAIN_MAX should remain an environment variable. 2024-08-05 08:54:10 -07:00
Sam Lantinga
0da346f129 Added SDL_HINT_HIDAPI_LIBUSB, SDL_HINT_HIDAPI_LIBUSB_WHITELIST, and SDL_HINT_HIDAPI_UDEV 2024-08-05 08:54:10 -07:00
Sam Lantinga
8a5b9559dc Removed the SDL_VIDEO_NGAGE_SAVE_FRAMES environment variable
Display updating is now implemented, presumably we don't need to be able to dump frames for debugging.
2024-08-05 08:54:10 -07:00
Sam Lantinga
d9f9e9e764 Added SDL_HINT_VIDEO_DUMMY_SAVE_FRAMES and SDL_HINT_VIDEO_OFFSCREEN_SAVE_FRAMES 2024-08-05 08:54:10 -07:00
Sam Lantinga
f370e1a645 Removed the SDL_ALTIVEC_BLIT_FEATURES environment variable.
This code has long since been tested, and none of the developers have an Altivec CPU.
2024-08-05 08:54:10 -07:00
Sam Lantinga
95adcc522f Allow SDL hints to override OpenGL extension availability 2024-08-05 08:54:10 -07:00
Sam Lantinga
a97dadf779 Added hints to replace environment variables on the PlayStation Vita 2024-08-05 08:54:10 -07:00
Sam Lantinga
3669d1e76a Added SDL_HINT_VULKAN_DISPLAY 2024-08-05 08:54:10 -07:00
Sam Lantinga
997df06320 Added SDL_HINT_X11_XCB_LIBRARY 2024-08-05 08:54:10 -07:00
Sam Lantinga
175f28f59f Added SDL_HINT_VIDEO_X11_NODIRECTCOLOR 2024-08-05 08:54:10 -07:00
Sam Lantinga
8cde570ad9 Added SDL_HINT_VIDEO_X11_VISUALID 2024-08-05 08:54:10 -07:00
Sam Lantinga
05f870f20d Added SDL_HINT_OPENGL_LIBRARY and SDL_HINT_VULKAN_LIBRARY 2024-08-05 08:54:10 -07:00
Sam Lantinga
c9b2bfa7c1 Added SDL_HINT_AUDIO_DISK_INPUT_FILE, SDL_HINT_AUDIO_DISK_OUTPUT_FILE, and SDL_HINT_AUDIO_DISK_TIMESCALE 2024-08-05 08:54:10 -07:00
Sam Lantinga
e1ee0e748d Added SDL_HINT_WAVE_CHUNK_LIMIT 2024-08-05 08:54:10 -07:00
Sam Lantinga
897610d317 Updated migration documentation for the AUDIODEV environment variable 2024-08-05 08:54:10 -07:00
Sam Lantinga
a4dc130d7e Removed the SDL_PATH_DSP environment variable from the NetBSD and OSS audio driver
The AUDIODEV environment variable is no longer used by other audio drivers, and can be used exclusively to specify the DSP audio device.
2024-08-05 08:54:10 -07:00
Sam Lantinga
f3fcc41a4e Removed the AUDIODEV environment variable from the sndio audio driver
The sndio documentation says that the AUDIODEVICE environment variable is used when the device is opened with SIO_DEVANY.
2024-08-05 08:54:10 -07:00
Sam Lantinga
ff0e42c51c Removed the SDL_AUDIO_ALSA_DEBUG environment variable
The debug info is available if you set SDL_HINT_LOGGING to "audio=debug"
2024-08-05 08:54:10 -07:00
Sam Lantinga
f05cd85048 Added SDL_HINT_AUDIO_ALSA_DEFAULT_DEVICE 2024-08-05 08:54:10 -07:00
Sam Lantinga
71574ac985 Added SDL_HINT_AUDIO_DUMMY_TIMESCALE 2024-08-05 08:54:10 -07:00
Sam Lantinga
5aa1a48ac3 Added SDL_HINT_AUDIO_FREQUENCY, SDL_HINT_AUDIO_CHANNELS, and SDL_HINT_AUDIO_FORMAT 2024-08-05 08:54:10 -07:00
Sam Lantinga
0a6bab3ac7 Added SDL_CreateRenderer to the "see also" for SDL_RenderPresent() 2024-08-05 07:56:29 -07:00
hwsmm
4f343f96b4 Fix name discrepancy in Android JNI 2024-08-05 05:46:39 -07:00
Anonymous Maarten
e631fdfbd2 gdk: show dialog when xgameruntime.dll is not installed 2024-08-05 09:18:21 +00:00
Sam Lantinga
881e2bc344 Fixed build 2024-08-04 20:34:10 -07:00
Sam Lantinga
571a4b4b32 Updated macOS build requirements
Building the latest SDL requires at least Xcode 12.2 and the macOS 11.0 SDK.
2024-08-04 20:24:19 -07:00
Sam Lantinga
f59d66f4b1 Implemented left-justification in SDL_PrintString()
Fixes https://github.com/libsdl-org/SDL/issues/10310
2024-08-04 20:04:58 -07:00
SDL Wiki Bot
6212497ea3 Sync SDL3 wiki -> header 2024-08-05 03:00:45 +00:00
Sam Lantinga
795499a529 Removing a timer that isn't running is a success. 2024-08-04 20:00:13 -07:00
Sam Lantinga
b1af91e788 Clarified timer documentation
Fixes https://github.com/libsdl-org/SDL/issues/10079
2024-08-04 19:44:13 -07:00
Anonymous Maarten
7dfb9acb71 VisualC: add testdialog project 2024-08-05 00:07:15 +02:00
Anonymous Maarten
90757fba5d Remove bscmake reference
Although BSCMAKE is still installed with Visual Studio,
it is no longer used by the IDE.
Since Visual Studio 2008, browse and symbol information is stored
automatically in a SQL Server .sdf file in the solution folder.
2024-08-04 22:16:25 +02:00
Ethan Lee
4bea89e945 Xbox buildfixes 2024-08-04 15:54:22 -04:00
Anonymous Maarten
4b3a80bb73 msbuild: add TreatWarningAsError property, and enable it on ci 2024-08-04 21:23:25 +02:00
SDL Wiki Bot
a699ff2419 Sync SDL3 wiki -> header 2024-08-04 17:49:28 +00:00
Sam Lantinga
bc1c3f826f Added SDL_HINT_LOGGING documentation to the logging category page.
Fixes https://github.com/libsdl-org/SDL/issues/10335
2024-08-04 10:48:42 -07:00
SDL Wiki Bot
454c85ad51 Sync SDL3 wiki -> header 2024-08-04 17:39:54 +00:00
Sam Lantinga
6da4278d37 Clarify how to check for EOF in SDL_ReadIO() documentation.
Fixes https://github.com/libsdl-org/SDL/issues/8564
2024-08-04 10:37:51 -07:00
Sam Lantinga
66cb2153cc Handle Colemak swapping of CapsLock and Backspace
Fixes https://github.com/libsdl-org/SDL/issues/7853
2024-08-04 10:30:19 -07:00
Sam Lantinga
c709385856 Enable events for external X11 windows
Fixes https://github.com/libsdl-org/SDL/issues/3825
Fixes https://github.com/libsdl-org/SDL/issues/5142
Fixes https://github.com/libsdl-org/SDL/issues/9503
2024-08-04 09:07:19 -07:00
Sam Lantinga
ef6521aee7 testnative: print events with --info event 2024-08-04 09:07:19 -07:00
Sam Lantinga
6f6f4fbfd3 Updated X11 event debugging 2024-08-04 09:07:19 -07:00
Anonymous Maarten
31b3f5ea79 ci: add GDK 2024-08-04 13:07:32 +00:00
Sam Lantinga
490f7af92b Removed test that triggers an asan overflow warning
Fixes https://github.com/libsdl-org/SDL/issues/8884
2024-08-03 18:20:26 -07:00
Frank Praznik
ca2c9f680b video: Support multiple video driver entries having the same name string
Allow multiple bootstrap entries for a single video driver with the same name, which internally allows preferential and fallback init conditions while hiding the implementation details from applications (e.g. applications will just see "wayland", regardless of whether it's using the preferred or fallback driver list entry).

If a driver is requested, all instances of it in the list will be tried before reporting failure, and client applications programmatically enumerating the video drivers will be presented with a deduplicated list of entries.
2024-08-03 06:55:24 -07:00
Joshua Ashton
ab916a959e video: Only prefer Wayland if fifo-v1 and commit-timing-v1 are available
Wayland has a myriad of unresolved problems regarding surface suspension
blocking forever in QueuePresent/SwapBuffers when occludedand the FIFO
(vsync) implementation being fundamentally broken leading to reduced
GPU-bound performance and 'barcoding' frametimes due to swapchain
starvation.

There are two protocols used to solve these two problems together --
fifo-v1 and commit-timing-v1, which implement the commit queue on the
compositor side, and a timestamp that frames are intended to be
displayed for/discarded respectfully.

To avoid severe performance regressions for developers targeting SDL3,
only pick Wayland as the default backend when these two protocols are
supported -- otherwise fallback to X11/XWayland.

We do this by having two VideoBootStraps, one which is tests the
preferred case, "wayland_preferred" (ie. if fifo-v1 + commit-timing-v1
are available init time), and the fallback, which is just "wayland",
the same name as before, which does no such tests.
Thus, forcing with SDL_VIDEO_DRIVER=wayland will go onto the fallback
option, and pick Wayland always, as usual, so there is no behaviour
change.

In the case that X11/XWayland is not available (ie. no DISPLAY), we will
still fallback to using Wayland without these protocols available.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2024-08-03 06:55:24 -07:00
SDL Wiki Bot
cb440ec4a4 Sync SDL3 wiki -> header 2024-08-03 13:40:37 +00:00
Sam Lantinga
cd5f0d2cce Added SDL_RectToFRect() 2024-08-03 06:40:06 -07:00
Susko3
e3cf20e1cc Remove createSDLMainRunnable() in favour of main() to fix multiple issues when providing custom main/runnable code (#10434)
This allows managed applications (eg. Java, C#) to override main() to their liking.
2024-08-03 06:34:38 -07:00
SDL Wiki Bot
2f24e9c2f2 Sync SDL3 wiki -> header 2024-08-03 13:30:08 +00:00
Sam Lantinga
2c0fcf27e8 Don't use alloca() in a loop, we might overflow the stack. 2024-08-02 21:38:29 -07:00
Sam Lantinga
978e5fc4f8 Updated Xcode project for SDL_GetWindowFromEvent() 2024-08-02 20:38:50 -07:00
Sam Lantinga
f7c8d66ccb Use the convenience function SDL_GetWindowFromEvent() 2024-08-02 20:36:35 -07:00
Sam Lantinga
8d748d64e8 Fixed compiler warning building for macOS 2024-08-02 20:27:33 -07:00
SDL Wiki Bot
b5c0921196 Sync SDL3 wiki -> header 2024-08-03 02:37:43 +00:00
Anonymous Maarten
f57c597c60 Added SDL_GetWindowFromEvent 2024-08-03 02:37:11 +00:00
Sam Lantinga
79f4de9f7e Use SDL_PROP_APP_METADATA_IDENTIFIER_STRING for the app ID 2024-08-02 19:36:31 -07:00
Sam Lantinga
cea71fbfcc SDL_cocoakeyboard: Fix errant semicolons in sendPendingKey and clearPendingKey definitions
- These are ignored by Clang but produce a warning: "semicolon before method body is ignored"
2024-08-02 18:55:30 -07:00
Sam Lantinga
2c1d40a9eb Added an error message when SDL_GetWindowFromID() fails 2024-08-02 18:43:24 -07:00
SDL Wiki Bot
e058aa6d65 Sync SDL3 wiki -> header 2024-08-02 21:50:11 +00:00
Sam Lantinga
50492e1d03 Change the text input defaults to match the natural input experience 2024-08-02 14:49:37 -07:00
Sam Lantinga
81f8e6aba6 Added SDL_StartTextInputWithProperties()
This allows you to customize the text input so you can have numeric text entry, hidden passwords, etc.

Fixes https://github.com/libsdl-org/SDL/issues/7101
Fixes https://github.com/libsdl-org/SDL/issues/7965
Fixes https://github.com/libsdl-org/SDL/issues/9439
2024-08-02 14:49:37 -07:00
Sam Lantinga
5d51e3b4ab testime: added support for multiple windows 2024-08-02 14:49:37 -07:00
Sam Lantinga
bffd35995c Added unifont-15.1.05.hex to the Xcode project for testime 2024-08-02 14:49:37 -07:00
SDL Wiki Bot
f01d4278c6 Sync SDL3 wiki -> header 2024-08-01 20:49:00 +00:00
Sam Lantinga
31ed3665ad Added support for high-DPI cursors and icons
Fixes https://github.com/libsdl-org/SDL/issues/9838
2024-08-01 13:48:28 -07:00
Sam Lantinga
94d9229ce2 Added SDL_AddSurfaceAlternateImage(), SDL_SurfaceHasAlternateImages(), SDL_GetSurfaceImages() and SDL_RemoveSurfaceAlternateImages()
These functions allow you to create surfaces with alternate high DPI content, and will be used for high DPI icon and cursor support.
2024-08-01 13:48:28 -07:00
Sam Lantinga
b8dc97c577 Use SDL_PremultiplySurfaceAlpha() when creating NSImages 2024-08-01 13:48:28 -07:00
Sam Lantinga
b8f3cd0a10 Added SDL_CursorData for internal cursor data 2024-08-01 13:48:28 -07:00
Sam Lantinga
22ffb487d0 Added SDL_ScaleSurface() 2024-08-01 13:48:28 -07:00
Sam Lantinga
15f68a86ff Group the blit copy flags to simplify code 2024-08-01 13:48:28 -07:00
Ozkan Sezer
7d27a97402 d3d12.h, d3d12sdklayers.h: fix build against older mingw-w64 versions.
Fixes: https://github.com/libsdl-org/SDL/issues/10452 .
2024-08-01 21:45:02 +03:00
Anonymous Maarten
68fb07787b cmake: Remove HAVE_D3D12_H from sources and introduce SDL_RENDER_D3D(11|12) 2024-08-01 17:49:02 +00:00
Anonymous Maarten
0c5bb532c3 Remove support for building a SDL3 library from gradle 2024-08-01 17:48:49 +00:00
Anonymous Maarten
349540f73f Document the new SDL3 Android archive artifact 2024-08-01 17:48:49 +00:00
Dragon-Baroque
808c312b2a Support SDL_EVENT_DROP_FILE in Windows with IDropTarget instead of WM_DROPFILES
Support SDL_EVENT_DROP_TEXT in Windows

  src/video/windows/SDL_windowsvideo.c + .h
    Connect      to COM WIN_CoInitialize   + OLE OleInitialize   in WIN_VideoInit
    Disconnect from COM WIN_CoUninitialize + OLE OleUninitialize in WIN_VideoQuit
  src/video/windows/SDL_windowswindow.c + .h
    Create / Destroy IDropTarget or use fallback WM_DROPFILES
      depending on OleInitialize success in WIN_VideoInit
    Handle text/uri-list, text/plain;charset=utf-8, CF_UNICODE_TEXT, CF_TEXT, CF_HDROP
    Call terminating WIN_AcceptDragAndDrop from WIN_DestroyWindow ( CleanupVideoData )
2024-08-01 07:17:17 -07:00
Ethan Lee
efefc4a1f3 d3d12: Move platform-specific includes/defines to SDL_d3d12.h 2024-07-31 23:34:31 -07:00
SDL Wiki Bot
2e058ba7a4 Sync SDL3 wiki -> header 2024-08-01 05:37:11 +00:00
Sam Lantinga
a5f18048b2 Extend the 9-grid functions to handle a non-uniform grid layout (thanks @zaun!)
Fixes https://github.com/libsdl-org/SDL/issues/10389
2024-07-31 22:36:39 -07:00
Anonymous Maarten
a1c6f99877 android: add script in Android archive to create a SDK
Also,
- Move mingw's pkg-support into build-scripts
- Add type annotations to python scripts for mypy
- ci: use v4 tag of actions/cache
- cmake: use PYTHON3_EXECUTABLE for running xxd.py
  (Python3::Interpreter is not always recognized.)
2024-08-01 05:07:08 +02:00
Sam Lantinga
091960441b Don't check SDL_RENDER_DRIVER in automated tests
This might be set in the environment for testing purposes
2024-07-31 19:10:13 -07:00
Sam Lantinga
445983fc79 Remove D3D12 call hacks now that we have a good set of D3D12 headers 2024-07-31 19:10:13 -07:00
Sam Lantinga
de30400a7b Fixed uninitialized variable warning 2024-07-31 18:54:45 -07:00
Sam Lantinga
1954ac407f Don't mix keyboard and mouse raw input timestamps
We want to keep mouse timestamps consistently using the same interval, and it's helpful to know when multiple keyboard events come in at the same time.
2024-07-31 18:54:45 -07:00
Ethan Lee
55e9a8ca45 d3d12: Import DirectX-Headers, use local d3d12.h in SDL_render.
This avoids lots of build issues with the various D3D12 headers out there (MinGW, old Windows SDKs, etc) and also opens the door for WSL2 libd3d12.so support.

Note that the build system has not been changed; technically _all_ platforms now have d3d12.h but we should only enable the backend when it's actually expected to work.
2024-07-31 18:41:17 -07:00
Sam Lantinga
c5a99f1515 Fixed detecting wrapping Windows message time
It's possible to get message times out of order when processing the Windows message queue, so this passes those times through unchanged, while still detecting when the message tick wraps.
2024-07-31 16:36:47 -07:00
Ryan C. Gordon
364bbd545d audio: SDL_ClosestAudioFormats now favors float32 and native byte order.
Fixes #9581.
2024-07-31 07:19:15 -07:00
Sami Kyöstilä
80f5f0b1fb android: Fix activity pause/resume with external graphics context
This patch fixes two issues with pausing and resuming the Android
activity when an external graphics context[1] is used:

1. When pausing, don't wait for the EGL context to be backed up if a
   context wasn't created in the first place.

2. When resuming, don't recreate the EGL surface unless one was
   requested by the user when originally creating the window.

[1] SDL_PROP_WINDOW_CREATE_EXTERNAL_GRAPHICS_CONTEXT_BOOLEAN
2024-07-30 20:15:42 -07:00
Sam Lantinga
89de8e2110 Fixed infinite loop searching for matching video modes (thanks @Synt4xErr0r4!) 2024-07-30 17:29:21 -07:00
Anonymous Maarten
b68ac011e0 ctest: fail if there are outstanding allocations 2024-07-30 20:56:19 +00:00
Anonymous Maarten
c7a1876536 SDL_test: use mutex based on SDL_AtomicInt in memory tracking
SDL_Mutex or SDL_SpinLock cannot be used as these use SDL_malloc internally.

ff
2024-07-30 20:56:19 +00:00
Anonymous Maarten
4c00433b69 SDL_test: format tracked allocation names during report generation 2024-07-30 20:56:19 +00:00
Anonymous Maarten
bc8f4a1d0b ci: fix artifacts on libsdl-org repo 2024-07-30 22:55:36 +02:00
Anonymous Maarten
1ef3263ad4 ci: only upload artifacts in libsdl-org GitHub organization 2024-07-30 22:53:14 +02:00
Ryan C. Gordon
afabccd4d0 examples: Split up description text by line breaks. 2024-07-30 15:37:46 -04:00
Ozkan Sezer
b24bfc2c98 fix RandFunc typedef 2024-07-30 21:15:04 +03:00
Semphris
6aca728056 Fix examples description CSS 2024-07-30 13:46:34 -04:00
Ryan C. Gordon
3b5c3d6cc8 examples/snake: Actually fixed build this time. 2024-07-30 13:43:03 -04:00
Ryan C. Gordon
883576beb8 examples: Improve source code output when there are multiple files. 2024-07-30 13:40:09 -04:00
Ryan C. Gordon
bc8b768b9a examples/snake: Fix up build. 2024-07-30 13:40:01 -04:00
Dylam De La Torre
dbb4e05c28 Add "Snake" game example 2024-07-30 13:26:01 -04:00
Ryan C. Gordon
69a2d7960c examples: first shot at description text at top of page. Not working yet. 2024-07-30 13:18:58 -04:00
Sami Kyöstilä
b881e19896 android: Update window/surface pointers on change
When the native window or surface backing the SDL window changes, e.g.,
when the activity is resumed, we should also update the corresponding
window pointer properties (SDL_PROP_WINDOW_ANDROID_{WINDOW,SURFACE}
_POINTER) so that they remain in sync.
2024-07-30 09:27:53 -07:00
Ryan C. Gordon
6a25e94472 examples: Print a description of the program to the console on startup. 2024-07-30 12:23:07 -04:00
Sam Lantinga
a6407e88da Document the events that need to be handled in a callback 2024-07-30 07:52:13 -07:00
Sam Lantinga
f039b2290a Added logging for life cycle events 2024-07-30 07:52:13 -07:00
Ryan C. Gordon
900213e16e examples: Pop up the console on new output for three seconds if hidden. 2024-07-30 09:45:06 -04:00
Ryan C. Gordon
6559cfb143 examples: make SDL_Log work with the Emscripten console.
Fixes #10410.
2024-07-30 08:59:52 -04:00
Ryan C. Gordon
fbed34a645 cmake: Don't warn about lack of X11/Wayland backend on Emscripten. 2024-07-30 00:33:08 -04:00
Ryan C. Gordon
89cc526a67 examples: Fix out-of-tree builds. 2024-07-30 00:13:32 -04:00
Semphris
949765a3b0 Stylize examples/template.html 2024-07-29 23:41:43 -04:00
Sam Lantinga
de209c81d1 Fixed macOS build 2024-07-29 17:38:59 -07:00
Sam Lantinga
9fac7d7eb0 metal: set the shader input type based on the colorspace, not the pixel format
Fixes https://github.com/libsdl-org/SDL/issues/10402
2024-07-29 17:18:45 -07:00
Sam Lantinga
61e78830d0 Revert "Revert "Fixed warning: result of comparison of constant 9223372035 with expression of type '__kernel_old_time_t' (aka 'long') is always true""
This reverts commit 8caebf823a.
2024-07-29 14:45:03 -07:00
Sam Lantinga
8caebf823a Revert "Fixed warning: result of comparison of constant 9223372035 with expression of type '__kernel_old_time_t' (aka 'long') is always true"
This reverts commit 299d181984.
2024-07-29 14:44:02 -07:00
Sam Lantinga
0a924b185d Fixed crash with joystick rumble after disconnection
This prevents continuing a rumble after the first one fails, and fixes a long standing crash issue if rumble is started immediately before the controller is disconnected.

Thanks to @AntTheAlchemist for the key bug report that showed what was happening here.

Fixes https://github.com/libsdl-org/SDL/issues/10422
2024-07-29 13:35:58 -07:00
Sam Lantinga
67b973b5fa Fixed whitespace 2024-07-29 12:52:11 -07:00
Ryan C. Gordon
614a88ca3b SDL_IOFromFile: Apple targets no longer use the app bundle's resources dir.
Fixes #8403.
2024-07-29 15:44:51 -04:00
Sam Lantinga
299d181984 Fixed warning: result of comparison of constant 9223372035 with expression of type '__kernel_old_time_t' (aka 'long') is always true 2024-07-29 12:04:08 -07:00
Sam Lantinga
930d83aed2 Fixed warning: implicit conversion loses integer precision: 'VkDeviceSize' (aka 'unsigned long long') to 'size_t' (aka 'unsigned int') 2024-07-29 12:01:53 -07:00
Sam Lantinga
c4582a6536 Fixed warning building on tvOS 2024-07-29 11:56:28 -07:00
Sam Lantinga
062caeaa4b Fixed Android build with audio disabled
These functions are called by the Android event code regardless of whether audio is enabled

Fixes https://github.com/libsdl-org/SDL/issues/10418
2024-07-29 10:40:10 -07:00
Frank Praznik
51cccf3fa2 video: Disable relative warp emulation when warping the cursor after a fullscreen transition
Otherwise, relative mode can be accidentally activated if the cursor is hidden.
2024-07-29 12:46:48 -04:00
Sam Lantinga
5637cd009a Don't assert or change window draggable state if SDL isn't managing hit testing
Fixes an assert if the application has set up its own hit testing on macOS
2024-07-29 09:15:55 -07:00
Sam Lantinga
5318e30ee5 Pause and resume Android audio without taking device locks
The AAudio driver implemented pause/resume by dangerously locking the audio devices. If there was an audio hotplug event or a background thread tried to interact with the audio system, this could cause deadlocks.
2024-07-29 08:41:40 -07:00
Sam Lantinga
9d35f178a6 Follow up to removing the ancient Android audio driver 2024-07-29 08:06:43 -07:00
Sam Lantinga
691cf15e75 Removed the ancient Android audio driver
OpenSLES is well supported on Android 4.0 and later.
2024-07-29 08:05:36 -07:00
Anonymous Maarten
446c05a001 ci: update actions descriptions + fix loongarch64 action
[sdl-ci-filter *loongarch64*]
2024-07-29 13:53:27 +02:00
SDL Wiki Bot
3b01a0b884 Sync SDL3 wiki -> header 2024-07-29 11:26:36 +00:00
Sam Lantinga
61a88077a7 Re-added SDL_HINT_APP_ID and SDL_HINT_APP_NAME 2024-07-29 07:26:03 -04:00
Ozkan Sezer
94827e0acd SDL_mslibc.c: revert PR/10303 changes 2024-07-28 22:48:05 +03:00
Sam Lantinga
45ecea1346 Fixed crash when switching a window from using OpenGL to Metal 2024-07-28 11:43:11 -07:00
Sam Lantinga
e35a559442 Revert "Add two more mapping for Nvidia controller (2019)"
This reverts commit 5d6333d6ea, which was accidentally committed during testing.
2024-07-28 11:07:59 -07:00
Sam Lantinga
383ccb2b6a Finish removing SDL_DECLSPEC_FREE 2024-07-28 08:06:20 -07:00
Arias800
5d6333d6ea Add two more mapping for Nvidia controller (2019)
0500b30c550900001472000001000000 is the ID when the controller is connected via Bluetooth and 0300b30c550900001472000011010000 is for USB mode.

Tested by setting "SDL_GAMECONTROLLERCONFIG" in some games.
2024-07-28 08:06:01 -07:00
Sam Lantinga
dfe6efcd2d Fixed memory leak in testthread 2024-07-28 08:05:31 -07:00
Sam Lantinga
728bf363cb Make sure we call SDL_Quit() before SDLTest_CommonDestroyState()
Otherwise we'll report leaks that will be cleaned up in SDL_Quit()
2024-07-28 08:05:31 -07:00
Sam Lantinga
b5ad74998b Removed SDL_DECLSPEC_FREE 2024-07-28 07:24:21 -07:00
SDL Wiki Bot
18fe89e036 Sync SDL3 wiki -> header 2024-07-28 14:23:13 +00:00
Sam Lantinga
a36fe632fd Added SDL_SetAppMetadata() (#10404)
Removed duplicate hints SDL_HINT_APP_NAME, SDL_HINT_APP_ID, and
SDL_HINT_AUDIO_DEVICE_APP_NAME.

Wired up a few things to use the metadata; more to come!

Fixes https://github.com/libsdl-org/SDL/issues/4703
2024-07-28 07:22:46 -07:00
hwsmm
35e42d0a25 Remove SDL_DECLSPEC_FREE before SDL_DECLSPEC in gendynapi 2024-07-27 22:31:49 -07:00
Anonymous Maarten
44f1f81d6c ci: add vita job 2024-07-28 03:12:51 +02:00
Frank Praznik
5617ce277d wayland: Don't fail to retrieve a system cursor if no window is focused
Doing this can leave the cursor data in a weird, corrupt state.
2024-07-27 20:24:24 -04:00
Sam Lantinga
f080336fa6 Fixed memory leak if logging is done after SDL_Quit()
If someone calls SDL_Quit(), then runs an SDL function that implicitly initializes TLS or logging, and then calls SDL_Quit() again, we want to make sure we run through the quit process again. Each of the Init/Quit calls are protected against being called multiple times.
2024-07-27 16:46:09 -07:00
Sam Lantinga
82c89c0125 Removed redundant subystem quit calls
SDL_Quit() quits everything
2024-07-27 16:46:09 -07:00
Sam Lantinga
95dd8781ce Do a full cleanup if renderer creation fails during autodetection 2024-07-27 16:46:09 -07:00
Sam Lantinga
ebd059e6eb Don't send keys consumed by the IME on macOS
This makes the macOS behavior match other platforms where the IME eats keys that are used for composing text.
2024-07-27 16:37:05 -07:00
Sam Lantinga
91d2dbdc9d Fixed memory leak if joysticks were initialized but gamepads were not
If a joystick is connected, SDL_IsGamepad() will be called on it, which adds it to the cache, which then needs to be cleaned up when joysticks quit.
2024-07-27 13:44:45 -07:00
Sam Lantinga
7eb2605630 Fixed memory leak when a renderer fails to be created
The supported texture formats were leaking. In order to catch future issues, we'll just do a full teardown of the renderer in the failure case, and make sure it's safe to do so with a partially initialized renderer.
2024-07-27 13:36:12 -07:00
Sam Lantinga
da035142b2 Use SDL_InitFlags for the SDL_Init* function implementations 2024-07-27 10:32:11 -07:00
Anthony
7cd23bfb6a Respect Android's auto-rotate setting when choosing orientation 2024-07-27 09:38:41 -07:00
Sam Lantinga
9da58e9fb7 Fixed storing a key in the persistent string hashtable that's about to be freed 2024-07-27 09:35:22 -07:00
Sam Lantinga
1d5f9c7b92 testaudio: fixed memory leak in SetTitleBar() 2024-07-27 09:16:29 -07:00
Sam Lantinga
473feab2a4 Added SDL_unsetenv() 2024-07-27 09:10:08 -07:00
Sam Lantinga
b854e1fe0b Fixed some issues found with static analysis 2024-07-27 09:07:42 -07:00
Sam Lantinga
218e45247f Fixed memory leak when SDL_Init() was called multiple times 2024-07-27 09:06:52 -07:00
Sam Lantinga
623a90c47d testutils: use SDL_asprintf() to simplify path composition 2024-07-27 08:41:06 -07:00
Sam Lantinga
625bc2d250 Fixed getting the initial window safe area
Fixes testsprite and testwm on desktop platforms
2024-07-27 08:40:31 -07:00
Anonymous Maarten
12eb1f1497 ci: limit jobs by using sdl-ci-filter
[sdl-ci-filter msvc-*]
2024-07-27 15:19:20 +00:00
Anonymous Maarten
eae6758abe ci: build haiku as canary 2024-07-27 15:19:20 +00:00
Anonymous Maarten
da8aa84c1d ci: merge all workflows into one 2024-07-27 15:19:20 +00:00
Anonymous Maarten
3374e57102 stdinc: strcasecmp is declared in strings.h 2024-07-27 15:19:20 +00:00
Anonymous Maarten
76f60c4b66 riscos: fix -Wunused-variable 2024-07-27 15:19:20 +00:00
Anonymous Maarten
3bfc103e76 tests: start memory tracking first + clean up cached text textures 2024-07-27 13:44:04 +02:00
Anonymous Maarten
6f1136c6ce testgles2: fix leaks 2024-07-27 13:06:54 +02:00
Anonymous Maarten
8a5d1fc196 cmake: add swift test 2024-07-27 08:39:55 +02:00
Anonymous Maarten
37881b3150 cmake: use genex to link with Apple Frameworks 2024-07-27 08:37:21 +02:00
Sam Lantinga
538adc52d2 Removed the temporary memory symbols from the public API 2024-07-26 21:10:47 -07:00
SDL Wiki Bot
0f2fc2fbaa Sync SDL3 wiki -> header 2024-07-27 03:59:43 +00:00
Sam Lantinga
4f55271571 Removed temporary memory from the API
It was intended to make the API easier to use, but various automatic garbage collection all had flaws, and making the application periodically clean up temporary memory added cognitive load to using the API, and in many cases was it was difficult to restructure threaded code to handle this.

So, we're largely going back to the original system, where the API returns allocated results and you free them.

In addition, to solve the problems we originally wanted temporary memory for:
* Short strings with a finite count, like device names, get stored in a per-thread string pool.
* Events continue to use temporary memory internally, which is cleaned up on the next event processing cycle.
2024-07-26 20:59:14 -07:00
Sam Lantinga
21411c6418 Don't apply creation window flags to external windows.
Whoever provided the window has already set it up the way they want it.

Fixes SDL removing iconified or maximized state when creating a window from an existing OS window.
2024-07-26 10:39:05 -07:00
SDL Wiki Bot
2137e6eed1 Sync SDL3 wiki -> header 2024-07-26 17:05:33 +00:00
Sam Lantinga
5e513ecc7f Don't automatically free temporary memory, let the application call SDL_FreeTemporaryMemory() when it's ready.
Also mark up all functions that return temporary memory with SDL_DECLSPEC_TEMP, to help people implementing language bindings.

Fixes https://github.com/libsdl-org/SDL/issues/10378
2024-07-26 10:05:03 -07:00
Eduard Gushchin
2f38a4bf5e Fixed a typo in the link to the GetTouchFingers function 2024-07-26 07:59:08 -07:00
SDL Wiki Bot
a1a8278029 Sync SDL3 wiki -> header 2024-07-26 00:47:35 +00:00
Sam Lantinga
750aef2bee Clarified that temporary memory shouldn't be kept beyond the current function scope or event handling. 2024-07-25 17:47:00 -07:00
SDL Wiki Bot
a880410cb2 Sync SDL3 wiki -> header 2024-07-25 23:58:09 +00:00
Frank Praznik
66eb2ea443 mouse: Make pointer warp emulation via relative mode available to all platforms
Move the Wayland pointer warp emulation code up to the SDL mouse layer, and activate it when a client attempts to warp a hidden mouse cursor when the hint is set.

testrelative adds the ability to test the warp emulation activation/deactivation with the --warp parameter and 'c' key for toggling cursor visibility.
2024-07-25 19:57:39 -04:00
Eduard Gushchin
92667e3066 Update SDL_keycode.h
Removed the link referring to yourself
2024-07-25 14:12:04 -07:00
Eduard Gushchin
3ee59359c4 Fix documentation references and update method usage for SDL_GetGamepadGUIDForID in SDL_gamepad.h
In the documentation for the SDL_GetGamepadGUIDForID method in the SDL_gamepad.h file, there are two references to the methods SDL_GetGamepadGUID and SDL_GetGamepadGUIDString, but there are no methods of its own. I replaced these two methods with the existing SDL_GUIDToString.
2024-07-25 11:43:41 -07:00
Anonymous Maarten
2aad26abb0 cmake: gate all preseeding behind SDL_PRESEED option 2024-07-25 16:42:11 +00:00
Ryan C. Gordon
546cd3ac83 cmake: Preseed CMake cache for Emscripten builds.
Makes a from-scratch build on this laptop go from 2 minutes 42 seconds to
28 seconds!
2024-07-25 16:42:11 +00:00
Dmitry Marakasov
0cd4fc7c87 Allow to enable vulkan support on FreeBSD (#10361) 2024-07-25 09:31:40 -07:00
Sam Lantinga
42650d79c1 Moved Android event initialization to SDL_InitEvents() 2024-07-25 09:25:00 -07:00
Ryan C. Gordon
53022aeb5e examples: Use the existing CMake infrastructure instead of rolling our own. 2024-07-25 11:56:19 -04:00
hwsmm
8fa550e003 Check window fullscreen flag in SDL_GetWindowSizeInPixels 2024-07-25 08:49:50 -07:00
Sam Lantinga
e9a7014e56 Fixed hanging after onDestroy() on Android 2024-07-25 07:34:25 -07:00
Anonymous Maarten
9826f73230 cmake: fix copying of resource files on uwp 2024-07-25 16:01:57 +02:00
Anonymous Maarten
9f9ebcd40a cmake: fix copying of example resource files on desktop, ps2 and psp 2024-07-25 14:54:20 +02:00
Sam Lantinga
e387314a67 Fixed building on older macOS SDK 2024-07-25 05:44:54 -07:00
Anthony
d6554a9505 Fix running on Android 9 and older 2024-07-25 04:41:43 -07:00
Daniel Ludwig
76c4c16ca9 Fix DXGI cleanup code 2024-07-25 11:35:10 +03:00
Daniel Ludwig
ff66ec5fb5 GDK build: fix Xbox targets 2024-07-25 11:35:10 +03:00
Daniel Ludwig
7e48d4522b GDK build: move suspend/constrain setup back to previous compilation unit 2024-07-25 11:35:10 +03:00
Daniel Ludwig
0a678a654e GDK build: fix project settings and API changes 2024-07-25 11:35:10 +03:00
SDL Wiki Bot
ba8495c214 Sync SDL3 wiki -> header 2024-07-25 00:41:44 +00:00
Sam Lantinga
cf8b158ccb Added SDL_GetRenderSafeArea() 2024-07-24 17:40:41 -07:00
Sam Lantinga
eb09264076 Added the safe area to the debug window information 2024-07-24 17:40:41 -07:00
Sam Lantinga
9e6d5babce Fixed display detection after the monitor resolution changed on X11 2024-07-24 17:46:25 -07:00
Sam Lantinga
b98e1e9ef0 Fixed the render viewport not updating when the metal view resizes
When the phone is in portrait mode and the window is in landscape mode, the view changes orientation after layoutSubviews runs. In this case we need some way of notifying the application that the Metal view has changed.
2024-07-24 16:12:29 -07:00
Ryan C. Gordon
195c26a50a examples: Add a way to add datafiles to an example, and add audio/load-wav 2024-07-24 17:30:55 -04:00
Sam Lantinga
f562a6d9f7 Added Android API level 35 to the table 2024-07-24 14:09:54 -07:00
Sam Lantinga
e7771fb4f6 Fixed memory corruption in SDL_GetPreferredLocales()
Fixes https://github.com/libsdl-org/SDL/issues/10362
2024-07-24 13:37:40 -07:00
Sam Lantinga
31730bef1a Fixed running on Android 10 and older (thanks @AntTheAlchemist!) 2024-07-24 13:37:40 -07:00
Sam Lantinga
c601120883 Handle all Android lifecycle events on the main thread
This restructuring also allows us to wait efficiently in SDL_WaitEvent() on Android
2024-07-24 13:37:40 -07:00
Sam Lantinga
a7c0192017 Renamed SDL_PostSemaphore() to SDL_SignalSemphore() 2024-07-24 13:37:40 -07:00
Anthony
27f86cbe18 Update proguard-rules.pro to include onNativeInsetsChanged 2024-07-24 10:22:45 -07:00
Sam Lantinga
83c7ce2681 Android life cycle behavior more closely matches iOS
On iOS, the application gets one last change to process messages before going into the background. We do the same on Android, which more closely matches the previous behavior.
2024-07-24 06:18:18 -07:00
Sam Lantinga
ca4bd4b63c Android life cycle behavior more closely matches iOS
This change also decouples the pause/resume handling from the video subsystem on Android, so applications that don't use SDL for video can get application life cycle events.

The semantics for the life cycle events are that they need to be handled in an event watch callback, and once they've been delivered, the application will block until it's been resumed. SDL_HINT_ANDROID_BLOCK_ON_PAUSE can be used to control that behavior, and if that's set to "0", then the application will continue to run in the background at low CPU usage until being resumed or stopped.

SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO has been removed, and the audio will be paused when the application is paused.

Fixes https://github.com/libsdl-org/SDL/issues/3193
2024-07-24 05:11:13 -07:00
Sam Lantinga
fff783de6c Fixed life cycle events on iOS when using main callbacks 2024-07-24 05:11:13 -07:00
Sam Lantinga
45fc548562 Don't queue application events that need to be handled immediately
This makes it more clear that these events can't be handled in the normal event loop. It also makes pause and resume transparent to applications that don't handle them, which is a nice side effect.
2024-07-24 05:11:13 -07:00
Sam Lantinga
fa0918a686 Renamed SDL life cycle functions
This maps better to how SDL delivers the events, and the iOS delegate methods are in the documentation for reference.
2024-07-24 05:11:13 -07:00
Ryan C. Gordon
06c0ed68b1 mac: Rename Objective-C classes that conflict with SDL2.
Fixes #6709.
2024-07-24 01:35:04 -04:00
Sam Lantinga
f0363a0466 Functions that return display modes return temporary memory.
Also use the real pointer to display modes for internal mode processing

Fixes https://github.com/libsdl-org/SDL/issues/10353
2024-07-23 19:26:19 -07:00
SDL Wiki Bot
10dcae784b Sync SDL3 wiki -> header 2024-07-24 00:07:31 +00:00
Sam Lantinga
457ca3995c Added SDL_GetWindowSafeArea()
Fixes https://github.com/libsdl-org/SDL/issues/3243
2024-07-23 17:06:04 -07:00
Sam Lantinga
1c4cc2b024 Updated Android minimum API level to 21 (Android 5.0)
This is necessary for the window safe area support, and is a reasonable default for SDL 3.0
2024-07-23 17:06:04 -07:00
Sam Lantinga
57dcd7993f Update the package name in the app build.gradle
Also only change the name of the activity in AndroidManifest.xml, not all of the descriptive text saying to change the name of the activity.
2024-07-23 17:06:04 -07:00
Sam Lantinga
a432221db5 Specify that this script uses python3
Fixes running on macOS
2024-07-23 17:06:04 -07:00
SDL Wiki Bot
230161a50c Sync SDL3 wiki -> header 2024-07-23 22:49:23 +00:00
Ryan C. Gordon
bd65d154d5 examples: Added audio/simple-playback-callback. 2024-07-23 17:52:42 -04:00
Ryan C. Gordon
ea137cfbaf examples: Fix window titles. 2024-07-23 17:52:24 -04:00
Ryan C. Gordon
35a1cf910a examples/audio/simple-playback: Add a description to the example. 2024-07-23 17:33:33 -04:00
Sam Lantinga
66011e497d Removed duplication in SDL_EGL_* function names 2024-07-23 13:11:37 -07:00
Eduard Gushchin
86934975b9 Update SDL_video.h
Fixed a typo in the function name in the documentation for SDL_EGL_GetProcAddress
2024-07-23 12:48:10 -07:00
Ryan C. Gordon
f5f44de155 examples: Add audio/01-simple-playback. 2024-07-23 14:52:31 -04:00
Ryan C. Gordon
5216aea31d examples: Explicitly call SDL_Init(). 2024-07-23 14:52:30 -04:00
Sam Lantinga
ff7a60db85 Minor fixes to the primitive example
* The random number generator is automatically seeded, no need for SDL_srand()
* Draw the points first, so they don't overlap the other primitives and look like broken line drawing
2024-07-23 08:34:15 -07:00
Sam Lantinga
b499c54af4 Fixed testvulkan on macOS (thanks @proton991!)
Fixes https://github.com/libsdl-org/SDL/issues/10351
2024-07-23 08:17:22 -07:00
Sam Lantinga
5c00e54073 Updated SDL_migration.cocci for SDL_GUIDFromString rename (thanks @sezero!) 2024-07-23 08:14:13 -07:00
Ryan C. Gordon
4d8b938969 examples: Added renderer/primitives example. 2024-07-23 10:37:14 -04:00
Ryan C. Gordon
266744af03 examples: Number examples, so they are presented in a specific order. 2024-07-23 10:12:53 -04:00
Ryan C. Gordon
23cf09163e examples: More n3ds build fixes. 2024-07-23 01:35:15 -04:00
Ryan C. Gordon
3671497ea1 examples: Maybe fix n3ds builds. 2024-07-23 01:28:19 -04:00
Ryan C. Gordon
d2e2b9bdc9 examples: Maybe fix Android builds. 2024-07-23 01:25:29 -04:00
Ryan C. Gordon
d8d7212efd examples: Maybe fix UWP builds. 2024-07-23 01:22:19 -04:00
Ryan C. Gordon
a03ecaacb0 workflows: Enable building examples on GitHub Actions. 2024-07-23 01:04:05 -04:00
Ryan C. Gordon
16535b7ee2 examples: Add CMake glue to optionally build examples, as we do for the tests.
In fact, most of the CMake code was stolen from the test directory.
2024-07-23 00:58:57 -04:00
Ryan C. Gordon
2038620717 examples/README: fixed typo. 2024-07-22 23:41:16 -04:00
Ryan C. Gordon
15562564ad build-web-examples: Run highlight with --enclose-pre option. 2024-07-22 23:23:53 -04:00
Ryan C. Gordon
549317e0e4 build-web-examples: Minor tweaks. 2024-07-22 23:05:59 -04:00
Ryan C. Gordon
2de83359ba build-web-examples: Fix CMake dir. 2024-07-22 22:55:41 -04:00
Ryan C. Gordon
70348d77e1 build-web-examples: It's usually /bin/bash on Linux, not /usr/bin/bash. 2024-07-22 22:42:32 -04:00
Ryan C. Gordon
5339b4458d examples: Added initial examples infrastructure. 2024-07-22 22:39:09 -04:00
Ryan C. Gordon
2f6e34d2d0 wikiheaders: Added copyright comment to the top of file. 2024-07-22 22:39:09 -04:00
SDL Wiki Bot
2aea74aa84 Sync SDL3 wiki -> header 2024-07-22 22:19:38 +00:00
Sam Lantinga
a36be94ad1 More clarification on temporary memory 2024-07-22 15:19:26 -07:00
Sam Lantinga
29f0fd33dc SDL_getenv() should return const
This also allows us to use SDL_FreeLater() and make SDL_getenv() thread-safe on Windows.
2024-07-22 13:00:39 -07:00
Sam Lantinga
ef21e31a9a SDL_GUIDFromString() renamed SDL_StringToGUID() 2024-07-22 12:39:15 -07:00
SDL Wiki Bot
5e12706ae0 Sync SDL3 wiki -> header 2024-07-22 17:05:52 +00:00
Eduard Gushchin
24bb95f60c Fixed a typo in the name of the method in the documentation for SDL_GetDisplayProperties 2024-07-22 10:04:59 -07:00
Sam Lantinga
c4bf5f9f59 SDL_CreateTexture() uses the SDL_TextureAccess type for the access parameter 2024-07-22 09:32:02 -07:00
Frank Praznik
b0713a7d30 x11: Track cursor visibility internally
Cursor visibility in the SDL input layer only reflects whether ShowCursor/HideCursor was called. In the case of relative mode, the cursor can be hidden, but the SDL_Mouse visibility flag will be true.

Track cursor visibility separately in the X11 driver. Fixes the cursor becoming visible when using the warping relative mode with XWayland.
2024-07-22 12:03:07 -04:00
SDL Wiki Bot
3e943090d0 Sync SDL3 wiki -> header 2024-07-22 14:50:48 +00:00
Eduard Gushchin
61565b7f61 Update SDL_video.h
Led to the actual list of WindowsFlag in the documentation of the SDL_CreateWindow method
2024-07-22 07:50:07 -07:00
SDL Wiki Bot
40cb3fb74a Sync SDL3 wiki -> header 2024-07-22 14:35:35 +00:00
Sam Lantinga
ff1d351390 Removed SDL_FreeTemporaryMemory()
This was just causing confusion and anxiety. SDL temporary memory will be automatically freed on the main thread when processing events and on other threads when it ages out after a second. The application can free it directly by calling SDL_ClaimTemporaryMemory() to get ownership of the pointer, if necessary.
2024-07-22 07:34:25 -07:00
Ozkan Sezer
70c1012e8c SDL_stdinc.h (SDL_COMPILE_TIME_ASSERT): Keep C++ case alone (after PR/10331)
Some versions of gcc will define __STDC_VERSION__ even when compiling in C++ mode.
Reference issue: https://github.com/libsdl-org/SDL/issues/6078 which was fixed by
f6b81125b3
2024-07-22 16:00:37 +03:00
SDL Wiki Bot
230f2a684d Sync SDL3 wiki -> header 2024-07-22 12:59:19 +00:00
Sam Lantinga
685e381735 Add an overview of how to handle temporary memory 2024-07-22 05:58:19 -07:00
Sam Lantinga
9bfd0d901c Audio device IDs are unsigned 2024-07-22 05:48:01 -07:00
Sam Lantinga
033c9c5951 Added SDL_CopyFile() and SDL_CopyStorageFile()
Fixes https://github.com/libsdl-org/SDL/issues/9553
2024-07-21 19:58:23 -07:00
Sam Lantinga
128df75e05 Fixed potential NULL dereference 2024-07-21 14:32:19 -07:00
Sam Lantinga
bd27b89903 Prevent potential overflow in rectangle functions
We're limiting the functions to rects with positions and sizes < 1 billion for speed, which is totally fine for most SDL use cases. If you need rectangles larger than that, you can roll your own functions that use 64-bit intermediate values and do proper overflow handling of output values.

Fixes https://github.com/libsdl-org/SDL/issues/8879
2024-07-21 13:04:11 -07:00
Anonymous Maarten
22bfbdbc02 stdinc: c23 deprecated _Static_assert in favor of static_assert 2024-07-21 21:51:55 +03:00
Sam Lantinga
4830fc4e40 Added more 8-bit blit test coverage 2024-07-21 11:39:38 -07:00
Sam Lantinga
bab982f2e0 Don't recalculate the blit mapping when changing surfaces
We don't actually need to change the blit mapping if we're targeting a new surface with the same format and palette.
2024-07-21 11:39:38 -07:00
Dragon-Baroque
68cabc2837 Support SDL_EVENT_DROP_TEXT in Cocoa
src/video/cocoa/SDL_cocoawindow.m
    Support Copy in addition to Generic as Drag and Drop operation,
    Register and Support public.utf8-plain-text for SDL_EVENT_DROP_TEXT.
2024-07-21 11:17:04 -07:00
Sam Lantinga
c040a02d6c Removed SDL_PROP_SURFACE_COLORSPACE_NUMBER
Now that we have surface internal data, we can store it there. This slightly improves performance in the surface blitting paths.
2024-07-21 09:36:22 -07:00
SDL Wiki Bot
4a7e95402f Sync SDL3 wiki -> header 2024-07-21 15:09:24 +00:00
Sam Lantinga
e0fd59de64 Fixed floating point rectangles to be mathematically correct.
* A floating point rectangle contains all points >= x and <= x + w
* A floating point rectangle is only empty if it has negative width. The zero rectangle contains the zero point.
* Adjacent floating point rectangles intersect along their shared side

Fixes https://github.com/libsdl-org/SDL/issues/6791
2024-07-21 08:08:15 -07:00
Sam Lantinga
9e978740c3 Removed unnecessary casts 2024-07-21 08:08:15 -07:00
Sam Lantinga
35ae56d344 Switched the rectangle tests to listing by name instead of by number. 2024-07-21 08:08:15 -07:00
Sam Lantinga
f244f08165 Fixed building with SDL_VIDEO_OPENGL_WGL disabled (thanks @Please-just-dont!)
Fixes https://github.com/libsdl-org/SDL/issues/10330
2024-07-20 21:24:02 -07:00
Sam Lantinga
78991bdb13 Revert "SDL_BlitSurfaceUnchecked() should invalidate the map when switching from scaled to unscaled blits"
This reverts commit 1f3b2fc8b3.

SDL_BlitSurface() also handles scaling, so we shouldn't clear the scaling flag inside of it.
2024-07-20 21:17:15 -07:00
Sam Lantinga
b0a6afaa35 Updated documentation for SDL_GetPreferredLocales() 2024-07-20 20:12:55 -07:00
Sam Lantinga
bce6d5b421 Actually, we still need size overflow checking in SDL_BlitSurfaceUncheckedScaled() 2024-07-20 18:53:31 -07:00
Sam Lantinga
9bdb3e8b6a Moved some error checking out of SDL_BlitSurfaceUncheckedScaled() 2024-07-20 18:51:42 -07:00
Sam Lantinga
1f3b2fc8b3 SDL_BlitSurfaceUnchecked() should invalidate the map when switching from scaled to unscaled blits 2024-07-20 18:44:23 -07:00
SDL Wiki Bot
979c71b18b Sync SDL3 wiki -> header 2024-07-21 01:22:39 +00:00
Sam Lantinga
6209c71f54 Added SDL_BlitSurface9Grid() and SDL_RenderTexture9Grid() 2024-07-20 18:21:19 -07:00
Sam Lantinga
9294476788 Added SDL_WriteSurfacePixel() and SDL_WriteSurfacePixelFloat() 2024-07-20 18:21:19 -07:00
Sam Lantinga
12e50d17a2 Removed SDL_SoftStretch() from the public API
SDL_BlitSurfaceScaled() is more flexible and uses the SDL_SoftStretch() fast path when possible. Having two surface scaling APIs was confusing, especially when one of them has unexpected limitations.
2024-07-20 18:21:19 -07:00
Sam Lantinga
5ce81ebcc9 Corrected blit colorkey documentation
Fixes https://github.com/libsdl-org/sdlwiki/issues/576
2024-07-20 18:21:19 -07:00
Sam Lantinga
67fa7a9138 SDL_BlitSurface() and SDL_BlitSurfaceScaled() now have a const dstrect parameter
This was originally to avoid duplicating clipping work in Maelstrom on a 486 computer. This has been confusing for users and computers are a little faster these days, so we'll make it work the way people expect.
2024-07-20 18:21:19 -07:00
Sam Lantinga
198caa54a1 Added SDL_RenderTextureTiled() 2024-07-20 18:21:19 -07:00
Sam Lantinga
9e55ee9391 Added SDL_BlitSurfaceTiledWithScale() 2024-07-20 18:21:19 -07:00
Sam Lantinga
f47ddbf1ac Added SDL_BlitSurfaceTiled()
Fixes https://gamedev.stackexchange.com/questions/136792/is-there-a-way-to-set-texture-wrap-mode-as-repeat-in-sdl-2
2024-07-20 18:21:19 -07:00
Sam Lantinga
71d2662a39 Fixed warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data 2024-07-20 11:50:27 -07:00
Sam Lantinga
03bb2c17ed Enable texture wrapping for SDL_RenderGeometry()
Currently wrapping is based on whether texture coordinates are outside of [0,1], but the code is structured so it's easy to add an API to set it and add additional wrapping modes if we want.

Fixes https://github.com/libsdl-org/SDL/issues/9238
Closes https://github.com/libsdl-org/SDL/pull/5369
2024-07-20 09:51:05 -07:00
Frank Praznik
6a74ade73d Make SDL_URIToLocal available to multiple platforms
Moves the functions out of core/unix into SDL_utils.c
2024-07-20 12:39:18 -04:00
hwsmm
6a62c54b93 Remove a duplicate definition that is already in SDL_guid.h 2024-07-20 12:23:50 +03:00
Ryan C. Gordon
e1aa995732 audio: recording devices also need to update their streams' channel maps. 2024-07-19 20:37:05 -04:00
Ryan C. Gordon
068c785491 audio: Assigning a device channel map to an audio stream was quietly failing.
Fixes #10317.
2024-07-19 20:37:05 -04:00
Anonymous Maarten
6d39c18dd3 ci: test the MSVC development archive for targeting arm64ec 2024-07-20 00:59:58 +02:00
Anonymous Maarten
476b987f1b intrinsics: avx, avx2 and avx512f are (currently) unsupported on arm64ec 2024-07-20 00:59:58 +02:00
Anonymous Maarten
b3b74e8aed Fix SDL3ConfigVersion.cmake of VC development package for ARM64EC 2024-07-20 00:59:58 +02:00
Sam Lantinga
aafbbe4ebc Fixed warning C4090: 'function': different 'const' qualifiers 2024-07-19 15:38:41 -07:00
Sam Lantinga
64cb431ead Updated migration documentation for functions that now return temporary memory 2024-07-19 14:45:47 -07:00
Sam Lantinga
f0a839b9b7 Removed SDL 2.1 note, we're not going to revisit this for SDL 3.0
Closes https://github.com/libsdl-org/SDL/issues/9480
2024-07-19 13:39:22 -07:00
Anonymous Maarten
cc47969a79 cmake: actually check ARM64EC 2024-07-19 22:24:44 +02:00
SDL Wiki Bot
fc8cd657a5 Sync SDL3 wiki -> header 2024-07-19 20:08:05 +00:00
Sam Lantinga
02dceed760 Simpler pointer arithmetic 2024-07-19 13:06:54 -07:00
Sam Lantinga
b80784fced SDL_GetGamepadBindings() follows the SDL_GetStringRule 2024-07-19 13:06:54 -07:00
Sam Lantinga
93db5ef135 Fixed documentation for SDL_GlobDirectory() 2024-07-19 13:06:54 -07:00
Sam Lantinga
0079b6d45f SDL_GetTouchFingers() follows the SDL_GetStringRule 2024-07-19 13:06:54 -07:00
SDL Wiki Bot
975457cfb6 Sync SDL3 wiki -> header 2024-07-19 19:23:24 +00:00
Sam Lantinga
a340de6196 The candidates in SDL_EVENT_TEXT_EDITING_CANDIDATES should be a single allocation 2024-07-19 12:22:03 -07:00
Sam Lantinga
bebde1c4c9 Make sure we're not trying to add temporary memory twice 2024-07-19 12:22:03 -07:00
Sam Lantinga
71a60d4c0e Updated documentation for functions that return temporary memory 2024-07-19 12:22:03 -07:00
Sam Lantinga
68322ac851 Ensure that all functions that follow the SDL_GetStringRule return temporary memory 2024-07-19 12:22:03 -07:00
Sam Lantinga
fd9fe1bb7b Renamed event memory to temporary memory, since it's not just used for events 2024-07-19 12:22:03 -07:00
Sam Lantinga
c4eac60000 SDL_GetClipboardData() follows the SDL_GetStringRule 2024-07-19 12:22:03 -07:00
Sam Lantinga
61a7a0e579 SDL_GUIDToString() follows the SDL_GetStringRule
Also removed the distinction between SDL_GUID and SDL_JoystickGUID
2024-07-19 12:22:03 -07:00
Sam Lantinga
892df4bf4b SDL_GetWindowICCProfile() follows the SDL_GetStringRule 2024-07-19 12:22:03 -07:00
Sam Lantinga
eb22fcce35 SDL_GetTouchDevices() follows the SDL_GetStringRule 2024-07-19 12:22:03 -07:00
Sam Lantinga
856d598d6e SDL_GetSensors() follows the SDL_GetStringRule 2024-07-19 12:22:03 -07:00
Sam Lantinga
4f8c348402 SDL_GetPreferredLocales() follows the SDL_GetStringRule 2024-07-19 12:22:03 -07:00
Sam Lantinga
9be73ed7c5 SDL_GetMice() follows the SDL_GetStringRule 2024-07-19 12:22:03 -07:00
Sam Lantinga
6ca18ed0e5 SDL_GetKeyboards() follows the SDL_GetStringRule 2024-07-19 12:22:03 -07:00
Sam Lantinga
5ce0aacaa4 SDL_GetGamepads() follows the SDL_GetStringRule 2024-07-19 12:22:03 -07:00
Sam Lantinga
4961af4569 SDL_GetJoysticks() follows the SDL_GetStringRule 2024-07-19 12:22:03 -07:00
Sam Lantinga
b32c9615a7 SDL_GetHaptics() follows the SDL_GetStringRule 2024-07-19 12:22:03 -07:00
Sam Lantinga
9de8cb888a SDL_GetFullscreenDisplayModes() follows the SDL_GetStringRule 2024-07-19 12:22:03 -07:00
Sam Lantinga
9758e102bc SDL_GetDisplays() follows the SDL_GetStringRule 2024-07-19 12:22:03 -07:00
Sam Lantinga
01199469de SDL_GetCameras() follows the SDL_GetStringRule 2024-07-19 12:22:03 -07:00
Sam Lantinga
0fe6603747 SDL_GetCameraSupportedFormats() follows the SDL_GetStringRule
Also changed the function to return an array of pointers and added example usage to testcamera
2024-07-19 12:22:03 -07:00
Sam Lantinga
637e9700dd Standardize placement of '*' in function declarations
Implemented using these sed commands on the headers:
sed -E -i'' '/SDLCALL|;/ s,([a-z])\* ,\1 *,g' *
sed -E -i'' 's,(\(.*[^\*])\* ([a-z])(.*\)),\1*\2\3,g' *
sed -E -i'' 's,\*const,* const,g' *
sed -E -i'' 's,\*SDLCALL,* SDLCALL,g' *
sed -E -i'' 's,void\(,void (,g' *
git checkout *gl*
2024-07-19 12:22:03 -07:00
Sam Lantinga
bdafc8e212 SDL_GetWindows() follows the SDL_GetStringRule 2024-07-19 12:22:03 -07:00
Sam Lantinga
8ca6caeda5 SDL_GetAudioPlaybackDevices() and SDL_GetAudioRecordingDevices() follow the SDL_GetStringRule 2024-07-19 12:22:03 -07:00
Sam Lantinga
bb96320cc4 Make sure we always copy the data returned using SDL_GetStringRule
This prevents race conditions where calling an API from one thread returns the data and it's freed by updates on another thread
2024-07-19 12:22:03 -07:00
Sam Lantinga
ef884c8aa6 Transfer event memory between the local pool and the event queue
This allows threads to free memory from their local pool without affecting events that are queued, and to transfer memory ownership cleanly between threads that are queuing and dequeuing events.
2024-07-19 12:22:03 -07:00
Sam Lantinga
f95ecac300 Added SDL_ClaimEventMemory() 2024-07-19 12:22:03 -07:00
Sam Lantinga
2816745f48 Allow passing a pointer to SDL_FreeEventMemory()
Also clarify in the documentation that you should not call SDL_FreeEventMemory(NULL) from your main thread.
2024-07-19 12:22:03 -07:00
Sam Lantinga
217330a7b3 Made return value descriptions more consistent across the API 2024-07-19 12:22:03 -07:00
Sam Lantinga
d73c7311d5 Clarify that the SDL_GetStringRule means that SDL will automatically free the memory later. 2024-07-19 12:22:03 -07:00
Frank Praznik
0d24b6e9f3 wayland: Use the compositor provided size during state transitions
Always use the size sent by the compositor when transitioning back to the floating state on the xdg-toplevel path, unless the client explicitly requested a new floating size while the window was in a fixed-size state.

If a window is requested to be maximized or made fullscreen while an uncommitted size request is pending, the surface will first be committed so that the compositor will set the new size when the window is restored.

Fixes the window being wrongly resized when leaving the maximized state in KDE.
2024-07-19 14:15:36 -04:00
Charlie Birks
25559faaea emscripten: restore key event prevent default behaviour
This restores the behaviour before 9221548114 where we only preventDefault the event if:
- the key is recognised
- the event is enabled
- the event is not filtered

(ignoring the KEYPRESS special case, which is unchanged)

(cherry picked from commit 6e931bee01)
2024-07-19 09:41:02 -07:00
Anonymous Maarten
f8c1cd6622 ci: build MSVC workflows using Ninja generator 2024-07-19 10:21:34 +00:00
Anonymous Maarten
a2a1d2de66 Add HAVE_UNSETENV to preprocessor guard 2024-07-19 10:21:34 +00:00
Anonymous Maarten
2d1d3d9fb2 cmake: fix building UWP with non-MSVC generator 2024-07-19 10:21:34 +00:00
Anonymous Maarten
ccebbb6c6e Fix UWP build in non-UNICODE mode 2024-07-19 10:21:34 +00:00
Anonymous Maarten
c59771d7fc cmake: detect ARM64EC 2024-07-19 10:21:34 +00:00
vanfanel
7d83e03ac2 Fix KMSDRM double buffering.
(cherry picked from commit 5ab1151508)
2024-07-18 14:36:58 -07:00
Sam Lantinga
9af7a80767 OpenGL ES is still available on iOS 2024-07-18 09:27:16 -07:00
SDL Wiki Bot
e949f12f63 Sync SDL3 wiki -> header 2024-07-18 01:04:46 +00:00
Sam Lantinga
38a301a3f9 Added automated tests to verify SDL_ClearSurface() and SDL_PremultiplySurfaceAlpha() 2024-07-17 18:04:16 -07:00
Sam Lantinga
02a072a1b7 Added SDL_ClearSurface() and SDL_ReadSurfacePixelFloat() 2024-07-17 18:04:16 -07:00
Sam Lantinga
b07bd55baf Fixed use of SDL_expand_byte after flipping from bit loss to bit count 2024-07-17 18:04:16 -07:00
Sam Lantinga
cd25cb3435 Check SDL_LockSurface() return value 2024-07-17 18:04:16 -07:00
Sam Lantinga
eefcb62588 SDL_MUSTLOCK() returns true once a surface has the RLE flag set
This more closely matches the mental model of people using SDL, and locking a surface that isn't RLE encoded doesn't cause any issues.

Fixes https://github.com/libsdl-org/SDL/issues/5594
2024-07-17 18:04:16 -07:00
Sam Lantinga
de6595bda6 SDL_MUSTLOCK() should return true if the surface needs locking even if it's currently locked.
There's a bunch of code that assumes this in SDL, and presumably in applications as well.
2024-07-17 18:04:16 -07:00
Sam Lantinga
334962b056 Enhancements for SDL_PremultiplyAlpha()
The function can now convert between pixels of different formats, and takes a parameter to control whether the premultiplication is done in sRGB or linear space.

Also added SDL_PremultiplySurfaceAlpha(), which can premultiply the pixels of a surface in-place.
2024-07-17 18:04:16 -07:00
Frank Praznik
b99ea1ff75 wayland: Add SDL_VIDEO_DOUBLE_BUFFER support
Manual cherry-pick of 9e6b8d56e3

thanks @vanfanel
2024-07-17 18:27:46 -04:00
Amir
5db08b86ca Fix warning for Android NDK compiler: "function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]"
https://stackoverflow.com/questions/42125/warning-error-function-declaration-isnt-a-prototype
In C int foo() and int foo(void) are different functions. int foo() accepts an arbitrary number of arguments, while int foo(void) accepts 0 arguments. In C++ they mean the same thing.
2024-07-17 14:09:11 -07:00
Sam Lantinga
94c40fb3c9 Fixed warning: no previous prototype for function 'SDL_InitFilesystem' 2024-07-17 11:00:25 -07:00
Sam Lantinga
761e86e25e Initialize output parameters to reasonable defaults in case of error 2024-07-17 10:27:37 -07:00
Sam Lantinga
5f5e91eab6 Reverted 3d2e5a0b66
Applying these changes to external code doesn't actually improve anything, and within the context of the other Get* functions for renderers and surfaces, these stand out as outliers, so I'm going to back this change out.
2024-07-17 10:27:37 -07:00
Sam Lantinga
b3df46e4bc Added missing SDL_sysfilesystem.h includes 2024-07-17 09:09:42 -07:00
Ozkan Sezer
2eda7b2c24 SDL_sysvideo.h: remove SDL_DisplayModeData typedef:
Fixes a type redefinition error:

In file included from /tmp/SDL3/test/../src/events/SDL_events_c.h:28,
                 from /tmp/SDL3/test/../src/events/SDL_pen.c:26,
                 from /tmp/SDL3/test/testautomation_pen.c:83:
/tmp/SDL3/test/../src/events/../video/SDL_sysvideo.h:34: error: redefinition of typedef 'SDL_DisplayModeData'
/tmp/SDL3/include/SDL3/SDL_video.h:78: note: previous declaration of 'SDL_DisplayModeData' was here
2024-07-17 12:30:32 +03:00
Sam Lantinga
8c25129458 SDL_EVENT_WINDOW_LAST should be SDL_EVENT_WINDOW_HDR_STATE_CHANGED
Fixes https://github.com/libsdl-org/SDL/issues/10299
2024-07-16 22:43:02 -07:00
SDL Wiki Bot
b92ec25147 Sync SDL3 wiki -> header 2024-07-17 04:33:30 +00:00
Sam Lantinga
3d2e5a0b66 Fixed a few remaining functions to directly return their values instead of an error code. 2024-07-16 21:32:17 -07:00
Sam Lantinga
1e828eec57 Fixed warning C4244: '=': conversion from 'float' to 'int', possible loss of data 2024-07-16 21:32:17 -07:00
Sam Lantinga
98bea25363 Converted surfaces with alpha format default to SDL_BLENDMODE_BLEND
Fixes https://github.com/libsdl-org/SDL/pull/4690
2024-07-16 18:50:22 -07:00
Sam Lantinga
7c0307060d Textures with alpha format default to SDL_BLENDMODE_BLEND
Fixes https://github.com/libsdl-org/SDL/issues/9941
2024-07-16 18:50:22 -07:00
Sam Lantinga
2db57e2678 Removed SlowBlitPixelAccess_Unknown
This wasn't actually set anywhere, and not needed.
2024-07-16 18:43:14 -07:00
Sam Lantinga
b5292bdec9 Added blend mode testing for 8-bit surfaces 2024-07-16 17:57:12 -07:00
Sam Lantinga
e41428d259 Added full blit feature support for 8-bit surfaces
Fixes https://github.com/libsdl-org/SDL/issues/8079
2024-07-16 17:57:12 -07:00
Sam Lantinga
b7ec2119dd Use a dither palette when converting RGB images to indexed formats 2024-07-16 17:57:12 -07:00
Sam Lantinga
626bb53772 Fail blits between indexed and RGB surfaces if there is no palette set 2024-07-16 17:57:12 -07:00
Sam Lantinga
9ca1792848 Renamed driverdata to internal
This was done to SDL_DisplayMode for consistency with SDL_Surface and gives it a type so we don't have to do casts in SDL code.

I considered switching to an ID and hashing the driver data, etc. but all of that involved a lot of internal code churn and this solution gives us flexibility in how we handle this in the future.

After consideration, I made this renaming global across the project, for consistency.

Fixes https://github.com/libsdl-org/SDL/issues/10198
2024-07-16 17:17:13 -07:00
SDL Wiki Bot
fe183872ee Sync SDL3 wiki -> header 2024-07-16 20:45:34 +00:00
Ryan C. Gordon
4dda785c69 gamepad: Several gamepad mapping functions now follow the SDL_GetStringRule.
Reference Issue #10229.
2024-07-16 16:44:36 -04:00
Ryan C. Gordon
ed1f93cd11 filesystem: SDL_Glob*Directory() functions now follow the SDL_GetStringRule.
Reference Issue #10229.
2024-07-16 16:44:36 -04:00
Ryan C. Gordon
52bf7ff42d filesystem: SDL_GetPrefPath() now follows the SDL_GetStringRule.
Reference Issue #10229.
2024-07-16 16:44:36 -04:00
Ryan C. Gordon
2321726ff1 filesystem: SDL_GetUserFolder() now follows the SDL_GetStringRule.
It also now caches at the higher level, so the platform-specific bits don't
change their interface much.

Reference Issue #10229.
2024-07-16 16:44:36 -04:00
Ryan C. Gordon
d40b89dff6 clipboard: SDL_GetPrimarySelectionText() now follows the SDL_GetStringRule.
Reference Issue #10229.
2024-07-16 16:44:36 -04:00
Ryan C. Gordon
158fc459f1 clipboard: SDL_GetClipboardText() now follows the SDL_GetStringRule.
Reference Issue #10229.
2024-07-16 16:44:36 -04:00
Ryan C. Gordon
3bc81a81f5 filesystem: SDL_GetBasePath() now follows the SDL_GetStringRule.
It also now caches at the higher level, so the platform-specific bits don't
change their interface much.

A little code hygiene work was applied to some of the platform bits on top of
this.

Reference Issue #10229.
2024-07-16 16:44:36 -04:00
SDL Wiki Bot
d65a8146b9 Sync SDL3 wiki -> header 2024-07-16 19:03:15 +00:00
Sam Lantinga
4aeabb3c3b Made event and temporary string memory thread-local and added SDL_FreeEventMemory()
Fixes https://github.com/libsdl-org/SDL/issues/10283
2024-07-16 12:01:51 -07:00
Sam Lantinga
ec3bb4c029 Removed the need for SDL_CreateTLS()
This eliminates the tap dancing needed for allocating TLS slots, we'll automatically allocate them as needed, in a thread-safe way.
2024-07-16 12:01:51 -07:00
Ryan C. Gordon
1592452cad video: Fixed remaining return 0 to use NULL in CreateDevice implementations. 2024-07-16 14:26:30 -04:00
Ryan C. Gordon
d78ef58b4b offscreen: Don't ever use this backend unless explicitly requested.
Reference PR #10202.
2024-07-16 14:19:58 -04:00
Ryan C. Gordon
bc1ceb0883 dummyvideo: Change a thing returning a 0 pointer to return NULL instead. 2024-07-16 14:17:02 -04:00
Ryan C. Gordon
045f0456b1 dummyvideo: Change a thing using int to use SDL_bool instead. 2024-07-16 14:15:38 -04:00
huanhuan-jiang
723c1cc5b3 Print message in summary when a X11 or wayland video driver is not found 2024-07-16 11:02:57 -07:00
SDL Wiki Bot
70727d36b2 Sync SDL3 wiki -> header 2024-07-16 16:37:08 +00:00
Sam Lantinga
027671bedb SDL_GetWindowOpacity() directly returns the opacity instead of using an out parameter.
Fixes https://github.com/libsdl-org/SDL/issues/10286
2024-07-16 09:36:11 -07:00
Sam Lantinga
58270ef3f2 Finished renaming functions in SDL_system.h 2024-07-16 09:35:49 -07:00
Ryan C. Gordon
199e6929e5 README-macos: fixed some text. 2024-07-16 08:25:38 -04:00
SDL Wiki Bot
4ac67f5ba6 Sync SDL3 wiki -> header 2024-07-16 01:38:55 +00:00
Sam Lantinga
033df70d4c SDL_DelayNS() will attempt to sleep exactly the requested amount of time
This provides a highly accurate sleep function for your application, although you are still subject to being switched out occasionally.

Fixes https://github.com/libsdl-org/SDL/issues/10210
2024-07-15 18:38:09 -07:00
Sam Lantinga
54366181c3 Rename functions in SDL_system.h to match SDL 3.0 naming convention
Fixes https://github.com/libsdl-org/SDL/issues/10277
2024-07-15 16:27:48 -07:00
Bruce Mitchener
e38f971f46 Fix typos in cmake 2024-07-15 15:24:00 -07:00
Sam Lantinga
70c8fe61d7 Align SDL_BLENDMODE_INVALID with the other constants 2024-07-15 15:00:09 -07:00
Sam Lantinga
bf501ab2d4 Made the SDL_BlendMode values wiki-friendly 2024-07-15 14:46:56 -07:00
Sam Lantinga
492e3c1a54 direct3d11: we don't need to create all the blend states up front 2024-07-15 14:12:33 -07:00
Sam Lantinga
a419e2c890 Updated and re-enabled surface and render blend mode tests 2024-07-15 14:12:33 -07:00
Sam Lantinga
df573391b1 Added SDL_BLENDMODE_BLEND_PREMULTIPLIED and SDL_BLENDMODE_ADD_PREMULTIPLIED
Fixes https://github.com/libsdl-org/SDL/issues/2485
2024-07-15 14:12:33 -07:00
Carl Åstholm
f099898a66 Correct ibus include path
ibus-1.0.pc adds /usr/include/ibus-1.0 to the search path but not
/usr/include, which makes the canonical include path <ibus.h>.
2024-07-15 11:24:47 -07:00
SDL Wiki Bot
9406a9d527 Sync SDL3 wiki -> header 2024-07-14 23:42:33 +00:00
Sam Lantinga
5c875e1183 Renamed *FromID() to *ForID()
While it makes sense to get an object pointer from an object ID, you want to get object attributes for an ID, otherwise e.g. GetNameFromID() sounds like it's a name ID, not an object ID. This is also consistent with the function naming convention in SDL2.
2024-07-14 15:56:50 -07:00
SDL Wiki Bot
0cdc60666b Sync SDL3 wiki -> header 2024-07-14 21:04:37 +00:00
Ryan C. Gordon
f61900465c stdinc: Fixed up documentation details for standard types. 2024-07-14 17:03:15 -04:00
SDL Wiki Bot
cb854d1bc9 Sync SDL3 wiki -> header 2024-07-14 20:02:23 +00:00
Sam Lantinga
5836b880b4 Sorted symbols 2024-07-14 13:01:53 -07:00
Sam Lantinga
9797c5d0c0 Renamed CameraDevice to Camera
This is consistent with the rest of the SDL API
2024-07-14 13:01:53 -07:00
Sam Lantinga
9358333286 Renamed SDL_GetKeyboardInstanceName() and SDL_GetMouseInstanceName()
For consistency with other device APIs
2024-07-14 13:01:53 -07:00
Sam Lantinga
d154b37b41 Renamed *FromInstanceID() to *FromID() 2024-07-14 13:01:53 -07:00
Sam Lantinga
cad9e6ea20 Fixed SDL_SINT64_C typo
Apparently all the platforms we compile on have INT64_C defined?

Fixes https://github.com/libsdl-org/SDL/issues/10268
2024-07-14 12:53:32 -07:00
Ryan C. Gordon
90e69f81e5 SDL_hidapi.h: Fixed something that apparently upset wikiheaders. 2024-07-14 15:20:26 -04:00
Ryan C. Gordon
15f850babc SDL_hidapi.h: remove struct predeclaration before typedef. 2024-07-14 15:18:08 -04:00
Anonymous Maarten
b9dcc5de60 ci: bump cross-platform-actions/action, used by the BSDs 2024-07-14 21:09:18 +02:00
Sam Lantinga
a17b742e34 Added documentation references to the components of a colorspace 2024-07-14 11:43:39 -07:00
SDL Wiki Bot
abaef81615 Sync SDL3 wiki -> header 2024-07-14 18:04:00 +00:00
Sam Lantinga
6217094c40 Updated colorspace documentation for the wiki 2024-07-14 11:02:56 -07:00
Sam Lantinga
1fecef5e4b Assign numeric values to pixel format enums
This makes it easier to generate language bindings for these.
2024-07-14 11:02:56 -07:00
Sam Lantinga
cb395f7e80 Change SDL_AudioFormat into an enum
This makes it easier to understand in the debugger, and is consistent with SDL_PixelFormat and SDL_Colorspace
2024-07-14 10:04:31 -07:00
Sam Lantinga
e290e99d89 Fixed error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'unsigned int' 2024-07-14 09:04:09 -07:00
Sam Lantinga
e90060d07f Renamed functions to get information from device IDs
Fixes https://github.com/libsdl-org/SDL/issues/10237
2024-07-14 09:03:59 -07:00
Anonymous Maarten
933f2fc239 pthread: timespec.tv_nsec must be less then 1000000000 ns 2024-07-14 17:28:54 +02:00
Sam Lantinga
bfee544685 Changed SDL_GetWindowPixelFormat() to return SDL_PixelFormat
Fixes https://github.com/libsdl-org/SDL/issues/10257
Closes https://github.com/libsdl-org/SDL/pull/10258
2024-07-14 07:19:20 -07:00
Sam Lantinga
dd08c279e2 Fixed coccinelle patching
Fixes https://github.com/libsdl-org/SDL/issues/10260
2024-07-14 07:15:48 -07:00
Sam Lantinga
509f3a42d7 Fixed crash when pumping events after the window has been destroyed on Android 2024-07-13 17:57:46 -07:00
Anonymous Maarten
c80665a696 Avoid code duplication in SDL_GetPixelFormatDetails 2024-07-14 01:20:02 +02:00
pixls
4e3f35ccbf Unlocking mutex in success case too
Without unlocking, we trigger an assertion failure in SDL_sysmutex.c at line 80 (i.e. 'rc == 0'). Each lock-unlock pair should ideally cancel each other out, maintaining a reference count that returns to zero.
2024-07-13 16:12:46 -07:00
SDL Wiki Bot
2596482c3f Sync SDL3 wiki -> header 2024-07-13 21:32:39 +00:00
Sam Lantinga
650271af46 Added SDL_CreateSurfacePalette() 2024-07-13 14:31:28 -07:00
Sam Lantinga
9379e2eb8d Don't force vsync on for the software renderer
Setting vsync 0 should succeed for the software renderer.
2024-07-13 10:04:15 -07:00
Sam Lantinga
1e6119e335 VULKAN_RenderPresent() should return result code 0 on success 2024-07-13 09:27:06 -07:00
Ryan C. Gordon
3d86dce673 haiku: No more chdir to executable's directory at startup in SDL3.
Use SDL_GetBaseDir() to find this directory instead.

Reference Issue #8403.
Fixes #7596.
2024-07-13 12:24:27 -04:00
Sam Lantinga
c6b9b08e9f Fixed Android build warnings 2024-07-13 09:00:41 -07:00
Sam Lantinga
44f06b216a Fixed refresh interval calculation 2024-07-13 08:52:43 -07:00
captain0xff
2dcb9440f1 android: fix the vulkan renderer 2024-07-13 08:16:26 -07:00
captain0xff
0506cf18ab android: enable vulkan renderer 2024-07-13 08:16:26 -07:00
Anonymous Maarten
f13be04980 testaudio: use SDL_APP_FAILURE macro to signal failure 2024-07-13 17:06:54 +02:00
ceski
68cf17d0d4 Add a Windows mapping for SplitFish Game Controller 2024-07-12 19:48:40 -07:00
Sam Lantinga
00ab330207 Use DXGI to get precise display mode refresh rate values
Fixes https://github.com/libsdl-org/SDL/issues/10185
2024-07-12 19:45:01 -07:00
Sam Lantinga
730d5cf2f8 Added fractional representation of refresh rate to SDL_DisplayMode 2024-07-12 18:09:14 -07:00
Sam Lantinga
1162a1cb8e Added SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED and SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED 2024-07-12 18:09:14 -07:00
SDL Wiki Bot
3f446a12df Sync SDL3 wiki -> header 2024-07-12 19:42:55 +00:00
Ryan C. Gordon
8779c95905 android: Added SDL_AndroidGetCachePath().
Fixes #8408.
2024-07-12 15:41:54 -04:00
SDL Wiki Bot
d949673bc9 Sync SDL3 wiki -> header 2024-07-12 18:25:57 +00:00
Sam Lantinga
4c88ddf86d More property documentation clarification 2024-07-12 11:24:40 -07:00
SDL Wiki Bot
cf441332c4 Sync SDL3 wiki -> header 2024-07-12 18:21:05 +00:00
Sam Lantinga
0e56f6a3ca Clarify property group documentation
Fixes https://github.com/libsdl-org/SDL/issues/10241
2024-07-12 11:20:15 -07:00
Frank Praznik
be15d4ae1f wayland: Add support for SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH behavior
Previously, the Wayland backend did not implement support for this hint and always passed focus clicks through. Obey the hint to match the behavior of other platforms.
2024-07-12 13:58:20 -04:00
SDL Wiki Bot
d6fe06bb5d Sync SDL3 wiki -> header 2024-07-12 17:42:22 +00:00
Sam Lantinga
5bf6bc4d7d Renamed SDL_Get/SetProperty() to SDL_Get/SetPointerProperty()
This is consistent with the naming for the functions that affect other data types

Fixes https://github.com/libsdl-org/SDL/issues/10241
2024-07-12 10:41:02 -07:00
Ryan C. Gordon
bf03dee866 Remove struct SDL_Camera predeclare.
This is unnecessary and confuses the wiki bridge.
2024-07-12 13:25:06 -04:00
Anonymous Maarten
7277d69c0e cmake: verify no undefined versioned symbols exist 2024-07-12 18:45:38 +02:00
Anonymous Maarten
ca36f6c43b sdlprocdump: remove dead code 2024-07-12 18:38:03 +02:00
Sam Lantinga
bd041b4831 Make sure SDL subsystems are initialized before starting threads 2024-07-12 09:10:05 -07:00
SDL Wiki Bot
f531003776 Sync SDL3 wiki -> header 2024-07-12 15:37:23 +00:00
SDL Wiki Bot
68dfae1322 Sync SDL3 wiki -> header 2024-07-12 15:35:05 +00:00
Sam Lantinga
bafbbbf7dd Fixed V4L2 framerate request
V4L2 uses time interval instead of framerate

Fixes https://github.com/libsdl-org/SDL/issues/10234
2024-07-12 06:47:34 -07:00
Sam Lantinga
282cf286fc SDL_GetPixelFormatName() returns a string 2024-07-12 05:59:45 -07:00
SDL Wiki Bot
50589cbff6 Sync SDL3 wiki -> header 2024-07-12 12:33:26 +00:00
Ethan Lee
180b4d7e74 x11: Fix a bogus return in Vulkan_GetPresentationSupport 2024-07-11 21:50:37 -04:00
Anonymous Maarten
40f9fd854f test: use SDL_HINT_(AUDIO,VIDEO)_DRIVER macro 2024-07-11 23:37:11 +02:00
Sam Lantinga
f4f4b453de Sorted API entry points 2024-07-11 12:16:35 -07:00
Sam Lantinga
b517043936 Added TLS initialization and shutdown functions
Fixes https://github.com/libsdl-org/SDL/issues/8576
2024-07-11 12:11:01 -07:00
SDL Wiki Bot
f0ceb92dca Sync SDL3 wiki -> header 2024-07-11 19:01:27 +00:00
Ethan Lee
8d24bb8dfc video: Added parameter checks to SDL_Vulkan_GetPresentationSupport 2024-07-11 15:00:59 -04:00
Ethan Lee
5d506a53a6 testvulkan: Add call to SDL_Vulkan_GetPresentationSupport 2024-07-11 15:00:59 -04:00
Ethan Lee
1993ef664e Add SDL_Vulkan_GetPresentationSupport 2024-07-11 15:00:59 -04:00
Frank Praznik
186fec2560 pipewire: Consolidate registry enumeration instances
The preferred Pipewire path requires both devices being available, and that a sufficiently recent underlying core version is running on the host system. These criteria were being checked separately, which required two separate instances of enumerating the Pipewire registry, which is a fairly heavy operation. Move the version info callback to the main hotplug thread to avoid enumerating the registry twice, and check for both the version and required devices at the same time on the preferred path.
2024-07-11 14:14:15 -04:00
Ozkan Sezer
f437fe75f2 SDL_dynapi_overrides.h: remove left-over SDL_DestroyPixelFormat entry. 2024-07-11 18:56:40 +03:00
Sam Lantinga
875c4f0a4c Support indexed surfaces without palettes (thanks @sulix!)
Currently, all SDL_Surfaces with an indexed pixel format have an
associated SDL_Palette. This palette either consists of entirely the
colour black, or -- in the special case of 1-bit surfaces, black and
white.

When an indexed surface is blitted to another indexed surface, a 'map'
is generated from the source surface's palette to the destination
surfaces palette, in order to preserve the look of the image if the
palettes differ.

However, in most cases, applications will want to blit the raw index
values, rather than translate to make the colours as similar as
possible. For instance, the destination surface's palette may have been
modified to fade the screen out.

This change allows an indexed surface to have no associated palette. If
either the source or destination surface of a blit do not have a
palette, then the raw indices are copied (assuming both have an indexed
format).

This mimics better what happens with most other APIs (such as
DirectDraw), where most users do not set a palette on any surface but
the screen, whose palette is implicitly used for the whole application.
2024-07-11 08:31:32 -07:00
Anonymous Maarten
83d4251540 hidapi: netbsd's iconv expects a 'char ** restrict src' 2024-07-11 08:12:42 -07:00
Anonymous Maarten
131108ee48 Remove references to SDL_CreatePixelFormat and SDL_DestroyPixelFormat 2024-07-11 08:12:42 -07:00
Anonymous Maarten
9ecc531970 ci: bump NetBSD and FreeBSD 2024-07-11 08:12:42 -07:00
David Gow
540a356199 test: Add testspritesurface
This is a cut-down version of testsprite which uses SDL_Surface (and
SDL_GetWindowSurface), instead of the Render API. It's useful for
quickly validating that blitting works, including some basic format
conversion (with a palette).

Signed-off-by: David Gow <david@ingeniumdigital.com>
2024-07-11 08:11:29 -07:00
Anonymous Maarten
b5a7b1ca89 ci: force PDB and runtime variables 2024-07-11 13:58:13 +02:00
Sam Lantinga
0b2c80557c Update the blit mapping when the palette is set on a surface
Make sure you do this even if the palette pointer hasn't changed, as the contents may have.

Fixes https://github.com/libsdl-org/SDL/issues/10225
2024-07-10 23:22:06 -07:00
Giovanni Petrantoni
a16ff651e8 Set Fixed Scale Factor for VisionOS (#10222) 2024-07-10 21:56:50 -07:00
Sam Lantinga
9e331d235f Fixed the return value of SDL_Vulkan_CreateSurface() on the Vivante platform 2024-07-10 20:32:47 -07:00
Sam Lantinga
5ee88d43f9 Fixed mapping the non-US hash key on European keyboards 2024-07-10 20:13:40 -07:00
Sam Lantinga
8722c297a4 Added a key name for the non-US backslash key 2024-07-10 19:16:04 -07:00
Anonymous Maarten
628e083e02 ci: Build SDL3 with libusb support on MSVC 2024-07-10 23:42:39 +02:00
Substring
9548bba63a KMSDRM: fix unsupported modifiers 2024-07-10 14:41:58 -07:00
Sam Lantinga
d5e6116f8e Initialize and shutdown clipboard listener on iOS 2024-07-10 14:10:45 -07:00
Sam Lantinga
60ed914c66 Added notes for migrating SDL_GetRGBA()/SDL_MapRGBA() code 2024-07-10 13:19:46 -07:00
Ryan C. Gordon
af2dbf3ff3 video: Rename SDL_GL_DeleteContext to SDL_GL_DestroyContext.
Turns out that there isn't a strong OpenGL naming convention for "Delete" ...
WGL offers "wglDeleteContext" but the GLX equivalent is "glxDestroyContext"
and then EGL sealed the deal by going with Destroy as well! Since it matches
SDL3 naming conventions (Create/Destroy), we're renaming it.

Fixes #10197.
2024-07-10 15:54:08 -04:00
SDL Wiki Bot
29b0076659 Sync SDL3 wiki -> header 2024-07-10 19:45:01 +00:00
Ryan C. Gordon
4755055bc3 audio: Separate channel maps out of SDL_AudioSpec. 2024-07-10 15:43:57 -04:00
Anonymous Maarten
1664ac4fcb hidapi: fix 'conversion from 'size_t' to 'int', possible loss of data' of libusb functions 2024-07-10 20:27:39 +02:00
Anonymous Maarten
d1eab18de2 cmake: build ci and and release with static runtime library
(The Visual Studio projects do this as well)
2024-07-10 19:47:27 +02:00
Sam Lantinga
21aba2b19c Don't try to use D3D11 or D3D12 if the window isn't backed with an HWND
Fixes https://github.com/libsdl-org/SDL/issues/10196
2024-07-10 09:42:36 -07:00
Anonymous Maarten
001c1b29df cmake: remove SDL_STATIC_VCRT option
projects are expected to use CMAKE_MSVC_RUNTIME_LIBRARY to select the
runtime library.

With current CMake versions, this can be done with:

 -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_MSVC_RUNTIME_LIBRARY=xxx

with xxx one of:
 "MultiThreaded"         -> -MT (static non-debug)
 "MultiThreadedDLL"      -> -MD (shared non-debug)
 "MultiThreadeDebug"     -> -MTd (static debug)
 "MultiThreadedDebugDLL" -> -MDd (shared debug)

See CMake documentation for more information:
https://cmake.org/cmake/help/latest/policy/CMP0091.html
https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html
2024-07-10 18:34:34 +02:00
David Gow
1857f57686 Remove incorrect asserts from SDL_InitPixelFormatDetails()
The SDL_Surface rework in #10201 adds some extra checks that the pixel
format enum matches the SDL_PixelFormatDetails struct, which is largely
filled in with values from SDL_GetMasksForPixelFormat().

However, there are a few cases where these do not match:
- Indexed 1-, 2-, and 4-bit formats encode a bytes_per_pixel of 0, but
  SDL_GetMasksForPixelFormat() gives a value of 1.
- Packed formats, like SDL_PIXELFORMAT_XRGB8888 encode a bits_per_pixel
  of the number of used bits (24), but SDL_GetMasksForPixelFormat()
  includes the padding byte, giving a total of 32.

We could change the encoding of these in the enum, or change what we store
in the details struct to match, but I suspect we'd either break something
that relies on it, or lose some (_maybe_ useful) information. In the meantime,
this gets the tests working again.

Signed-off-by: David Gow <david@ingeniumdigital.com>
2024-07-10 09:26:46 -07:00
Frank Praznik
3b60ee666e wayland: Note that setting the damage region in the frame callback is explicitly to work around a driver bug 2024-07-10 10:46:39 -04:00
SDL Wiki Bot
fdc04708f1 Sync SDL3 wiki -> header 2024-07-10 07:48:48 +00:00
Sam Lantinga
2ba76dbe80 Simplified SDL_Surface
SDL_Surface has been simplified and internal details are no longer in the public structure.

The `format` member of SDL_Surface is now an enumerated pixel format value. You can get the full details of the pixel format by calling `SDL_GetPixelFormatDetails(surface->format)`. You can get the palette associated with the surface by calling SDL_GetSurfacePalette(). You can get the clip rectangle by calling SDL_GetSurfaceClipRect().

SDL_PixelFormat has been renamed SDL_PixelFormatDetails and just describes the pixel format, it does not include a palette for indexed pixel types.

SDL_PixelFormatEnum has been renamed SDL_PixelFormat and is used instead of Uint32 for API functions that refer to pixel format by enumerated value.

SDL_MapRGB(), SDL_MapRGBA(), SDL_GetRGB(), and SDL_GetRGBA() take an optional palette parameter for indexed color lookups.
2024-07-10 00:48:18 -07:00
Brick
40ed098ce8 Improve the bucket distribution of SDL_HashTable
SDL_HashID does no hashing, which isn't good if the lower bits of the key aren't evenly distributed.
2024-07-09 20:50:26 +01:00
Brick
d604555142 Replace BlitRGBtoRGBSurfaceAlphaMMX 2024-07-08 20:59:42 +01:00
Brick
d37f8fa2b3 Optimize BlitRGBtoRGBSurfaceAlpha 2024-07-08 20:59:42 +01:00
Brick
fde2378ccd Refactor alpha blitters, move the SSE41/AVX2 versions into SDL_blit_A.c 2024-07-08 20:59:42 +01:00
Brick
43a5da358d Set ALLOWABLE_ERROR_BLENDED to 0 2024-07-08 20:59:42 +01:00
Anonymous Maarten
1cddc7b66e sdlprocdump: exceptions are not handled 2024-07-08 21:30:49 +02:00
Anonymous Maarten
c4cbbca185 sdlprocdump: ignore C++ exceptions 2024-07-08 20:48:33 +02:00
Sam Lantinga
d6c8485f28 Make sure we're actually running on Windows before using D3D renderers 2024-07-08 11:36:11 -07:00
Sam Lantinga
4d5f139f0f Add the blit automation tests 2024-07-08 10:58:48 -07:00
Brick
c457dbb629 Fix BlitNtoNPixelAlpha for formats with no dst alpha 2024-07-08 10:53:46 -07:00
Brick
3c59d3f69c Remove old references to blitter files 2024-07-08 10:53:46 -07:00
Brick
95b683ac3e Tidy up/optimize BlitNtoNPixelAlpha_SSE4_1 2024-07-08 10:53:46 -07:00
Brick
070e48f66e Tidy up/optimize BlitNtoNPixelAlpha_AVX2 2024-07-08 10:53:46 -07:00
Brick
5d875aa94e Fix rounding in MULT_DIV_255 2024-07-08 10:53:46 -07:00
Isaac Aronson
b7b513b70b Fix bytes_per_pixel rename 2024-07-08 10:53:46 -07:00
Isaac Aronson
44d397282d Re-enable intrinsic blitters 2024-07-08 10:53:46 -07:00
Isaac Aronson
b34faf732d Implement fast 255 mult-div in SDL_blit_auto 2024-07-08 10:53:46 -07:00
Isaac Aronson
23d4e9ec13 Support VisualC-WinRT UWP build 2024-07-08 10:53:46 -07:00
Isaac Aronson
8d099d8976 Fix formatting 2024-07-08 10:53:46 -07:00
Isaac Aronson
8e3afd56f5 Restore BlitARGB 555 and 565 blending algorithms 2024-07-08 10:53:46 -07:00
Isaac Aronson
5cec91e27a Implement accurate, performant 32-bit scalar blitter for ARGB dst case 2024-07-08 10:53:46 -07:00
Isaac Aronson
e5bbe32641 Implement alpha blend as macro and replace inaccurate blitters 2024-07-08 10:53:46 -07:00
Isaac Aronson
0f351cd6af Remove ARM32 assembly/pixman blitters 2024-07-08 10:53:46 -07:00
Isaac Aronson
3ecb927587 Remove last non-SDL types from test 2024-07-08 10:53:46 -07:00
Isaac Aronson
adca9d408e Fixup tests to use correct types 2024-07-08 10:53:46 -07:00
Isaac Aronson
f5ee88c2cf Implement mathematically correct scalar blitters 2024-07-08 10:53:46 -07:00
Isaac Aronson
f0238ef615 Fix build issues 2024-07-08 10:53:46 -07:00
Isaac Aronson
594ca1a897 Add testautomation suite for alpha blending 2024-07-08 10:53:46 -07:00
Isaac Aronson
9590a47629 Implement visually accurate SIMD blitters 2024-07-08 10:53:46 -07:00
Isaac Aronson
f6f12d0451 Revert "Remove buffer in SSE4.1, use unpacklo and packus intrinsics"
This reverts commit 149cd55840e7fdfd5ecde5c545aede5822abd14e.
2024-07-08 10:53:46 -07:00
Isaac Aronson
a027ad9788 Remove buffer in SSE4.1, use unpacklo and packus intrinsics 2024-07-08 10:53:46 -07:00
Isaac Aronson
2432b6686e Add back in buffer free removed during testing 2024-07-08 10:53:46 -07:00
Isaac Aronson
380bcff018 Allow arbitrary dstfmt in 1 pixel case; naming and const cleanup 2024-07-08 10:53:46 -07:00
Isaac Aronson
87958f44d0 Support arbitrary destination formats; remove buffer from AVX2 2024-07-08 10:53:46 -07:00
Isaac Aronson
c80c540be3 Support older GCC and clang that lack some intrinsics 2024-07-08 10:53:46 -07:00
Isaac Aronson
e8cba442c5 Clean up API surface to use attribute macros and rename convertPixels 2024-07-08 10:53:46 -07:00
Isaac Aronson
bac318fc27 Check for SSE4.1 first as more common 2024-07-08 10:53:46 -07:00
Isaac Aronson
12d18c7497 Add back glob for src/video/*.c to CMakeLists.txt 2024-07-08 10:53:46 -07:00
Isaac Aronson
735cf5a6f9 Relocate intrinsic modules to src/video/ 2024-07-08 10:53:46 -07:00
Isaac Aronson
f68a7edcf8 Properly shortcut only when AVX2 or SSE4.1 available 2024-07-08 10:53:46 -07:00
Isaac Aronson
3e0581c625 Merge upstream and sdl3-blitters 2024-07-08 10:53:46 -07:00
Frank Praznik
159d7087c6 wayland: Only set the window geometry when viewports are unsupported
Setting the window geometry on the xdg-toplevel path is a hack used to prevent protocol violations if a buffer with an old size is committed. Since viewports decouple the window geometry from the buffer size, this is not needed if viewports are supported.

Fixes an invalid window geometry warning and incorrect window overview size for fullscreen windows in GNOME.
2024-07-08 11:40:54 -04:00
Sam Lantinga
4fa5196820 Revert "Switch pixel format loss fields to number of bits"
This reverts commit 3c90b1c1f6.

It turns out this is problematic for sdl2-compat. We're investigating a more complete separation between SDL2 and SDL3 surfaces, but in the meantime, I'll fix the breakage.
2024-07-07 19:41:05 -07:00
Anonymous Maarten
18c9bd21b5 sdlprocdump: become C90 compatible 2024-07-07 21:18:16 +02:00
Anonymous Maarten
4d6b23b68f mingw: use DESTDIR to change the install location of the mingw package 2024-07-07 20:35:33 +02:00
SDL Wiki Bot
bfa4e71284 Sync SDL3 wiki -> header 2024-07-07 18:05:35 +00:00
SDL Wiki Bot
e37d6f71b3 Sync SDL3 wiki -> header 2024-07-07 18:02:15 +00:00
Giovanni Petrantoni
a057240984 Fix vision os fake screen size
It never really worked, as the value was arbitrary, digging apple docs showed the right values.
2024-07-06 20:49:23 -07:00
Sam Lantinga
3c90b1c1f6 Switch pixel format loss fields to number of bits
This makes more sense and handles pixel formats with > 8 bits per channel

Fixes https://github.com/libsdl-org/SDL/issues/10168
2024-07-06 11:37:16 -07:00
mariob92
9389712917 wgl/glx: Fix attribute list for SDL_GL_FLOATBUFFERS
This commit fixes the attribute list in the WGL and GLX code when requesting a floating point pixel format. The name of the attribute was missing in the list.

Fixes libsdl-org#10189
2024-07-06 11:35:19 -07:00
SDL Wiki Bot
f3ac2d9d4f Sync SDL3 wiki -> header 2024-07-06 15:46:41 +00:00
Frank Praznik
fbb5652d3e video: Document that SDL_RaiseWindow is a request and subject to window manager policy
The result of SDL_RaiseWindow is ultimately subject to window manager policy, particularly if the request would result in stealing focus from another window. Document that this is only a request, and if successful, will result in a focus gained event along with the input focus flag being set on the window.
2024-07-06 11:45:43 -04:00
Anonymous Maarten
be43dec798 sdlprocdump: store context and exception record in minidump 2024-07-06 17:36:16 +02:00
Sam Lantinga
0fa74d8aa8 Wiki-compatible documentation for SDL_ALPHA_OPAQUE and SDL_ALPHA_TRANSPARENT 2024-07-06 05:53:40 -07:00
Sam Lantinga
e52603ac8f Support format conversion and YUV surfaces in SDL_SoftStretch()
These are slow paths, but at least they'll do the right thing now.

Fixes https://github.com/libsdl-org/SDL/issues/9496
2024-07-06 05:32:31 -07:00
Sam Lantinga
4ba2e9f4f4 Improved detection of Nintendo Switch Pro controller report mode
Fixes https://github.com/libsdl-org/SDL/issues/10182
2024-07-06 05:29:12 -07:00
Sam Lantinga
6d64d821fb Fixed display hotplug events
The add event was accidentally removed in 30e176d6ba
2024-07-05 15:55:56 -07:00
Sam Lantinga
753f3f8609 Fixed crash when disconnecting external display on iOS 2024-07-05 15:51:20 -07:00
Sam Lantinga
e559b271b5 Clear the wave format so the channel map is cleared before returning from SDL_LoadWAV_IO() 2024-07-05 12:44:25 -07:00
Sam Lantinga
c347bee7b8 Fixed IME cursor location (thanks @zturtleman!) 2024-07-05 12:33:17 -07:00
Anonymous Maarten
50ae47af5e android: create android project in create-android-project.py python script
This script supersedes androidbuild.sh, and also supports using a SDL3 prefab archive
2024-07-05 21:12:26 +02:00
Sam Lantinga
2d05dcc1f7 The same VID/PID is used for the FlyDigi Apex 4 2024-07-05 10:04:59 -07:00
Sam Lantinga
4f71218e17 Allow for floating point error in matching framerates
Fixes https://github.com/libsdl-org/SDL/issues/10053
2024-07-05 09:23:41 -07:00
SDL Wiki Bot
d5a0f60963 Sync SDL3 wiki -> header 2024-07-05 15:59:26 +00:00
Sam Lantinga
8412f52853 Clarified that the renderer should be destroyed before the window
I didn't add a note to SDL_DestroyWindow() because we actually protect against this case now, but it's useful information to know conceptually when working with the renderer.
2024-07-05 08:57:30 -07:00
Ryan C. Gordon
4b5309cd98 main: Move SDL_RunApp bits from src/core to src/main.
Fixes #10170.
2024-07-05 08:52:25 -07:00
Max Maisel
607b1f225c Drain HIDAPI buffer in SDL_hidapi_steamdeck.c.
Add a loop around SDL_hid_read() in the Steam Deck HIDAPI driver as it
is done in other HIDAPI drivers. This loop reads data from the device and
processes it until the input buffer is empty which ensures that clients
always get the latest data.

This fixes an input latency issue if the application polls the events
slower than the hardware generates them.
2024-07-05 08:25:52 -07:00
Sam Lantinga
c7ed78a9ef Try to create an accelerated renderer for the window surface even if SDL_HINT_RENDER_DRIVER is "software"
This case is properly handled inside SDL_CreateWindowTexture()

Fixes https://github.com/libsdl-org/SDL/issues/10155
2024-07-05 08:18:45 -07:00
Sam Lantinga
065ec2d518 Actually return an error when the surface is invalid 2024-07-05 08:12:05 -07:00
Sam Lantinga
c057849035 Return the correct error from SDL_CreateSoftwareRenderer() when the surface is NULL 2024-07-05 08:05:40 -07:00
Ryan C. Gordon
f9a06c20ed Revert "render: Set renderer->window to NULL in SDL_DestroyRendererWithoutFreeing."
This reverts commit 9f8dffbd2d.

This causes some tests to fail, and wasn't otherwise a necessary change, so
I'm backing it out.

(Looks like some sort of interaction with software renderers and their
surfaces not getting destroyed...?)
2024-07-04 19:45:37 -04:00
Ryan C. Gordon
9f8dffbd2d render: Set renderer->window to NULL in SDL_DestroyRendererWithoutFreeing.
This wasn't triggering a bug afaik, but obviously the more correct thing to do.

Reference Issue #10174.
2024-07-04 14:47:46 -04:00
Sam Lantinga
d13fc3c3a7 Fixed building without X11 support 2024-07-04 11:32:50 -07:00
SDL Wiki Bot
b43f1688d9 Sync SDL3 wiki -> header 2024-07-04 15:12:07 +00:00
Ryan C. Gordon
c3bf874abf stdlib: Clean up and export SDL_UCS4ToUTF8().
Also fix internal usage of the function.

Fixes #10157.
2024-07-04 11:10:50 -04:00
Ryan C. Gordon
f338fa20dd emscripten: Let SDL hints be set by URL parameters.
Any parameters (key/value pairs after the '?' in a URL) that have a keyname
that starts with `SDL_` will be put into Emscripten's environment variable
emulation table at startup, before SDL_main runs.

This lets users set hints the same way they might set them from a shell's
command line on a desktop platform:

For example:

`https://example.com/my_sdl3_application.html?SDL_RENDER_DRIVER=software`

Fixes #10154.
2024-07-04 11:09:42 -04:00
Sam Lantinga
9d47daef0a Do a final pass freeing temporary memory when we quit.
Fixes https://github.com/libsdl-org/SDL/issues/10169
2024-07-03 18:47:15 -07:00
Sam Lantinga
a04596c9a7 Added support for the ROG RAIKIRI 2024-07-03 13:54:00 -07:00
SDL Wiki Bot
d7a875432b Sync SDL3 wiki -> header 2024-07-03 20:07:11 +00:00
Ryan C. Gordon
2a8f1e11ca audio: Add gain support to audio streams and logical audio devices.
Fixes #10028.
2024-07-03 16:05:55 -04:00
Frank Praznik
74cc06db1b Remove the SDL_EVENT_WINDOW_TAKE_FOCUS event
This was added by the Unreal Engine to handle the input focus for popups and dialogs, window types for which SDL3 has built-in, cross-platform support.

This was only ever implemented in X11, and the only purpose was to hint that a client application may want to call the SDL_SetWindowInputFocus() function, which has since been removed, rendering it pointless now.
2024-07-03 15:08:21 -04:00
Frank Praznik
be13328cb1 Remove SDL_SetWindowInputFocus
This was added to SDL2 for the Unreal Engine's implementation of menus and dialogs on X11, window types for which SDL3 has added built-in, cross-platform support.

Remove this function, as it was only ever implemented for X11 and is now basically useless aside from allowing annoying or malicious client apps to discretely steal focus. As the documentation states: "You almost certainly want SDL_RaiseWindow() instead of this function."
2024-07-03 15:08:21 -04:00
Sam Lantinga
0f8054cf87 Only use the default gamepad mapping if an automatic mapping isn't available
Fixes https://github.com/libsdl-org/SDL/issues/10162
2024-07-03 11:44:20 -07:00
SDL Wiki Bot
98f27b8f2e Sync SDL3 wiki -> header 2024-07-03 18:39:46 +00:00
Ryan C. Gordon
ece76ec90d audio: Attempt to placate NetBSD 9.3's incorrect compiler warning. 2024-07-03 14:38:33 -04:00
Ryan C. Gordon
16e7fdc4f2 audio: Add channel remapping to SDL_AudioSpec and SDL_AudioStream.
Fixes #8367.
2024-07-03 14:38:33 -04:00
Ryan C. Gordon
0367f1af19 loopwave: Use SDL_ResumeAudioStreamDevice.
...instead of the more-wordy:

`SDL_ResumeAudioDevice(SDL_GetAudioStreamDevice(stream));`
2024-07-03 14:38:33 -04:00
Sam Lantinga
61441c2be9 Fixed the French numeric keycode from varying based on shift state 2024-07-03 10:33:08 -07:00
SDL Wiki Bot
b948d1446a Sync SDL3 wiki -> header 2024-07-03 01:35:19 +00:00
Sam Lantinga
ed9bbb2dca Restore default behavior for keypad keycodes
Added a hint to translate numpad keycodes into their non-numpad versions based on the NumLock state
2024-07-02 18:34:35 -07:00
Ryan C. Gordon
bafd04ecdb camera: small Media Foundation backend init tweak. 2024-07-02 15:16:10 -04:00
Ryan C. Gordon
e290d16c47 include: Clean up SDL_GetKeyName documentation. 2024-07-02 12:29:33 -04:00
SDL Wiki Bot
f787790243 Sync SDL3 wiki -> header 2024-07-01 20:57:56 +00:00
Sam Lantinga
109f268972 Added support for non-US keyboard layouts in Emscripten 2024-07-01 13:56:49 -07:00
Sam Lantinga
2c333c7355 The mode modifier only affects character keys 2024-07-01 13:56:49 -07:00
Sam Lantinga
d4497ecdbd Numpad scancodes have non-numpad keycodes
This allows the numpad to work as the user expects based on the numlock state. If the application needs to distinguish the keys, it can check to see whether the scancode is a numpad key or not.
2024-07-01 13:56:49 -07:00
Sam Lantinga
78dbf9be50 Document that SDL_GetKeyName() always returns uppercase names for alphabetic keycodes 2024-07-01 13:56:49 -07:00
Sam Lantinga
e8dbbf8380 Renamed SDLK_a-z to SDLK_A-Z
Made the symbols uppercase for consistency with the other SDLK_* constants, but the values are still lowercase.
2024-07-01 13:56:49 -07:00
Sam Lantinga
d9dc4b320a The keycode in key events is the base, unmodified, keycode for the current keyboard layout 2024-07-01 13:56:49 -07:00
SDL Wiki Bot
5755bde3b8 Sync SDL3 wiki -> header 2024-07-01 20:36:18 +00:00
Anonymous Maarten
8290c4e82e sdlprocdump: also print a stacktrace on a fatal exception 2024-07-01 20:49:52 +02:00
Anonymous Maarten
9601d98e7f SDL_test: always use symbols with 64-suffix from DbgHelp 2024-07-01 20:49:40 +02:00
Frank Praznik
1f0bc4b808 x11: Check for button presses before clearing an XInput2 pointer grab
XInput2 will grab the pointer on button presses, which causes the grab attempt to fail and ultimately timeout since the pointer is already grabbed, however, ungrabbing the pointer when no buttons are pressed and the pointer is outside the window can generate enter/leave notify events, which result in further calls of the grab function. The end result is an infinite loop of grab/ungrab attempts generating enter/leave events. This causes a hang in testautomation when creating a window with the grabbed flag if the pointer is not positioned within window bounds.

Check the button state and only ungrab if a mouse button is in the pressed state.
2024-06-30 12:16:50 -04:00
SDL Wiki Bot
ede4483420 Sync SDL3 wiki -> header 2024-06-29 21:26:31 +00:00
Sam Lantinga
473257cce6 Added SDL_GetRenderLogicalPresentationRect()
Fixes https://github.com/libsdl-org/SDL/issues/8815
2024-06-29 14:25:59 -07:00
Sam Lantinga
b72c22340e We don't need to pull scancode state to see if ALT is held down 2024-06-29 13:05:07 -07:00
Sam Lantinga
017a1039e2 Removed unnecessary cast 2024-06-29 13:05:07 -07:00
Sam Lantinga
7258b36e30 Make it easier to turn on Windows message logging 2024-06-29 13:05:07 -07:00
Sam Lantinga
5322b3528a Losing keyboard focus doesn't automatically mean you lose mouse capture
Fixes https://github.com/libsdl-org/SDL/issues/5616
2024-06-29 11:15:21 -07:00
Sam Lantinga
2a58e7b11c Respect SDL_HINT_RENDER_DRIVER when creating an accelerated window surface
Fixes https://github.com/libsdl-org/SDL/issues/10061
2024-06-29 10:47:28 -07:00
Sam Lantinga
a522bfe3f1 Clean up any renderer in SDL_DestroyWindowSurface()
Also added an automated test to verify window surface functionality.

Fixes https://github.com/libsdl-org/SDL/issues/10133
2024-06-29 10:47:28 -07:00
Sam Lantinga
6f199eabb8 Removed SDL_RenderGeometryRawFloat()
After discussion with @ocornut, SDL_RenderGeometryRaw() will take floating point colors and conversion from 8-bit color can happen on the application side.  We can always add an 8-bit color fast path in the future if we need it on handheld platforms.

If you need code to do this in your application, you can use the following:

int SDL_RenderGeometryRaw8BitColor(SDL_Renderer *renderer, SDL_Texture *texture, const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, int num_vertices, const void *indices, int num_indices, int size_indices)
{
    int i, retval, isstack;
    const Uint8 *color2 = (const Uint8 *)color;
    SDL_FColor *color3;

    if (num_vertices <= 0) {
        return SDL_InvalidParamError("num_vertices");
    }
    if (!color) {
        return SDL_InvalidParamError("color");
    }

    color3 = (SDL_FColor *)SDL_small_alloc(SDL_FColor, num_vertices, &isstack);
    if (!color3) {
        return -1;
    }

    for (i = 0; i < num_vertices; ++i) {
        color3[i].r = color->r / 255.0f;
        color3[i].g = color->g / 255.0f;
        color3[i].b = color->b / 255.0f;
        color3[i].a = color->a / 255.0f;
        color2 += color_stride;
        color = (const SDL_Color *)color2;
    }

    retval = SDL_RenderGeometryRaw(renderer, texture, xy, xy_stride, color3, sizeof(*color3), uv, uv_stride, num_vertices, indices, num_indices, size_indices);

    SDL_small_free(color3, isstack);

    return retval;
}

Fixes https://github.com/libsdl-org/SDL/issues/9009
2024-06-29 00:10:08 -07:00
Sam Lantinga
22bca55d84 Minor blitting cleanup 2024-06-29 00:10:08 -07:00
1F616EMO
79f6baa494 Remove the inconsistent and lag-causing usleep call in SDL_fcitx.c
(cherry picked from commit 3bf2b90da0)
2024-06-29 00:09:12 -07:00
SDL Wiki Bot
2cfcb144e4 Sync SDL3 wiki -> header 2024-06-29 02:42:49 +00:00
Sam Lantinga
212a491f7c Renamed SDL_HINT_IME_NATIVE_UI to SDL_HINT_IME_IMPLEMENTED_UI
This inverts the logic to make more sense from an application perspective.
2024-06-28 19:41:37 -07:00
Sam Lantinga
e47179c4c7 We should still set the text input area if SDL_DISABLE_WINDOWS_IME is defined
Fixes https://github.com/libsdl-org/SDL/issues/6254
2024-06-28 18:28:19 -07:00
SDL Wiki Bot
9332de9f25 Sync SDL3 wiki -> header 2024-06-29 00:09:51 +00:00
Sam Lantinga
a7d4f0a76c Center the composition text in the text input area 2024-06-28 17:09:22 -07:00
Sam Lantinga
4c7db129df SDL_HINT_IME_INTERNAL_EDITING and SDL_HINT_IME_SHOW_UI are replaced with SDL_HINT_IME_NATIVE_UI 2024-06-28 17:09:22 -07:00
Sam Lantinga
d9d7104feb Removed unneeded Text Services Framework code from IME handling
We can get the candidate list in uiless mode using ImmGetCandidateListW() once message processing has completed
2024-06-28 17:09:22 -07:00
Sam Lantinga
bdd531986b SDL_SetTextInputRect() has been renamed to SDL_SetTextInputArea()
The new function includes the cursor position so IME UI elements can be placed relative to the cursor, as well as having the whole text area available so on-screen keyboards can avoid it.
2024-06-28 17:09:22 -07:00
Sam Lantinga
e324c7d692 Fixed event spam caused by repeated calls to IME_SetTextInputRect() 2024-06-28 17:09:22 -07:00
Sam Lantinga
42d8db7e34 Current Korean IMEs don't have candidates 2024-06-28 17:09:22 -07:00
Sam Lantinga
ed2022a175 Added SDL_EVENT_TEXT_EDITING_CANDIDATES
This allows applications that have set SDL_HINT_IME_SHOW_UI to "0" to get candidates lists they can draw themselves.

Fixes https://github.com/libsdl-org/SDL/issues/4855
2024-06-28 17:09:22 -07:00
SDL Wiki Bot
c983c1da97 Sync SDL3 wiki -> header 2024-06-28 22:35:57 +00:00
Frank Praznik
44ec57626f vulkan: Don't set the opaque bit on transparent windows
If window transparency was requested via the SDL_WINDOW_TRANSPARENT flag, don't set the opaque bit on the swapchain composite alpha value. Fixes transparent windows when using the Vulkan renderer (e.g. testsprite --transparent).
2024-06-28 14:47:32 -04:00
Anonymous Maarten
339d83bdfa ci: assume all .dmp files in build directy are minidump files 2024-06-28 18:28:31 +02:00
hwsmm
915ef28753 Fix mouse button not changing in pen mouse emulation 2024-06-28 11:27:35 -04:00
Ryan C. Gordon
87439c0008 x11: Fix build when X_HAVE_UTF8_STRING is not defined.
Fixes #10094.

(cherry picked from commit 3e4bb5acd0)
2024-06-27 22:14:31 -07:00
Ryan C. Gordon
ecfa363889 begin_code: Solaris Studio has __has_attribute defined by isn't usable here.
Fixes #10095.

(cherry picked from commit d96f1d5360)
2024-06-27 22:13:48 -07:00
Ryan C. Gordon
d7ee9ce455 SDL_endian.h: Fix byte order detection on Solaris (and some SPARC compilers).
Fixes #10093.

(Sort of cherry-picked from 14183f8ecac099982883331ae7e405f82e42aa6b.)
2024-06-28 00:14:26 -04:00
Ryan C. Gordon
d8e68aea9d atomic: Solaris needs the _nv variant of atomic_or_uint.
(This means "new value" and returns the atomically updated value. Before, we
were returning a value from a void function.)

(cherry picked from commit 498cbffd89)
2024-06-27 23:50:31 -04:00
Sam Lantinga
8165e96514 Fixed whitespace 2024-06-27 18:35:12 -07:00
Sam Lantinga
dcd7b4e497 testime: highlight selected clauses in Japanese composition mode 2024-06-27 17:43:03 -07:00
Sam Lantinga
50250adba7 testime: draw a blinking cursor at the text insertion point 2024-06-27 17:43:03 -07:00
Sam Lantinga
3d525331aa testime: add a 1 pixel border around glyphs to avoid texture sampling into other glyphs 2024-06-27 17:43:03 -07:00
Sam Lantinga
938c974cca testime: use a replacement character for characters not in the font 2024-06-27 17:43:03 -07:00
Sam Lantinga
a67e6b80de Updated unifont to version 15.1.05 2024-06-27 17:43:03 -07:00
Sam Lantinga
50f50612bd Removed checkkeysthreads
It's out of date relative to the IME changes and doesn't add any value
2024-06-27 17:43:03 -07:00
Sam Lantinga
b7748c1513 Prevent duplicate calls to start/stop text input 2024-06-27 17:43:03 -07:00
Sam Lantinga
3609b15920 Fixed showing the selected clause in the Japanese IME 2024-06-27 17:43:03 -07:00
SDL Wiki Bot
b7ab5182d3 Sync SDL3 wiki -> header 2024-06-27 21:37:27 +00:00
Ryan C. Gordon
1e0ac5771a testiconv: Remove half-baked SDL_StepUTF8 testing code. 2024-06-27 17:36:09 -04:00
Ryan C. Gordon
a9cfcf6bde stdinc: Drastically improve SDL_StepUTF8() and make it a public API.
Fixes #10105.
2024-06-27 17:36:09 -04:00
Ryan C. Gordon
9b8c5f642f testaudio: Better fix for NULL dereference.
This code already handled NULL fine, it just got wrapped in a SDL_strdup call
in e23257307e, so make that SDL_strdup check for
NULL first.
2024-06-27 17:24:49 -04:00
Ryan C. Gordon
5631c6dbaa testaudio: Don't crash if SDL_GetAudioDeviceName() returns NULL.
It definitely will for default devices, so this crash is real, but it's also
good defensive coding if something blows up unexpectedly.

Fixes #10130.
2024-06-27 17:20:11 -04:00
Ryan C. Gordon
982feb7a65 vulkan: SDL_Vulkan_CreateSurface now returns the usual int (0=ok, -1=error).
Fixes #10091.
2024-06-27 15:25:10 -04:00
Ozkan Sezer
a4f962fd46 SDL_x11shape.c: fix build if SDL_VIDEO_DRIVER_X11_XSHAPE isn't defined
Fixes :  https://github.com/libsdl-org/SDL/issues/10128.
2024-06-27 05:47:50 +03:00
Frank Praznik
800c35a2c1 dialog: Don't potentially call SDL_free() on an uninitialized value 2024-06-26 21:56:40 -04:00
Frank Praznik
596651f13a dialog: Decodes percent encoded URI paths returned by the xdg file portal 2024-06-26 21:31:35 -04:00
Frank Praznik
71200e94a8 core: Factor out common URI decode functions from Wayland and X11 2024-06-26 21:31:35 -04:00
Sam Lantinga
0ae4fd0ec9 Make sure we don't try to use the XInput DLL after it's unloaded
Steam ran into a crash SDL_XINPUT_JoystickDetect() with XINPUTGETCAPABILITIES being NULL. I'm not sure how that happened, and there may still be a race condition if this is a multi-threaded issue, but at least this is more correct.
2024-06-26 15:44:03 -07:00
Francisco Javier Trujillo Mata
d86ea0622d Add slash to cwd call 2024-06-26 13:31:59 -07:00
Sam Lantinga
c7f7464174 Updated scancode documentation 2024-06-26 12:33:16 -07:00
Sam Lantinga
8949de3978 Fixed building with older libdrm headers 2024-06-26 12:18:43 -07:00
Sam Lantinga
56e85064ff Fixed audio recording latency after a hitch
We want to return any data as soon as it's available, if we get a hitch and always wait, we'll never catch up.
2024-06-26 12:06:03 -07:00
Ryan C. Gordon
9fd54b724f include: Added documentation for SDL_PRESSED and SDL_RELEASED.
Fixes #10069.
2024-06-26 14:08:56 -04:00
SDL Wiki Bot
306cc6f91e Sync SDL3 wiki -> header 2024-06-26 17:52:24 +00:00
Sam Lantinga
80e64ef921 Windows IME cleanup
* Don't need to initialize values already zeroed
* Added debug message logging
* Don't send duplicate SDL_EVENT_TEXT_EDITING events with empty text
* Send the length of selected text in the SDL_EVENT_TEXT_EDITING event
* Fixed potential crashes when out of memory
2024-06-26 08:26:52 -07:00
hwsmm
dc8b06fb5a Check if SDL_GetKeyboardFocus is null in X11/Wayland events 2024-06-26 08:11:54 -07:00
Edoardo Lolletti
64acde86de stdcpp threads, simplify SDL_GetCurrentThreadID implementation
Removed the workaround that handrolled a thread id using a thread_local variable alongside static mutexes
2024-06-26 09:06:27 -04:00
Cecill Etheredge
e9a93246ef fix: Use drmModeAddFB2WithModifiers instead of drmModeAddFB to allow using GBM modifiers.
This fixes corrupt framebuffers on platforms that require the use of modifiers.

(cherry picked from commit 620e875335)
(cherry picked from commit 6589287ed6)
2024-06-25 14:21:36 -07:00
Sam Lantinga
b37b94453c Fixed multi-window test programs not quitting when windows are closed 2024-06-25 10:17:52 -07:00
Aleksander
596c0af0f3 Camera: Bugfix: ChooseBestCameraSpec doesn't set camera colorspace 2024-06-25 07:03:22 -07:00
SDL Wiki Bot
3d121d9bc7 Sync SDL3 wiki -> header 2024-06-25 03:32:46 +00:00
Sam Lantinga
0804598b5d Added a font glyph for missing characters 2024-06-24 20:32:03 -07:00
Sam Lantinga
def7a43a2e SDL_HINT_IME_SHOW_UI defaults to SDL_TRUE
This hint is currently only used on Windows, and this matches the behavior of other platforms.
2024-06-24 20:32:03 -07:00
Sam Lantinga
382494eeda checkkeys: draw the IME composition text 2024-06-24 20:32:03 -07:00
Sam Lantinga
018ca39c45 Don't move the cursor to the end of the selected candidate
We might have legitimately moved the cursor to the beginning.

Fixes https://github.com/libsdl-org/SDL/issues/9761
2024-06-24 20:32:03 -07:00
Sam Lantinga
92b3ce20b1 checkkeys: don't toggle text input with the left mouse button
This often gets triggered when clicking back and forth between the language bar and the application
2024-06-24 20:32:03 -07:00
Sam Lantinga
377014c430 Added some documentation to the SDL_EVENT_TEXT_EDITING event 2024-06-24 20:32:03 -07:00
Sam Lantinga
01ae067504 checkkeys: print the start/length values of the SDL_EVENT_TEXT_EDITING event 2024-06-24 20:32:03 -07:00
Sam Lantinga
8328fdfe0d Don't use raw keyboard input when text input is active
This lets IME processing consume key events that shouldn't be passed on to the application
2024-06-24 20:32:03 -07:00
Frank Praznik
f79d0adfc9 x11: Avoid excessive keymap reconstruction
KeymapNotify events happen on focus events, as well as when the keymap group changes. Query the current group and don't rebuild the keymap if it hasn't changed.

Note that some IME changes, such as activating intelligent Japanese or Chinese input methods on Gnome, will only trigger IBus activation, and won't send a keymap or group update as they use the existing layout.
2024-06-24 16:39:20 -04:00
Sam Lantinga
94ae4e1513 Fixed build warnings 2024-06-24 13:36:56 -07:00
Anonymous Maarten
d52ea20916 cmake: check for valid isinf/isinff/isnan/isnanf macros 2024-06-24 22:00:53 +02:00
SDL Wiki Bot
ea11c9e0c7 Sync SDL3 wiki -> header 2024-06-24 19:23:37 +00:00
Sam Lantinga
0ff5c05486 Added SDL_GetWindows() 2024-06-24 12:22:12 -07:00
SDL Wiki Bot
2c745dbd3c Sync SDL3 wiki -> header 2024-06-24 18:50:19 +00:00
Sam Lantinga
2f5b20fcb5 Updated based on feedback from @JKaniarz 2024-06-24 11:49:15 -07:00
Sam Lantinga
a938e2b979 Replaced test framework random code with SDL random functions 2024-06-24 11:49:15 -07:00
Sam Lantinga
96f2f23240 Simplified SDL random function names and added thread-safe versions 2024-06-24 11:49:15 -07:00
Sam Lantinga
d013ac80ef Don't check for isinf() and friends using CMake
These are often macros or defined for only doubles or only floats, so the current detection doesn't meet our needs
2024-06-24 11:49:15 -07:00
Sam Lantinga
89cdadf7c3 Added SDL_isinf(), SDL_isinff(), SDL_isnan(), and SDL_isnanf() 2024-06-24 11:49:15 -07:00
SDL Wiki Bot
410bed20ba Sync SDL3 wiki -> header 2024-06-24 18:21:18 +00:00
Edoardo Lolletti
20dbe90771 Fix std::thread memory leak
In the stdcpp thread implementation, the allocated std::thread objects were never deleted after joining/detaching
2024-06-24 14:20:10 -04:00
Sam Lantinga
138eb8649d checkkeys: draw a blinking cursor 2024-06-24 11:20:08 -07:00
Sam Lantinga
505badb7af checkkeys: added support for multiple windows 2024-06-24 11:20:08 -07:00
Sam Lantinga
76631a0978 The text input state has been changed to be window-specific.
SDL_StartTextInput(), SDL_StopTextInput(), SDL_TextInputActive(), SDL_ClearComposition(), and SDL_SetTextInputRect() all now take a window parameter.

This change also fixes IME candidate positioning when SDL_SetTextInputRect() is called before SDL_StartTextInput(), as is recommended in the documentation.
2024-06-24 11:20:08 -07:00
Sam Lantinga
258ee05655 checkkeys: enable showing IME candidates 2024-06-24 11:20:08 -07:00
Simon McVittie
2cfeff1505 testevdev: Associate HID reports for pedals with their other test data
This is how these globals were intended to have been used, similar to
what we already did for the Fanatec device.

Fixes: 3772d6cc "testevdev: Add raw HID report descriptors where available"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-06-24 04:39:34 -07:00
Simon McVittie
3150fdc75e Revert "testevdev.c: comment out two unused data to fix build."
This reverts commit e4f53e6b21.
We'll use these in the next commit.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-06-24 04:39:34 -07:00
Frank Praznik
a4ceb3a31c Revert "x11: Avoid excess keymap reconstruction"
Switching between layouts with the same group number (e.g. US to Japanese) were incorrectly filtered out with this change, as it doesn't trigger a MappingNotify event.

This reverts commit 3d42412650.
2024-06-23 22:21:09 -04:00
Frank Praznik
3d42412650 x11: Avoid excess keymap reconstruction
KeymapNotify events happen on focus events, as well as when the key group changes. Query the current group and don't rebuild the keymap if it hasn't changed.
2024-06-23 17:52:21 -04:00
Anonymous Maarten
5217c040be Sort possible SDL_KeyCode values (swap SDLK_PERCENT and SDLK_DOLLAR) 2024-06-23 22:52:17 +02:00
Frank Praznik
974bbea20b x11: Add keymap support
XkbKeycodeToKeySym is replaced with XkbLookupKeySym, which can take the modifier states. The associated cmake check has been renamed for consistency.

Only the XKB path is currently handled. The deprecated XKeycodeToKeysym path is TODO.
2024-06-23 15:40:55 -04:00
Frank Praznik
c874a78ffb wayland: Add keymap support 2024-06-23 15:40:55 -04:00
Sam Lantinga
ab3c8552c2 Clean up renderers at shutdown
Fixes https://github.com/libsdl-org/SDL/issues/10082
2024-06-23 00:41:19 -07:00
Sam Lantinga
fd3143f445 Added more documentation for SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE and SDL_HINT_MOUSE_RELATIVE_CLIP_INTERVAL 2024-06-23 00:11:56 -07:00
SDL Wiki Bot
398391b01e Sync SDL3 wiki -> header 2024-06-23 07:11:23 +00:00
expikr
3b504c4a89 Add SDL_HINT_MOUSE_RELATIVE_CLIP_INTERVAL (#10085) 2024-06-23 00:09:59 -07:00
Frank Praznik
0280d8249a keyboard: Fix typo 2024-06-22 15:56:50 -04:00
Anonymous Maarten
2018882bf2 testmanymouse: enable raw keyboard events on Windows 2024-06-22 11:35:00 -07:00
Ganael Laplanche
f8ad4abe4e Fix joystick (/dev/input/xxx) support on FreeBSD
When switching to CMake, src/joystick/linux/SDL_sysjoystick.c file got
excluded from FreeBSD builds, losing support for /dev/input/xxx devices.

See also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279907
2024-06-22 07:06:02 -07:00
Anonymous Maarten
99d28ca485 testmanymouse: fix argument parsing 2024-06-22 14:43:06 +02:00
SDL Wiki Bot
ba188e7555 Sync SDL3 wiki -> header 2024-06-22 07:20:00 +00:00
Sam Lantinga
90034b16dc The keycode in key events is affected by modifiers by default.
This behavior can be customized with SDL_HINT_KEYCODE_OPTIONS.
2024-06-22 00:19:06 -07:00
SDL Wiki Bot
1e81424b3d Sync SDL3 wiki -> header 2024-06-22 05:06:38 +00:00
Sam Lantinga
c9cfa4688e Use unsigned constants for SDL_Keycode values
Fixes https://github.com/libsdl-org/SDL/issues/10020
Closes https://github.com/libsdl-org/SDL/pull/10070
2024-06-21 22:06:08 -07:00
Sam Lantinga
0dd579d40d Removed SDL_Keysym 2024-06-21 22:06:08 -07:00
Sam Lantinga
679e4471ed Added the ability to query the keymap for keycodes based on modifier state 2024-06-21 22:06:08 -07:00
Sam Lantinga
ef9bd8b609 Add the raw platform specific key code to SDL_Keysym
This allows applications to handle keys that SDL doesn't recognize, in a platform dependent way.

Fixes https://github.com/libsdl-org/SDL/issues/6390
2024-06-21 22:06:08 -07:00
Sam Lantinga
9d816c72ef Updated SDL3 scancode list
This adds more app editing and audio control keys and removes keys that launch applications

Work in progress on https://github.com/libsdl-org/SDL/issues/6390
2024-06-21 22:06:08 -07:00
Sam Lantinga
00ab4a8eba Added missing Windows scancodes
Based on the scancode list at https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_code_values, which is correct for all other scancodes
2024-06-21 22:06:08 -07:00
Sam Lantinga
306c4164bc Added SDL_AllocateEventString() 2024-06-21 22:06:08 -07:00
Sam Lantinga
fa5367d379 Enable virtual joystick support for Emscripten 2024-06-21 12:06:53 -07:00
Anonymous Maarten
cf267e4985 Fix -Wunused-variable warning in src/video/x11/SDL_x11events.c 2024-06-21 17:39:37 +02:00
Simon McVittie
53eff7f903 testevdev: Add X-Box One S controller via xpadneo 0.9.x
This is an out-of-tree driver providing an alternative interface to
X-Box gamepads. Compared with the in-kernel driver, it adds four
pseudo-buttons used to indicate which profile is active, and an
optional "misc" axis that combines the two triggers into a rudder.

Partially addresses libsdl-org/SDL#7823

Thanks: @kakra
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-06-21 07:05:26 -07:00
Simon McVittie
2804f92eff testevdev: Add missing device ID for Wiimote Classic Controller
Thanks: Jeremy Whiting
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-06-21 07:04:56 -07:00
Simon McVittie
c244eb937b testevdev: Add the virtual X360 controller created by Steam Input
Thanks: Robert Beckett
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-06-21 07:02:23 -07:00
Simon McVittie
f471392e73 testevdev: Add test data from Steam Deck built-in devices
Thanks: Robert Beckett
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-06-21 07:02:23 -07:00
Simon McVittie
740850d3ce testevdev: Add a field for the USB device version
For some devices, such as the Steam Deck's built-in Steam Controller,
the version number reported via evdev and the version number reported
via USB are different. We don't currently use this information anyway,
but in case we want to use it in the future, let's include it in our
test data.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-06-21 07:02:23 -07:00
Anonymous Maarten
0f27686a51 tests: run tests under a minimal debugger that can create minidumps
Tests on ci are run using this dumper, and will upload the minidumps.
2024-06-21 12:39:11 +02:00
Sam Lantinga
6e53a36414 Fixed Y + right shoulder button combination on third party Switch controllers 2024-06-20 14:39:04 -07:00
SDL Wiki Bot
83933fdfa0 Sync SDL3 wiki -> header 2024-06-20 19:55:37 +00:00
Frank Praznik
2f276a2eea video: Expose HDR metadata per-window
Moves the HDR properties from the display to be per-window, and adds the frog_color protocol to enable HDR under Wayland.
2024-06-20 15:55:07 -04:00
Blaž Tomažič
0383333b54 android: add an option to manually pass the context when loading a native library
(cherry picked from commit b444e656cd)
2024-06-20 10:38:59 -07:00
Blaž Tomažič
3b5f35138e android: actually use ReLinker
When loading libraries the `SDL.mContext` is still `null`. This results in
relinker code path in `SDL.loadLibrary(...)` always throwing a null exception
and fallbacking to system loader.

Fix it by passing the context explicitly.

(cherry picked from commit 6a2dd96ac7)
2024-06-20 09:36:17 -07:00
Anonymous Maarten
72d5f39e5c Make testnative (on win32) UNICODE compatible 2024-06-20 15:40:32 +02:00
Anonymous Maarten
992f80eb51 testnative: include SDL_build_config.h instead of SDL_internal.h 2024-06-20 15:40:32 +02:00
SDL Wiki Bot
e6944584a0 Sync SDL3 wiki -> header 2024-06-20 00:01:27 +00:00
John Kaniarz
8a80f41b77 Added check for n<0 in SDL_rand_n() 2024-06-19 17:00:58 -07:00
John Kaniarz
38cac043af Added algorithm comments to SDL_rand_*() 2024-06-19 17:00:58 -07:00
John Kaniarz
8f29f8cae5 Renamed SDL_rand() to SDL_rand_bits() and updated tests 2024-06-19 17:00:58 -07:00
SDL Wiki Bot
237bbfcb9d Sync SDL3 wiki -> header 2024-06-19 18:02:45 +00:00
John Kaniarz
16e69cb4c9 Removed SDL_rand_r() 2024-06-19 11:02:02 -07:00
John Kaniarz
86b06f74dc Updated docs 2024-06-19 11:02:02 -07:00
John Kaniarz
3ee4bff8ac Upgraded constants after statistical testing. 2024-06-19 11:02:02 -07:00
John Kaniarz
83d21e20df Added SDL_rand_float and SDL_rand_n to API 2024-06-19 11:02:02 -07:00
John Kaniarz
f4ee59a1a2 Moved SDL_rand auto-initialization out of SDL_rand_r 2024-06-19 11:02:02 -07:00
Sam Lantinga
421326b6da Fixed controllers not being seen as gamepads after adding a mapping 2024-06-19 08:32:18 -07:00
Hubert Maier
90b7097a90 JANITORIAL: Fix ammount typos (#10060) 2024-06-19 07:27:19 -07:00
SDL Wiki Bot
ab98d51b9f Sync SDL3 wiki -> header 2024-06-19 14:15:46 +00:00
Hubert Maier
81d8fcb5d8 JANITORIAL: Fix judgement typos (#10059) 2024-06-19 07:14:58 -07:00
Hubert Maier
3acdb8a90b JANITORIAL: Fix typos in comments in various files (#10058) 2024-06-19 07:13:46 -07:00
Aikawa Yataro
0fe9f5da54 Update qsort implementation 2024-06-19 05:40:01 +03:00
Zack Middleton
02597cdc56 Remove cursors not in SDL2 from migration guide 2024-06-18 12:22:02 -04:00
Zack Middleton
5ecf125456 Update descriptions for window resize cursors
The SIZENWSE, SIZENS, etc cursors were renamed.
2024-06-18 12:22:02 -04:00
Sam Lantinga
d7391394d3 Switched the camera format to use framerate ratio instead of interval ratio
This is more intuitive for game developers and users.

Fixes https://github.com/libsdl-org/SDL/issues/9896
2024-06-18 07:39:52 -07:00
Sam Lantinga
ea8df46575 We don't support directly rendering to PQ swap chains
Normally this would be done by creating a PQ swap chain and a linear SRGB render target and doing blending operations in linear space and then final conversion to PQ HDR, but we're going to short-circuit all of that and just support linear SRGB output directly.
2024-06-17 17:29:33 -07:00
Anonymous Maarten
122c3e6a81 ci: create simpler Gradle testspriteminimal project instead 2024-06-18 00:38:35 +02:00
Anonymous Maarten
1a68d846de Create a functional CMake project using androidbuild.sh 2024-06-18 00:11:44 +02:00
Sam Lantinga
8ab1ffca8a Fixed requesting USB permission on Android 14 (thanks @ikhoeyZX!)
Fixes https://github.com/libsdl-org/SDL/issues/9831
2024-06-17 15:10:33 -07:00
Sam Lantinga
3a68febedf Enable HIDAPI controller support on mobile platforms 2024-06-17 15:05:12 -07:00
Sam Lantinga
4236fb2d63 Fixed build warnings with Android debug logging 2024-06-17 15:01:21 -07:00
Sam Lantinga
1cdcb57865 Fixed launching on Android after audio capture -> recording renaming 2024-06-17 14:44:54 -07:00
Sam Lantinga
361cae0874 Pass through the original name used by the Steam Virtual Gamepad
Proton uses this on Linux to determine what the XInput slot is for the gamepad. Other applications will get the real controller name and VID/PID by virtue of the code in SDL_steam_virtual_gamepad.c
2024-06-17 12:14:44 -07:00
Miku AuahDark
3373667faa Android: Use SCREEN_ORIENTATION_FULL_USER instead of SCREEN_ORIENTATION_FULL_SENSOR for resizable window.
The former will respect user orientation lock setting while the latter does not.
2024-06-17 07:44:05 -07:00
Sam Lantinga
b6e6c73541 Fixed building the metal renderer with SDL_LEAN_AND_MEAN
Fixes https://github.com/libsdl-org/SDL/issues/10038
2024-06-16 22:04:57 -07:00
Sam Lantinga
aeea819494 Added colorspace to SDL_CameraSpec 2024-06-16 17:47:16 -07:00
Yasushi SHOJI
98499d6818 .editorconfig: Remove excess apostrophe at *.cocci
Remove the excess apostrophe (') introduced by commit
c4b471bd13.

Some editors complain about it.

Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
2024-06-16 09:18:17 -07:00
Sam Lantinga
182a28b343 Fixed documentation typo 2024-06-16 08:01:16 -07:00
SDL Wiki Bot
4e5ed569c3 Sync SDL3 wiki -> header 2024-06-16 14:42:00 +00:00
Sam Lantinga
d1d484ddbe Added SDL_srand(), SDL_rand(), and SDL_rand_r() (thanks @JKaniarz!)
These are simple random functions that should not be used for serious random number generation.

Fixes https://github.com/libsdl-org/SDL/issues/4968
2024-06-16 07:41:00 -07:00
Sam Lantinga
9cb4bb92f6 Fixed parsing SDL_ANALYZER_NORETURN 2024-06-16 07:08:19 -07:00
Sam Lantinga
cf2d8dac30 Reordered conditional for clarity 2024-06-16 06:25:41 -07:00
SDL Wiki Bot
65f0691866 Sync SDL3 wiki -> header 2024-06-16 13:21:56 +00:00
expikr
ee559d51be Add SDL_MOUSE_RELATIVE_CURSOR_VISIBLE (#7947) 2024-06-16 06:21:29 -07:00
Ryan C. Gordon
17af09f3a9 coreaudio: simplify memory leak fix.
I _did_ appreciate the explanation, but it doesn't have to live in the
source code; also we can just release `devuid` and then check for error with
the usual macro, since SDL is done with it either way at this point.
2024-06-15 11:42:44 -04:00
Ryan C. Gordon
7c2329cd78 wikiheaders: Fix C typedef parsing.
Before, it was treating `typedef struct x x;` as a struct typedef instead of
a datatype typedef. Worse, it was treating `typedef struct x *x` the same!

This might require us to manually clean out some incorrect CategoryAPIStruct
tags that have accumulated in various pages.
2024-06-15 11:31:17 -04:00
Sam Lantinga
51f90f308b Fixed spacing 2024-06-15 08:10:48 -07:00
obeecodes
3b5dce10c4 Addressed memory leak in SDL_coreaudio.m 2024-06-15 08:05:47 -07:00
Sam Lantinga
e388e377aa audio: Refer to audio devices to "playback" and "recording" 2024-06-15 08:00:33 -07:00
Anonymous Maarten
a64960cfc0 SDL_GLContext is not a void* pointer anymore 2024-06-15 14:44:09 +02:00
SDL Wiki Bot
63138c79af Sync SDL3 wiki -> header 2024-06-15 05:09:09 +00:00
Ryan C. Gordon
b83ab7eb12 audio: Remove const from an SDL_bool parameter in SDL_AddAudioDevice. 2024-06-15 01:08:12 -04:00
Ryan C. Gordon
38f0214e8a audio: Refer to audio devices to "playback" and "recording".
Fixes #9619.
2024-06-15 01:08:12 -04:00
Anonymous Maarten
031dc0743f Use an opaque struct typedef for SDL_GLContext
Using a struct typedef instead of a void pointer results in extra C typechecks
2024-06-15 01:43:22 +02:00
Frank Praznik
41532e84cb wayland: Prevent a possible crash when determining the display for a minimized window
A minimized window may not be associated with any displays, so check that the output array is valid and that there is at least one associated display before dereferencing.

Fixes a crash when attempting to unset fullscreen on a minimized window.
2024-06-14 12:25:13 -04:00
Emmanuele Bassi
a98774e62c Check the Xft/DPI XSETTINGS
Similar to Xrm's "Xft.dpi" key, but stores in 1024th increments.
2024-06-14 08:54:17 -07:00
Emmanuele Bassi
e049098733 Query XSETTINGS for the content scale factor
For GTK-based systems using XSETTINGS it's much more likely to be
available, rather than the "GDK_SCALE" environment variable, which is a
debugging tool according to the GTK documentation.
2024-06-14 08:54:17 -07:00
Emmanuele Bassi
61dafb3b2f Add XSETTINGS support to x11 driver
Import the XSettingsClient implementation to handle the settings
selection.

Currently, we only care about the Gdk/WindowScalingFactor value used by
the windowing system to notify us of display-wide changes in the scaling
factor.
2024-06-14 08:54:17 -07:00
Ozkan Sezer
d6da494c1c un-revert commit 65d911a:
SDL3 isn't using `long long` casts, so there are no issues there
SDL2 needs handling it right..
2024-06-14 18:37:50 +03:00
Ozkan Sezer
e25a7e88ce revert commit 65d911a as it broke linux.. 2024-06-14 14:56:24 +03:00
Ozkan Sezer
65d911aff0 SDL_events.c: override of SDL_PRIs64 for mingw is no longer needed 2024-06-14 14:50:50 +03:00
Ryan C. Gordon
51902d4ac5 Updated headers with latest wikiheaders tweaks. 2024-06-14 02:09:55 -04:00
Ryan C. Gordon
c0c0c64a1d wikiheaders: Some quick scripting to make params/return info consistent.
- Lowercase the first letter of \param and \returns data; in the former case,
  it looks better in the table and Doxyggen (imho), in the latter it's because
  it's inserted after the word "Returns" to make an english sentence on the
  wiki. This is disabled in this commit, but it was useful to turn it on to
  fix up the headers manually.

- Make sure everything ends with punctuation. Inserts a period if there's
  no existing period or exclamation point at the end of the text. This is
  enabled going forward, so we won't have to manage it ourselves.
2024-06-14 02:08:50 -04:00
Ryan C. Gordon
5bc654aad3 camera: SDL_GetCameraDeviceName() now follows the SDL_GetStringRule. 2024-06-13 18:13:51 -04:00
Ryan C. Gordon
2ad7c70ac6 documentation: clean up a minor syntax issue. 2024-06-13 18:10:28 -04:00
Ryan C. Gordon
466886049c SDL_main.h: fix up SDL_main_func documentation to match SDL_main. 2024-06-13 18:08:40 -04:00
SDL Wiki Bot
2253c3cacf Sync SDL3 wiki -> header 2024-06-13 21:49:55 +00:00
Sam Lantinga
0635112119 Added SDL_HINT_WINDOWS_ERASE_BACKGROUND_MODE (thanks @lostgoat!) 2024-06-13 14:54:36 -07:00
SDL Wiki Bot
d46b8bc54e Sync SDL3 wiki -> header 2024-06-13 21:31:58 +00:00
Ryan C. Gordon
9d3d893322 testcamera: Report device name and SDL camera driver in the window title. 2024-06-13 17:05:47 -04:00
SDL Wiki Bot
fa3e22c5da Sync SDL3 wiki -> header 2024-06-13 21:04:27 +00:00
Ryan C. Gordon
12119cbaad include: Several documentation tweaks; cleaned up new wikiheaders warnings. 2024-06-13 17:03:31 -04:00
Ryan C. Gordon
a9d0eaf34a wikiheaders: Warn if a function returns non-void but has no \returns line. 2024-06-13 16:45:59 -04:00
SDL Wiki Bot
49f2a3463f Sync SDL3 wiki -> header 2024-06-13 19:34:29 +00:00
Sam Lantinga
6821fb2fe4 Fixed the right trigger on the Nintendo SNES Controller in simple report mode 2024-06-13 11:35:29 -07:00
Sam Lantinga
a3cc900157 Fixed Nintendo Switch triggers when in simple report mode 2024-06-13 11:25:27 -07:00
Frank Praznik
4eb08a6154 x11: Ungrab before attempting a confinement grab with XInput2 enabled
If XInput2 is enabled, it will grab the pointer on button presses, which results in XGrabPointer returning AlreadyGrabbed. Clear any existing grabs before attempting the confinement grab to avoid a timeout scenario.
2024-06-13 13:04:44 -04:00
Mykola Rubets
4919359a6f Fix compilation with enabled render commands logging 2024-06-13 09:51:00 -07:00
Sam Lantinga
bf27269952 Re-enable full controller reports for Joy-Con controllers
When they are in simple report mode, the thumbstick gets turned into a digital hat, so let's use them in full report mode.
2024-06-12 23:36:16 -07:00
Sam Lantinga
6619de8f24 Try to guess the type of a Nintendo Switch controller if we can't read the device info 2024-06-12 23:22:44 -07:00
Sam Lantinga
5ee9a840b1 Ignore spurious reply packets when reading Nintendo Switch controller reports 2024-06-12 23:03:50 -07:00
Sam Lantinga
fcd2a3a6ad Fixed mapping for Joy-Con controllers in simple report mode 2024-06-12 22:28:47 -07:00
Sam Lantinga
9f984e6fb4 testcontroller: fixed showing analog axis values 2024-06-12 22:27:54 -07:00
SDL Wiki Bot
674cc04ef4 Sync SDL3 wiki -> header 2024-06-13 02:25:45 +00:00
Sam Lantinga
80a907e0e6 Backed out the viewport and cliprect changes in 9fb5a9ccac
This ended up being lots of application code churn without any real benefit in practice.
2024-06-12 19:25:15 -07:00
Sam Lantinga
b2ccfc0b6f Log whether a controller is Bluetooth or not 2024-06-12 17:22:52 -07:00
SDL Wiki Bot
99f0309ac1 Sync SDL3 wiki -> header 2024-06-12 23:34:42 +00:00
Ryan C. Gordon
97ec4b0937 wikiheaders: fixed to work with not-SDL3 projects.
(SDL2 still uses DECLSPEC, not SDL_DECLSPEC.)
2024-06-12 19:30:10 -04:00
Ryan C. Gordon
fe620f0345 wikiheaders: List parameter and return value datatypes.
This lets them be clickable on the wikipages when they are SDL symbols.

Reference Issue #9236 (the "Missing links" checklist).
Reference Issue #9995.
2024-06-12 19:30:10 -04:00
Sam Lantinga
3e70376bce Enabled HIDAPI debug logging for diagnostic purposes 2024-06-12 15:03:41 -07:00
SDL Wiki Bot
9e3e489012 Sync SDL3 wiki -> header 2024-06-12 19:10:53 +00:00
Ryan C. Gordon
5416bd5fdc ios: Move animation callback to its own typedef. 2024-06-12 15:10:16 -04:00
SDL Wiki Bot
5b0f14a936 Sync SDL3 wiki -> header 2024-06-12 17:19:08 +00:00
Sam Lantinga
9fb5a9ccac Use floating point values for viewport, clip rectangle, and texture sizes
These are integer values internally, but the API has been changed to make it easier to mix other render code with querying those values.

Fixes https://github.com/libsdl-org/SDL/issues/7519
2024-06-12 10:18:39 -07:00
Sam Lantinga
463984ec20 Make sure the output settings match the camera device format 2024-06-11 20:43:28 -07:00
Sam Lantinga
876f10795f Don't set a YCbCr colorspace for an RGB texture
Fixes https://github.com/libsdl-org/SDL/issues/10006
2024-06-11 20:43:28 -07:00
SDL Wiki Bot
2d13fefc20 Sync SDL3 wiki -> header 2024-06-12 02:20:21 +00:00
SDL Wiki Bot
a4bb93e8e4 Sync SDL3 wiki -> header 2024-06-12 01:34:03 +00:00
Anonymous Maarten
32907a9606 Rename SDL_Swap(16|32|64)(LE|BE) to SDL_Swap(LE|BE)(16|32|64) 2024-06-12 02:29:39 +02:00
Anonymous Maarten
ef6123886e Add SDL_ReadS8 and SDL_WriteS8 2024-06-12 01:39:08 +02:00
Ryan C. Gordon
96bb06d9c7 wikiheaders: Clean out extra blank lines in function declarations on wiki.
This has been driving me nuts for awhile now.  :)
2024-06-11 12:37:41 -04:00
Ryan C. Gordon
386aa56711 wikiheaders: Make cleaning out function attributes more generic.
Changes the wiki page's "Syntax" section from things like...

```c
void SDL_LockMutex(SDL_Mutex *mutex) SDL_ACQUIRE(mutex);
```

...to...

```c
void SDL_LockMutex(SDL_Mutex *mutex);
```
2024-06-11 12:30:32 -04:00
SDL Wiki Bot
f003461a0b Sync SDL3 wiki -> header 2024-06-11 16:23:27 +00:00
Ryan C. Gordon
96f2ef77ab include: Make function pointer params into typedefs.
This is easier to read and document in general, but will also make some
new parsing work in wikiheaders much easier.
2024-06-11 12:22:46 -04:00
Sam Lantinga
391a63f29f Check raw keyboard input in checkkeys 2024-06-11 09:09:30 -07:00
Ryan C. Gordon
b53f6cf77a wikiheaders: Removed a FIXME comment. 2024-06-11 11:37:45 -04:00
Ryan C. Gordon
8e782602de wikiheaders: Fixes and cleanups to fix SDL_ReportAssertion's wiki page. 2024-06-11 11:29:44 -04:00
Ryan C. Gordon
c3a4b15a74 wikiheaders: Don't present printf-support compiler metadata in wiki. 2024-06-11 10:58:02 -04:00
Sam Lantinga
66aac9aced Fixed channel order typo 2024-06-10 18:05:31 -07:00
SDL Wiki Bot
454d890bef Sync SDL3 wiki -> header 2024-06-11 00:57:54 +00:00
Ryan C. Gordon
d3a62d8298 audio: Update docs on channel ordering. 2024-06-10 20:56:50 -04:00
Sam Lantinga
ed5993d1cb Removed unused variable 2024-06-10 15:01:41 -07:00
Sam Lantinga
44f66b5c8b Show the cursor when relative mode is enabled and the app doesn't have focus
Testing:
* Run test/testwm
* Hit Ctrl-R to toggle relative mode
* Alt-tab away
* Move the mouse over testwm
* Note that the cursor is visible until testwm gains focus
2024-06-10 14:57:32 -07:00
Sam Lantinga
0cc61b27a2 SDL takes care of handling mouse relative mode on focus change 2024-06-10 14:57:32 -07:00
Anonymous Maarten
657c0135b1 android: android release binary should only contain a shared SDL3 library 2024-06-10 18:04:18 +02:00
Anonymous Maarten
dd0bb25f66 cmake: remove SDL_STATIC_PIC cmake option.
Use CMAKE_POSITION_INDEPENDENT_CODE instead
2024-06-10 18:04:18 +02:00
Sam Lantinga
4ce4fc575a Fixed mapping between Apple YUV formats and SDL formats
Fixes https://github.com/libsdl-org/SDL/issues/10001
2024-06-10 08:59:21 -07:00
Sam Lantinga
4fc68a48f2 Keep track of whether a controller was a gamepad
Fixes https://github.com/libsdl-org/SDL/issues/9996
2024-06-09 17:45:20 -07:00
Sam Lantinga
20fccdabf4 Fixed crashes when passed a NULL hashtable 2024-06-09 17:45:20 -07:00
Ryan C. Gordon
8ddf05855b iostream: clarified SDL_IO_STATUS_READY documentation. 2024-06-09 13:21:31 -04:00
Sam Lantinga
3e018517c3 Fixed build errors after SDL_IOWhence change 2024-06-09 11:52:04 -04:00
SDL Wiki Bot
9651ca5918 Sync SDL3 wiki -> header 2024-06-09 05:52:14 +00:00
Ryan C. Gordon
6110405c07 include: Fill in some documentation gaps. 2024-06-09 01:51:30 -04:00
Ryan C. Gordon
7d54a37d74 iostream: Make seeking's whence value a real enum. 2024-06-09 01:50:48 -04:00
SDL Wiki Bot
35adef17a8 Sync SDL3 wiki -> header 2024-06-09 05:33:28 +00:00
Ryan C. Gordon
40e8d0155e SDL_joystick.h: Add some notes to the category documentation. 2024-06-09 01:32:41 -04:00
Ryan C. Gordon
8af58b4bec SDL_FLT_EPSILON: Updated documentation to be wikiheaders-friendly. 2024-06-08 23:15:21 -04:00
Green Sky
997dd3e6eb reword SDL_FlashWindow params
so they link the types in the wiki
2024-06-08 17:25:27 -04:00
Frank Praznik
7a7d780289 wayland: Fix broken dead key behavior
This fixes numerous problems regarding dead keys on Wayland. Most notably, Wayland was enforcing dead keys on SDL_KEYDOWN and SDL_KEYUP events, which caused unresponsiveness on keys that were mapped to dead keys (tilde on US-Intl is most notable for this, commonly used as a console key).

When starting text input, not all state was reset properly. The text input protocol requires to be re-enabled every time text input changes, which SDL did not do. Also, XKB compose state was not reset at all, causing composite and dead keys to carry over from when text input was disabled.

Manual cherry-pick of 1c3090a1ac by Hanicef
2024-06-08 12:00:30 -04:00
Anthony
e9982bf1b5 Filter Android drivers according to SDL_***_DISABLED macros to help reduce APK size (#9986) 2024-06-08 08:55:15 -07:00
Sam Lantinga
e69272344c Added documentation for SDL_FLT_EPSILON (thanks @MrOnlineCoder!)
Closes https://github.com/libsdl-org/sdlwiki/pull/549
2024-06-08 08:29:17 -07:00
Fabrice Desclaux
f62a1bed16 Fix spurious LCtrl on RAlt key pressed
(cherry picked from commit 22c14442e2)
2024-06-07 09:21:40 -07:00
SDL Wiki Bot
9a4fc81bff Sync SDL3 wiki -> header 2024-06-06 17:59:48 +00:00
Sam Lantinga
5701c4f4bc Added migration documentation for iOS window properties
Fixes https://github.com/libsdl-org/SDL/issues/9430
2024-06-06 10:59:15 -07:00
Sam Lantinga
1938d25b7e Use "%S" format specifier for wide-character strings 2024-06-06 10:59:15 -07:00
Sam Lantinga
2a8f87d34b Fixed build warnings 2024-06-06 10:59:15 -07:00
SDL Wiki Bot
a5356f9b45 Sync SDL3 wiki -> header 2024-06-06 17:08:43 +00:00
Sam Lantinga
23db1062fc Document that you can pass NULL to SDL_PeepEvents()
Fixes https://github.com/libsdl-org/sdlwiki/issues/547
2024-06-06 10:08:20 -07:00
kanjitalk755
7547d80c05 Add SDL_PIXELFORMAT_XRGB8888 and SDL_PIXELFORMAT_XBGR8888 to SDL_render_metal.m 2024-06-06 09:57:35 -07:00
Oleg
7529b4bed5 Added VRS DirectForce Pro wheelbase VID/PID to wheel devices list 2024-06-06 09:53:39 -07:00
Sam Lantinga
b6d7adfec1 Fixed PlayStation detection interrupting input for the Logitech K400 keyboard
Also added the Logitech Chillstream to the list of PS3 controllers and fixed the right shoulder axis.
2024-06-05 19:11:10 -07:00
Anthony
3c5b1b52ac Update proguard-rules.pro for recent haptic changes 2024-06-05 14:54:42 -07:00
Sam Lantinga
27728db41d Sort joystick drivers in Android.mk 2024-06-05 12:08:29 -07:00
Sam Lantinga
69bfa5c951 Build the dummy joystick driver on Android
Fixes https://github.com/libsdl-org/SDL/issues/9978
2024-06-05 12:07:31 -07:00
Sam Lantinga
26fc7a8060 Fixed signatures for internal haptics functions 2024-06-05 10:09:02 -07:00
Sam Lantinga
f879411627 Added support for gamepad rumble on Android
Tested with the DualSense controller over Bluetooth on Android 12

Fixes https://github.com/libsdl-org/SDL/issues/7847
2024-06-05 09:53:56 -07:00
erysdren
0c3dcdf4a3 Add a basic ShowMessageBox implementation for PSP (#9932) 2024-06-05 07:42:22 -07:00
Frank Praznik
a422dfe572 video: Don't attempt to apply window flags to popup windows when the window is shown
None of the operations are valid on popup windows and will just set an error.
2024-06-05 09:39:31 -04:00
Sam Lantinga
7b14fcb4d9 Stack allocation never happened, so explicitly allocate the path 2024-06-05 05:48:39 -07:00
Sam Lantinga
4836fd1e70 Fixed crash if a file can't be opened on Android 2024-06-05 05:48:21 -07:00
Sam Lantinga
9b2debb131 Renamed old function reference 2024-06-04 22:25:37 -07:00
Sam Lantinga
ce65f84fd8 Fixed Android warnings 2024-06-04 16:38:32 -07:00
Hunter Kvalevog
5387022855 camera: Initialize AVCaptureVideoDataOutput.videoSettings to zero
AVCaptureVideoDataOutput.videoSettings should be initialized to zero to
receive frames matching the device format.

See: https://developer.apple.com/documentation/avfoundation/avcapturevideodataoutput/1389945-videosettings?language=objc
2024-06-04 16:24:27 -07:00
Hunter Kvalevog
14f7eebac6 testcamera: Add [--camera name] parameter 2024-06-04 16:24:27 -07:00
Wouter Wijsman
a3adc41f79 PSP: Add on-screen keyboard support 2024-06-04 14:31:05 -07:00
Wouter Wijsman
25e41df4db Merge pull request #9961 from erysdren/psp-renderer-crash
SDL_render_psp.c: Fix crash in PSP_DestroyRenderer()
2024-06-04 23:27:57 +02:00
Sam Lantinga
4d392bfc67 Fixed camera capture on iOS
My phone captured 1920x1080 images even though the highest reported format was higher resolution, so I adjusted testcamera to be able to handle different sized images than expected.

Fixes https://github.com/libsdl-org/SDL/issues/9930
2024-06-04 11:34:39 -07:00
Sam Lantinga
7e231fcd90 Added testcamera to Xcode test apps 2024-06-04 10:43:45 -07:00
Sam Lantinga
b1529699cf Fixed Xcode build after adding offscreen Vulkan support 2024-06-04 10:43:20 -07:00
Sam Lantinga
60396971ce Move the main header with SDL_MAIN_USE_CALLBACKS 2024-06-04 10:42:44 -07:00
David Gow
5eeeaf4780 render: Mark an already-destroyed renderer as freed
It's possible to destroy an SDL_Renderer without freeing it using
SDL_DestroyRendererWithoutFreeing(), which is used to make it possible
to destroy windows and their renderers in either order. However, if a
renderer has already been destroyed before it is freed (e.g., the window
was destroyed before the renderer), the object is never marked invalid.
This means the SDL_Renderer is reported as leaked, even if
SDL_DestroyRenderer() is called.

SDL_GetWindowSurface() will trigger this, as the window texture is
cleaned up _after_ the window destroys its associated renderer. This
makes it impossible to use SDL_FRAMEBUFFER_ACCELERATION without
triggering a leak warning.

Fix this by unconditionally marking the SDL_Renderer object as invalid
in SDL_DestroyRenderer().
2024-06-04 07:50:46 -07:00
Mathieu Eyraud
43c2b42517 Fix stack address escape in SDL_CameraDevicePermissionOutcome()
If allocation of 'p' fails, 'pending_tail' points to 'pending'.
2024-06-04 07:49:07 -07:00
Mathieu Eyraud
c226630086 Fix memory leak in SDL_IOFromFile()
If Android_JNI_FileOpen() or windows_file_open() fail, SDL_CloseIO(iostr) does nothing because 'iostr' is NULL and 'iodata' is leaked.
2024-06-04 07:48:25 -07:00
Sam Lantinga
470cfc2755 Make sure we set the initial report interval value 2024-06-04 07:47:34 -07:00
meyraud705
4c9a91b62e Update gamepad sensor rate
SDL_HINT_JOYSTICK_HIDAPI_PS4_REPORT_INTERVAL allows to change sensor rate. Make SDL_GetGamepadSensorDataRate() returns the updated value.
2024-06-04 07:38:48 -07:00
SDL Wiki Bot
e5101ebae6 Sync SDL3 wiki -> header 2024-06-04 04:11:34 +00:00
Sam Lantinga
a0d1445ccb Replaced SDL_GetRendererInfo() with SDL_GetRendererName()
The texture formats are available via the SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER property

Fixes https://github.com/libsdl-org/SDL/issues/9851
2024-06-03 21:10:58 -07:00
Ozkan Sezer
ca28bcb3b8 hidapi/windows/hid.c: avoid warnings with gcc < 8. 2024-06-04 06:10:24 +03:00
SDL Wiki Bot
74c9c9a325 Sync SDL3 wiki -> header 2024-06-04 01:23:30 +00:00
Semphris
8c8ee2174d Dialog: Add filter number, remove NULL termination 2024-06-03 18:22:26 -07:00
Sam Lantinga
3e70964ae2 Updated docs to note that SDL_GetAudioDeviceName() now returns const char * 2024-06-03 17:42:53 -07:00
Sam Lantinga
1d83b782b8 Set the headphones to 50% volume to avoid blasting people's ears
Also fixed audio routing comments
2024-06-03 17:28:32 -07:00
Sam Lantinga
8aa7910184 Added an example of setting PS5 controller audio routing
Closes https://github.com/libsdl-org/SDL/pull/9661
2024-06-03 17:24:36 -07:00
erysdren
b867db4d54 SDL_render_psp.c: Fix crash in PSP_DestroyRenderer() 2024-06-03 17:33:51 -05:00
Sam Lantinga
a9a51cebde Disable raw keyboard input by default
It interferes with keyboard hooks and most applications don't expect key events coming from another thread
2024-06-03 14:43:46 -07:00
Sam Lantinga
73879ef26e Only register for the type of raw input requested by the application 2024-06-03 14:43:46 -07:00
Anonymous Maarten
a919774fe4 Build with -Wfloat-conversion + fix all warnings 2024-06-03 21:33:29 +00:00
SDL Wiki Bot
17c459e384 Sync SDL3 wiki -> header 2024-06-03 18:48:59 +00:00
SDL Wiki Bot
9c4fb449e2 Sync SDL3 wiki -> header 2024-06-03 18:41:23 +00:00
SDL Wiki Bot
de5a8b61d0 Sync SDL3 wiki -> header 2024-06-03 18:27:57 +00:00
SDL Wiki Bot
39c2dacc8f Sync SDL3 wiki -> header 2024-06-03 18:21:49 +00:00
Ryan C. Gordon
e23257307e Introduce formal policy for APIs that return strings.
This declares that any `const char *` returned from SDL is owned by SDL, and
promises to be valid _at least_ until the next time the event queue runs, or
SDL_Quit() is called, even if the thing that owns the string gets destroyed
or changed before then.

This is noted in the headers as "the SDL_GetStringRule", so this will both be
greppable to find a detailed explaination in docs/README-strings.md and
wikiheaders will automatically turn it into a link we can point at the
appropriate documentation.

Fixes #9902.

(and several FIXMEs, both known and yet-undocumented.)
2024-06-03 14:20:49 -04:00
Carlo Bramini
b1f3682216 SDL_assert: add support for aarch64-w64-mingw32
GCC 15 development branch provides an experimental support for Windows on ARM64, which will be officially released next year, according to latest news.
I tried to compile SDL2 with this new compiler but I got a tiny problem into SDL_assert.h because it couldn't find the right platform.
However, it has been easy to fix and I included it into this PR.
More details can be also found here:
https://learn.microsoft.com/en-us/cpp/intrinsics/debugbreak?view=msvc-170

(cherry picked from commit 2cb1a2d0a7)
2024-06-03 10:55:14 -07:00
Sam Lantinga
76e5aa5bfd Log any leaked objects at shutdown 2024-06-03 08:54:46 -07:00
Sam Lantinga
b0e93e4e63 Prevent crashes if freed objects are passed to SDL API functions
Instead of using the magic tag in the object, we'll actually keep track of valid objects

Fixes https://github.com/libsdl-org/SDL/issues/9869
Fixes https://github.com/libsdl-org/SDL/issues/9235
2024-06-03 08:54:46 -07:00
Ryan C. Gordon
57a15933cd SDL_GetCSSCursorName: Don't assert on unrecognized cursor types.
These values are passed through from the calling app and shouldn't trigger
asserts when they are bogus.
2024-06-01 22:32:43 -04:00
Ryan C. Gordon
9a9a3d1a33 SDL_SystemCursor: rename enum items to match CSS.
Fixes #9079.
2024-06-01 22:32:43 -04:00
Ozkan Sezer
49b6c24722 always define PRI?64 using 'I64' when targeting windows
avoids -Wformat warnings from mingw toolchains -- e.g.:
src/test/SDL_test_harness.c:581:37: warning: unknown conversion type character 'l' in format [-Wformat=]
2024-06-01 22:35:40 +03:00
Anonymous Maarten
fd2b9c0602 cmake: don't check c++ compiler flags for asan when CXX is not enabled 2024-06-01 10:18:15 +02:00
Frank Praznik
85a2a201b1 x11: Always disable the borders when leaving fullscreen from a borderless window created as fullscreen
Borderless windows flagged as fullscreen at creation time turn on the borders, because doing so prevents some window managers from wrongly positioning the borderless window, and in these cases the borders need to be removed whether fullscreen is exited programmatically or via a compositor event. Set a flag when forcing the borders on, so they will be removed in all cases later.
2024-05-31 19:11:50 -04:00
Sam Lantinga
4c7459eda8 SDL_cocoawindow: Fix setting parent-relative coordinates for child windows in Cocoa_SetWindowSize 2024-05-31 15:29:19 -07:00
Sam Lantinga
e3beaa1972 Added support for the Razer Kitsune in PS5 mode 2024-05-31 15:18:15 -07:00
Sam Lantinga
cd9c25e800 Don't set the borderless flag if we're about to go fullscreen.
This prevents the GNOME window manager from moving the window to a different display before the window goes fullscreen.

Fixes https://github.com/libsdl-org/SDL/issues/9915
2024-05-31 11:35:18 -07:00
Anonymous Maarten
6896c4c3bf tests: testcases accept a void pointer argument 2024-05-31 19:18:24 +02:00
Anonymous Maarten
d5060423a2 testplatform: fix leak at exit time
A leak was present at exit time on the Emscripten platform
2024-05-31 18:53:36 +02:00
Anonymous Maarten
4b0f52b04e cmake: fall back to per-cpu test when all-in-one test fails
The 'all-in-one' test fails for Emscripten because try_compile does not copy back the actual binary:
the wasm file contains the machine parseable strings, not the html or js file(s).
2024-05-31 18:53:21 +02:00
mechakotik
8f88c32ca6 android: Default to custom theme in styles.xml
Custom theme file exists in project, but is not used by app, which is kinda unintuitive. Using it by default so people who not familiar with Android development won't spend lots of time troubleshooting.
2024-05-31 09:04:06 -07:00
Ozkan Sezer
550d5b95c0 fix type redefinition errors after commit b1b4638cac. 2024-05-31 17:47:20 +03:00
Ozkan Sezer
5aa9ee8446 SDL_windowsmodes.c (WIN_GetDisplayNameVista): fix return after PR/9923
why haven't any of the build tests catch this..
2024-05-31 11:33:50 +03:00
Sam Lantinga
90beffdeb1 Revert "WASAPI_WaitDevice: Check current padding before waiting on event"
This reverts commit 09fbb2a07d.

This was causing issues in CS2 and DOTA:
https://old.reddit.com/r/DotA2/comments/1d4bqe3/dota_2_sound_crackling_since_this_morning/
https://old.reddit.com/r/DotA2/comments/1d44udf/anyone_having_sound_issues_or_any_clue_how_to_fix/
2024-05-30 16:50:30 -07:00
Ozkan Sezer
e4518af377 move vista+ display config function ptr calls to device->driverdata
.. and change hdr code's display config function calls to use those
function ptrs.
2024-05-31 02:50:02 +03:00
Sam Lantinga
fb2287dd47 Fixed updating NV12 and YV12 textures on the direct3d11 renderer
Fixes https://github.com/libsdl-org/SDL/issues/9928
2024-05-30 14:19:34 -07:00
Hunter Kvalevog
8604847214 SDL_SetEventFilter: Don't flush when removing filter
Don't flush the event queue if the filter paramter is NULL.
2024-05-30 13:06:01 -07:00
Hunter Kvalevog
0136bf2f8f SDL_SetEventFilter: Don't flush good events
Only cut events that don't pass the user filter instead of flushing the
entire list.

Fixes #9592
2024-05-30 13:06:01 -07:00
Sam Lantinga
4954690828 Fixed warning C4244: '=': conversion from 'double' to 'float', possible loss of data 2024-05-30 07:44:00 -07:00
Sam Lantinga
690d73f5c9 Fixed warning C4244: 'initializing': conversion from 'WPARAM' to 'Uint32', possible loss of data 2024-05-30 07:42:35 -07:00
Ozkan Sezer
d41e48e4c6 WIN_AdjustWindowRectWithStyle: silence gcc maybe-uninitialized warnings
/tmp/SDL3/src/video/windows/SDL_windowswindow.c: In function 'WIN_SetWindowPositionInternal':
/tmp/SDL3/src/video/windows/SDL_windowswindow.c:216:17: warning: 'h' may be used uninitialized in this function [-Wmaybe-uninitialized]
     rect.bottom = *height;
     ~~~~~~~~~~~~^~~~~~~~~
/tmp/SDL3/src/video/windows/SDL_windowswindow.c:320:12: note: 'h' was declared here
     int w, h;
            ^
/tmp/SDL3/src/video/windows/SDL_windowswindow.c:215:16: warning: 'w' may be used uninitialized in this function [-Wmaybe-uninitialized]
     rect.right = *width;
     ~~~~~~~~~~~^~~~~~~~
/tmp/SDL3/src/video/windows/SDL_windowswindow.c:320:9: note: 'w' was declared here
     int w, h;
         ^
2024-05-29 16:39:03 -07:00
Sam Lantinga
a801f81132 Revert "Fix flickering of window when using desktop-fullscreen and borderless window on multiple monitors on Linux. Closes #8186."
This reverts commit 2de2e9d031.

The fullscreen state is no longer available to check, and the actual bug this was trying to work around was fixed in ad813a65e7
2024-05-29 14:15:59 -07:00
Frank Praznik
63c164f778 x11: Use the floating size for the constraints on non-resizable windows
Otherwise, the window manager can think that the window is larger than it is and try to reposition it.
2024-05-29 14:09:29 -07:00
Ozkan Sezer
384e5486bc SDL_windows.h: set _WIN32_WINNT to 0xA00 dxgi1_6.h is available
to make sure DISPLAYCONFIG_SDR_WHITE_LEVEL is visible to us.
2024-05-30 00:05:55 +03:00
Ozkan Sezer
b1c7b2f44f SDL_wasapi.c: avoid unused warning if IAudioClient3 isn't available 2024-05-29 15:43:33 -04:00
Ozkan Sezer
dde9c10e79 SDL_camera_mediafoundation.c: hardcode MF_DEVSOURCE_ATTRIBUTE_* GUIDs 2024-05-29 15:33:42 -04:00
Ramez Ragaa
6bb91c7c08 Support X11 incremental clipboard transfers.
This adds support for pasting large clipboard contents using the INCR
property mechanism

Fixes #8871
2024-05-29 12:30:34 -07:00
Sam Lantinga
652b34bd15 Added SDL_DumpProperties() for internal debugging 2024-05-29 10:30:31 -07:00
Sam Lantinga
ae59afa7d0 Fixed building with ENABLE_SDL_CALL_LOGGING enabled 2024-05-29 10:30:31 -07:00
Frank Praznik
57504385e0 wayland: Maintain aspect ratio while resizing the window
Note that Wayland places a restriction on windows being resized, where the requested size passed to the configuration event is a maximum, and attempting to exceed it is a protocol violation, so trying to grow the window by dragging the sides only vertically or horizontally is limited, as the provided dimensions can't be exceeded.

In practice, nothing seems to kill clients that do this, but the more immediate problem is that doing so causes GNOME to glitch out.
2024-05-29 12:23:36 -04:00
Sam Lantinga
b1b4638cac Add basic vulkan support to offscreen video driver so it doesn't crash if you happen to get the offscreen driver and try to use vulkan.
Enable offscreen video driver in windows to make it easier to test.
Enable offscreen video driver in macos just to complete the desktop computer trio.
2024-05-28 20:02:55 -07:00
SDL Wiki Bot
04a0a85d92 Sync SDL3 wiki -> header 2024-05-29 02:48:51 +00:00
Sam Lantinga
542a3663de Added SDL_GetDefaultKeyFromScancode() to the public API
This is useful when getting the English name of a key for a non-Latin keyboard layout, for example.
2024-05-28 19:48:24 -07:00
Ryan C. Gordon
aeb223fc23 pipewire: if no devices seen in "preferred" init, try a different backend.
We're seeing people with legit PipeWire installs that don't export any
devices, that are also running a (not emulated) PulseAudio install that
works.

This solution might still get tweaked some more, but it seems to be working
so far.
2024-05-28 22:17:40 -04:00
Frank Praznik
fafc9f642a win32: Don't set the display HDR values to uninitialized data
The HDR properties are zeroed and set in WIN_GetHDRProperties, and using the struct without calling this function results in sending uninitialized data.
2024-05-28 15:51:02 -04:00
Ozkan Sezer
2b374e6c0f check dxgi1_6.h before enabling sdr/hdr code in SDL_windowsmodes.c
thanks @madebr
2024-05-28 22:11:56 +03:00
Ozkan Sezer
00a7b14ee7 cmake: check mfapi.h before enabling SDL_CAMERA_DRIVER_MEDIAFOUNDATION 2024-05-28 22:11:50 +03:00
Sam Lantinga
d141827895 Fixed positioning a window with undefined position on a specific display 2024-05-28 12:06:48 -07:00
SDL Wiki Bot
98fdef75bb Sync SDL3 wiki -> header 2024-05-28 18:54:02 +00:00
Sam Lantinga
c74886ab00 Added SDL_SetWindowAspectRatio() and SDL_GetWindowAspectRatio()
Fixes https://github.com/libsdl-org/SDL/issues/1573
2024-05-28 11:52:31 -07:00
Ozkan Sezer
aacafd6233 time/windows/SDL_systime.c: remove minwinbase.h & timezoneapi.h includes
core/windows/SDL_windows.h is included in there, which inludes windows.h
which in turn includes winbase.h, which in turn includes the two already
2024-05-28 11:27:37 +03:00
Ozkan Sezer
864df05b19 SDL_windowsevents.c: define RI_MOUSE_HWHEEL if missing. 2024-05-28 11:11:50 +03:00
Ozkan Sezer
ba1fdf24c9 fix type redefinition error after commit dfe4445214
In file included from /tmp/SDL3/src/events/SDL_events_c.h:28,
                 from /tmp/SDL3/src/SDL.c:46:
/tmp/SDL3/src/events/../video/SDL_sysvideo.h:31: error: redefinition of typedef 'SDL_VideoDevice'
/tmp/SDL3/src/video/SDL_video_c.h:27: note: previous declaration of 'SDL_VideoDevice' was here
2024-05-28 11:00:02 +03:00
erysdren
2f1384e5d1 SDL_systime.c: missing include for PSP toolchain 2024-05-27 14:36:46 -07:00
Sam Lantinga
36015ad5e5 Fixed compiling SDL_platform_defines.h on macOS with older compilers (thanks @sezero!)
Fixes #9632
2024-05-27 14:34:21 -07:00
Ryan C. Gordon
e508d82f74 include: Tweaked some vsync-related documentation.
Reference PR #9903.
2024-05-27 16:57:32 -04:00
SDL Wiki Bot
6524f9c9b8 Sync SDL3 wiki -> header 2024-05-27 20:12:47 +00:00
Sam Lantinga
dfe4445214 Added SDL_SetWindowSurfaceVSync() and SDL_GetWindowSurfaceVSync()
Fixes https://github.com/libsdl-org/SDL/issues/9347
2024-05-27 13:12:17 -07:00
SDL Wiki Bot
7c75801571 Sync SDL3 wiki -> header 2024-05-27 20:04:46 +00:00
Ryan C. Gordon
3364aff757 main: Make the main callback return value symbols smaller (thanks, @Lzard!).
Reference #9901.
2024-05-27 16:03:45 -04:00
Frank Praznik
ef5d56de51 wayland: Implement animated system cursors when not using the cursor shape protocol
If a system cursor has more than one frame, create a frame callback to run the animation and attach new buffers as necessary to animate the cursor.
2024-05-27 14:38:52 -04:00
SDL Wiki Bot
a086144dad Sync SDL3 wiki -> header 2024-05-27 16:59:55 +00:00
Ryan C. Gordon
0fe9900429 main: Main callback docs recommend returning the symbols instead of -1, 0, 1.
Reference #9901.
2024-05-27 12:58:22 -04:00
L zard
06aa02453a Tests: Use the main callback code macros 2024-05-27 09:22:07 -07:00
Sam Lantinga
7d81e9d46c Note that you can redraw in response to SDL_EVENT_WINDOW_EXPOSED from an event watch callback 2024-05-27 08:06:13 -07:00
SDL Wiki Bot
54fcacae31 Sync SDL3 wiki -> header 2024-05-27 14:58:03 +00:00
Sam Lantinga
14667cc0a3 Document that the timer callback can potentially be called before the timer returns. 2024-05-27 07:57:33 -07:00
Sam Lantinga
aaa9bf9422 Added more error checking for SDL timer functions 2024-05-27 07:57:33 -07:00
Sam Lantinga
99599d9236 Added SDL_AddTimerNS() 2024-05-27 07:57:33 -07:00
Sam Lantinga
b6360516e4 Added the timerID to the SDL timer callback
Fixes https://github.com/libsdl-org/SDL/issues/2593
2024-05-27 07:57:33 -07:00
Sam Lantinga
a5b0041b4a Fixed SDL_strncmp() logic in portal dialog code
Also removed redundant calls to SDL_strlen()

Fixes https://github.com/libsdl-org/SDL/issues/9899
2024-05-27 07:46:58 -07:00
Sam Lantinga
df25e4022d Removed short aliases for 16-bit pixel formats
These were potentially misleading in the same way the RGB888/BGR888 aliases were

Fixes https://github.com/libsdl-org/SDL/issues/4994
2024-05-27 07:24:46 -07:00
SDL Wiki Bot
5fa9432b7d Sync SDL3 wiki -> header 2024-05-27 02:54:30 +00:00
Ryan C. Gordon
066f49da1a main: Add some macros for main callback return codes.
Fixes #9883.
2024-05-26 22:53:06 -04:00
SDL Wiki Bot
c168ccc3c3 Sync SDL3 wiki -> header 2024-05-27 02:00:01 +00:00
Anonymous Maarten
ddb826d1a0 VC+d3d12: spread test for __has_include and d3d12.h test over multiple lines 2024-05-27 03:02:10 +02:00
Anonymous Maarten
279fb3acc3 release: build mingw binaries on Ubuntu 24.04
Ubuntu 22.04 ships with mingw that does not support direct3d12.

[ci skip]
2024-05-27 02:30:51 +02:00
Anonymous Maarten
4fa5006247 VC+d3d12: use __has_include to detect presence of d3d12 ehaders 2024-05-27 00:44:53 +02:00
Anonymous Maarten
bba76859f5 cmake: detect CPU architecture in 1 compilation 2024-05-26 23:52:48 +02:00
Anonymous Maarten
3af4f120d0 cmake: direct3d12 renderer needs d3d12.h and d3d12sdklayers.h
Older MinGW releases don't ship d3d12sdklayers.h
2024-05-26 23:00:41 +02:00
Frank Praznik
716dc0e1bf wayland: Implement SetWindowOpacity via the alpha modifier protocol
The wp_alpha_modifier_v1 protocol allows for a global blending factor to be specified for an entire surface. Use this to add support for SDL_SetWindowOpacity().
2024-05-26 14:17:05 -04:00
Sam Lantinga
606903c02f Updated window event names 2024-05-26 11:13:34 -07:00
Ryan C. Gordon
a4ccace9c5 include: Fix warnings from gendynapi.py.
Fixes #9890.
2024-05-26 13:44:16 -04:00
Ryan C. Gordon
ca2d7f9844 gendynapi.py: Ignore wiki documentation blocks.
Otherwise, it thinks SDL_CreateThread, etc, are real functions.

Reference Issue #9890.
2024-05-26 13:34:13 -04:00
Ryan C. Gordon
a0376ab057 SDL_MouseButtonFlags: Clarified some documentation. 2024-05-26 13:23:21 -04:00
Ryan C. Gordon
10bbf9d1da Fixed SDL_PenCapabilityFlags from Uint64 to Uint32. 2024-05-26 13:23:21 -04:00
Ryan C. Gordon
0e6db371e8 pen: Make the \since field in SDL_PenCapabilityFlags match everything else. 2024-05-26 13:23:21 -04:00
Ryan C. Gordon
cf2874080f mouse: Move mouse button state from a Uint32 to a formal typedef.
Reference Issue #9812.
2024-05-26 13:23:21 -04:00
Ryan C. Gordon
13b18e3c41 test: Moved some Uint32 bitfields over to typedefs.
Reference Issue #9812.
2024-05-26 13:23:21 -04:00
Ryan C. Gordon
0f0570b060 pen: Change a Uint32 bitfield into a typedef.
Reference Issue #9812.
2024-05-26 13:23:21 -04:00
SDL Wiki Bot
8e3ff8c3a1 Sync SDL3 wiki -> header 2024-05-26 17:21:54 +00:00
Sam Lantinga
534768c7c5 Added SDL_PauseAudioStreamDevice() and SDL_ResumeAudioStreamDevice() 2024-05-26 13:21:23 -04:00
SDL Wiki Bot
a6da2e6f8b Sync SDL3 wiki -> header 2024-05-26 16:19:32 +00:00
Ryan C. Gordon
2626304e70 properties: add formal SDL_CleanupPropertyCallback type, improve docs. 2024-05-26 12:17:34 -04:00
Frank Praznik
4ee28b6bb4 wayland: Refactor and fix size handling in the configure events
In some cases, size data set programmatically could be overwritten by old configuration data, particularly when on the display scaling path. This refactors the configuration code to be much more strict and verbose regarding the handling of window sizes, which fixes some scenarios where tests were failing when display scaling was activated.
2024-05-26 10:30:46 -04:00
SDL Wiki Bot
84cb065da2 Sync SDL3 wiki -> header 2024-05-26 03:34:35 +00:00
Ryan C. Gordon
033793faed audio: SDL_OpenAudioDeviceStream() now allows a NULL spec. 2024-05-25 23:34:01 -04:00
Ryan C. Gordon
6a40a8eb12 audio: Minor documentation clarifications. 2024-05-25 23:34:00 -04:00
Frank Praznik
0e1f3b681f video: Distinguish between explicit fullscreen enter requests and update requests
Video backends that run asynchronously can wind up in a race situation if a mode or position update request queues up a fullscreen enter request while an unprocessed asynchronous leave request is in flight, and the mode switch or position update request is processed after the leave request, causing the window to erroneously return to fullscreen.

Instead of the internal SDL_UpdateFullscreenMode and backend SetWindowFullscreen functions taking a boolean value, use an enum that allows the backends to distinguish between "this is an explicit fullscreen enter/leave request", and "this is an update request to change the mode or position". Communicating the specific intent allows the backend to early-out when required, which prevents windows from erroneously returning to fullscreen due to update requests made after a leave request, and allows for the removal of some internal synchronization previously needed to (attempt to) work around this, which improves overall performance while also increasing robustness.

This is only relevant to the internal functions, and nothing in the public-facing API has been changed.
2024-05-25 14:13:00 -04:00
Anonymous Maarten
fefa47e409 dropfile: main callbacks need extra CMake care on UWP 2024-05-25 16:35:11 +02:00
Anonymous Maarten
78e25d4994 testdropfile: convert to use callbacks 2024-05-25 04:44:07 +02:00
Anonymous Maarten
89a4d9ae67 cmake+d3d12: d3d12 now builds succesfully on older Windows SDKs, so simplify the checks 2024-05-24 21:48:04 +02:00
capehill
318ab9361b opengl: remove duplicated texture format 2024-05-24 12:16:08 -07:00
Anonymous Maarten
98fcf112e7 d3d12: older Windows SDK headers contain wrong function prototypes
Declare correct function pointers ourselves.
2024-05-24 19:39:45 +02:00
Frank Praznik
ecdcf94c5b wayland: Only restore windowed constraints in configuration events
In some cases, the fullscreen deadline handler can be hit before the associated configure event is received, resulting in the constraints being erroneously restored. The state is doubled buffered, so it shouldn't interfere with the pending fullscreen dimensions, but it isn't correct behavior.

According to the spec, calls to set/unset fullscreen will always have an associated configure event, and the constraints will be reapplied as needed there.
2024-05-24 11:01:13 -04:00
d-musique
535be42b1c Correct name for SDL_CreateThreadWithStackSize() 2024-05-24 07:32:34 -07:00
Sam Lantinga
7a043d9958 Note that SDL_BlitSurface() was renamed SDL_BlitSurfaceScaled() 2024-05-24 05:33:51 -07:00
Sam Lantinga
836e6c1531 Don't toggle modifier state for repeated keys (thanks @dalawren!)
Closes https://github.com/libsdl-org/SDL/pull/9387
2024-05-24 04:44:56 -07:00
Anonymous Maarten
f3695ef34e VC: don't import Microsoft.CPP.UpgradeFromVC[67]0.props projects
Only thing these do is define a _VC80_UPGRADE macro.
2024-05-24 11:13:40 +02:00
Sam Lantinga
9259d532da isVRHeadset returns true for Pico headsets 2024-05-23 17:39:06 -07:00
Sam Lantinga
89caa88b73 Get the definition for SDL_PropertiesID in SDL_thread.h 2024-05-23 17:14:07 -07:00
Sam Lantinga
a3ab46b707 Fixed mapping the touchpad for the Qanba PS5 controllers like the Qanba Drone 2 Arcade Joystick
These controllers are autodetected by the HIDAPI driver, so SDL_GetGamepadTypeFromGUID() should be used to pull the gamepad type out of the GUID.
2024-05-23 16:48:04 -07:00
Sam Lantinga
98a9ca5e32 Added Linux bindings for the Qanba Drone 2 Arcade Joystick 2024-05-23 15:34:38 -07:00
Sam Lantinga
2461bd8648 Removed unnecessary float casts 2024-05-23 15:12:19 -07:00
Semphris
3acca27e95 Dialog: XDG Portals: Remove the file:// URI 2024-05-23 12:54:39 -07:00
Sam Lantinga
6e081eb7dc Memory leak no more! 2024-05-23 11:26:59 -07:00
Sam Lantinga
156ca356b5 Free any temporary environment memory at SDL_Quit()
Fixes https://github.com/libsdl-org/SDL/issues/9860
2024-05-23 11:23:20 -07:00
Cyao
4022682c28 Fix touchid assertion faliure on emscripten 2024-05-23 10:30:24 -07:00
SDL Wiki Bot
66fbbdf46a Sync SDL3 wiki -> header 2024-05-23 17:09:44 +00:00
SDL Wiki Bot
3e8d8f81b4 Sync SDL3 wiki -> header 2024-05-23 17:04:35 +00:00
Frank Praznik
baacbeb4c4 wayland: Make sure the correct cached window dimensions are used when a config size of 0,0 is received
The window may be in a maximized or tiled state, in which case, don't use the floating size.
2024-05-23 11:13:02 -04:00
Frank Praznik
b1061a3ec1 video: Rename 'state_not_floating' to the more descriptive 'tiled' 2024-05-23 10:35:58 -04:00
Frank Praznik
37672f52da wayland: Simplify resize logic
Non-size configuration events are filtered out, so there is no need to enqueue an event when setting the size, as it won't be overwritten in the configure event when only changing state.
2024-05-23 10:35:58 -04:00
scribam
3f1143b4f5 release: fix arm64 Visual Studio build directory
[skip ci]
2024-05-23 13:04:35 +02:00
Ryan C. Gordon
2f2c3afb05 SDL_internal: tweaked comment. 2024-05-22 20:55:28 -04:00
Ryan C. Gordon
48ebc829e4 thread: Fix build, if SDL is built without an external C runtime.
Fixes #9858.
2024-05-22 20:46:44 -04:00
Ryan C. Gordon
25024ea295 windows: Before SDL_main has run, use WideCharToMultibyte, not SDL_iconv.
Otherwise, this will crash if the app sets its own SDL_malloc allocator, since
SDL_iconv uses SDL_malloc.

WideCharToMultibyte lets us calculate the needed memory for the argv[] string
conversions, and then we use the win32 HeapAlloc() API to get some memory
for it.

Fixes #8967.
2024-05-22 20:08:15 -04:00
Anonymous Maarten
86b2f441c0 release: create arm64 Visual Studio binaries
[skip ci]
2024-05-23 00:13:10 +02:00
SDL Wiki Bot
be5d4e5857 Sync SDL3 wiki -> header 2024-05-22 21:40:15 +00:00
SDL Wiki Bot
6429806dce Sync SDL3 wiki -> header 2024-05-22 19:47:56 +00:00
Anonymous Maarten
3c00af1ac6 cmake: preseed CMake cache on MSVC to speed up configuration 2024-05-22 21:03:12 +02:00
Ryan C. Gordon
daf5009395 dialog: fixed typo in docs. 2024-05-22 14:26:50 -04:00
Semphris
93a0db597a Add documentation about dialogs and events 2024-05-22 11:26:03 -07:00
Anonymous Maarten
e10666397e ci: build simple Android SDL app using gradle 2024-05-22 20:19:18 +02:00
Anonymous Maarten
8954e42bcb xcode: cmake scripts inside frameworks in side xcframework differ from the top cmake script 2024-05-22 20:17:13 +02:00
Anonymous Maarten
e10207e831 cmake: disallow '#include "SDL.h"' 2024-05-22 20:17:13 +02:00
Ryan C. Gordon
f2e3437311 include: Fixed headers to not break with wikiheaders. This is a hack for now.
I broke the "Don't taunt wikiheaders" rule.  :)

https://wiki.libsdl.org/SDL3/README/documentation-rules#dont-taunt-wikiheaders
2024-05-22 12:29:30 -04:00
SDL Wiki Bot
b7bb220e60 Sync SDL3 wiki -> header 2024-05-22 15:40:15 +00:00
Ryan C. Gordon
b2ca8fe458 thread: Simplified docs, moved some technical details to a non-wiki comment. 2024-05-22 11:39:43 -04:00
Ryan C. Gordon
b83bb035e6 thread: SDL_CreateThreadWithStackSize is now SDL_CreateThreadWithProperties. 2024-05-22 11:39:43 -04:00
Ryan C. Gordon
0ec716819e thread: Reworked SDL_CreateThread to be consistent across platforms.
Also documented missing and weird bits, rename typedefs to fit SDL standards.
2024-05-22 11:39:43 -04:00
SDL Wiki Bot
983544a53e Sync SDL3 wiki -> header 2024-05-22 00:41:09 +00:00
SDL Wiki Bot
95aa9a79a9 Sync SDL3 wiki -> header 2024-05-22 00:07:49 +00:00
SDL Wiki Bot
7164ca374e Sync SDL3 wiki -> header 2024-05-22 00:06:36 +00:00
SDL Wiki Bot
1f0884ffef Sync SDL3 wiki -> header 2024-05-21 23:59:08 +00:00
Anonymous Maarten
85c87f4140 release: use git archive to get sources 2024-05-22 01:28:44 +02:00
Anonymous Maarten
9b0203d9b1 release: Include pdb in Visual Studio release artifacts + build in C:\temp 2024-05-22 01:28:44 +02:00
Anonymous Maarten
45081db9d4 Build Android prefab in releaser.py script
[ci skip]
2024-05-22 01:28:44 +02:00
Frank Praznik
1f89c407e0 win32: Fix maximized windows when leaving fullscreen
If a window is fullscreen and the maximized state is requested, it needs to be explicitly entered after leaving fullscreen, or the resulting window will be in the maximized state, but still the size of the non-maximized window.
2024-05-21 18:57:55 -04:00
Anonymous Maarten
2123b84fbe SDL_test: add --hide-cursor to help 2024-05-21 22:56:29 +02:00
Dragon-Baroque
05fb91c7b4 TESTWM : Option and Keyboard action to ShowCursor and HideCursor
In include/SDL3/SDL_test_common.h
   Add flag hide_cursor
In src/test/SDL_test_common.c
   Handle option --hide-cursor to SDL_HideCursor
   Handle Ctrl-h toggle to SDL_HideCursor and SDL_ShowCursor
2024-05-21 13:49:35 -07:00
Frank Praznik
888a45977d tests: Check the usable bounds for centered window positioning
SDL now centers windows according to the usable display bounds, so the window centering test requires an update for the new behavior.
2024-05-21 12:26:40 -04:00
Sam Lantinga
f9260a8470 Added an entry for the 8Bitdo Ultimate Wired Controller 2024-05-20 16:44:45 -07:00
Sam Lantinga
5aecd40683 Try to center windows in the usable bounds if they fit
Fixes https://github.com/libsdl-org/SDL/issues/3480
2024-05-20 15:00:26 -07:00
Ryan C. Gordon
78a36830f8 video: Remove MMX codepath from SDL_BlitCopy.
It was only used if SSE wasn't supported (available since the Pentium III in
1999), or the data was aligned to 8 bytes but not aligned to 16 bytes.

The likelihood of ever hitting this codepath seems extremely low.
2024-05-20 16:37:41 -04:00
Susko3
9d03ff6c18 Decrement before as the code makes more sense 2024-05-20 11:08:19 -07:00
Susko3
9458dc07dc Fix double-free on cleanup and general nonsense when deleting fingers 2024-05-20 11:08:19 -07:00
SDL Wiki Bot
71050341d4 Sync SDL3 wiki -> header 2024-05-20 16:46:41 +00:00
Ryan C. Gordon
dd09d4b4ee hidapi: Replace BSD license with "original" hidapi license.
HIDAPI's source code licensing says this:

```
HIDAPI can be used under one of three licenses.

1. The GNU General Public License, version 3.0, in LICENSE-gpl3.txt
2. A BSD-Style License, in LICENSE-bsd.txt.
3. The more liberal original HIDAPI license. LICENSE-orig.txt

The license chosen is at the discretion of the user of HIDAPI. For example:
1. An author of GPL software would likely use HIDAPI under the terms of the
GPL.

2. An author of commercial closed-source software would likely use HIDAPI
under the terms of the BSD-style license or the original HIDAPI license.
```

Since the original license in LICENSE-orig.txt is basically only clause 3 of
the zlib license (do not remove this notice from the source code), it makes
sense to switch to it, since it adds no new requirements to the user.

(Plus, it's extremely short and direct, which is always nice.)

The entire license:

```
 HIDAPI - Multi-Platform library for
 communication with HID devices.

 Copyright 2009, Alan Ott, Signal 11 Software.
 All Rights Reserved.

 This software may be used by anyone for any reason so
 long as the copyright notice in the source files
 remains intact.
```

Fixes #9786.
2024-05-20 12:45:11 -04:00
SDL Wiki Bot
c6cc719067 Sync SDL3 wiki -> header 2024-05-20 01:46:10 +00:00
Frank Praznik
4d32f66fe7 wayland: Don't destroy and recreate the confinement region with window size changes
The spec says that an undefined confinement region should match the input region, so it is resized automatically.

This was a hack for a very old, buggy compositor and is no longer needed.
2024-05-19 10:23:31 -04:00
Sam Lantinga
9d70f1b483 coccinelle doesn't support floating point constants 2024-05-18 16:36:29 -07:00
Frank Praznik
18513d1ce8 wayland: Scale mouse warp coordinates
Fixes warp positioning with scaled windows.
2024-05-18 10:00:53 -04:00
Frank Praznik
b1e01b971b video: Disable mouse warp on fullscreen transitions for Wayland and XWayland
At best, it simply doesn't work, and if it does, it frequently warps the pointer to the wrong position as the window animates in/out of fullscreen mode.

It can also inadvertently trigger the relative warp mode emulation mode on Wayland if a fullscreen transition occurs while the client has the pointer hidden.
2024-05-18 10:00:53 -04:00
Sam Lantinga
6f2621438a Renamed DECLSPEC to SDL_DECLSPEC 2024-05-17 17:09:09 -07:00
Sam Lantinga
2cf32b0e0a Fixed warning: 'fA' may be used uninitialized in this function 2024-05-17 09:42:38 -07:00
APGR22
961488b0dc Added NULL pointer check 2024-05-17 08:54:28 -07:00
Brick
09fbb2a07d WASAPI_WaitDevice: Check current padding before waiting on event
During playback, don't queue another buffer unless there are none in the queue.

During capture, there may be multiple buffers of audio available.
WASAPI_CaptureFromDevice only processes one buffer, and if we always wait on the next event, we will never catch up if it falls behind.
2024-05-17 14:46:20 +01:00
Anonymous Maarten
d3d7c04bf8 testcamera: libSDL3_test destroys the window and renderer
This fixes a "DEBUG: Parameter 'renderer' is invalid" message when exiting testcamera.
2024-05-17 14:39:29 +02:00
Anonymous Maarten
18225f7bb5 libSDL3_test: don't remove windows and renders when quiting
This fixes a "DEBUG: Parameter 'texture' is invalid" message when exiting testcamera.
2024-05-17 14:39:29 +02:00
Anonymous Maarten
a7d4ee05f6 video: hide window before destroying properties
This fixes a few "DEBUG: Parameter 'props' is invalid" messages, when exiting testcamera.
2024-05-17 14:39:29 +02:00
Anonymous Maarten
690875d555 testiconv: free all memory to fix --trackmem 2024-05-17 14:39:29 +02:00
Anonymous Maarten
831c79d32f testatomic: destroy threads + free all memory at quit to fix --trackmem 2024-05-17 14:39:29 +02:00
SDL Wiki Bot
eda9247f01 Sync SDL3 wiki -> header 2024-05-17 12:37:31 +00:00
Brick
b6b9d5508e Renamed SDL_MixAudioFormat to SDL_MixAudio, and use float volume 2024-05-17 13:36:51 +01:00
Sam Lantinga
5c4b558c1c Dynamic API symbol cleanup 2024-05-16 23:18:41 -07:00
Ozkan Sezer
f295f6814c fix type redefinition errors after #9817 2024-05-17 07:28:50 +03:00
Ali Emre Gülcü
f17b556c76 Add SDL_Vulkan_DestroySurface functionality (#9817)
Added SDL_Vulkan_DestroySurface, its documentation and corresponding platform specific implementations. Fixed some header inclusion orders to improve consistency between platforms. Added TODOs regarding MetalView creation and destruction which will benefit from the new functionality.
2024-05-16 17:41:15 -07:00
vittorioromeo
a69eaae32e Add SDL_NODISCARD macro to SDL_begin_code.h 2024-05-16 17:08:52 -07:00
Anonymous Maarten
a50e0319d5 ci: retry package creation multiple times
DMG creation on macOS occasionally fails, so try multiple times
https://gitlab.kitware.com/cmake/cmake/-/issues/25671
2024-05-16 22:55:57 +02:00
Sam Lantinga
7cddde32ac Removed SDL_SWSURFACE, added unsigned suffix for surface flags 2024-05-16 11:40:38 -07:00
Sam Lantinga
c24f860c4d Fixed warning C4244: '=': conversion from 'int' to 'Uint8', possible loss of data 2024-05-16 11:28:02 -07:00
SDL Wiki Bot
919c012d29 Sync SDL3 wiki -> header 2024-05-16 18:24:34 +00:00
Sam Lantinga
abfd0dc683 Added SDL_HINT_JOYSTICK_HIDAPI_PS4_REPORT_INTERVAL 2024-05-16 11:23:29 -07:00
Sam Lantinga
730fa2c379 Re-sorted API functions 2024-05-16 10:22:15 -07:00
Sam Lantinga
02ff85f2f3 Renamed SDL_SIMDGetAlignment() to SDL_GetSIMDAlignment() 2024-05-16 10:22:15 -07:00
Sam Lantinga
4609af618a Updated logging functions for SDL3 naming convention 2024-05-16 10:22:15 -07:00
Ryan C. Gordon
241603b607 README-documentation-rules: Reorganized sections into a more-clear order.
(I hope.)
2024-05-16 12:58:14 -04:00
Frank Praznik
67f3a3ee54 wayland: Disable warp emulation when restoring cursor visibility with the shape protocol 2024-05-16 12:53:54 -04:00
Ryan C. Gordon
241cfaf38f surface: Make a typedef for SDL_Surface bitflags, as is SDL3 policy.
Reference Issue #9812.
2024-05-16 12:29:58 -04:00
Ryan C. Gordon
253c917296 SDL_render.h: Remove unnecessary struct x; before typedef struct x x;. 2024-05-16 12:21:14 -04:00
Ryan C. Gordon
45df084287 SDL_keyboard.h: Added a \sa to SDL_Keysym's docs. 2024-05-16 12:19:50 -04:00
Ryan C. Gordon
665ff8c5f6 include: Removed :: from symbol names in comments.
This isn't C++ code, so there's no need to append global symbols with two
colons. It looks ugly.

I _did_ leave them for actual C++ things in WinRT-specific comments and other
places, like a reference to a Perl class thing.

Also, even though it's not valid C, it's a useful expression to say
`StructType::SpecificField`, so I left those alone, too.
2024-05-16 12:16:57 -04:00
SDL Wiki Bot
10ab623d43 Sync SDL3 wiki -> header 2024-05-16 16:02:15 +00:00
Frank Praznik
9ac523f940 wayland: Set the cursor visibility flag when using the cursor shape protocol 2024-05-16 11:59:10 -04:00
Ryan C. Gordon
5e6d85b8f0 wikiheaders: bridge wiki Category docs to the headers!
Did an initial cleanup on the headers and wrote a few pieces of documentation,
but this needs more work to fill out the documentation.
2024-05-16 11:48:23 -04:00
Sam Lantinga
558630d59c Use ALooper_pollOnce() instead of ALooper_pollAll()
The structure of the existing loop makes the inner loop of the previous commit unnecessary.
2024-05-16 07:53:18 -07:00
Sam Lantinga
7843579358 Revert "Fixed bug #9792 - Android: build failure with ndk 27-beta1 due to use of deprecated ALooper_pollAll"
This reverts commit ee16d2f705.

@madebr's change was simpler and correct.
2024-05-16 07:52:32 -07:00
Sylvain
ee16d2f705 Fixed bug #9792 - Android: build failure with ndk 27-beta1 due to use of deprecated ALooper_pollAll
replace ALooper_pollAll by ALooper_pollOnce
2024-05-16 07:49:54 -07:00
Anonymous Maarten
027856b9fa Revert changes to SDL_androidsensor.c 2024-05-16 16:47:25 +02:00
Anonymous Maarten
88980aeb21 android+test: testcamera needs CAMERA permissions 2024-05-16 16:43:53 +02:00
Oleg
79cabeef18 Added Moza wheelbases VID/PID to wheel devices list 2024-05-15 19:37:30 -07:00
Oleg
dc9d9dd85a Added Simucube wheelbases VID/PID to wheel devices list 2024-05-15 19:37:30 -07:00
Oleg
ce9177b64f Added Cammus C5 wheelbase VID/PID to wheel devices list 2024-05-15 19:37:30 -07:00
Sam Lantinga
fd678ff50f Fixed SDL capitalization 2024-05-15 14:53:52 -07:00
Green Sky
0ee874f02d fix pipewire camera interval fraction inversion
SDL expects an interval fraction to be provided by the backend, but
pipewire provides a framerate fraction, we we just switch them.
2024-05-15 14:42:45 -07:00
Sam Lantinga
fbe7e2e6d3 Moved the SDL version back to SDL_version.h
Added a comment at the top of SDL.h with the current version, for informational purposes
2024-05-15 14:38:29 -07:00
SDL Wiki Bot
c6354252a1 Sync SDL3 wiki -> header 2024-05-15 21:33:30 +00:00
Susko3
e6345716e0 Fix typo 2024-05-15 14:32:11 -07:00
Susko3
968e8c9275 Prefix names with SDL_RENDERER_ 2024-05-15 14:32:11 -07:00
Susko3
8d7f91f8e4 Add defined constants for renderer vsync values 2024-05-15 14:32:11 -07:00
Ryan C. Gordon
4b3b5fb56c docs: Remove some mistakenly-generated pages. 2024-05-15 14:59:26 -04:00
SDL Wiki Bot
60d355eb0b Sync SDL3 wiki -> header 2024-05-15 18:55:12 +00:00
Ryan C. Gordon
d57f2afcaf docs/README-documentation-rules.md: Added more content, fixed a typo. 2024-05-15 14:22:19 -04:00
Sam Lantinga
661f2fc1fc Removed the SDL_Version structure, moved SDL version to SDL.h
Inspired by https://github.com/libsdl-org/SDL/issues/9788
2024-05-15 10:43:31 -07:00
SDL Wiki Bot
5a0879b7dd Sync SDL3 wiki -> header 2024-05-15 17:17:31 +00:00
Susko3
f229e940a4 Fix missing #include in SDL_blendmode.h
Regressed when SDL_BlendMode was changed from an enum to a typedef Uint32.
2024-05-15 10:16:24 -07:00
SDL Wiki Bot
f9876b6b5c Sync SDL3 wiki -> header 2024-05-15 16:46:12 +00:00
Ryan C. Gordon
2066ee08c9 docs/README-documentation-rules.md: Initial shot at documenting this. 2024-05-15 12:33:53 -04:00
Ryan C. Gordon
917c62e55c .wikiheaders-options: there are no more KMOD_ or AUDIO_ symbols in SDL3. 2024-05-15 12:33:53 -04:00
Anonymous Maarten
c7205ab6b5 cmake: don't generate SDL3 jar for CMake versions < 3.19 2024-05-15 18:31:37 +02:00
Petar Popovic
1103294d33 SDL_scancode.h: Updating HID usage tables link 2024-05-14 18:13:21 -07:00
Ryan C. Gordon
1796511782 SDL_revision.h: Put this stuff into the "Version" wiki category. 2024-05-14 15:00:11 -04:00
Ryan C. Gordon
62a7e419f7 wikiheaders: Automatically categorize API symbols by subsystem. 2024-05-14 13:30:42 -04:00
Ryan C. Gordon
17976c1ae1 SDL_filesystem.h: SDL_GLOB_CASEINSENSITIVE was defined twice. 2024-05-14 13:30:41 -04:00
Petar Popovic
3baec8aab4 Renaming SDLK_QUOTEDBL to SDLK_DBLAPOSTROPHE 2024-05-14 08:46:38 -07:00
Sam Lantinga
863a9029ae Added SDL_GlobFlags 2024-05-14 07:13:35 -07:00
Ryan C. Gordon
03b7e02804 include: SDL_GLOB_CASESENSITIVE is associated with SDL_GlobDirectory.
Put it under the function so wikiheaders associates it with the right symbol.
2024-05-14 01:58:04 -04:00
Sam Lantinga
92301ae8a3 Fixed whitespace 2024-05-13 21:52:42 -07:00
Sam Lantinga
9b7f88e512 Pass the VR controller "back" button to the application on the Oculus Quest 2024-05-13 21:01:04 -07:00
Sam Lantinga
84fa11f740 Added missing events in SDL event logging
Also improved formatting for unknown events
2024-05-13 21:01:01 -07:00
Sam Lantinga
be786aeb9d Fixed assertion, it's possible for the OS to grant permissions we haven't asked for. 2024-05-13 19:42:54 -07:00
SDL Wiki Bot
8b5f0d07e9 Sync SDL3 wiki -> header 2024-05-13 23:11:31 +00:00
Frank Praznik
df3fea87d6 wayland: Rework scale-to-display
This extends the display scaling mode to be global and work in terms of pixels everywhere, with the content scale value set on displays. The per-window property had some issues, and has been removed in favor of retaining only the global hint that changes all coordinates to pixel values, sets the content scale on the displays, and generally makes the Wayland backend behave similarly to Win32 or X11.

Some additional work was needed to fix cases where displays can appear to overlap, since Wayland desktops are always described in logical coordinates, and attempting to adjust the display positions so that they don't overlap can get very ugly in all but the simplest cases, as large gaps between displays can result.
2024-05-13 19:10:19 -04:00
SDL Wiki Bot
c7087fea01 Sync SDL3 wiki -> header 2024-05-13 22:07:34 +00:00
Sam Lantinga
5f1e01cce0 Added support for late swap tearing to the Vulkan renderer 2024-05-13 15:06:11 -07:00
Sam Lantinga
17520c2e6e Removed SDL_RendererFlags
The flags parameter has been removed from SDL_CreateRenderer() and SDL_RENDERER_PRESENTVSYNC has been replaced with SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER during window creation and SDL_PROP_RENDERER_VSYNC_NUMBER after renderer creation.

SDL_SetRenderVSync() now takes additional values besides 0 and 1.

The maximum texture size has been removed from SDL_RendererInfo, replaced with SDL_PROP_RENDERER_MAX_TEXTURE_SIZE_NUMBER.
2024-05-13 15:06:11 -07:00
SDL Wiki Bot
678cfd23c0 Sync SDL3 wiki -> header 2024-05-13 21:30:12 +00:00
SDL Wiki Bot
7d6453ea33 Sync SDL3 wiki -> header 2024-05-13 21:24:33 +00:00
Ryan C. Gordon
766de7deff SDL_audio.h: Whoops, one more documentation typo! 2024-05-13 17:24:08 -04:00
Ryan C. Gordon
7bc4bb9f96 SDL_audio.h: Fixed a documentation typo. 2024-05-13 17:23:21 -04:00
Petar Popovic
94cbaaabbf Renaming SDLK_QUOTE and SDLK_BACKQUOTE
Renaming SDLK_QUOTE to SDLK_APOSTROPHE.
Renaming SDLK_BACKQUOTE to SDLK_GRAVE.
This makes them similar to their scancode names.
2024-05-13 11:11:11 -07:00
SDL Wiki Bot
06d6f2cb25 Sync SDL3 wiki -> header 2024-05-13 16:09:32 +00:00
Sam Lantinga
b959203c9b Use SDL_WindowFlags appropriately in SDL test code 2024-05-13 09:08:44 -07:00
Sam Lantinga
fc62dfc6e2 Added properties for the swap chain in the direct3d11 and direct3d12 renderers
Fixes https://github.com/libsdl-org/SDL/issues/9775
2024-05-13 09:06:57 -07:00
Frank Praznik
f4aca6866c test: Free clipboard data after calling SDL_GetClipboardText()
Clipboard allocations were being leaked in two instances.
2024-05-13 10:27:24 -04:00
SDL Wiki Bot
486af58797 Sync SDL3 wiki -> header 2024-05-13 14:14:30 +00:00
Thomas J Faughnan Jr
ad166be1c5 Add SDL_HINT_AUDIO_DEVICE_APP_ICON_NAME 2024-05-13 10:13:01 -04:00
SDL Wiki Bot
8bd0433966 Sync SDL3 wiki -> header 2024-05-13 07:19:15 +00:00
Sam Lantinga
cb416922e3 Fixed compiling with WIN32_LEAN_AND_MEAN
Fixes https://github.com/libsdl-org/SDL/issues/9766
2024-05-12 16:00:21 -07:00
Sylvain
7b252634fd Fixed bug #9672 - v4l2/camera prevent deadlock when there is a delay between SDL_ReleaseCameraFrame and SDL_CloseCamera 2024-05-12 15:58:40 -07:00
Cyao
d4ce9183b8 Update SDL_portaldialog.c
Do not throw error when quitting with escape or closing the window
2024-05-12 09:41:13 -07:00
Anonymous Maarten
a4371d28ac doc: document how to use generator expressions + explain why we no longer provide CMake variables 2024-05-11 17:20:16 -04:00
Sam Lantinga
026edbeab0 Use the correct type for the modifier in SDL_Keysym
This shrinks the structure by 32-bits because we've removed implicit padding between the fields
2024-05-10 17:36:10 -07:00
Sam Lantinga
c95c415a0b Fixed warning C4244: '=': conversion from 'SDL_Keymod' to 'Uint16', possible loss of data 2024-05-10 16:43:09 -07:00
Sam Lantinga
8582bdaab8 Fixed warning C4244: 'function': conversion from 'Uint16' to 'Uint8', possible loss of data 2024-05-10 16:09:11 -07:00
Sam Lantinga
c64d7ed0aa Fixed warning C4244: '=': conversion from 'SDL_Keymod' to 'Uint16', possible loss of data 2024-05-10 16:07:17 -07:00
Sam Lantinga
71f3750ff1 Fixed SDL_GetPathInfo() return value on Windows
Fixes https://github.com/libsdl-org/SDL/issues/9755
2024-05-10 16:01:54 -07:00
Petar Popovic
9c6aa5066a PipeWire: removing log message 2024-05-10 13:06:20 -07:00
Sam Lantinga
a87fa020ac Don't enable enhanced report mode for Bluetooth Nintendo Switch controllers by default
This breaks applications using them in DirectInput mode, which isn't worth just getting battery status. We'll turn on enhanced mode if the application enables sensors.
2024-05-10 12:17:28 -07:00
Sam Lantinga
323bab9305 Fixed warning: implicit conversion loses integer precision: 'SDL_WindowFlags' (aka 'unsigned long') to 'Uint32' (aka 'unsigned int') 2024-05-10 08:56:32 -07:00
Ozkan Sezer
2205626816 SDL_iconv_string: simplify recomputation of outbuf and outbytesleft
Noticed this in SDL-1.2 where gcc-13 emits a -Wuse-after-free warning.
No such warning in SDL2 and SDL3, because unlike SDL1.2, SDL_realloc()
is not a macro expanding to libc realloc(). It warns, of course, if
SDL_realloc() is replaced with plain realloc():

src/stdlib/SDL_iconv.c: In function 'SDL_iconv_string_REAL':
src/stdlib/SDL_iconv.c:824:39: warning: pointer 'oldstring' may be used after 'realloc' [-Wuse-after-free]
  824 |             outbuf = string + (outbuf - oldstring);
      |                               ~~~~~~~~^~~~~~~~~~~~
src/stdlib/SDL_iconv.c:818:30: note: call to 'realloc' here
  818 |             string = (char *)realloc(string, stringsize + sizeof(Uint32));
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2024-05-10 18:50:32 +03:00
Ozkan Sezer
b2fca55e5c SDL_x11sym.h: corrected XQueryKeymap() proto.
Noticed this in SDL-1.2 in a gcc-13 build, which emitted the following
warning:  (No such warnings in SDL2 and SDL3, due to macro differences)

./src/video/x11/SDL_x11sym.h:84:48: warning: argument 2 of type 'char *' declared as a pointer [-Warray-parameter=]
   84 | SDL_X11_SYM(int,XQueryKeymap,(Display* a,char *b),(a,b),return)
      |                                          ~~~~~~^
./src/video/x11/SDL_x11dyn.c:95:15: note: in definition of macro 'SDL_X11_SYM'
   95 |         rc fn params { ret p##fn args ; }
      |               ^~~~~~
In file included from ./src/video/x11/SDL_x11dyn.h:27,
                 from ./src/video/x11/SDL_x11dyn.c:26:
/usr/include/X11/Xlib.h:2980:5: note: previously declared as an array 'char[32]'
 2980 |     char [32]           /* keys_return */
      |     ^~~~~~~~~

The original actually was char[32] but was changed with
8ada1e8a6e
(https://bugzilla.libsdl.org/show_bug.cgi?id=170
https://github.com/libsdl-org/SDL-1.2/issues/101)
2024-05-10 18:50:10 +03:00
SDL Wiki Bot
cd45e0a1ed Sync SDL3 wiki -> header 2024-05-10 14:30:13 +00:00
SDL Wiki Bot
7857d34d2c Sync SDL3 wiki -> header 2024-05-10 01:26:32 +00:00
Sam Lantinga
06a5d4d24f Documented the return value of SDL_GetDateTimeLocalePreferences() 2024-05-09 18:25:22 -07:00
Sam Lantinga
c1ba31118b Added ball, touchpad, and sensor support for virtual joysticks
Fixes https://github.com/libsdl-org/SDL/issues/9542
2024-05-09 18:25:22 -07:00
Ryan C. Gordon
d231edd2ad SDL_dialog.h: Added missing \param lines to callback documentation. 2024-05-09 19:57:36 -04:00
SDL Wiki Bot
5f86f64f06 Sync SDL3 wiki -> header 2024-05-09 23:33:11 +00:00
Sam Lantinga
bcbf09acde Renamed SDL_AttachVirtualJoystickEx() to SDL_AttachVirtualJoystick()
The shorthand version of this function didn't allow specifying a controller name, which seems pretty important. It seems like anyone actually implementing a virtual joystick is going to want to use some of the extended functionality.
2024-05-09 14:05:58 -07:00
Sam Lantinga
598b4e0a1f Removed the limit on the number of supported renderer texture formats
Fixes https://github.com/libsdl-org/SDL/issues/9056
2024-05-09 13:30:07 -07:00
Wim Taymans
f3d79ad75f camera: make things work on older PipeWire 2024-05-09 13:19:27 -07:00
Wim Taymans
fb429f0dfe camera: work around old PipeWire versions 2024-05-09 13:19:27 -07:00
Wim Taymans
8186e4b322 camera: don't use newer PipeWire cleanup features 2024-05-09 13:19:27 -07:00
Wim Taymans
2b9ac185cd camera: improve PipeWire version checks
Remove the custom server version check. We can easily do this as part of
starting the hotplug loop. Check that we are at least running against a
1.0.0 server.

Log the compiled, linked, server and required versions.

Check that we are compiled and linked with the right version before using
the time symbol of a struct.
2024-05-09 13:19:27 -07:00
Wim Taymans
da06e67b1b camera: PipeWire 24 bits formats are endianness independent 2024-05-09 13:19:27 -07:00
Wim Taymans
3c7bccfb2b camera: clean up format table some more
Move the common formats outside of the ifdef
2024-05-09 13:19:27 -07:00
Wim Taymans
55d4b44441 camera: move PipeWire camera first in list
If it fails, we fall back to the next one, which is v4l2.
2024-05-09 13:19:27 -07:00
Wim Taymans
5d779153b2 camera: pipewire: only list formats with valid mapping 2024-05-09 13:19:27 -07:00
Wim Taymans
a340748c06 camera: add PipeWire camera support
The PipeWire camera will enumerate the pipewire Video/Source nodes with
their formats.

When capturing is started, a stream to the node will be created and
frames will be captured.
2024-05-09 13:19:27 -07:00
Ozkan Sezer
890ceb4ac4 SDL_stdinc.h: add fallback cases for SDL_SINT64_C and SDL_UINT64_C
These are needed when INT64_C and UINT64_C macros are either not
available (not likely), or guarded by __STDC_LIMIT_MACROS in C++
compilations (which is the case in many old SDKs.)
2024-05-09 20:55:56 +03:00
Ryan C. Gordon
9245084c06 SDL_video.h: Added a \sa from SDL_GLContext to SDL_GL_CreateContext. 2024-05-09 13:51:26 -04:00
Frank Praznik
87374af0a5 cocoa: Fix the window position when resizing
Cocoa will resize the window from the bottom-left instead of the top-left, so the position must be preserved when setting the new size.
2024-05-09 13:46:06 -04:00
Sam Lantinga
54fb629da5 SDL_WindowFlags is now 64-bit
Fixes https://github.com/libsdl-org/SDL/issues/7321
2024-05-09 10:39:54 -07:00
Susko3
895586c928 Use 1u literal for flags/masks calculation
Changes `1 <<` and `1<<` to use `1u`.
2024-05-09 10:29:48 -07:00
Sam Lantinga
1944c009e9 SDL_Keycode is now Uint32 2024-05-09 10:00:46 -07:00
SDL Wiki Bot
d3e28f3ab8 Sync SDL3 wiki -> header 2024-05-09 16:18:35 +00:00
Sam Lantinga
33e7238268 Clarified the meaning of the cursor hotspot (thanks @nbriggs!)
Fixes https://github.com/libsdl-org/sdlwiki/issues/380
2024-05-09 09:16:46 -07:00
Sam Lantinga
3947356282 Removed obsolete documentation 2024-05-09 09:01:27 -07:00
Sam Lantinga
88fc529261 Removed misleading documentation for SDL_AppEvent()
Fixes https://github.com/libsdl-org/SDL/issues/9731
2024-05-09 09:01:27 -07:00
SDL Wiki Bot
793622ff1c Sync SDL3 wiki -> header 2024-05-08 21:48:12 +00:00
SDL Wiki Bot
a5e49cc4e8 Sync SDL3 wiki -> header 2024-05-08 19:36:35 +00:00
Frank Praznik
1f43c88220 time: Use a function instead of properties to retrieve the system date and time locale info
This allows applications to re-query the values if the system locale is changed during runtime, and better matches the other locale functions. A note is included in the documentation mentioning that this can be slow, as it has to call into OS functions.

Also allows for the removal of the init/quit time functions, as they are no longer needed.
2024-05-08 15:35:04 -04:00
Ozkan Sezer
e909c0360f remove most of SDL_OutOfMemory() calls where SDL is the allocator.
Since commit 447b508a77, SDL_malloc,
SDL_calloc, and SDL_realloc already calls SDL_OutOfMemory().
2024-05-08 20:00:50 +03:00
SDL Wiki Bot
7abc589438 Sync SDL3 wiki -> header 2024-05-08 16:56:38 +00:00
Frank Praznik
7d47d16526 kmsdrm: Report the panel orientation hint property
Queries the "panel orientation" property on the connector and reports it in degrees of clockwise rotation via the 'SDL.display.KMSDRM.panel_orientation' display property.

This is provided by the kernel as a hint to userspace applications, and the application itself is ultimately responsible for any required coordinate transformations needed to conform to the requested orientation.
2024-05-08 12:55:19 -04:00
Semphris
0411633bb2 Fixes and improvements for dialogs 2024-05-08 09:08:43 -07:00
Daniel Ludwig
22bcee3318 VisualC-GDK: Fix Xbox builds 2024-05-08 08:58:29 -07:00
SDL Wiki Bot
8af26cf463 Sync SDL3 wiki -> header 2024-05-08 07:53:33 +00:00
Ryan C. Gordon
e14ba41689 Some minor documentation tweaks. 2024-05-08 03:52:31 -04:00
Sam Lantinga
04be04c338 Removed mostly unused SDL_errorcode 2024-05-07 15:45:06 -07:00
Sam Lantinga
afe7c7a644 Changed SDL_ClearError() to always return 0.
This will provide a quick and easy way of clearing the error when a function succeeds, if we want to do that in a more widespread way.

For now we guarantee that SDL_Init() will never have an error set when it returns successfully.

Fixes https://github.com/libsdl-org/SDL/issues/8421
2024-05-07 15:45:06 -07:00
Sam Lantinga
991d28ae37 Use SDL_MessageBoxFlags and SDL_MessageBoxButtonFlags appropriately 2024-05-07 13:41:12 -07:00
Sam Lantinga
748490677c Use SDL_RendererFlags in the API (thanks @Sackzement!) 2024-05-07 13:41:12 -07:00
Anonymous Maarten
818721fc9d ci: disable building docs on mingw32/clang32
See https://github.com/msys2/MINGW-packages/pull/20085
2024-05-07 22:35:31 +02:00
SDL Wiki Bot
4928d0e479 Sync SDL3 wiki -> header 2024-05-07 19:25:31 +00:00
Sam Lantinga
aecb62e30d Improved API consistency for flag data types
Flag data types are always unsigned and have the valid values following the typedef.
2024-05-07 12:24:37 -07:00
Ryan C. Gordon
1d2b00efe1 wikiheaders: A few fixes that the SDL2 branch exposed. 2024-05-07 14:23:19 -04:00
Sam Lantinga
537c62f4c1 Fixed memory leak cleaning up mouse and keyboard instances
Fixes https://github.com/libsdl-org/SDL/issues/9487
2024-05-07 09:26:18 -07:00
Sam Lantinga
53a45a4437 Fixed inconsistent hint names (thanks @Sackzement!)
Fixes https://github.com/libsdl-org/SDL/issues/9643
2024-05-07 08:47:25 -07:00
Anonymous Maarten
9aff68746f cmake: add khronos include directories with PRIVATE visibility 2024-05-07 17:37:21 +02:00
hwsmm
7bcbc48c61 wasapi: Fix a type mismatch in QueryInterface
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
2024-05-07 10:27:23 -04:00
hwsmm
8252f59668 wasapi: Use IAudioClient3 if possible to make use of sample_frames 2024-05-07 10:27:23 -04:00
Susko3
56feecc17d Fix property cleanup callback not being called on error (#9663)
The documentation for `SDL_SetPropertyWithCleanup` mentions that the cleanup function
is called upon failure. But this wasn't working in the code.
2024-05-06 14:50:28 -07:00
Sam Lantinga
01d560df50 Added a Windows mapping for the SPEEDLINK STRIKE Gamepad
Fixes https://github.com/libsdl-org/SDL/issues/9705
2024-05-06 10:11:26 -07:00
Miku AuahDark
86fada6faa Android: Implement open and save file dialog. 2024-05-06 09:33:48 -07:00
SDL Wiki Bot
ea1904eda1 Sync SDL3 wiki -> header 2024-05-06 16:09:31 +00:00
Petar Popovic
45ac1a09d9 System dependent 64 bit integer suffixes
Added macros SDL_SINT64_C() and SDL_UINT64_C().
Integer suffixes of SDL_MAX_SINT64, SDL_MIN_SINT64, SDL_MAX_UINT64
and SDL_MIN_UINT64 are now system dependent.
2024-05-06 09:08:49 -07:00
SDL Wiki Bot
d7d3028765 Sync SDL3 wiki -> header 2024-05-06 16:06:32 +00:00
Miku AuahDark
33ae7e38d6 Android: Allow SDL_IOFromFile to open content:// URI. (#9696) 2024-05-06 09:05:49 -07:00
hwsmm
61c99c0da7 x11: Fix text input not being null-terminated 2024-05-06 07:51:50 -07:00
Ryan C. Gordon
353001e077 wikiheaders: Fixed LaTeX chapter list and symbol sorting. 2024-05-05 02:44:45 -04:00
Ryan C. Gordon
b181e7b1ca wikiheaders: LaTeX output support.
Reference Issue #9440.
2024-05-05 02:03:44 -04:00
Ryan C. Gordon
0768e0e431 wikiheaders: Fixed See Also section in --copy-to-headers.
This broke when the list bullet markdown was fixed, and then the fixed wiki
data was copied back to the headers.
2024-05-05 01:53:37 -04:00
Ryan C. Gordon
5dc207b3b6 include: Fix a preformatted piece of documentation that isn't C code. 2024-05-05 01:22:46 -04:00
Ryan C. Gordon
a16b76cf80 wikiheaders: Markdown should use '-' for unordered lists, not '*'. 2024-05-05 01:22:45 -04:00
Anonymous Maarten
8f4cab0f83 ci: fix dmg release artifacts
- build-release.py: use absolute paths instead of resolved paths
- xcode: run the shell script with 'set -ex' for extra verbosity +
  failing when an error happens
- On macOS ci, /tmp resolves to /private/tmp, causing the shell script
  to not find the SDL3.xcframework. So don't  use /tmp.
2024-05-05 01:30:07 +02:00
Miku AuahDark
84c69d0f9f gendynapi.py: Fix output line ending when running in non-cygwin Windows. 2024-05-04 08:11:07 -07:00
SDL Wiki Bot
7856c8fb8f Sync SDL3 wiki -> header 2024-05-03 19:40:33 +00:00
Ryan C. Gordon
cf0b5db9e1 SDL_system.h: Improve window message hook documentation. 2024-05-03 15:37:11 -04:00
Ryan C. Gordon
a04abd78d3 SDL_filesystem.h: Add a \sa from SDL_GetUserFolder to SDL_Folder.
Reference https://github.com/libsdl-org/sdlwiki/issues/522
2024-05-03 15:24:06 -04:00
SDL Wiki Bot
27b931a8a0 Sync SDL3 wiki -> header 2024-05-03 18:11:35 +00:00
Semphris
06b9d88682 Add more links in SDL_dialog documentation 2024-05-03 11:10:03 -07:00
Ryan C. Gordon
77f4ffcc79 wikiheaders: Don't list SDL property #defines below functions.
They will still generate "please refer to" pages, though.
2024-05-03 13:19:27 -04:00
Ryan C. Gordon
a790a67883 include: Filling in more documentation gaps. 2024-05-03 13:19:26 -04:00
Ryan C. Gordon
92bd7d99dd wikiheaders: Deal with multiline typedefs.
This happens more than once with function pointer typedefs.

Reference Issue #9440.
2024-05-03 13:01:20 -04:00
Ryan C. Gordon
3473cef7df surface: SDL_blit is not used in the public API, remove it from headers. 2024-05-03 12:57:09 -04:00
SDL Wiki Bot
7559acaf75 Sync SDL3 wiki -> header 2024-05-03 16:34:33 +00:00
Frank Praznik
3979ea8ed0 tests: Add a pointer warp test to testmouse
Press 'c' to center the pointer in the window using relative coordinates via SDL_WarpMouseInWindow().

Press alt+'c' to center the pointer in the window using global coordinates via SDL_WarpMouseGlobal().
2024-05-03 12:33:19 -04:00
Frank Praznik
3a6d9c59f4 wayland: Add mouse pointer warp support
The pointer confinement protocol does allow attempted warping the pointer via a hint, provided that the pointer is locked at the time of the request, and the requested coordinates fall within the bounds of the window.

Toggle the pointer locked state and request the pointer warp when the required protocol is available. This is similar to what XWayland does internally.
2024-05-03 12:33:19 -04:00
Sam Lantinga
22016228ca Fixed build 2024-05-03 09:25:54 -07:00
Sam Lantinga
b18a071639 Removed SDL_DROPEVENT_DATA_SIZE and SDL_TEXTEDITINGEVENT_TEXT_SIZE
Fixes https://github.com/libsdl-org/SDL/issues/9681
2024-05-03 09:19:49 -07:00
Sam Lantinga
63979f04c8 Don't pass the sentinel event to event callbacks
This is just for internal use and we don't need to incur the overhead of calling callback and watchers for this event.
2024-05-03 09:00:41 -07:00
SDL Wiki Bot
a03829d636 Sync SDL3 wiki -> header 2024-05-03 13:59:29 +00:00
Ryan C. Gordon
31a45d7cb3 SDL_main.h: Document SDL_main. 2024-05-03 09:58:05 -04:00
Ryan C. Gordon
21c181b3b4 SDL_main.h: Minor documentation tweaks. 2024-05-03 09:48:27 -04:00
SDL Wiki Bot
e86f22b52b Sync SDL3 wiki -> header 2024-05-03 13:42:29 +00:00
Ryan C. Gordon
d570fd7c2c SDL_main.h: Document SDL_MAIN_USE_CALLBACKS. 2024-05-03 09:41:02 -04:00
SDL Wiki Bot
3bd04e5a34 Sync SDL3 wiki -> header 2024-05-03 13:32:31 +00:00
Ryan C. Gordon
3348d0caaf wikiheaders: Deal with SDLMAIN_DECLSPEC functions. 2024-05-03 09:31:27 -04:00
SDL Wiki Bot
ab5b904890 Sync SDL3 wiki -> header 2024-05-03 03:27:33 +00:00
Ryan C. Gordon
0e0bb22f79 include: More documentation updates. 2024-05-02 23:25:45 -04:00
Ryan C. Gordon
46b69af5a3 SDL_vulkan.h: Remove Tizen compatibility typedefs.
Any app for this system that wants to move to SDL3 will have to adjust to
all the other API changes anyhow, so there's no need to keep these anymore.

Fixes #9678.
2024-05-02 23:25:44 -04:00
SDL Wiki Bot
10c2682647 Sync SDL3 wiki -> header 2024-05-03 02:54:35 +00:00
Ryan C. Gordon
760d7d276b include: Filled in some missing documentation. 2024-05-02 22:53:08 -04:00
Brick
1c6ba2a9ab Disable SDL_DYNAMIC_API during __INTELLISENSE__
Stops visual studio showing multiple definitions for all the functions
2024-05-02 17:48:27 -07:00
Ethan Lee
7327fd734c macOS: Do not use the system iconv by default.
macOS 14 changes the iconv implementation which causes things to break, so we may as well match macOS with all the other platforms now.
2024-05-02 17:42:36 -07:00
Sam Lantinga
db43a6b418 testcamera: open the camera using the highest framerate available 2024-05-02 12:27:20 -07:00
Sam Lantinga
d4dc613559 Allow specifying only some SDL_CameraSpec fields when opening a camera
This allows setting the size without format, or FPS without size, etc.
2024-05-02 12:25:39 -07:00
Sam Lantinga
861815e51d Fixed camera FPS matching 2024-05-02 12:12:20 -07:00
Sam Lantinga
53bec8b7b7 Fixed updating NV12 textures when using the D3D11 render driver 2024-05-02 11:40:28 -07:00
Sam Lantinga
e6e1412e20 testcamera: create the texture as a streaming texture, since we'll update it every frame.
Also set the window size to the camera texture size
2024-05-02 11:40:28 -07:00
Sam Lantinga
eb26f439d8 Fixed crash when the graphics driver is upgraded while the renderer is running 2024-05-02 11:40:28 -07:00
Anonymous Maarten
a8526f5a19 cmake: disable documentation installation by default 2024-05-02 19:54:37 +02:00
Semphris
4ac8968f65 Fix improper handling of NULL dialog filter on Cocoa 2024-05-02 10:18:31 -07:00
Ryan C. Gordon
9f842e9b5a wikiheaders: Bind #defines below a function to it, like typedefs.
This effectively adds the property symbols for various functions to the
function's wiki page.
2024-05-02 12:49:30 -04:00
Semphris
0178b19489 Add '/' to GetUserFolder(HOME) on Cocoa & Unix 2024-05-02 08:51:58 -07:00
Ryan C. Gordon
eb2c9e9235 wikiheaders: added --report-coverage-gaps to see what we aren't covering! 2024-05-01 19:58:21 -04:00
Frank Praznik
05c5b3398f wayland: Clean up xdg_dialog objects with toplevel windows 2024-05-01 15:18:23 -04:00
Sam Lantinga
d95f5bad24 Updated to version 3.1.2 for the preview release 2024-05-01 09:34:25 -07:00
Sam Lantinga
e52a2474f1 Fixed updating CMakeLists.txt with update-version.sh 2024-05-01 09:33:30 -07:00
Ryan C. Gordon
12b6c17575 wikiheaders: Generate wiki pages for defines under a typedef.
These are just there to handle cases where a user stumbles upon a symbol
and punches it into the wiki, so they don't get a 404 for it, but rather
a pointer to where that symbol is relevant.

These pages are generated in the wiki if they don't exist, and are never
overwritten, in case text has been added to them. They are also not bridged
back to the headers or added to the set of manpages.
2024-04-30 22:47:02 -04:00
Ryan C. Gordon
a24d30e911 wikiheaders-options: Correct project full name. 2024-04-30 21:46:56 -04:00
Ryan C. Gordon
5481ea4cd4 wikiheaders: manpages See Also sections should specify 3 vs 3type. 2024-04-30 21:46:56 -04:00
Ryan C. Gordon
9210c68c44 wikiheaders: Manpages go in man3 directory, even if they're 3type. 2024-04-30 21:46:56 -04:00
Petar Popovic
dec872bdd9 Fix SDL_GetDaysInMonth() num days in january 2024-04-30 18:06:41 -07:00
Semphris
b9d3d746a0 Add trailing path separator to SDL_GetUserFolder() 2024-04-30 18:01:16 -07:00
SDL Wiki Bot
97d0e78842 Sync SDL3 wiki -> header 2024-04-30 17:48:27 +00:00
Semphris
c6a70d6898 Add support for modal windows to more platforms
- Adds support for modal windows to Win32, Mac, and Haiku, and enhances functionality on Wayland and X11, which previous set only the parent window, but not the modal state.
- Windows can be declared modal at creation time, and the modal state can be toggled at any time via SDL_SetWindowModalFor() (tested with UE5 through sdl2-compat).
- Allows dynamic unparenting/reparenting of windows.
- Includes a modal window test.
2024-04-30 13:47:57 -04:00
Sam Lantinga
97f7b4620a Fixed building with GDK (thanks @Romans-I-XVI!)
(cherry picked from commit 1caa427035)
2024-04-30 10:22:56 -07:00
Austin Sojka
42d7225a62 Added GDK app constrained/unconstrained events (#9608)
(cherry picked from commit 7554e82ec3)
2024-04-30 10:21:59 -07:00
Semphris
2b7af6636f Fix dialogs on Windows
This fixes a bunch of issues with dialogs on Windows.

- Removed lpstrFileTitle assignation, which overwrote the buffer
- Increased the memory size available for long file selections
- Removed seemingly unused `default_folder` in win_Args struct
- Properly handle the case where only one file is selected in multiselect mode
- Properly handle the initial folder, which would fail in specific conditions

The details for the last entry are explained in a comment in the code.
2024-04-30 10:17:46 -07:00
Ravbug
2f8cfce154 Fix SDL_main on UWP with C++20
/ZW is incompatible with C++20, so disable the #error in that case. In addition, define a main function because UWP in C++20 mode links to standard main.
2024-04-30 10:16:32 -07:00
Nhalrath
8eeaa815d9 docs: rename num to size in SDL_iostream 2024-04-30 10:16:10 -07:00
Susko3
5045680628 Override onTrimMemory() instead of onLowMemory()
https://developer.android.com/reference/android/content/ComponentCallbacks#onLowMemory()

> Preferably, you should implement ComponentCallbacks2#onTrimMemory from ComponentCallbacks2 [...].
> That API is available for API level 14 and higher, so you should only use this onLowMemory() method as a fallback for older versions.

Since the SDL3 min api level is 19, there's no need for `onLowMemory()` compat.
2024-04-30 08:54:19 -07:00
SDL Wiki Bot
556d9b8497 Sync SDL3 wiki -> header 2024-04-30 10:45:12 +00:00
SDL Wiki Bot
8b06473a11 Sync SDL3 wiki -> header 2024-04-29 20:53:27 +00:00
Petar Popovic
7bfecacc02 Removing function macro SDL_TABLESIZE() 2024-04-29 13:52:48 -07:00
Petar Popovic
8d0ad44edd Adding tag names to enums
Adding tag names to following enums:
SDL_JoystickType, SDL_JoystickConnectionState, SDL_TouchDeviceType, SDL_DUMMY_ENUM
2024-04-28 16:09:37 -07:00
Petar Popovic
dffbb574ea renaming SDL_eventaction tag to SDL_EventAction 2024-04-28 16:09:09 -07:00
SDL Wiki Bot
3f2f712fff Sync SDL3 wiki -> header 2024-04-28 12:29:13 +00:00
Sam Lantinga
0df12d223c Fixed crash cleaning up text
Text needs to be cleaned up before the renderer is freed.
2024-04-26 19:32:20 -07:00
Tyson Whitehead
0ab5a8a413 Initialize udev before joystick manual scan so class lookup works
LINUX_JoystickInit does a manual scan first so devices are sorted.
If SDL_UDEV_Init hasn't run by then, then the product info cannot
be looked up by SDL_UDEV_GetProductInfo and the initial-plugged-
in-device classification falls back to heuristic guessing.

(cherry picked from commit 0963c11af8)
2024-04-26 12:16:24 -07:00
SDL Wiki Bot
d42d661498 Sync SDL3 wiki -> header 2024-04-26 18:04:12 +00:00
Anonymous Maarten
817c45fc64 ci: build SDL on macos 13 (x86_64) 2024-04-26 17:09:31 +00:00
Petar Popovic
410a3c2c37 .gitignore: Adding compile_commands.json and .cache/ 2024-04-26 08:48:22 -07:00
Sam Lantinga
14f584a94b SDL_CreateWindowAndRenderer() takes the window title as the first parameter
Fixes https://github.com/libsdl-org/SDL/issues/9626
2024-04-25 20:00:14 -07:00
Sam Lantinga
2d7cc6ded0 Fixed getting the renderer info when creating a window texture 2024-04-25 17:32:56 -07:00
Sam Lantinga
ca61bf682a Make sure output parameters are zeroed in the case of an error 2024-04-25 16:46:44 -07:00
Sam Lantinga
04f1901751 Fixed window flashing under X11 when creating a window and OpenGL renderer 2024-04-25 16:42:43 -07:00
Ethan Lee
26b71d14e9 storage: Static analysis fix 2024-04-25 19:40:07 -04:00
SDL Wiki Bot
57f96fb124 Sync SDL3 wiki -> header 2024-04-25 21:23:14 +00:00
SDL Wiki Bot
1b8d4d77d6 Sync SDL3 wiki -> header 2024-04-25 21:01:12 +00:00
Ryan C. Gordon
2ee1c87eb0 wikiheaders: Fixed preprocessor line check to include #endif.
Reference Issue #9557.
2024-04-25 16:46:43 -04:00
Ryan C. Gordon
6b1a98e664 wikiheaders: Allow basic typedefs to pull in some preprocessor logic.
Reference Issue #9557.

This lets SDL_AudioFormat have the `#if byteorder == lilendian` section.
2024-04-25 16:44:09 -04:00
SDL Wiki Bot
a13bdeee8a Sync SDL3 wiki -> header 2024-04-25 20:40:14 +00:00
Petar Popovic
e0b45fed06 testlock.c: replace function call kill with raise
Replacing function call `kill(0, SIGINT);` with `(void)raise(SIGINT);` in file test/testlock.c.
The `kill()` function is not available on Unix systems when compiling without system extensions enabled.
2024-04-25 15:11:08 -04:00
Ryan C. Gordon
d29b861a76 wikiheaders: Allow blank lines in post-typedef #define blocks.
Reference Issue #9557.
2024-04-25 14:26:49 -04:00
Sam Lantinga
ac5a61cd60 Fixed build error (thanks @sezero!) 2024-04-25 09:45:10 -07:00
Tyson Whitehead
391b8c0c07 Avoid opening non-joystick devices if possible to speedup scanning
Closing a device file takes 0.01 to 0.5s, which can add up to
significant startup delays. The udev classification does not
require opening the actual device files, so, use it if possible,
and only fall back to opening the device and probing otherwise.

(cherry picked from commit 45b804c158)
2024-04-25 08:49:48 -07:00
Ryan C. Gordon
2fb024ab8e wikiheaders: Defines directly following a non-struct typedef are documented.
The idea is that if you have a `typedef Uint32 MyFlags` that has a bunch of
defines that are meant to be bitflags, you can pack them into the same wiki
page automatically.

This only works with `typedef`s that are _not_ struct/union/enums, and it
only pulls in `#define` lines that immediately follow the typedef line.
Even a blank line or a comment will signal to stop including lines for
this page!
2024-04-25 03:02:27 -04:00
SDL Wiki Bot
47ff4addd4 Sync SDL3 wiki -> header 2024-04-25 06:37:31 +00:00
Ryan C. Gordon
2733345422 SDL_audio.h: Documentation updates. 2024-04-25 02:36:08 -04:00
Ozkan Sezer
3959765b81 SDL_waylandvulkan.c: fix type redefinition errors.
Fixes https://github.com/libsdl-org/SDL/issues/9620
2024-04-25 03:50:00 +03:00
SDL Wiki Bot
ceeefb0512 Sync SDL3 wiki -> header 2024-04-24 20:43:29 +00:00
Ryan C. Gordon
cdb3cea76d SDL_atomic.h: Documentation updates. 2024-04-24 16:42:16 -04:00
Ryan C. Gordon
ec97857a87 SDL_assert.h: Documentation improvements. 2024-04-24 15:17:31 -04:00
Sam Lantinga
e56f05bac1 Fixed unclipping the mouse when a monitor is placed left of the primary one on Windows.
There is now a desktop bounds variable that could potentially be exposed in the API if we wanted.
2024-04-24 12:06:00 -07:00
SDL Wiki Bot
5fbc038375 Sync SDL3 wiki -> header 2024-04-24 17:20:14 +00:00
Frank Praznik
b41699e9c4 event: Always clear the mouse capture flag, even if the backend capture function isn't implemented.
Some backends, such as Wayland, don't support explicit mouse capture, and thus don't implement the backend function to do so, but do set/unset the capture flag on button events to handle cases where a button is pressed and the pointer is dragged outside the window.

If the backend doesn't support explicitly setting the mouse capture mode, manually clear the capture flag when the window has had the focus forcibly removed, to avoid sending bogus motion events as well as an assert condition.
2024-04-24 12:40:56 -04:00
Sam Lantinga
98582dca02 Fixed Win+V handling (pasting from clipboard history) on Windows
Fixes https://github.com/libsdl-org/SDL/issues/9613
2024-04-24 09:35:19 -07:00
Sam Lantinga
30d93fb29b Relax, it's not that exciting :) 2024-04-24 09:19:38 -07:00
Ryan C. Gordon
4a11809370 SDL_TextInputEvent: Note that text field is UTF-8 encoded.
Reference Issue https://github.com/libsdl-org/sdlwiki/issues/516
2024-04-24 11:18:35 -04:00
Petar Popovic
b98116a996 Removing trailing commas in enums in SDL headers
Trailing commas in enums is a C99 feature.
This commit removes them in SDL headers for ANSI compatibility.
2024-04-24 09:44:41 -04:00
Ryan C. Gordon
be6b8dead4 CaseFoldUtf8String: Fixed to actually work with Unicode values.
I think this started off as a UTF-32 output, and I forgot to actually
finish this off to encode back to UTF-8.

Fixes #9607.
2024-04-23 18:57:48 -04:00
Sam Lantinga
8acb91936a Fixed warning, needs more work by @icculus 2024-04-23 14:35:55 -07:00
Sam Lantinga
bcd2807065 Fixed warning C4244: 'initializing': conversion from 'int' to 'SDL_AudioFormat', possible loss of data 2024-04-23 14:12:05 -07:00
Ryan C. Gordon
42579e2af1 docs: Remove README-hg.md
It's been a few years in general, and SDL3 has never been in Mercurial.

We'll leave this document alive in the SDL2 branch, though!
2024-04-23 15:48:29 -04:00
Ryan C. Gordon
30970780a9 include: Fixed some old Doxygen markup to be Markdown instead. 2024-04-23 14:38:04 -04:00
Frank Praznik
7729a8b5c3 x11: Don't try to capture mouse input via X when XInput2 is in use
Trying to capture the pointer via XGrabPointer() when XInput2 is in use will always fail with 'AlreadyGrabbed', since the pointer is already grabbed by XInput2.
2024-04-23 11:59:36 -04:00
Sam Lantinga
42f8e94d11 mac: Fix SDLWindow nswindow member no longer being cleaned up in Cocoa_DestroyWindow
- A refactor changed how SetupWindowData handled external windows where previously it was tracked
  in a field of SDL_CocoaWindowData but now it is tracked by setting SDL_WINDOW_EXTERNAL in the
  window flags. Removed the now unused field and updated the external window check in DestroyWindow.
2024-04-23 06:20:30 -07:00
Ryan C. Gordon
cfabb7a9ac wikiheaders-options: Clean up header file info a bit more. 2024-04-22 23:54:40 -04:00
Brick
c9cfc681b9 Workaround GCC bug in audio resampler 2024-04-22 18:38:55 -04:00
Ryan C. Gordon
acf811a06b Revert "dynapi: Remove unused ENABLE_SDL_CALL_LOGGING code."
This reverts commit 9128f92f38.

Apparently this is useful for debugging from time to time!
2024-04-22 17:01:07 -04:00
Ryan C. Gordon
3dcacd2dc8 wikiheaders_options: People can include specific headers if they want!
Fixes #9536.
2024-04-22 16:59:31 -04:00
yassineimounachen
5ffb2f47d1 Add USB IDs for the Thrustmaster TS-XW racing wheel
To be of use, this depends on https://github.com/berarma/oversteer/pull/200 and https://github.com/Kimplul/hid-tmff2/pull/94.
2024-04-22 11:35:31 -07:00
Ryan C. Gordon
39d0e62ef5 dynapi: Remove DISABLE_JUMP_MAGIC.
The "jump magic" codepath was never written, and would have involved a lot
of low-level and platform/processor/compiler specific work.

A better solution is for compilers to treat the function call in the jump
table functions as a tail call, which would effectively produce the same
result in a portable way.

Clang already has a way to do this that we could add later. But this wouldn't
need a separate "jump magic" section.
2024-04-21 22:16:48 -04:00
Ryan C. Gordon
9128f92f38 dynapi: Remove unused ENABLE_SDL_CALL_LOGGING code.
This was hardcoded to disabled, since building it in bloated the binary
massively for little gain (one could probably accomplish this same thing
with ltrace or something).

If we need it, we'll pull it out of revision control.
2024-04-21 22:13:43 -04:00
Ryan C. Gordon
7a36504952 storage: SDL_WriteStorageFile() wasn't marked as SDLCALL.
Fixes #9594.
2024-04-21 09:26:07 -04:00
Erik Scholz
c623bd2fdc reword SDL_BlitSurfaceScaled param
so it will link to the type in the docs/wiki
2024-04-20 07:51:40 -07:00
Frank Praznik
fb4c15319e pipewire: Raise minimum build version to 0.3.44 2024-04-19 12:34:22 -04:00
Frank Praznik
566d142938 tests: Clean up the renderer in the video test suite since it isn't automatic anymore. 2024-04-19 12:23:40 -04:00
Frank Praznik
bede245395 Remove references to renderers being destroyed with windows in the documentation 2024-04-19 12:23:40 -04:00
Ryan C. Gordon
cab3defc18 render: SDL_DestroyWindow hollows out its renderer but doesn't free it.
This allows apps to destroy the window and renderer in either order, but
makes sure that the renderer can properly clean up its resources while OpenGL
contexts and libraries are still loaded, etc.

If the window is destroyed first, the renderer is (mostly) destroyed but its
pointer remains valid. Attempts to use the renderer will return an error,
but it can still be explicitly destroyed, at which time the struct is free'd.

If the renderer is destroyed first, everything works as before, and a new
renderer can still be created on the existing window.

Fixes #9540.
2024-04-19 00:25:59 -04:00
Ryan C. Gordon
39c8434f5f render: Manage memory for SDL_Renderer* at higher level.
Previously, each backend would allocate and free the renderer struct. Now
the higher level does it, so the backends only manage their private resources.

This removes some boilerplate and avoids some potential accidents.
2024-04-19 00:25:59 -04:00
Frank Praznik
09e32faa68 x11: Ensure that a configure event was received before sending the final window size and coordinates
Headless display servers might not send an initial configure event, so don't assume that one has arrived and send garbage size/position values when showing a window.
2024-04-18 14:28:16 -04:00
SDL Wiki Bot
64d5fb6ab6 Sync SDL3 wiki -> header 2024-04-18 17:41:14 +00:00
Anonymous Maarten
911fc9b17e testffmpeg: treat Khronos headers as system headers 2024-04-18 09:10:15 -07:00
devon-artmeier
9c65738926 dialog: Use size_t for length variables (#9572)
Shuts up a warning about size differences.
2024-04-18 09:09:10 -07:00
bootrako
1de8a53015 windows hidapi: fix header compilation 2024-04-18 09:00:49 -07:00
Frank Praznik
0bda7e22cf wayland: Print an error when the display connection is closed by the server
Otherwise, it isn't immediately clear to the client application as to why its windows suddenly disappeared, and it received a quit event out of nowhere.
2024-04-18 11:23:58 -04:00
Frank Praznik
a923db9d0a pipewire: Use the core version info for the preferred version check
When running in a container, the underlying Pipewire version may not match the library version, so retrieve and check the core version info to see if it meets the preferred version requirements.
2024-04-17 22:34:26 -04:00
Ryan C. Gordon
bc6ad3ee43 dialog: convert_ext_list had parameter names in wrong order in header. 2024-04-17 21:45:51 -04:00
Anonymous Maarten
7dd4f1ec22 SDL3 removed SDL_HINT_RENDER_SCALE_QUALITY hint
textures now default to linear filtering, use SDL_SetTextureScaleMode(texture, SDL_SCALEMODE_NEAREST) if you want nearest pixel mode instead
2024-04-17 16:38:15 -07:00
Ryan C. Gordon
093160904d SDL_Keymod: Removed SDL_KMOD_RESERVED.
Fixes #9481.
2024-04-17 17:30:10 -04:00
Frank Praznik
b1e47704ee audio: Prefer Pipewire if at least version 1.0.0
Checking for the pipewire-pulse service is unreliable when used in containers such as Flatpak, so simply use a minimum version check instead and prefer it over the Pulseaudio backend if at least version 1.0.0.
2024-04-17 17:16:28 -04:00
SDL Wiki Bot
2c183c602d Sync SDL3 wiki -> header 2024-04-17 21:09:29 +00:00
Ryan C. Gordon
a18f3d55b7 SDL_iostream.h: Corrected documentation for SDL_ReadIO and SDL_WriteIO.
Fixes #9443.
2024-04-17 17:08:05 -04:00
Mathieu Eyraud
cac1434295 Close pipe in Wayland_ShowMessageBox
When closing message box by pressing escape, Zenity does not write to the pipe and fgets() get stuck waiting for EOF.
2024-04-17 15:27:34 -04:00
Frank Praznik
a2eb2697a3 x11: Fix mode switching when running under XWayland
XWayland emulates the XRandR interface, so it still needs the actual mode switch call to trigger the mode switching emulation.

There is also no need to wait when using XWayland mode switching emulation, as it is handled via viewport scaling and thus instantaneous.
2024-04-17 11:39:49 -04:00
Frank Praznik
bed6c5b81f x11: Wait for mode switches to complete when synchronizing a window
Otherwise, the sync can timeout due to mode switching taking several seconds.
2024-04-17 11:39:49 -04:00
Sam Lantinga
e632ed23ad Fixed compilation with C89 (thanks @d-s-a!)
Closes https://github.com/libsdl-org/SDL/pull/9564

(cherry picked from commit 4e29be814e)
2024-04-17 07:49:19 -07:00
DevonArtmeier
65a04a772e dialog: Allocate space for terminator when building filter string 2024-04-16 14:09:18 -07:00
Ryan C. Gordon
fdcc3e1151 thread: make generic SDL_Condition a no-op if built with SDL_THREADS_DISABLED.
Otherwise, when you call SDL_CreateCondition() in something that can otherwise
survive in a single-threaded build, you'll get an error that seems fatal.

We already do this for mutexes and rwlocks (but not semaphores!)

Fixes #9558.
2024-04-16 15:07:56 -04:00
SDL Wiki Bot
bf0bf80df6 Sync SDL3 wiki -> header 2024-04-16 17:30:27 +00:00
Ryan C. Gordon
db6b6bd75e include: Fixed up some sensor documentation.
Fixes #9468.
2024-04-16 13:29:26 -04:00
Sam Lantinga
650d3b44e1 Removed the word "other" since the version has been removed 2024-04-16 08:52:21 -07:00
Ryan C. Gordon
235bfe2631 SDL_log.h: Remove SDL_MAX_LOG_MESSAGE.
The message length limit was removed in 2.0.24, so there's no need for
this define in SDL3 at all.

Fixes #9467.
2024-04-16 00:31:57 -04:00
Ryan C. Gordon
12b371679f audio: Code defensively to placate static analyzers, don't disabling warnings. 2024-04-15 23:53:56 -04:00
Sam Lantinga
bdd47f7770 Fixed warning: no previous extern declaration for non-static variable 'ResamplerFilter'
Fixes https://github.com/libsdl-org/SDL/issues/9556
2024-04-15 16:16:32 -07:00
Sam Lantinga
d51b53ef8f Add final Vulkan AV1 ext and VVC support
Fixes https://github.com/libsdl-org/SDL/issues/9464
2024-04-15 16:15:09 -07:00
Sam Lantinga
57a5b26d77 Updated to the latest version of the Vulkan SDK 2024-04-15 16:05:32 -07:00
Brick
5e985b72dc SDL_ConvertAudioSamples: Make sure we got enough data 2024-04-15 11:47:18 -10:00
Brick
edaab8ad9f Refactored audio conversion to reduce copying
More of the logic has been moved into SDL_AudioQueue,
allowing data to be converted directly from the input buffer.
2024-04-15 11:47:18 -10:00
Brick
ae57b0c9d8 Randomly split the data in audio_resampleLoss
This helps ensure correct resampling across track boundaries
2024-04-15 11:47:18 -10:00
Brick
8f6f9cadc4 Rewrote audio resampler using cubic filter interpolation
This allows using a much smaller (1.5 KB) lookup table, in exchange for a small amount of extra work per frame.

The extra work (a few extra loads/mul/adds) is negligible, and can execute in parallel.
The reduction in cache misses almost certainly outweighs any added cost.

The table is generated at runtime, and takes less than 0.02ms on my computer.
2024-04-15 11:47:18 -10:00
Brick
46cecc42a2 Slightly optimized and fixed float SDL_MixAudioFormat 2024-04-15 11:47:18 -10:00
Brick
33f28d6143 Refactored ConvertAudio, added SIMD endian-swapping 2024-04-15 11:47:18 -10:00
Brick
e9e9424b9a Implemented NEON audio type conversion
Compiler support for loading/storing multiple registers at once (i.e vld1q_f32_x4) seems very poor, so avoiding them for now.

Also switched to aligned stores with SSE. Although both SSE and NEON support unaligned stores, there is more likely to be a penalty to them, i.e when crossing a cache line. So might as align them.
2024-04-15 11:47:18 -10:00
Brick
7f96217c63 Add testautomation to android artifacts 2024-04-15 11:47:18 -10:00
Brick
9c2e4f52e6 Fixed misuse of entry->size in SDL_TrackAllocation
entry->size is the size of the allocation, not the number of stack frames
2024-04-15 11:47:18 -10:00
Brick
f18cf7cffb Avoid changing dst_spec in testaudiostreamdynamicresample skip_audio
This is no longer allowed on bound streams
2024-04-15 11:47:18 -10:00
Brick
449b0229eb Fix SDL_SetAudioStreamFormat incorrectly blocking changes on bound streams
We want to avoid changes to the end used by the device, so src for capture and dst for output
2024-04-15 11:47:18 -10:00
Sam Lantinga
d69e6714a8 Document that tooltip windows don't get mouse or keyboard focus 2024-04-15 14:38:00 -07:00
Sam Lantinga
bfde7294f5 Added a note that the joystick should be initialized on the main thread on Windows
Fixes https://github.com/libsdl-org/SDL/issues/9533
2024-04-15 14:19:44 -07:00
SDL Wiki Bot
7000a112a3 Sync SDL3 wiki -> header 2024-04-15 21:13:12 +00:00
Sam Lantinga
70ce808c09 Changed SDL_KeyCode values to defines
This clears up confusion about whether to use SDL_KeyCode or SDL_Keycode and makes it clear that the values aren't the full set of possible keycodes.

Fixes https://github.com/libsdl-org/SDL/issues/9493
2024-04-15 11:08:51 -10:00
Sam Lantinga
2fa4937e1a Removed obsolete padding 2024-04-15 13:55:01 -07:00
Sam Lantinga
dc13c08375 Use single line comment format 2024-04-15 13:42:28 -07:00
SDL Wiki Bot
35c08c828b Sync SDL3 wiki -> header 2024-04-15 19:23:27 +00:00
Sam Lantinga
1862a62b5d Replaced SDL_GetNumTouchFingers() and SDL_GetTouchFinger() with SDL_GetTouchFingers()
Fixes https://github.com/libsdl-org/SDL/issues/9484
2024-04-15 09:22:41 -10:00
SDL Wiki Bot
cdcd346575 Sync SDL3 wiki -> header 2024-04-15 19:13:11 +00:00
Anonymous Maarten
aab7caebf0 cmake: pass macho version information separately from so version 2024-04-15 18:36:27 +00:00
Frank Praznik
a845c7027e x11: Fix pointer warp on XWayland
XWayland seems to require that the pointer be hidden when it is warped, so hide and show the pointer when warping, if required.

Note that XWayland still only allows warping within the window, so attempts to warp to global coordinates outside the window won't work.
2024-04-15 14:27:13 -04:00
Sam Lantinga
a00669db18 Fixed warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data 2024-04-15 10:29:45 -07:00
Sam Lantinga
43a59ffe45 Fixed crashes when a window has NULL driverdata 2024-04-15 10:15:10 -07:00
SDL Wiki Bot
69ee186a1e Sync SDL3 wiki -> header 2024-04-15 16:56:12 +00:00
Ryan C. Gordon
9f6f4dfcb9 events: Fixed crash in SDL_SetEventEnabled.
This could happen if `enabled` was non-zero but not set to SDL_TRUE.

Static analysis tried to warn us!!

The added SDL_assert is meant to sanity check this, not pacify the analyzer;
this passes Clang's static analysis now, with or without the assert.

Fixes #9544.
2024-04-15 12:44:04 -04:00
Sam Lantinga
8a45c38f48 Removed unnecessary exclamation marks 2024-04-15 09:42:10 -07:00
Cameron Cawley
9b8e5a705e 3DS: Improve framebuffer support 2024-04-15 06:37:16 -10:00
Cameron Cawley
723cbf4b8e testmouse: Create the window on the touch screen when building for the 3DS 2024-04-15 06:37:16 -10:00
Cameron Cawley
8bc8047b6f 3DS: Ensure that touchscreen events are associated with a window 2024-04-15 06:37:16 -10:00
Sam Lantinga
e161795071 Fixed build
Also removed the assert, since we assume window->driverdata is valid everywhere else.
2024-04-15 09:35:41 -07:00
Semphris
0429f5d6a3 Replace if() with SDL_assert()
If the if statement was not fulfilled, the pointers passed would be silently left unfilled.
2024-04-15 06:02:58 -10:00
Ozkan Sezer
f06f761c2f remove SDL_quit.h include from SDL.h 2024-04-15 18:47:24 +03:00
Ryan C. Gordon
9c8c254af2 include: Removed SDL_quit.h
It only had one (sort of scary) macro in it.

Fixes #9534.
2024-04-15 11:35:39 -04:00
SDL Wiki Bot
0397d23ed8 Sync SDL3 wiki -> header 2024-04-15 14:36:12 +00:00
Joshua Ashton
d0819bcc5c x11: Mark XWayland as MODE_SWITCHING_EMULATED
That way we don't do the awful minimise on focus loss logic by default on XWayland where mode switching is emulated (like on the Wayland backend).

This fixes CS2, Dota 2 minimising on alt-tab when playing in fullscreen (which is really annoying when managing eg. Discord on another screen)
2024-04-15 03:35:06 -10:00
Petar Popovic
56e6f05440 SDL_RendererFlip rename fixes 2024-04-15 03:32:23 -10:00
Cameron Cawley
d760f16ba6 Add a capability for fullscreen-only video drivers 2024-04-15 03:30:50 -10:00
Sylvain Becker
6b9a8f0da1 IOS: fix compilation of testautomation.app
only for IOS/TVOS, also disable testautomation_pen suite which requires sdl internals files
2024-04-15 03:28:16 -10:00
Petar Popovic
edb370b8bb Fixing testffmpeg.c fallthrough warning 2024-04-15 03:27:42 -10:00
Vicki Pfau
19445339b8 evdev INPUT_PROP_SEMI_MT devices should be early-detected as touchpads
Some psmouse touchpads were being misdetected as joysticks due to only having
INPUT_PROP_SEMI_MT and INPUT_PROP_POINTER as well as having BTN_1
2024-04-15 03:26:29 -10:00
Semphris
0caa2828d5 Fixes for testdialog.c 2024-04-15 03:25:55 -10:00
Mathieu Eyraud
29d43272e2 Fix memory leak in WIN_GetMonitorPathInfo 2024-04-15 03:24:09 -10:00
meyraud705
db9b4ba2fa Fix memory leak in dialog 2024-04-15 03:23:52 -10:00
Anonymous Maarten
07b7ec68eb Add SDLTest_CompareMemory function to compare memory ranges 2024-04-15 03:05:05 -10:00
Petar Popovic
875ddb4969 SDL_atomic.h rename fixes
Adding following macro to SDL_oldnames.h:
SDL_atomic_t SDL_atomic_t_renamed_SDL_AtomicInt
2024-04-15 09:02:39 -04:00
SDL Wiki Bot
1731d53d02 Sync SDL3 wiki -> header 2024-04-15 13:01:12 +00:00
Frank Praznik
f4611ffe9a wayland: Fix comment 2024-04-14 15:02:31 -04:00
Frank Praznik
ad813a65e7 x11: Fix initial window positioning
Some window managers can send garbage values during the initial mapping of a window, and need the position set again after mapping to ensure proper placement. Position requests sent before mapping can otherwise end up ignored. Ignore initial configure events when initially showing the window, and make sure that the position is set after the window is mapped, either when the window borders appear, or after the initial configure events in the case of borderless windows.

This also eliminates sending excessive/redundant move requests, which can cause strange behavior on some window managers, particularly if done before the window is actually mapped.

Fixes cases of incorrect initial window placement on GNOME + XWayland.
2024-04-14 12:19:00 -04:00
Frank Praznik
01195c5d32 x11: Cancel the mode switch timer immediately upon success
Prevents erroneous timeout error messages if the window is moved to another display before the timeout period elapses.
2024-04-14 12:19:00 -04:00
Frank Praznik
037a62add5 wayland: Apply exclusive fullscreen parameters if changed between the initial fullscreen call and the fullscreen configure event 2024-04-14 12:19:00 -04:00
Frank Praznik
26d3cbee79 video: Use the origin for determining the display for fullscreen windows
Fullscreen windows may be larger than the display if they were moved between differently sized displays and the new position was received before the new size or vice versa. Using the center of the window rect in this case can report the wrong display, so use the origin.

Fixes flickering and the window bouncing between different displays when moving fullscreen X11 and Wayland windows in certain multi-monitor layouts.
2024-04-14 12:19:00 -04:00
Frank Praznik
1804ad175c wayland: Don't send spurious display changes when a fullscreen window is moving
When moving a fullscreen window, the compositor movement animation can cause it to cross multiple displays, sending multiple display changed events, which can cause the window to jitter or be snapped to the wrong display in the case of exclusive fullscreen modes.

When moving fullscreen windows, only send the display changed event when the window isn't on multiple displays to avoid spurious display changed events.
2024-04-14 12:19:00 -04:00
SDL Wiki Bot
11de629dd2 Sync SDL3 wiki -> header 2024-04-14 05:50:22 +00:00
Ryan C. Gordon
291edc073c include: Document SDL_TriggerBreakpoint. 2024-04-14 01:48:52 -04:00
SDL Wiki Bot
59c332e569 Sync SDL3 wiki -> header 2024-04-14 05:35:26 +00:00
Ryan C. Gordon
041de0c2eb include: Some documentation improvements. 2024-04-14 01:33:56 -04:00
Ryan C. Gordon
21bc72bef1 wikiheaders: Allow parts of the headers to be ignored.
The specific cases here were SDL_size_mul_overflow_builtin and
SDL_size_add_overflow_builtin, which are forced-inline symbols in
SDL_stdinc.h that have to exist, but aren't really part of the public API,
and thus shouldn't be exported as documentation.
2024-04-13 22:57:23 -04:00
SDL Wiki Bot
e4f097805b Sync SDL3 wiki -> header 2024-04-14 00:22:23 +00:00
Ryan C. Gordon
081a94e321 include: Updated a bunch of documentation. 2024-04-13 20:10:13 -04:00
Ryan C. Gordon
3c86af5901 wikiheaders: Add support for SDL_FORCE_INLINE functions. 2024-04-13 20:08:14 -04:00
Ryan C. Gordon
239b34d760 docs: Added some notes about iOS and the main callbacks. 2024-04-13 15:14:32 -04:00
SDL Wiki Bot
9c5ae7293f Sync SDL3 wiki -> header 2024-04-13 18:59:10 +00:00
SDL Wiki Bot
cae90ef489 Sync SDL3 wiki -> header 2024-04-13 18:38:11 +00:00
Ryan C. Gordon
6e1ed94913 ios: Renamed APIs that referred to "iPhone" to refer to "iOS".
Macros that papered over this difference in SDL2 have been removed for SDL3.

Fixes #9527.
2024-04-13 14:30:30 -04:00
Ryan C. Gordon
d252a8fe12 joystick: SDL_VirtualJoystickDesc no longer takes a struct version.
If we need to extend this in the future, we'll make a second struct and
a second SDL_AttachVirtualJoystickEx-style function that uses it.

Just zero the struct and don't set a version.

Fixes #9489.
2024-04-13 14:16:12 -04:00
SDL Wiki Bot
202bd7b0ff Sync SDL3 wiki -> header 2024-04-13 13:24:25 +00:00
Ryan C. Gordon
f01b34fd8d include: Removed some SDL2 references in the documentation. 2024-04-13 09:23:37 -04:00
Ryan C. Gordon
98e9f361a8 winrt: Remove SDL_WinRTGetFSPathUNICODE, rename SDL_WinRTGetFSPathUTF8.
Fixes #9470.
2024-04-13 08:24:12 -04:00
SDL Wiki Bot
02da4acf0f Sync SDL3 wiki -> header 2024-04-13 12:07:27 +00:00
Ryan C. Gordon
3f4ac1a3c7 winrt: Implemented SDL_GetUserFolder() for WinRT/UWP. 2024-04-13 08:05:43 -04:00
Ryan C. Gordon
1e369b7f33 build-scripts/fnsince.pl: Remove SDL2-specific fixup. 2024-04-13 08:05:43 -04:00
SDL Wiki Bot
cbb3c69cb0 Sync SDL3 wiki -> header 2024-04-13 01:10:12 +00:00
anon
03bc53fe31 include: Fixes the improper fix I made before of documentation, SDL_SensorType. 2024-04-12 14:51:52 -04:00
Frank Praznik
3fca8d4f82 wayland: Fix build warning (boolean always true) 2024-04-12 14:15:29 -04:00
Frank Praznik
f6edc2f603 wayland: Use xdg-output to get connector names when older versions of libwayland are in use
Connector names prior to v4 were sent via xdg-output, so use that if an older version of libwayland is present.

Additionally, ensure the output names are actually allocated before comparing the strings.
2024-04-12 14:04:43 -04:00
Frank Praznik
60f26182c3 audio: Prefer Pipewire over Pulseaudio if the pipewire-pulse service is running
Use DBus to query Systemd to check if the pipewire-pulse service is in the "running" state. If it is, then it is certain that Pipewire is being used instead of Pulseaudio as the preferred system mixer.

If DBus support is not enabled or Systemd is not being used on the underlying system, this check will simply fail and the standard driver order will be tested.
2024-04-11 20:35:10 -04:00
Frank Praznik
b6cb63adef wayland: Update tablet-v2 protocol file to stable version
No functional changes, just removes the 'unstable' wording from the header names and updates some documentation.
2024-04-11 18:34:02 -04:00
SDL Wiki Bot
935b6502ac Sync SDL3 wiki -> header 2024-04-11 19:40:25 +00:00
anon
7ab8e4797e include: Add documentation to SDL_MessageBoxColorType. 2024-04-11 15:39:58 -04:00
anon
1abaacedb2 include: Fix documentation generation for SDL_SensorType. 2024-04-11 15:38:54 -04:00
SDL Wiki Bot
2f4f1f6923 Sync SDL3 wiki -> header 2024-04-11 17:35:27 +00:00
Ryan C. Gordon
0df988389c include: Add \since to all documentation that was missing it. 2024-04-11 13:34:29 -04:00
Ryan C. Gordon
db39de7f63 build-scripts/fnsince.pl: Updated to use Markdown instead of MediaWiki format. 2024-04-11 13:29:04 -04:00
SDL Wiki Bot
073d2378dc Sync SDL3 wiki -> header 2024-04-11 12:59:41 +00:00
Ryan C. Gordon
af6a4a9e38 wikiheaders: Fixed a silly logic bug. 2024-04-11 08:57:50 -04:00
Ryan C. Gordon
9421a01400 SDL_AudioStreamCallback: Note that there's no _requirement_ to do anything.
This is as opposed to something like the SDL2 audio callback, where you
_must_ supply data or disaster occurs.
2024-04-11 08:56:10 -04:00
Ryan C. Gordon
6ccdfffe26 wikiheaders: Fixes to manpage output for datatypes vs functions. 2024-04-11 01:03:07 -04:00
Ryan C. Gordon
e47f2956cf include: Documented SDL_bool a little. 2024-04-11 00:48:11 -04:00
Ryan C. Gordon
407e54e188 include: More improved docs for the wikibridge! 2024-04-11 00:37:11 -04:00
Ryan C. Gordon
5a58b3d97a wikiheaders: Bridge basic typedefs to the wiki! 2024-04-11 00:37:11 -04:00
Frank Praznik
d7dcf4916f docs: Mention the SDL_HINT_VIDEO_SYNC_WINDOW_OPERATIONS hint in the migration guide 2024-04-10 21:51:03 -04:00
Ryan C. Gordon
f121553082 include: Fixed up SDL_AudioFormat documentation.
(this is not currently bridged to the wiki, but will be soon!)
2024-04-10 18:45:29 -04:00
Frank Praznik
38c4f29c29 wayland: Round fractional scale values when viewports aren't supported 2024-04-10 16:01:23 -04:00
SDL Wiki Bot
b2239cb7ba Sync SDL3 wiki -> header 2024-04-10 19:59:14 +00:00
Ryan C. Gordon
557f26e6f0 include: Fixed up some more documentation. 2024-04-10 15:58:28 -04:00
ChedRed
b33420cac7 Updated INSTALL.md
Added a subsection for building MacOS universal packages.
2024-04-10 09:18:42 -04:00
Anonymous Maarten
06758685a5 stdinc: modify default alloca prototype
For compatibilty with TinyCC.
2024-04-10 08:03:46 +00:00
Petar Popovic
132cef91c8 Removing macro SDL_FColour from SDL_pixels.h 2024-04-09 18:20:03 -04:00
SDL Wiki Bot
534c44b156 Sync SDL3 wiki -> header 2024-04-09 22:04:21 +00:00
Ryan C. Gordon
a15a46340f SDL_revision: Added documentation. 2024-04-09 18:02:30 -04:00
Petar Popovic
f687e0732a Doxygen comment fixes in SDL_pixels.h 2024-04-09 16:57:34 -04:00
SDL Wiki Bot
196d123c66 Sync SDL3 wiki -> header 2024-04-09 16:36:25 +00:00
David Gow
d321e19ee5 stdinc: Document maths functions
SDL_stdinc.h has a documentation comment for SDL_acos(), but nothing else. Expand on
that comment, and add comments for the remaining maths functions.
2024-04-09 12:35:42 -04:00
David Gow
afd91b5e9c stdinc: Note that these functions match their C runtime equivalents
This header basically just consists of C runtime #defines and functions, but with
an SDL_ prefix. Note this in the documentation so people don't waste their time
reading through things they already understand.
2024-04-09 12:35:42 -04:00
Henry Wilson
629c694bd6 Fixed Doxygen comments
Added '*' to the start of Doxygen comments for SDL_FlipSurface and SDL_DuplicateSurface so they highlight properly in IDEs
2024-04-09 12:30:13 -04:00
Petar Popovic
9b5944a14f Removing SDL_Colour macro 2024-04-09 12:25:36 -04:00
SDL Wiki Bot
baf09904b3 Sync SDL3 wiki -> header 2024-04-09 13:59:22 +00:00
Ryan C. Gordon
79dc6af98f SDL_endian.h: Documented SDL_Swap* macros. 2024-04-09 09:58:01 -04:00
Ryan C. Gordon
e044318a8e Sync SDL3 wiki -> headers 2024-04-09 00:50:03 -04:00
Ryan C. Gordon
ad090d2444 include: A ton of little documentation tweaks, fixes, and improvements.
This is just stuff I noticed while working on the wikiheaders updates. A
thorough pass over all the docs would not be terrible, and maybe a simple
script to check for consistency (does everything have a `\since` on it? etc)
might be nice, too.
2024-04-09 00:50:02 -04:00
Ryan C. Gordon
645073961d wikiheaders: Don't mangle Markdown tables in wordwrap. 2024-04-09 00:50:02 -04:00
Ryan C. Gordon
a25d49c162 wikiheaders: Bridge structs, unions, and enums to the wiki! 2024-04-09 00:50:02 -04:00
Ryan C. Gordon
125bbc5e61 wikiheaders: Fixed usage of die().
(if there's a newline in the output, it won't print the line in the Perl
script where the failure happened, so fix this in places where it's used
more like an assert than error reporting.)
2024-04-09 00:50:02 -04:00
Ryan C. Gordon
6906c50e8b assert: SDL_AssertData::always_ignore should be an SDL_bool, not an int. 2024-04-09 00:50:01 -04:00
Ryan C. Gordon
34f4484f48 wikiheaders: Renamed "Related Functions" section to "See Also"
It's not all functions now!
2024-04-09 00:50:01 -04:00
Ryan C. Gordon
dd2780f9fb wikiheaders: Remove trailing whitespace from "brief" description. 2024-04-09 00:50:01 -04:00
Ryan C. Gordon
a26ec343c3 wikiheaders: Bridge macros to the wiki! 2024-04-09 00:50:01 -04:00
Petar Popovic
c8a066019b Renaming SDL_eventaction to SDL_EventAction 2024-04-08 14:28:52 -04:00
Petar Popovic
1efadcc5d4 Revert renaming SDL_eventaction. adding it again in next commit with
scripts

This reverts commit f08c31060a.
2024-04-08 14:28:52 -04:00
Anonymous Maarten
9f83647aec cmake: switch iOS and watchOS 2024-04-08 19:25:38 +02:00
Ravbug
2d640d0b59 ci: Add iOS and tvOS CMake GitHub Actions checks (#9465)
- Also add watchos support to CMake (SDL does not support this platform yet)

Co-authored-by: Ravbug <ravbug@users.noreply.github.com>
Co-authored-by: Anonymous Maarten <anonymous.maarten@gmail.com>
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
2024-04-08 19:18:28 +02:00
Frank Praznik
224f2e921e video: Remove unused bootstrap declarations
Pandora and KMSDRM_Legacy are not used anywhere.
2024-04-08 11:07:05 -04:00
Petar Popovic
764fe72449 SDL_time.h: Renaming enums SDL_DATE_FORMAT and SDL_TIME_FORMAT to SDL_DateFormat and SDL_TimeFormat 2024-04-07 23:03:01 -04:00
Petar Popovic
f08c31060a Renaming SDL_eventaction to SDL_EventAction 2024-04-07 12:04:32 -04:00
Robert Edmonds
e3395a7585 cmake: Fix ALSA "Unable to find..." warning
If cmake is invoked with -DSDL_ALSA=OFF, the misleading warning
message "Unable to find the alsa development library" is printed.
It's misleading because no attempt was actually made to find the ALSA
development library. It's always printed by the CheckALSA macro if
SDL_ALSA is false.

This commit moves this warning message in the CheckALSA macro to being
printed if ALSA_FOUND is false. However, I don't see an explicit warning
message like this for the other macros that search for development
libraries, so I wonder if the message shouldn't just be removed
entirely. It seems redundant with the "Could NOT find ALSA ..." message
generated by cmake.

Before this commit:

    $ cmake -B build -DSDL_ALSA=OFF
    [...]
    CMake Warning at cmake/sdlchecks.cmake:125 (message):
      Unable to find the alsa development library
    Call Stack (most recent call first):
      CMakeLists.txt:1530 (CheckALSA)
    [...]
    -- Options:
    --   SDL_ALSA                    (Wanted: OFF): OFF
    [...]

    $ cmake -B build -DSDL_ALSA=ON
    [...]
    -- Could NOT find ALSA (missing: ALSA_LIBRARY ALSA_INCLUDE_DIR)
    [...]
    -- Options:
    --   SDL_ALSA                    (Wanted: ON): OFF
    [...]

After this commit:

    $ cmake -B build -DSDL_ALSA=OFF
    [...]
    -- Options:
    --   SDL_ALSA                    (Wanted: OFF): OFF
    [...]

    $ cmake -B build -DSDL_ALSA=ON
    [...]
    -- Could NOT find ALSA (missing: ALSA_LIBRARY ALSA_INCLUDE_DIR)
    CMake Warning at cmake/sdlchecks.cmake:123 (message):
      Unable to find the alsa development library
    Call Stack (most recent call first):
      CMakeLists.txt:1530 (CheckALSA)
    [...]
    -- Options:
    --   SDL_ALSA                    (Wanted: ON): OFF
    [...]

All of the cmake invocations above were without the libasound2-dev
package installed.
2024-04-06 12:19:55 -04:00
Ryan C. Gordon
5c9dbf65a3 SDL_version.h: Fix some whitespace. 2024-04-06 02:09:48 -04:00
Semphris
6ad390fc50 File dialog improvements
- Add a globally-accessible function to handle the parsing of filter extensions
- Remove the ability of putting the wildcard ('*') among other patterns; it's either a list of patterns or a single '*' now
- Add a hint to select between portals and Zenity on Unix
2024-04-04 22:07:14 -07:00
Sam Lantinga
5fa87e29e7 Removed SDL_RENDERER_ACCELERATED and SDL_RENDERER_SOFTWARE
These flags are unnecessary and have always been a source of confusion.
2024-04-04 13:30:49 -07:00
Petar Popovic
3f8dba3713 Including SD_error.h into headers with error-returning functions 2024-04-04 11:12:58 -07:00
Ryan C. Gordon
ff651a7941 filesystem: Turn off case-insensitivity if glob pattern is NULL.
Just a small optimization; it'll avoid some allocations and case-folding we
don't actually need the results of later.
2024-04-04 10:44:19 -04:00
Ryan C. Gordon
bc94451bed testfilesystem: Add a '?' to the glob test, for a little more completeness. 2024-04-04 10:44:19 -04:00
Ryan C. Gordon
e12b8e767a SDL_filesystem.h: Fixed some whitespace. 2024-04-04 10:44:19 -04:00
SDL Wiki Bot
1a97d1f649 Sync SDL3 wiki -> header 2024-04-04 14:42:26 +00:00
Petar Popovic
de91aaa452 SDL_locale.h - SDL_GetPreferredLocales() - adding SDL_GetError() comment 2024-04-04 07:41:50 -07:00
Petar Popovic
7ae5474305 SDL_quit.h - removing SDL_error.h inclusion 2024-04-04 07:41:50 -07:00
Sam Lantinga
0abdc1a343 Renamed GLOBDIR to GLOB 2024-04-04 07:40:48 -07:00
SDL Wiki Bot
ac372e99fe Sync SDL3 wiki -> header 2024-04-04 13:41:27 +00:00
Ryan C. Gordon
764207d873 filesystem: Added SDL_GlobDirectory() and SDL_GlobStorageDirectory().
Fixes #9287.
2024-04-04 09:40:13 -04:00
Ryan C. Gordon
810656962c stdlib: Export some Unicode functions to other SDL internals. 2024-04-04 09:40:13 -04:00
Ryan C. Gordon
9192485746 filesystem: SDL_EnumerateDirectory should return -1 or 0.
The callback requesting a non-error stop should not return a special value.
2024-04-04 09:40:13 -04:00
Sam Lantinga
a8ed32c5f7 Re-enable cursor clipping when clicking into a window when relative mouse mode is enabled 2024-04-03 12:41:19 -07:00
Frank Praznik
2d9aff6433 wayland: Always use the whole buffer surface for the damage region
Using the current window size at the time of the call may not be correct if the window or buffer size was changed after the fact, so always set the damage region to cover the entire buffer.
2024-04-03 11:07:08 -04:00
Sam Lantinga
c7787a9191 The hint environment variables don't have the word "HINT" in them
Fixes https://github.com/libsdl-org/SDL/issues/9436
2024-04-02 19:24:07 -07:00
Anonymous Maarten
2f26c58504 cmake: fix typo in cmake/sdlplatform.cmake 2024-04-02 23:44:15 +02:00
Clownacy
65e7c8e265 Fix default Windows window icon not suiting the DPI.
For whatever reason, `ExtractIconEx` returns icons whose sizes are
inappropriate for the current DPI, resulting in terribly-blurry
window icons at higher DPIs.

To solve this, the window icon is now set to the first icon group
that is present in the executable. This behaviour should match what
Explorer does. By selecting an icon group instead of a specific icon,
Windows is free to select the icon within the group that best suits
the current DPI.

(cherry picked from commit 1fa6142903)
2024-04-02 12:04:52 -07:00
Anonymous Maarten
143b070074 cpuinfo: fix -Wmissing-prototypes warning 2024-04-02 18:57:36 +02:00
Ryan C. Gordon
58529c1827 stdlib: SDL_utf8strlen and SDL_utf8strnlen now use SDL_StepUTF8 internally.
Otherwise, they might find out strings with malformed UTF-8 sequences produce
a different amount of codepoints than the count returned here, overflowing
buffers that might be allocated based on the results.
2024-04-01 22:43:19 -04:00
Sam Lantinga
17d4f8d699 Updated to version 3.1.1 for the preview release 2024-04-01 17:03:46 -07:00
Brian Collins
560daa07f2 Workaround a macOS cursor-related bug.
This fixes an macOS bug that is only known to occur in fullscreen windows on the built-in displays of newer MacBooks with camera notches. When the mouse is moved near the top of such a window (within about 44 units) and then moved back down, the cursor rects aren't respected. This can cause the default cursor to be visible when it should not be.

(cherry picked from commit f1690e265e)
2024-04-01 16:21:24 -07:00
Sam Lantinga
a82ed82bc7 SDL_QueryTexture() fills in a pointer to SDL_PixelFormatEnum 2024-04-01 15:45:22 -07:00
Sam Lantinga
aea44cff6b Fixed warning C4702: unreachable code 2024-04-01 14:30:11 -07:00
Sam Lantinga
85b7f131b0 Fixed warning C4701: potentially uninitialized local variable 'percent' used 2024-04-01 14:27:19 -07:00
Sam Lantinga
c10a3df552 Only add the UniformTypeIdentifiers framework if we're building the dialog subsystem
This framework isn't available on older SDKs
2024-04-01 14:13:31 -07:00
SDL Wiki Bot
18c8af6e48 Sync SDL3 wiki -> header 2024-04-01 21:00:26 +00:00
Sam Lantinga
8847b35244 Separate joystick power state into battery status and percentage
This allows you to see battery percentage while the controller is charging
2024-04-01 13:59:00 -07:00
Sam Lantinga
5e624c2083 Moved display and window event renaming to the correct header section
Closes https://github.com/libsdl-org/SDL/pull/9396
2024-04-01 13:57:05 -07:00
Anonymous Maarten
63cb541797 cmake: set SYSTEM property in SDL3Config.cmake for compatibility with older CMake versions 2024-04-01 20:09:51 +02:00
Susko3
5f763083fc Use SDL_EventType and fix event name in comment 2024-04-01 11:04:02 -07:00
Susko3
c40e9cc634 Sort includes 2024-04-01 11:04:02 -07:00
Anonymous Maarten
4eb0f10dda cmake: install SDL headers with SYSTEM property disabled
This causes the SDL include path to be added using -I instead of -isystem
2024-04-01 18:38:47 +02:00
Anonymous Maarten
fb8ac1ab7d ci: verify SDL build system does not include installed SDL headers 2024-04-01 18:38:47 +02:00
Anonymous Maarten
19b01c39b0 ci: don't fix pspsdk toolchain anymore 2024-04-01 18:38:47 +02:00
Frank Praznik
a00ac61514 time: Fix UWP build 2024-04-01 10:53:35 -04:00
danginsburg
650ba8f3ec Vulkan Renderer - closes #9385. When the vertex buffer size is exceeded, make sure to wait for outstanding work before resizing it. This fixes validation errors/crash found with using Imgui SDL3 renderer on Vulkan. 2024-04-01 07:38:31 -07:00
Sean Ridenour
3448273be1 Weakly link UniformTypeIdentifiers.framework 2024-04-01 07:38:05 -07:00
Sean Ridenour
feebb9fcf8 Fix file selection dialog boxes not working on macOS 11.0+ 2024-04-01 07:38:05 -07:00
Frank Praznik
c0bfd8bafd time: Only call GetSystemTimePreciseAsFileTime if available
GetSystemTimePreciseAsFileTime is only available on Win8/Server 2012 or higher, so it must be dynamically loaded and only used if available.  Fixes compatability with Win7 and XP.
2024-04-01 10:23:02 -04:00
Susko3
c96bc8b1a2 Add missing includes for SDL_MouseID
Missed in f8844d387c and d1eb4adb16.
2024-03-31 16:11:23 -07:00
Ryan C. Gordon
74b58aebb9 README-migration: fix function signature on SDL_(Read|Write)IO docs. 2024-03-31 16:43:53 -04:00
Ryan C. Gordon
6b20152bda README-migration: Removed duplicate paragraph.
(Exact same text also exists earlier in the SDL_audio.h section.)
2024-03-31 16:26:08 -04:00
Sam Huang
a9cab01185 Don't change cwd with file dialogs 2024-03-31 12:50:29 -07:00
Mirko Galimberti
60cacc8277 README-migration: Fix wrong new name for SDL_WINDOWEVENT_ENTER and SDL_WINDOWEVENT_LEAVE 2024-03-31 12:47:55 -07:00
Sam Lantinga
fbbee04423 Revert "Only clear the raw input queue status if we don't call GetRawInputBuffer()"
This reverts commit 02c63667c7.

It turns out that QS_RAWINPUT isn't actually cleared by GetRawInputBuffer(). See https://github.com/libsdl-org/SDL/issues/9409 for more details.
2024-03-31 12:44:13 -07:00
Ryan C. Gordon
e055a9fc2d wikiheaders.pl: Report a function's header file name. 2024-03-31 12:56:00 -04:00
Mathieu Eyraud
4d00706f57 Do not store pointer before potentialy freeing it
Store data to windows->driverdata after call to SetProp() in case it fails.
2024-03-30 11:07:42 -07:00
Mathieu Eyraud
36dec0bf4e Fix return value of WIN_GetMonitorPathInfo 2024-03-30 11:04:32 -07:00
Sam Lantinga
8201b6dc4d Added support for raw mousewheel events 2024-03-30 07:38:38 -07:00
Sam Lantinga
4a00d34a86 Always send raw mouse button state changes
Fixes https://github.com/libsdl-org/SDL/issues/9395
2024-03-30 07:30:43 -07:00
Semphris
335fa5d6e4 Disable SDL dialogs for tvOS and iOS 2024-03-29 23:13:15 -07:00
Anonymous Maarten
72cf9c0ef4 test: don't run testautomation in parallel 2024-03-29 21:11:35 +01:00
SDL Wiki Bot
96c93d2252 Sync SDL3 wiki -> header 2024-03-29 19:02:25 +00:00
Ryan C. Gordon
49029c8454 stdinc: Document a bunch of ctype/string functions.
This is intended to help codify the rules for locale and Unicode in SDL3,
which were less-well defined in SDL2.
2024-03-29 15:01:40 -04:00
Ryan C. Gordon
a5c892d2c3 stdlib: Improve Unicode support and consistency in string comparison functions.
SDL_strcasecmp (even when calling into a C runtime) does not work with
Unicode chars, and depending on the user's locale, might not work with
even basic ASCII strings.

This implements the function from scratch, using "case-folding,"
which is a more robust method that deals with various languages. It
involves a hashtable of a few hundred codepoints that are "uppercase" and
how to map them to lowercase equivalents (possibly increasing the size of
the string in the process). The vast majority of human languages (and
Unicode) do not have letters with different cases, but still, this static
table takes about 10 kilobytes on a 64-bit machine.

Even this will fail in one known case: the Turkish 'i' folds differently
if you're writing in Turkish vs other languages. Generally this is seen as
unfortunate collateral damage in cases where you can't specify the language
in use.

In addition to case-folding the codepoints, the new functions also know how
to decode the various formats to turn them into codepoints in the first
place, instead of blindly stepping by one byte (or one wchar_t) per
character.

Also included is casefolding.txt from the Unicode Consortium and a perl
script to generate the hashtable from that text file, so we can trivially
update this if new languages are added in the future.

A simple test using the new function:

```c
 #include <SDL3/SDL.h>

 int main(void)
 {
     const char *a = "α ε η";
     const char *b = "Α Ε Η";
     SDL_Log("    strcasecmp(\"%s\", \"%s\") == %d\n", a, b, strcasecmp(a, b));
     SDL_Log("SDL_strcasecmp(\"%s\", \"%s\") == %d\n", a, b, SDL_strcasecmp(a, b));
     return 0;
 }
```

Produces:

```
INFO:     strcasecmp("α ε η", "Α Ε Η") == 32
INFO: SDL_strcasecmp("α ε η", "Α Ε Η") == 0
```

glibc strcasecmp() fails to compare a Greek lowercase string to its uppercase
equivalent, even with a UTF-8 locale, but SDL_strcasecmp() works.

Other SDL_stdinc.h functions are changed to be more consistent, which is to
say they now ignore any C runtime and often dictate that only English-based
low-ASCII works with them.

Fixes Issue #9313.
2024-03-29 15:01:40 -04:00
Ryan C. Gordon
4659a84bd1 coreaudio: fix race condition when closing an input device. 2024-03-29 00:55:38 -04:00
Ryan C. Gordon
2fd9447670 coreaudio: Make sure device handles are unique.
AudioDeviceID is not unique (hardware that can do both capture and output
will expose both interfaces off the same AudioDeviceID!).
2024-03-28 21:45:00 -07:00
Sam Lantinga
87235e0f6d Fixed detecting CoreAudio devices that have both capture and output endpoints 2024-03-28 18:35:42 -07:00
Sam Lantinga
af5728b94d Fixed event handle accumulation when the SDL window doesn't have focus
This also fixes a crash on shutdown caused by the raw input thread failing to stop
2024-03-28 15:11:45 -07:00
Christoph Reichenbach
6d37f4798e SDL_pen.c: release pen mutex on error return 2024-03-28 20:37:54 +00:00
Susko3
d785a647a4 Fix 'SyntaxWarning: invalid escape sequence' when running gendynapi.py 2024-03-28 13:21:26 -07:00
Ozkan Sezer
6cf71ca9a9 SDL_stdinc.h: Android passes sizeof(ENUM) == sizeof(int) assertion
Reference issue: https://github.com/libsdl-org/SDL/issues/9392 .
2024-03-28 20:28:02 +03:00
Sam Lantinga
47378eddf6 Fixed error: ordered comparison of pointer with integer zero 2024-03-28 09:34:48 -07:00
Sam Lantinga
0aa1022358 Clarify that SDL_SetWindowKeyboardGrab() is only needed if you set SDL_HINT_GRAB_KEYBOARD 2024-03-28 09:25:22 -07:00
Sam Lantinga
fc81d4e5fc Fixed 64-bit conversion warnings 2024-03-28 09:12:26 -07:00
Sam Lantinga
c8489a3710 Disable XInput2 keyboard events
It turns out they're only delivered to the window with mouse focus, not keyboard focus.

Fixes https://github.com/libsdl-org/SDL/issues/9374
2024-03-28 08:50:47 -07:00
danginsburg
fb5307c1b3 Vulkan Renderer - fix synchronization validation issues with testrendertarget and testcopyex. When a texture is destroyed, VULKAN_IssueBatch is called to make sure the texture isn't referenced in any outstanding command work. This path did not wait on the semaphore from vkAcquireNextImageKHR, which would create a hazard. 2024-03-28 07:37:49 -07:00
Ryan C. Gordon
0d007bbb01 psp: Fixed building with pspdev when not using CMake.
(psp-cmake defines `__PSP__` on the command line, but the compiler itself
only defines `__psp__` and some variations.

Fixes #9378.
2024-03-28 09:27:21 -04:00
Ryan C. Gordon
ad92c9e300 README-main-functions.md: Added notes about the new appstate parameter. 2024-03-27 23:04:36 -04:00
Sam Lantinga
7a9f99cff3 Corrected migration documentation for SDL_GetDisplayDPI()
Fixes https://github.com/libsdl-org/SDL/issues/9386
2024-03-27 18:27:57 -07:00
Ryan C. Gordon
d00ccc1546 audio: Fix audio stream incorrectly not unlocking during unbind.
(This patch was from @0x1F9F1, thanks!)

Fixes #9379.
2024-03-27 17:36:26 -04:00
Ryan C. Gordon
38e3c6a4aa main: Add an optional appstate param to main callback entry points.
This allows apps to maintain state data without using global variables.

Fixes #9377.
2024-03-27 17:22:08 -04:00
Sam Lantinga
a9dbdb1947 Removed SDL_RenderSetIntegerScale() renaming note
Fixes https://github.com/libsdl-org/SDL/issues/9384
2024-03-27 12:47:23 -07:00
Sam Lantinga
cde2dcd0d4 Note that SDL_EVENT_SYSWM has been removed
Fixes https://github.com/libsdl-org/SDL/issues/9382
2024-03-27 11:39:10 -07:00
SDL Wiki Bot
05b3605a41 Sync SDL3 wiki -> header 2024-03-27 18:02:23 +00:00
Frank Praznik
5abcfad352 video: Document that renderer lifetimes are tied to their associated windows 2024-03-27 11:01:41 -07:00
Sam Lantinga
02c63667c7 Only clear the raw input queue status if we don't call GetRawInputBuffer()
GetRawInputBuffer() will do that for us when we read all the queued events
2024-03-26 15:27:57 -07:00
Sam Lantinga
d6fc629b5b Fixed Windows rawinput crash
RAWINPUT structures are variable size
2024-03-26 15:27:57 -07:00
Frank Praznik
a7df28201b Revert "testautomation: fix renderer leak in video tests"
This reverts commit 2f13f66c71.

Not needed if renderers are once again implicitly cleaned up when their associated windows are destroyed.
2024-03-26 13:10:14 -07:00
Frank Praznik
8f14fa1113 video: Destroy the associated renderer when a window is destroyed
This was previous behavior that used window userdata and was lost during the move to properties.  Renderer objects need to be cleaned up when their associated windows are destroyed, or they can be leaked and backend refcounts won't be properly updated, leading to them not being properly shut down when SDL_Quit() is called.
2024-03-26 13:10:14 -07:00
Sam Lantinga
f0cd3ed330 x11: don't send raw mouse motion when the application doesn't have focus 2024-03-26 13:10:54 -07:00
Sam Lantinga
c47f9b9b54 x11: fixed mouse and keyboard input when XInput2 isn't available 2024-03-26 13:01:00 -07:00
Sam Lantinga
fed5f3a81b We no longer automatically set up a logical presentation mode 2024-03-26 10:40:40 -07:00
Sam Lantinga
823ab13b9c SDL_CreateTexture() takes a SDL_PixelFormatEnum format parameter 2024-03-26 10:40:40 -07:00
Sam Lantinga
35785d1354 SDL_CreateWindowTexture() shouldn't use 10-bit or float textures 2024-03-26 10:40:40 -07:00
Sam Lantinga
696ecca499 Fixed SDL_MapRGB(), SDL_MapRGBA(), SDL_GetRGB() and SDL_GetRGBA() when used with 10-bit pixel formats
Fixes https://github.com/libsdl-org/SDL/issues/9367
2024-03-26 10:40:40 -07:00
Sam Lantinga
3eb8f35f3b windows: handle the Pause key sequence for raw keyboard input 2024-03-26 09:22:00 -07:00
Daniel Ludwig
4562b41a4d VisualC-GDK: Add missing dialog sources, fix Xbox builds 2024-03-26 07:28:22 -07:00
Ozkan Sezer
693c75e36e SDL_x11events.c: fix build if Xinput2 is not available after 3dfc3b4c8 2024-03-26 11:56:02 +03:00
Ozkan Sezer
0556362c38 SDL_windowsevents.c: comment out unused local mouse var after 70b5cd44 2024-03-26 11:47:32 +03:00
Sam Lantinga
70b5cd44ec windows: explicitly check whether raw_mouse_enabled is true before handling Windows mouse messages 2024-03-25 20:49:16 -07:00
Sam Lantinga
3dfc3b4c8d x11: added hotplug support for XInput2 devices 2024-03-25 20:41:05 -07:00
Sam Lantinga
f1f24b173c Added support for multiple distinct keyboards 2024-03-25 20:41:05 -07:00
Sam Lantinga
78c7834f90 Added SDL_HINT_WINDOWS_RAW_KEYBOARD to control whether raw keyboard is enabled on Windows 2024-03-25 20:41:05 -07:00
Mark Delk
9095cb64c4 linux/SDL_system_theme.c: fix an include path 2024-03-25 17:07:27 -07:00
Anonymous Maarten
a65982e15d testevdev: include SDL_internal.h first, and fixup SDL_main.h 2024-03-26 00:10:40 +01:00
Frank Praznik
ffc3f71aa2 wayland: Use the floating width/height for initial window creation
The dimensions for fixed-size state set via window flags will be applied later in the window creation process.

Restores the window to the proper windowed size when leaving fullscreen.
2024-03-25 18:54:27 -04:00
Sam Lantinga
b9a88bbecb Removed SDL_TextInputShown()
This was only implemented on Windows and often confused with SDL_ScreenKeyboardShown()
2024-03-25 13:26:23 -07:00
Sam Lantinga
6443c75eda Removed SDL_TEXTINPUTEVENT_TEXT_SIZE 2024-03-25 13:26:23 -07:00
Sam Lantinga
fa236f169b Only do work to process text events if text input is active
Fixes https://github.com/libsdl-org/SDL/issues/9353
2024-03-25 13:26:23 -07:00
Sam Lantinga
658f3cdcf1 x11: use XInput2 for lower level access to keyboard events 2024-03-25 13:26:23 -07:00
Sam Lantinga
012fc1e32b windows: enable raw keyboard input when raw mouse input is enabled 2024-03-25 13:26:23 -07:00
Sam Lantinga
35d335e61f Fixed warning C4267: 'function': conversion from 'size_t' to 'DWORD', possible loss of data 2024-03-25 11:46:47 -07:00
Sam Lantinga
43b8e9f681 Fixed spacing 2024-03-25 11:41:51 -07:00
Sam Lantinga
5e8486bb29 Don't fail joystick initialization if udev isn't available 2024-03-25 11:29:18 -07:00
Ozkan Sezer
5a1c48be5c remove non-existent vulkan.hpp and vulkan_mir.h from Xcode project 2024-03-25 21:23:32 +03:00
Anonymous Maarten
58f2e102a9 visualc: filters also contained 2 wrong include headers 2024-03-25 18:02:05 +01:00
Anonymous Maarten
c7d32ff64b visualc: rename/remove 2 include paths 2024-03-25 17:10:31 +01:00
Sam Lantinga
977285ef6a Send joystick added events on portable handheld platforms
The IDs on these drivers are hard-coded as device_index + 1, so that's the ID we will send during initialization.
2024-03-25 07:14:00 -07:00
Sam Lantinga
b391e6477e The joystick instance ID is already set in the open call 2024-03-25 06:57:02 -07:00
Sam Lantinga
07c49d1a67 Fixed text input being active after SDL_StopTextInput() (thanks @AntTheAlchemist!) 2024-03-25 06:46:23 -07:00
Tyson Whitehead
53ade19430 udev: Fix O(n^2) device walking issue (closes #9092)
I believe there was a O(n^2) device walking issues on startup

- MaybeAddDevice gets called for every device at startup
- MaybeAddDevice calls IsJoystick
- IsJoystick calls SDL_UDEV_GetProductInfo
- SDL_UDEV_GetProductInfo calls udev_enumerate_scan_devices
- udev_enumerate_scan_devices walks all the devices

Prior to commit 3b1e0e1 this was mostly masked as IsJoystick only
called SDL_UDEV_GetProductInfo when a JSIOCGNAME ioctl was
successful. This fixes the O(n^2) behaviour by directly getting
the device via udev_device_new_from_devnum (based on type, major,
and minor number) instead of enumerating everything via
udev_enumerate_scan_devices and matching on name.
2024-03-25 06:45:01 -07:00
Alynne
2b4c75690c Add Yawman Arrow flightstick controller 2024-03-25 06:34:54 -07:00
Cameron Gutman
f14fb979c1 Remove legacy SDL2 input grab API 2024-03-24 16:53:23 -07:00
Anonymous Maarten
cf3cf0e106 dmg: fix SDL_version.h issue in sdl3-config-version.cmake 2024-03-24 20:15:42 +01:00
Mykola Rubets
fc053fb499 Fix OpenFolder dialog behavior on Windows 2024-03-24 11:44:16 -07:00
Sam Lantinga
13933222ee Fixed string comparison (thanks @meyraud705!) 2024-03-24 11:37:03 -07:00
SDL Wiki Bot
8f33f5cc33 Sync SDL3 wiki -> header 2024-03-24 18:34:24 +00:00
Anonymous Maarten
beb52ed54a pen: remove stray '#include <stdio.h>' 2024-03-24 16:58:59 +01:00
Sam Lantinga
96fbd10de0 Added a script to trigger the release workflow 2024-03-24 07:22:58 -07:00
Sam Lantinga
36e73bdda4 Updated to version 3.1.0 for the preview release 2024-03-24 06:16:02 -07:00
Sam Lantinga
a20eec1415 Tweaking documentation for the SDL 3.0 preview release 2024-03-24 06:16:02 -07:00
Frank Praznik
9e460ce6a6 wayland: Pass the keyboard ID through to repeat events 2024-03-24 08:49:29 -04:00
Christoph Reichenbach
0df0462d0a Removed all tabs in testautomation_pen.c 2024-03-24 05:05:30 -07:00
Christoph Reichenbach
615c7efd98 Fix #9279: Memory leak in pen name handling
- Fixes a leak in pen name allocation that would trigger
  for both X11 and Wayland for some non-pen input devices
  when new devices are added/removed.
- SDL_PenQuit() now deallocates and resets the table of known pens
- testautomation_pen.c now uses PenInit and PenQuit as setup and
  teardown, respectively

testautomation_pen.c was already triggering the leak, and it is
visible with --trackmem, so no new tests are added.
2024-03-24 05:04:53 -07:00
Sam Lantinga
675c9f01ff Renamed releaser.py to build-release.py 2024-03-23 16:56:26 -07:00
Sam Lantinga
c83d0d87c2 Revert "Added virtual keyboard support for Xbox (thanks @ts-13512)"
This reverts commit b5d4206b30.

@nkrapivin already implemented GDK virtual keyboard support in https://github.com/libsdl-org/SDL/pull/7728
2024-03-23 16:47:59 -07:00
Anonymous Maarten
f030533580 SDL_blit: remove SDL_BLIT_CPU_FEATURES override 2024-03-23 16:36:44 -07:00
Anonymous Maarten
1aa9ef7213 cpuinfo: reset cpu features on SDL_Quit 2024-03-23 16:36:44 -07:00
Anonymous Maarten
64465653b4 audio: always build fallback scalar converters 2024-03-23 16:36:44 -07:00
Anonymous Maarten
89b135e570 cmake: add automation and platform test without simd 2024-03-23 16:36:44 -07:00
Anonymous Maarten
1d0e5286aa Limit CPU features through a hint 2024-03-23 16:36:44 -07:00
Sam Lantinga
b5d4206b30 Added virtual keyboard support for Xbox (thanks @ts-13512) 2024-03-23 16:34:43 -07:00
SDL Wiki Bot
675216e81b Sync SDL3 wiki -> header 2024-03-23 23:32:24 +00:00
Sylvain
1855ce68af Fix bug #9331 - SDL3 Android crash getVibrator() == null 2024-03-23 16:31:21 -07:00
Sam Lantinga
208cd434b5 Show the names of mice and keyboards when they connect 2024-03-23 16:31:00 -07:00
Sam Lantinga
7852a6c307 Added device name for evdev mice and keyboards 2024-03-23 16:31:00 -07:00
Frank Praznik
87714ce5b9 wayland: Set the keyboard and mouse names to match XWayland 2024-03-23 16:31:00 -07:00
Sam Lantinga
72fc6f86e5 Text input is no longer automatically enabled when initializing video.
Fixes https://github.com/libsdl-org/SDL/issues/9309
Fixes https://github.com/libsdl-org/SDL/issues/9268
2024-03-23 16:31:00 -07:00
Sam Lantinga
6604d423fd Added a test program for multiple mice 2024-03-23 16:31:00 -07:00
Sam Lantinga
361b7190df Track unique button states between different mice
We were already halfway doing this, but now we make that information available to the Windows driver so it can cache the button state per-mouse
2024-03-23 16:31:00 -07:00
Sam Lantinga
35756593d6 Use the correct device ID (global or default or specific) based on context 2024-03-23 16:31:00 -07:00
Sam Lantinga
9eb87ca325 Note that many things are considered mice and keyboards that you might not expect 2024-03-23 16:31:00 -07:00
Sam Lantinga
c0f4565552 Added SDL_GetKeyboardName() and SDL_GetMouseName() 2024-03-23 16:31:00 -07:00
Sam Lantinga
20a860c876 Use the specific pointer device ID for X11 button and motion events 2024-03-23 16:31:00 -07:00
Sam Lantinga
476245564c Use the real device IDs for the X11 master keyboard and pointer
These always exist so they don't really help detect whether a keyboard/mouse is attached. Looking at the slave devices isn't that helpful either, as they're very permissive in what they might send.

For example, on my system with a single mouse and keyboard attached, xinput -list shows:
 Virtual core pointer                    	id=2	[master pointer  (3)]
   - Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
   - Generic USB Mouse                       	id=10	[slave  pointer  (2)]
   - Generic USB Consumer Control            	id=11	[slave  pointer  (2)]
   - KINESIS CORPORATION KB800HM Kinesis Freestyle2 for Mac	id=18	[slave  pointer  (2)]
   - Logitech Gaming Mouse G502 Consumer Control	id=15	[slave  pointer  (2)]
   - Logitech Gaming Mouse G502              	id=17	[slave  pointer  (2)]
 Virtual core keyboard                   	id=3	[master keyboard (2)]
   - Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
   - Power Button                            	id=6	[slave  keyboard (3)]
   - Power Button                            	id=7	[slave  keyboard (3)]
   - Sleep Button                            	id=8	[slave  keyboard (3)]
   - Generic USB                             	id=9	[slave  keyboard (3)]
   - Generic USB System Control              	id=12	[slave  keyboard (3)]
   - Generic USB Consumer Control            	id=19	[slave  keyboard (3)]
   - KINESIS CORPORATION KB800HM Kinesis Freestyle2 for Mac	id=20	[slave  keyboard (3)]
   - KINESIS CORPORATION KB800HM Kinesis Freestyle2 for Mac	id=21	[slave  keyboard (3)]
   - Logitech Gaming Mouse G502 Keyboard     	id=13	[slave  keyboard (3)]
   - Logitech Gaming Mouse G502 System Control	id=14	[slave  keyboard (3)]
   - Logitech Gaming Mouse G502 Consumer Control	id=16	[slave  keyboard (3)]
2024-03-23 16:31:00 -07:00
Sam Lantinga
d1eb4adb16 Be explicit about the event mouse and keyboard ID 2024-03-23 16:31:00 -07:00
Frank Praznik
1c54455353 wayland: Send keyboard and mouse added/removed events
Send keyboard and mouse added/removed events when seat capabilities change. Note that Wayland only supports one global keyboard and mouse object per seat, so events coming from different keyboards and mice on the same seat can't be distinguished.
2024-03-23 16:31:00 -07:00
Sam Lantinga
2fe1a6a279 Initial support for hotplugging mice and keyboards 2024-03-23 16:31:00 -07:00
Sam Lantinga
c33e4c998d Clear the subsystem ref count when shutting down subsystems in the main quit
This prevents dependent subsystems from being deinitialized multiple times
2024-03-23 16:31:00 -07:00
Sam Lantinga
171ff041d0 Removed invalid ascii from headers 2024-03-23 16:31:00 -07:00
Anonymous Maarten
e19b6c0b95 Add releaser script + workflow 2024-03-23 21:41:23 +01:00
Anonymous Maarten
c81d11fae4 mingw: add pkg-support files (INSTALL.txt and Makefile) 2024-03-23 21:41:20 +01:00
Anonymous Maarten
4defea47e1 dmg: fix sdl3-config.cmake 2024-03-23 21:41:20 +01:00
Anonymous Maarten
2ed0143425 visualc: fix sdl3-config.cmake 2024-03-23 21:41:20 +01:00
Anonymous Maarten
75a71bde4b cmake: build tests against installed SDL prefix 2024-03-23 21:41:20 +01:00
Anonymous Maarten
7f888f98f7 gles2: only build tests when building SDL3 or when the headers are available 2024-03-23 21:41:20 +01:00
Frank Praznik
297f8e41af wayland: Factor out the general SHM buffer allocation/free functions from the cursor code
It will be necessary for a forthcoming toplevel icon setting protocol that will likely soon call for implementations, and is cleaner in general.
2024-03-23 14:17:13 -04:00
Sam Lantinga
3d96c2426f PSP: improve performance counter res to us granularity (thanks @rofl0r!) 2024-03-23 09:34:07 -07:00
Anonymous Maarten
c493b40cc3 testffmpeg_vulkan: fix -Wincompatible-pointer-types warning
```
[1/1] Building C object test/CMakeFiles/testffmpeg.dir/testffmpeg_vulkan.c.o
/src/SDL/test/testffmpeg_vulkan.c: In function ‘BeginVulkanFrameRendering’:
/src/SDL/test/testffmpeg_vulkan.c:787:20: warning: passing argument 1 of ‘vk->lock_frame’ from incompatible pointer type [-Wincompatible-pointer-types]
  787 |     vk->lock_frame(frames, pVkFrame);
      |                    ^~~~~~
      |                    |
      |                    AVHWFramesContext *
/src/SDL/test/testffmpeg_vulkan.c:787:20: note: expected ‘struct AVHWFramesContext *’ but argument is of type ‘AVHWFramesContext *’
/src/SDL/test/testffmpeg_vulkan.c: In function ‘FinishVulkanFrameRendering’:
/src/SDL/test/testffmpeg_vulkan.c:885:22: warning: passing argument 1 of ‘vk->unlock_frame’ from incompatible pointer type [-Wincompatible-pointer-types]
  885 |     vk->unlock_frame(frames, pVkFrame);
      |                      ^~~~~~
      |                      |
      |                      AVHWFramesContext *
/src/SDL/test/testffmpeg_vulkan.c:885:22: note: expected ‘struct AVHWFramesContext *’ but argument is of type ‘AVHWFramesContext *’
```
2024-03-22 11:05:13 -07:00
Marcel Hild
67e425bcf8 Add support for MadCatz Saitek Side Panel Control Deck
Signed-off-by: Marcel Hild <hild@b4mad.net>
2024-03-22 09:15:39 -07:00
Sam Lantinga
05b57f6c2c Simplified SDL_SYS_RemovePath()
If we get ENOENT we call that success. If the parent directory doesn't exist, that's fine, other operations on it will fail if it matters to the application.
2024-03-21 21:16:14 -07:00
Anonymous Maarten
2521ba47fe jack: set error message when failing to open jack client 2024-03-22 01:22:39 +01:00
Mark Delk
dd4636e3fd SDL_sysmutex.c: fix void return compile error 2024-03-21 13:25:01 -07:00
Sam Lantinga
917d683811 Moved SDL_JoyBallEvent together with the other joystick events 2024-03-21 12:51:59 -07:00
Ozkan Sezer
888cc29df6 add missing reserved field to struct SDL_JoyBallEvent,
Fixes https://github.com/libsdl-org/SDL/issues/9327
2024-03-21 20:10:50 +03:00
Sam Lantinga
70b0d33106 Poll for the initial controller state when using DirectInput
This fixes getting a deflected axis as the first buffered input reading on a generic USB controller (G-Shark GS-GP702)
2024-03-20 10:45:11 -07:00
Frank Praznik
4a7e3beeb9 filesystem: Use high-res file times on more platforms
Some POSIX platforms don't define macros to note the presence of the POSIX.1-2008 st_*tim timespec members of the stat struct, so check if this member exists during CMake configuration and conditionally enable it.

Apple platforms use st_*timespec naming, which is supported as of OSX 10.6. SDL3 requires 10.9+, so no fallback is needed.

Android only supports the POSIX.1-2008 semantics as of API version 26 or higher, so this has to be conditionally enabled in the makefile build via an API version definition check.

In other cases, file times fall back to the legacy path with second precision.
2024-03-20 11:39:42 -04:00
Sam Lantinga
18feaa52dd Fixed comment at the top of testtime.c 2024-03-19 17:09:08 -07:00
Sam Lantinga
e0ef4dac85 Fixed int to float conversion warnings 2024-03-19 17:07:52 -07:00
Sam Lantinga
3316587113 Fixed warning C4389: '==': signed/unsigned mismatch 2024-03-19 17:04:29 -07:00
Sam Lantinga
da027ec3ee Fixed signed/unsigned comparison warning 2024-03-19 17:00:46 -07:00
Pierre Wendling
390fff4ae0 N3DS: Fix locale name and early return.
- The name for simplified Chinese should be `zh_CN`.
- Ensure `cfguExit` is called even if `CFGU_GetSystemLanguage` failed.
2024-03-19 16:54:07 -07:00
Pierre Wendling
8f529d9d16 N3DS: Implement SDL_GetSystemTimeLocalePreferences
The formats are deduced based on the system's current language and region.
2024-03-19 16:52:56 -07:00
Sam Lantinga
ed5d2bdda5 Fixed adding duplicate fsops files to CMakeLists.txt 2024-03-19 16:20:55 -07:00
Sam Lantinga
478b965e6c Fixed warning C4702: unreachable code
Also switched SDL_IOFromFile() to use SDL_InvalidParamError()
2024-03-19 16:02:54 -07:00
Sam Lantinga
b1215272ad Fixed warning C4244: '=': conversion from '__int64' to 'int', possible loss of data 2024-03-19 16:02:37 -07:00
Sam Lantinga
2265d22f75 Updated Xcode project for time APIs 2024-03-19 14:53:55 -07:00
Sam Lantinga
c582a89f78 Fixed build warning 2024-03-19 14:53:49 -07:00
Susko3
b90fed094f Standardise header includes
Changes "SDL_*.h" and "SDL3/SDL_*.h" to <SDL3/SDL_*.h>
2024-03-19 13:41:53 -07:00
Ivan Epifanov
2e45568338 PSVita: fix SDL_GetSystemTimeLocalePreferences 2024-03-19 12:32:51 -07:00
SDL Wiki Bot
ba0417db40 Sync SDL3 wiki -> header 2024-03-19 17:58:24 +00:00
Frank Praznik
a6fbf0488c Add time and realtime clock functions
Adds functions to query the system's realtime clock, convert time intervals to/from a calendar date and time in either UTC or the local time, and perform time related calculations.

An SDL_Time type (a time interval represented in nanoseconds), and SDL_DateTime struct (broken down calendar date and time) were added to facilitate this functionality.

Querying the system time results in a value expressed in nanoseconds since the Unix epoch (Jan 1, 1970) in UTC +0000. Conversions to and from the various platform epochs and units are performed when required.

Any direct handling of timezones and DST were intentionally avoided. The offset from UTC is provided when converting from UTC to a local time by calculating the difference between the original UTC and the resulting local time, but no other timezone or DST information is used.

The preferred date formatting and 12/24 hour time for the system locale can be retrieved via global preferences.

Helper functions for obtaining the day of week or day or year for calendar date, and getting the number of days in a month in a given year are provided for convenience. These are simple, but useful for performing various time related calculations.

An automated test for time conversion is included, as is a simple standalone test to display the current system date and time onscreen along with a calendar, the rendering of which demonstrates the use of the utility functions (press up/down to increment or decrement the current month, and keys 1-5 to change the date and time formats).
2024-03-19 10:57:36 -07:00
kanjitalk755
b6c9a72740 Add SDL_storage files to Xcode project 2024-03-18 22:52:58 -07:00
SDL Wiki Bot
b2682da035 Sync SDL3 wiki -> header 2024-03-19 04:57:27 +00:00
Sam Lantinga
24ec1c09b9 Renamed SDL_PROP_IOSTREAM_STDIO_HANDLE_POINTER to SDL_PROP_IOSTREAM_STDIO_FILE_POINTER 2024-03-18 21:56:11 -07:00
Cameron Gutman
d3a785e521 Improve event processing latency when gamepad/sensor is open
By using the SDL_WaitEventTimeout_Device() path even when polling is required,
we can still achieve sub-millisecond latency for non-gamepad/sensor events when
a gamepad or sensor is in use by the application.
2024-03-18 21:52:42 -07:00
Frank Praznik
1eb7b79986 video: Prepend global video property with "SDL" 2024-03-18 21:52:39 -04:00
Sam Lantinga
784311c20e Fixed duplicate SDL_Version change 2024-03-18 13:59:03 -07:00
Anonymous Maarten
009318c5a9 Fix warnings when building with -DSDL_LIBC=OFF on Linux 2024-03-18 21:29:08 +01:00
Anonymous Maarten
f59dbf6a12 cmake: add -Wimplicit-fallthrough warning 2024-03-18 20:34:50 +01:00
Sam Lantinga
086a7a4687 Fixed signed/unsigned comparison warning 2024-03-18 09:48:45 -07:00
Sam Lantinga
491f18eea3 Fixed uninitialized signal_id
Also removed unnecessary SDL_OutOfMemory() calls

Fixes https://github.com/libsdl-org/SDL/issues/9300
2024-03-18 09:12:51 -07:00
Sam Lantinga
90e2551c4f Sort the SDL API symbols
API renames are almost complete, let's prepare for a preview release
2024-03-18 09:03:36 -07:00
SDL Wiki Bot
0d0aaa2d75 Sync SDL3 wiki -> header 2024-03-18 15:57:23 +00:00
Sam Lantinga
92d01ef12a You can pass NULL to SDL_GetPathInfo() and SDL_GetStoragePathInfo() to test for the existence of a file. 2024-03-18 08:56:24 -07:00
Frank Praznik
ebb6582534 wayland: Handle the toplevel export property as a string
xdg-toplevel export handles are strings, so treat the property as one. Avoids the need to manually manage the string pointer.
2024-03-18 11:41:02 -04:00
Petar Popovic
9072b994f7 src/filesystem/unix/SDL_sysfilesystem.c add <stdio.h> inclusion
gets rid of some warnings
2024-03-18 15:55:40 +03:00
Mathieu Eyraud
6af979975f Add missing break 2024-03-18 15:55:14 +03:00
SDL Wiki Bot
fc26d5d328 Sync SDL3 wiki -> header 2024-03-18 04:28:30 +00:00
Sam Lantinga
a1a0156756 Renamed SDL_SizeIO() SDL_GetIOSize() 2024-03-18 00:27:18 -04:00
Sam Lantinga
df0f5deddf Added SDL_IOFromDynamicMem() 2024-03-18 00:27:18 -04:00
rofl0r
12245e4c75 PSP/Joystick: fix formatting
(cherry picked from commit c17d2246fb)
2024-03-17 13:23:51 -07:00
rofl0r
7169db1e62 PSP: don't block on joystick event query
using the blocking sceCtrlReadBufferPositive() effectively turns SDL_PollEvent() into WaitForVblank(), because the functions does exactly that if no input is buffered.
due to this, calling SDL_PollEvent() once per frame averaged in 7 ms delay out of the available 16ms budget to get a frame calculated and drawn to achieve 60 fps.

(cherry picked from commit 86f223d664)
2024-03-17 13:23:51 -07:00
Sam Lantinga
747300b356 SDL file times are 64-bit integers representing nanoseconds since the Unix epoch 2024-03-17 13:21:04 -07:00
Sam Lantinga
9153287fa0 Added storage filesystem operations to the exported function list 2024-03-17 13:02:52 -07:00
SDL Wiki Bot
e7b9f75e62 Sync SDL3 wiki -> header 2024-03-17 19:29:22 +00:00
Sam Lantinga
d65ae710a1 Renamed SDL_LogGetOutputFunction() and SDL_LogSetOutputFunction() to match SDL 3.0 naming convention 2024-03-17 12:28:11 -07:00
Sam Lantinga
d8a54cd4f8 Updated "see also" references to be more consistent
Fixes https://github.com/libsdl-org/SDL/issues/9282
2024-03-17 12:28:11 -07:00
Sam Lantinga
d972244d3a Added a mapping for the Defender Joystick Cobra R4 (thanks @kotenok2000!) 2024-03-17 12:13:21 -07:00
Sam Lantinga
4697153d1e Use the CRC as part of the unique key for mappings 2024-03-17 12:13:21 -07:00
Ryan C. Gordon
9d83c0a65d filesystem: Rename some internal symbols to remove "FSops" terminology.
This removes the "FSops" naming scheme, which was meant to mirror the
"RWops" naming scheme, which was also recently removed from SDL3.

The build system defines (`SDL_FSOPS_POSIX`, etc) and the source code
filenames retain this, because there's already things using the word
"filesystem" that might overlap (for example, lots of things have a
unique "SDL_sysfilesystem.c", to query base dirs, etc, but almost
everything uses the POSIX "SDL_sysfsops.c" source code.

Fixes #9288.
2024-03-17 14:20:11 -04:00
Petar Popovic
4ecea42fb0 testautomation_math.c: use isinf(V) instead of fpclassify(V) == FP_INFINITE
Using fpclassify can cause a linker error.
Using isinf instead fixes this.
2024-03-17 11:12:09 -07:00
Frank Praznik
cb39740cfd wayland: Remove additional instance of setting the viewport source rect 2024-03-17 13:10:48 -04:00
SDL Wiki Bot
a206e1e3c0 Sync SDL3 wiki -> header 2024-03-17 15:40:25 +00:00
Sam Lantinga
2f78e5f321 All storage interface functions are optional
If an application is creating custom storage, presumably they'll implement the functions they need.
2024-03-17 08:39:43 -07:00
Sam Lantinga
f460f42e70 Added filesystem operations to SDL_Storage 2024-03-17 08:39:43 -07:00
Sam Lantinga
7a088527c1 Removed the reserved parameter from SDL_EnumerateDirectoryCallback
If someone needs to, say, include an SDL_Storage object, they can simply point userdata at a structure that includes the the storage and any other data needed in enumeration.
2024-03-17 08:39:43 -07:00
Sam Lantinga
ec3ba387d1 Added SDL_OpenFileStorage() for local file storage 2024-03-17 08:39:43 -07:00
Sam Lantinga
ee0a23c7ab The storage ready callback is optional 2024-03-17 08:39:43 -07:00
Sam Lantinga
db0c1d7aeb Added portable file and directory operations (thanks @icculus!) 2024-03-17 08:39:43 -07:00
Sam Lantinga
fe5c34d4bd Renamed storage functions to match SDL 3.0 naming convention 2024-03-17 08:39:43 -07:00
Frank Praznik
1bab87399f wayland: Always use the entire buffer for the viewport source
Not doing so can result in protocol errors if the viewport source region is updated and a buffer with the old, smaller dimensions is committed.
2024-03-17 10:44:10 -04:00
Anonymous Maarten
e5812a9fd2 testpen: don't include math.h 2024-03-16 20:37:31 +01:00
Anonymous Maarten
2f13f66c71 testautomation: fix renderer leak in video tests 2024-03-16 11:59:04 -07:00
SDL Wiki Bot
9ccde0def4 Sync SDL3 wiki -> header 2024-03-16 14:20:24 +00:00
Ethan Lee
744227e6ab Add SDL_storage 2024-03-16 07:19:50 -07:00
Sam Lantinga
4fc749443f Added dialog files to the Xcode build 2024-03-15 16:27:02 -07:00
Sam Lantinga
25c64a954d Removed UIKit_SetWindowMouseGrab(), mouse grab isn't supported on iOS 2024-03-15 16:26:40 -07:00
Sam Lantinga
41e187be4f Adjust Steam button names to match SDL 2024-03-15 16:05:19 -07:00
Anonymous Maarten
572e088b8f SDL_IOFromMem/SDL_IOFromConstMem: free userdata on close 2024-03-15 23:55:29 +01:00
Frank Praznik
ea60c2079b dialog: Pass the Wayland or X11 parent window handle to the file dialog portal
Pass the Wayland window export string in the form "wayland:<handle string>" or the X11 window XID in the form "x11:<XID in hex>" to the file dialog portal, so that the window manager can associate the dialog with the parent window and position it correctly.
2024-03-15 18:30:05 -04:00
Frank Praznik
d523cd069f dialog: Detect if the file chooser portal is available
Use the introspection method to detect if the file chooser portal is available.
2024-03-15 18:30:05 -04:00
Frank Praznik
19764ffcc8 wayland: Add the xdg-foreign-unstable-v2 protocol
Add the xdg-foreign-unstable-v2 protocol and use it to create export handles for toplevel windows, which will be used when an external component, such as the file chooser portal, requires it.
2024-03-15 18:30:05 -04:00
Anonymous Maarten
db31367999 testffmpeg: use SDL_free instead of free 2024-03-15 21:26:40 +01:00
Anonymous Maarten
f8c2ec5462 testffmpeg: use Uint64 instead of __u64 2024-03-15 21:26:40 +01:00
Petar Popovic
2b45452dd5 Adding comments to init-flags SDL_INIT_AUDIO and SDL_INIT_SENSOR that they imply SDL_INIT_EVENTS
When initializing SDL with the flag SDL_INIT_AUDIO or SDL_INIT_SENSOR the event subsystem also gets initialized(SDL_INIT_EVENTS). This isn't mentioned in the comments.
This commit adds these two comments.
2024-03-15 13:10:49 -07:00
SDL Wiki Bot
fa7ec59ecd Sync SDL3 wiki -> header 2024-03-15 19:59:26 +00:00
Ryan C. Gordon
ec6de7017c Merge pull request #9254 from icculus/sdl3-rwops-hidden-interface
rwops: Reworked RWops for SDL3. Now it's SDL_IOStream!
2024-03-15 15:58:41 -04:00
Ryan C. Gordon
b7cda16613 iostream: Final fixes before merging.
- SDL_GetRWProperties -> SDL_GetIOProperties
- SDL_GetRWStatus -> SDL_GetIOStatus
- Some documentation corrections and improvements.
2024-03-15 15:37:03 -04:00
Ryan C. Gordon
c175eb488c iostream: Note that the new name has nothing to do with C++'s iostream class. 2024-03-15 01:16:31 -04:00
Ryan C. Gordon
5a21d87e69 rwops: Changed filenames that reference "rwops" to "iostream". 2024-03-14 23:30:59 -04:00
Ryan C. Gordon
6776b6108a iostream: "free*" params should be "closeio". 2024-03-14 23:14:46 -04:00
Ryan C. Gordon
5440fd7d12 README-migration.md: Fixed some RWops mistakes. 2024-03-14 23:13:26 -04:00
Ryan C. Gordon
3a344cf877 rwops: Fixed some SDL2 symbols that got missed. 2024-03-14 21:57:21 -04:00
Ryan C. Gordon
5f64cc511e rwops: Fixed build on Android. 2024-03-14 19:38:15 -04:00
Ryan C. Gordon
fc7afa9cbf rwops: Renamed SDL_RWops to SDL_IOStream, and other related symbols. 2024-03-14 19:38:12 -04:00
Ryan C. Gordon
fe33b2a81b rwops: Give implementations access to status value. 2024-03-14 19:37:07 -04:00
Ryan C. Gordon
447c29e65c include: Added missing RWops documentation. 2024-03-14 19:37:07 -04:00
Ryan C. Gordon
cc58da4c63 rwops: Add SDL_GetRWStatus, make the statuses into an enum. 2024-03-14 19:37:06 -04:00
Ryan C. Gordon
e35c304022 rwops: Add properties for some of the internal implementation details. 2024-03-14 19:37:05 -04:00
Ryan C. Gordon
7d4d8ccde0 rwops: Rename everything from SDL_RWxxx to SDL_XxxRW. 2024-03-14 19:37:04 -04:00
Ryan C. Gordon
655ceb3b31 rwops: Renamed SDL_CreateRW and SDL_DestroyRW to SDL_OpenRW and SDL_CloseRW. 2024-03-14 19:37:01 -04:00
Ryan C. Gordon
525919b315 rwops: Reworked RWops for SDL3.
- SDL_RWops is now an opaque struct.
- SDL_AllocRW is gone. If an app is creating a custom RWops, they pass the
  function pointers to SDL_CreateRW(), which are stored internally.
- SDL_RWclose is gone, there is only SDL_DestroyRW(), which calls the
  implementation's `->close` method before freeing other things.
- There is only one path to create and use RWops now, so we don't have to
  worry about whether `->close` will call SDL_DestroyRW, or if this will
  risk any Properties not being released, etc.
- SDL_RWFrom* still works as expected, for getting a RWops without having
  to supply your own implementation. Objects from these functions are also
  destroyed with SDL_DestroyRW.
- Lots of other cleanup and SDL3ization of the library code.
2024-03-14 19:36:08 -04:00
SDL Wiki Bot
495e432fb9 Sync SDL3 wiki -> header 2024-03-14 22:41:24 +00:00
Semphris
70c2e15615 Add file dialogs 2024-03-14 15:40:25 -07:00
Sam Lantinga
30e93b40c2 If a mapping specifies a crc, don't match for controllers that don't have that CRC
The CRC is used to distinguish between different controllers that have the same VID/PID, so if the CRC doesn't match, it's probably a different controller that we don't know about.

Fixes https://github.com/libsdl-org/SDL/issues/9265
2024-03-14 13:26:56 -07:00
Sam Lantinga
6c11449cd4 Added a note for the SDL_CommonEvent type 2024-03-14 09:00:47 -07:00
Sam Lantinga
209a87bf24 Added missing default case (thanks @sezero!) 2024-03-14 08:52:59 -07:00
Sam Lantinga
442073f379 Added missing reserved field in SDL_CameraDeviceEvent (thanks @Saalvage!) 2024-03-14 08:51:48 -07:00
Sam Lantinga
9bef331dc8 Note that SDL_UserEvent and SDL_Event type are intentionally Uint32 2024-03-14 08:49:02 -07:00
Frank Praznik
717f297849 Add 'wl_list_for_each_safe' to the clang-format macro list
...and fix the formatting when it is used.
2024-03-14 10:22:23 -04:00
Sam Lantinga
3875ef4552 Removed duplicated line (thanks @sechshelme!)
Fixes https://github.com/libsdl-org/SDL/issues/9264
2024-03-13 13:47:32 -07:00
Frank Praznik
4686a737a9 wayland: Minor cursor code cleanup
Clean up variable declarations and fix some formatting issues.
2024-03-13 12:39:00 -04:00
Dimitriy Ryazantcev
1973edb9b7 WIN_UpdateKeymap: cleanup code a bit 2024-03-13 09:09:59 -07:00
Anthony
0a86f8eb6e Move some code blocks inside SDL_VIDEO_RENDER_SW, where it belongs (#9259)
There was some software renderer specific code that can be excluded with SDL_LEAN_AND_MEAN. This contributes towards #9206
2024-03-12 21:15:46 -07:00
Frank Praznik
c2e9693de5 wayland: Add cursor-shape-v1 protocol support 2024-03-12 20:54:55 -04:00
Frank Praznik
9bdb992925 wayland: Allocate the cursor shared memory buffer entirely in memory, if possible.
Use memfd_create() to allocate the temporary SHM backing file in memory, and set the size with posix_fallocate(), which will return an error on insufficient space vs ftruncate(), which will silently succeed and allow a SIGBUS error to occur if the unbacked memory is accessed.

Additionally, make the legacy path more robust by unlinking the temp file, so it won't persist after close, and unmapping the shared memory buffer.
2024-03-12 20:54:55 -04:00
Sam Lantinga
41b7036f37 testffmpeg: added support for EGL OES frame formats 2024-03-12 16:13:04 -07:00
Sam Lantinga
d79f865251 Removed incorrect mapping for a HORI controller
This broke support for the Hori Fighting Stick EX2, which gets a good mapping if the automatic mapping is allowed to create one.

If the original controller needs a mapping, it should be added with a crc, since that VID/PID combination is used by several HORI controllers.
2024-03-11 17:11:20 -07:00
Sam Lantinga
d78a24a5ce testffmpeg: added verbose logging of ffmpeg messages 2024-03-11 15:48:52 -07:00
Sam Lantinga
7c5f79e7ea testffmpeg: removed redundant enumeration of hardware device types 2024-03-11 15:31:47 -07:00
Anonymous Maarten
bee8a95571 Fix SDL_LEAN_AND_MEAN build 2024-03-11 13:46:16 -07:00
Sam Lantinga
d4794cc714 Fix crash in SDL_UpdateFullscreenMode calling SetWindowFullscreen with a null display
- This mirrors the check above for fullscreen=true in the unlikely case where there is no primary display detected
2024-03-11 11:17:45 -07:00
Sam Lantinga
ab5351f5d6 Fixed leaving the cursor clip set when changing window focus
While the focus change happens, Windows appears to reset the cursor clip rectangle, and then restore it if the application that has focus has the clip rectangle set.

This fixes resetting the clip rectangle while changing focus between windows in the same application, e.g. the Source 2 editor.
2024-03-11 10:58:40 -07:00
Sam Lantinga
b322d27f62 Missed SDL_NumJoystickBalls() rename in SDL_migration.cocci 2024-03-10 21:31:19 -07:00
Sam Lantinga
efbbafb3f1 Re-added balls to the SDL joystick API
It turns out these were being used on Linux and at least one virtual driver was making use of them (thanks @mrfixit2001!)
2024-03-10 21:30:14 -07:00
Sam Lantinga
53e86be22f Minor cleanup with the new PS3 driver for windows 2024-03-10 20:12:11 -07:00
Riccardo Marcangelo
6534029691 Add DualShock 3 HIDAPI support on Windows (#9144)
This adds HIDAPI support for DualShock 3 controllers on Windows, addressing the current absence of this feature in SDL. To utilize this functionality, the official Sony driver 'sixaxis.sys' must be installed. HID offers several advantages over DirectInput, including rumble support and the ability to control the LED lights that display the controller number.
2024-03-10 20:08:36 -07:00
r4nx
feadbffb67 Destroy properties after applying them to avoid memory leakage 2024-03-10 18:16:40 -07:00
Anonymous Maarten
b5eb704fa8 cmake: we only need a C++ compiler for Android, Haiku and UWP
Our CMake script does (currently) not support NGage, Xbox One, or Xbox Series.
2024-03-11 00:27:54 +01:00
Sam Lantinga
fde420a645 Revert "Added SDL_FLIP_DIAGONAL"
This reverts commit b9ab326982.

@rainerdeyke pointed out:
"This commit is incorrect. Flipping both horizontally and vertically is not equivalent to flipping diagonally."
2024-03-10 15:20:36 -07:00
Sam Lantinga
e3cf2e4794 Turn HIDAPI joystick support off by default on mobile platforms
On Android, HIDAPI prompts for permissions and acquires exclusive access to the device, and on Apple mobile platforms it doesn't do anything except for handling Bluetooth Steam Controllers.

Fixes https://github.com/libsdl-org/SDL/issues/9241
2024-03-10 15:00:49 -07:00
Sam Lantinga
ed463b41e1 Unified the software renderer creation path
Previously there were two different paths for renderer creation, and the HDR metadata initialization was missing when creating a software renderer for a surface. Now all the cases are handled in a single path, so regardless of whether you create a software renderer by name, a software renderer for a surface, or fall back to a software renderer, you'll get the correct initialization in all cases.

Fixes https://github.com/libsdl-org/SDL/issues/9221
2024-03-10 11:05:26 -07:00
RPP-dev
b9ab326982 Added SDL_FLIP_DIAGONAL
Since SDL_RenderFlip is an enum, SDL_FLIP_HORIZONTAL and SDL_FLIP_VERTICAL can not be OR'ed to get the "SDL_FLIP_DIAGONAL".
Render code is actually able to perform these 3 kind of "flipping" so I just added a new enum called SDL_FLIP_DIAGONAL with the OR'ed value (3) so it can be used.
2024-03-10 09:27:14 -07:00
Anonymous Maarten
7341d5f361 cmake: allow hidapi to use libusb on Windows
When using SDL_HIDAPI_LIBUSB_SHARED=ON, extract the dll file name
from the import library.
2024-03-10 09:07:33 -07:00
Anonymous Maarten
3bc27d3856 hidapi_libusb: use SDL_wcscmp and SDL_wcslcpy from SDL 2024-03-10 09:07:33 -07:00
Anonymous Maarten
0e6fcf947a cmake: find libusb through LibUSB cmake module 2024-03-10 09:07:33 -07:00
Tolik708
2a775cad6f Named typedef-ed structs Gave name to structs that were defined like anonymous struct with name given by typedef. Example 'typedef struct {...} Foo;' -> 'typedef struct Foo {...} Foo;' 2024-03-10 09:04:18 -07:00
Sam Lantinga
37d066b99b Clarify what pitch means (thanks @zlago!) 2024-03-10 09:02:59 -07:00
Frosty-J
f9d018c808 Add flag to registerReceiver on Android 2024-03-10 09:01:07 -07:00
Green Sky
4de30a26a2 x11: workaround issues with primary selection and clipboard temporal ignorance 2024-03-10 08:59:44 -07:00
Simon McVittie
76defc5c82 joystick: Remove redundant CHECK_JOYSTICK_MAGIC in SDL_GetJoystickName
Since commit 0dfdf1f3 "Fixed crash if joystick functions are passed a
NULL joystick", we've already done this check by the time we get to
this point.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-03-09 08:40:04 -08:00
a dinosaur
41baf23e44 cmake: fix empty framework prefix on MacOS 2024-03-09 08:18:47 -08:00
Nour Fouad
b6c5ad0075 Update hardcoded value of pi to use SDL constant SDL_PI_F for improved consistency and readability. 2024-03-08 20:49:01 -08:00
Sam Lantinga
fcb132b8e8 Allow building testffmpeg without Vulkan support 2024-03-08 16:45:27 -08:00
Sam Lantinga
16e0806ced Note that the cursor clip has been cleared even if we didn't do it
This releases the mouse cursor when bringing up the console on Counter Strike in dev mode.
2024-03-08 15:56:49 -08:00
Mingjie Shen
19b3ddac2f Fix TOCTOU race condition
Separately checking the state of a file before operating on it may allow
an attacker to modify the file between the two operations. (CWE-367)
Fix by using fstat() instead of stat().
2024-03-08 15:52:04 -08:00
Sam Lantinga
cde793b0f5 Added support for the 6-button SEGA Mega Drive Control Pad for Nintendo Online
Closes https://github.com/libsdl-org/SDL/pull/9225
2024-03-08 12:33:54 -08:00
Ozkan Sezer
d86ff6c6c0 remove stale / wrong information from SDL_RWread() documentation 2024-03-08 18:55:40 +03:00
Ozkan Sezer
9e89f093d9 remove stale / wrong information from SDL_RWread() documentation 2024-03-08 18:55:19 +03:00
Sam Lantinga
790cd395f5 Make sure the type in the SDL_Event aligns properly across the union 2024-03-07 06:58:43 -08:00
Sam Lantinga
e9ab2d46de Revert "Change SDL_Keycode type to an enum"
SDL_Keycode can actually be any printable character on the keyboard, so isn't limited to the enumerated values of SDL_KeyCode.
2024-03-07 06:58:43 -08:00
Sam Lantinga
33eaddc565 Cleaned up various type conversion issues
This makes sure SDL_PixelFormatEnum flows through the internal code correctly, as well as fixing a number of other minor issues.
2024-03-07 06:58:43 -08:00
Sam Lantinga
f53bdc9531 The pixel format in SDL_DisplayMode uses SDL_PixelFormatEnum 2024-03-07 03:39:06 -08:00
Sam Lantinga
57a160c9ab Fixed mapping for the Sanwa Supply JY-P76USV controller 2024-03-06 20:53:48 -08:00
Sam Lantinga
5643fd683f Added migration notes for enum type changes 2024-03-06 16:59:28 -08:00
Anonymous Maarten
3cc4705dd2 cmake: build OBJC sources with warning & error flags, ignoring deprecated declarations 2024-03-07 01:58:28 +01:00
SDL Wiki Bot
59ab5c0824 Sync SDL3 wiki -> header 2024-03-07 00:20:27 +00:00
Sam Lantinga
c70710cde8 SDL_GetPixelFormatEnumForMasks() returns SDL_PixelFormatEnum 2024-03-06 16:19:08 -08:00
Susko3
01248a99c8 Add default: break; to switches on SDL_Event::type
This is just a nice-to-have, as `SDL_Event::type` in an `Uint32`, so there are no
compiler errors about not handling all `SDL_EventType` enum values.
2024-03-06 15:40:05 -08:00
Susko3
722f4104bf Use enums as types in SDL_*Event structures
The main `SDL_Event` union is not using the enum as
valid user events types are not in the enum.
2024-03-06 15:40:05 -08:00
Susko3
641b911d38 Update some internal files to use SDL_WindowFlags 2024-03-06 15:08:12 -08:00
Susko3
ce44eff3d2 Use SDL_WindowFlags in public headers 2024-03-06 15:08:12 -08:00
Susko3
4f58d18373 Typedef SDL_WindowFlags
Window flags were previously an enum with the same name.
See ebd7f9adbd.
2024-03-06 15:08:12 -08:00
Susko3
424616e032 Use SDL_PixelFormatEnum as type 2024-03-06 15:02:13 -08:00
Sam Lantinga
38c54b8e0e More null checks for SDL window operations 2024-03-06 13:33:30 -08:00
Sam Lantinga
6664a089d8 Add missing null check for displaydata during window creation
Found in the wild from minidump reports. Unclear displaydata is null, but according
to the API it is possible for this call to return null so it seems like a valid check.
2024-03-06 13:33:27 -08:00
Sam Lantinga
610e798406 Fix clicking on the titlebar causing mouse input to freeze until esc is pressed
When the titlebar drage region is clicked two actions are triggered:
  * The WM transfers focus to the application
  * The application starts a drag operation because the drag region was clicked

When the drag operation starts before input has been transferred to the application the
window manager gets in a bad state where mouse clicks don't work and the system isn't
actually dragging.

In this CL we delay drag operations until after the application has acquired active focus.
This fixes the problems outlined above.
2024-03-06 13:33:23 -08:00
Sam Lantinga
65a718f8c6 Disable warning C4113 in SDL_windows_gaming_input.c
- A new version of warning C4028 added in VS 2022.
2024-03-06 13:33:20 -08:00
Frank Praznik
53896c9e44 cocoa: Make keyboard grab function return an int 2024-03-06 15:53:24 -05:00
Susko3
f8cb3c742d Change SDL_Keycode type to an enum 2024-03-06 12:17:53 -08:00
Susko3
f8844d387c Use specific types in SDL_touch.h
Missed when picking 7ff34249c7 from https://github.com/libsdl-org/SDL/pull/9191.
2024-03-06 10:35:20 -08:00
Sam Lantinga
26b9178e5c Fixed whitespace 2024-03-06 09:57:39 -08:00
Sam Lantinga
c07b39fa06 Fixed build 2024-03-06 09:57:39 -08:00
SDL Wiki Bot
2d0cd90171 Sync SDL3 wiki -> header 2024-03-06 17:52:26 +00:00
Sam Lantinga
860155680d SDL_RegisterEvents() now returns 0 if it couldn't allocate any user events. 2024-03-06 09:51:15 -08:00
Ozkan Sezer
4d20b82850 SDL_RWFromFile, stdio: allow named pipes along with regular files.
Fixes https://github.com/libsdl-org/SDL/issues/9174

(cherry picked from commit 177a836653)
2024-03-06 18:51:20 +03:00
Sam Lantinga
ee87132385 Make sure fast path RGB <-> YUV conversions are using the same color primaries 2024-03-05 17:43:08 -08:00
Sam Lantinga
4545c77c9e Updated Vita renderer with colorspace clarification 2024-03-05 16:56:58 -08:00
Sam Lantinga
95fbbc6f07 Fixed accidental use of tabs 2024-03-05 16:55:26 -08:00
Susko3
e268cdbec6 Use specific types in public headers (#9205)
Uses specific typedef'd types instead of generic integral types where applicable.
2024-03-05 16:52:15 -08:00
Sam Lantinga
db24560387 Additional colorspace clarification
Note that SDL_MATRIX_COEFFICIENTS_BT470BG is functionally equivalent to SDL_MATRIX_COEFFICIENTS_BT601
2024-03-05 16:47:36 -08:00
Sam Lantinga
b3858ec5f7 BT2020_CL is very different from BT2020_NCL, and not currently supported 2024-03-05 15:49:17 -08:00
Frank Praznik
4c0601b93f video: Return a failure code if the video driver fails to grab the mouse or keyboard
Alter the video driver grab/confinement function signatures to return an int, set and return an error if the grab request fails, and clear the grab flags from the window if the mouse and/or keyboard wasn't actually grabbed.
2024-03-05 17:59:10 -05:00
Sam Lantinga
ae0caeef8d Fixed build 2024-03-05 13:54:17 -08:00
Sam Lantinga
9db68f97f9 Reverted SDL_Vulkan_GetInstanceExtensions() API change
This function is commonly used with Vulkan structures that use uint32_t, so we should keep the Uint32 signature.
2024-03-05 13:39:42 -08:00
Sam Lantinga
edbcef11ff Keep track of whether the Android on-screen keyboard was opened by the application
Fixes https://github.com/libsdl-org/SDL/issues/9202
2024-03-05 13:35:17 -08:00
Sam Lantinga
c36f773eb4 Fixed "${folder^}Activity: bad substitution" with bash 3.2 on macOS 2024-03-05 13:35:17 -08:00
SDL Wiki Bot
0b4a195f4b Sync SDL3 wiki -> header 2024-03-05 21:32:25 +00:00
Sylvain
cea717e5d3 Removed some uneeded 'unsigned': renderer.num_texture_format and SDL_Vulkan_GetInstanceExtensions() prototype 2024-03-05 13:31:28 -08:00
Sam Lantinga
1e0bac288b Use the hlsli extension for shader includes 2024-03-05 12:46:44 -08:00
Anonymous Maarten
4898505f23 cmake: add winres to the list of potential name rc compilers 2024-03-05 20:38:00 +01:00
Sam Lantinga
d4f4aa745a Use C++ style comments in new code 2024-03-05 04:46:37 -08:00
Ozkan Sezer
98bec6749f hidapi, windows: sync with mainstream: change MAX_STRING_WCHARS to 126.
This merges mainstream commit
4f2e91bae8
(authored by Vladimir Gladkov) into ours. From the original commit log:

Win32 HID API doc says: For USB devices, the maximum string length is
126 wide characters (not including the terminating NULL character).

For certain USB devices, using a buffer larger or equal to 127 wchars
results in successful completion of HID API functions, but a broken
string is stored in the output buffer. This behaviour persists even if
HID API is bypassed and HID IOCTLs are passed to the HID driver directly
(IOCTL_HID_GET_MANUFACTURER_STRING, IOCTL_HID_GET_PRODUCT_STRING, etc).

So, the buffer MUST NOT exceed 126 wchars.

windows: refactor ULONGLONG hid_internal_get_info(...) ->
 hid_internal_detect_bus_type_result hid_internal_detect_bus_type(...)

hid_internal_detect_bus_type is now only responsible for detection of
the bus type; rename it accordingly. Also, mixing an internal flag and
DEV_INST into an ULONGLONG retval feels kinda hackish; use a cleaner
approach instead (add an internal flag to help distinguishing between
BLUETOOTH and BLE devices, then clear it once we are done).
2024-03-05 14:39:20 +03:00
Ozkan Sezer
26e3ca7387 hidapi: minor sync with mainstream (for sake of symmetry, only.) 2024-03-05 14:33:06 +03:00
Sam Lantinga
fb87f8f15c testffmpeg: fixed mismatch between frame size and frame texture size
The AVHWFramesContext associated with the frame has the texture size, and the frame width and height are the displayed size and can be smaller than the texture size
2024-03-04 11:17:42 -08:00
Sam Lantinga
180dd0bb39 testffmpeg: don't free the instance extensions, we hold onto them in the context 2024-03-04 11:17:42 -08:00
Sam Lantinga
2d4105ba8b testffmpeg: only enable AV_PIX_FMT_VULKAN if we have a Vulkan renderer 2024-03-04 11:17:42 -08:00
Sam Lantinga
759ade8c90 vulkan: enable samplerYcbcrConversion when creating the device 2024-03-04 11:17:42 -08:00
SDL Wiki Bot
ffef13e1e1 Sync SDL3 wiki -> header 2024-03-04 17:30:25 +00:00
Sam Lantinga
97f97109d1 testffmpeg: fixed Vulkan validation errors
The semaphores need to be submitted in order
2024-03-04 09:29:36 -08:00
Sam Lantinga
dbec2150d0 testffmpeg: added support for Vulkan rendering 2024-03-04 09:29:36 -08:00
Sam Lantinga
48471f7dbd Added SDL_AddVulkanRenderSemaphores() for external synchronization with SDL rendering 2024-03-04 09:29:36 -08:00
Sam Lantinga
504d8c2fc0 Fixed potential memory leak if vkCreateInstance() fails 2024-03-04 09:29:36 -08:00
Frank Praznik
1e790b20c9 video: Don't overwrite all the pending flags in the OnWindowHidden handler
Other flags may have been set when programmatically hiding a window, so or in the fullscreen and maximized flags to avoid accidentally clearing any others.
2024-03-04 10:30:11 -05:00
Sam Lantinga
4189edaeb7 Uppercase the first letter of the class name to match Java conventions
Fixes https://github.com/libsdl-org/SDL/issues/8930
2024-03-03 16:57:02 -08:00
Robert Edmonds
a4d7ff6751 testffmpeg: Use EGL_EXT_image_dma_buf_import_modifiers extension
If the `EGL_EXT_image_dma_buf_import_modifiers` extension is available, propagate the DRM format modifier from the AVDRMObjectDescriptor to eglCreateImage() on Linux. Some hardware will decode video into a non-linear DRM surface, and passing the DRM format modifier to eglCreateImage() is required in order to display something useful.

Fixes https://github.com/libsdl-org/SDL/issues/9075
2024-03-03 15:18:56 -08:00
Frank Praznik
ae4484f4e5 video: Save pending window events when a window is hidden by the window manager
The window manager might hide/unmap the window when it is minimized, in which case the fullscreen and maximized flags must be preserved as pending flags so the window will be restored to the proper state when shown/mapped on restoration.
2024-03-03 18:01:25 -05:00
Sam Lantinga
9be35d4603 Convert mappings using labeled buttons to positional buttons
We were accidentally skipping all of the mappings that used the SDL_GAMECONTROLLER_USE_BUTTON_LABELS hint, because they used the '!' negate operator with a default hint value of 1. Instead we just want to use that hint to determine whether the mapping has positional buttons or not, and swap the buttons as needed.

Fixes https://github.com/libsdl-org/SDL/issues/9190
2024-03-03 14:17:03 -08:00
Sam Lantinga
ccd309c433 Added a mapping for the Sanwa Supply JY-P76USV controller
Fixes https://github.com/libsdl-org/SDL/issues/8644
2024-03-03 12:23:00 -08:00
Sam Lantinga
8d8076263e Removed the mapping for the G-Shark GS-GP702
This uses the same chipset as the DragonRise Inc. Generic USB Joystick, which many manufacturers use for different products with different mappings.

In order to add a mapping for a controller using this chipset, we need a unique crc for the device name.
2024-03-03 12:18:57 -08:00
Sam Lantinga
1b86a1c684 SDL_GetGamepadAppleSFSymbolsNameForAxis() returns NULL if the symbol isn't found 2024-03-03 11:55:40 -08:00
Sam Lantinga
5f37242607 Don't clear the clipboard on quit
Fixes https://github.com/libsdl-org/SDL/issues/8830
2024-03-03 11:48:08 -08:00
Sam Lantinga
6e03914375 Fixed signed/unsigned comparison warning 2024-03-03 11:36:23 -08:00
Sam Lantinga
2c85052966 Removed unused headers from SDL_rect.h
Fixes https://github.com/libsdl-org/SDL/issues/8966
2024-03-03 11:33:59 -08:00
Sam Lantinga
e54001b028 Updating the mouse capture should use the mouse focus window
Fixes https://github.com/libsdl-org/SDL/issues/8974
2024-03-03 11:32:17 -08:00
Sam Lantinga
c1da39a245 SDL_GetGamepadAppleSFSymbolsNameForButton() returns NULL if the symbol isn't found
Fixes https://github.com/libsdl-org/SDL/issues/9071
2024-03-03 11:07:39 -08:00
Sam Lantinga
74f4614289 Save the native texture parent and return that in SDL_GetRenderTarget()
Fixes https://github.com/libsdl-org/SDL/issues/9176
2024-03-03 09:47:40 -08:00
Susko3
86d36a2dc2 Add missing include 2024-03-03 09:37:59 -08:00
Sam Lantinga
eb5a2e7e7f Fixed building with SDL_LEAN_AND_MEAN
Fixes https://github.com/libsdl-org/SDL/issues/9173
2024-03-03 09:25:02 -08:00
Sam Lantinga
107e06a92a Use a valid finger ID when generating touch events from mouse events
Fixes https://github.com/libsdl-org/SDL/issues/9185
2024-03-03 09:15:07 -08:00
meyraud705
c6ec999869 Set udev class for accelerometer 2024-03-03 08:40:24 -08:00
Nour Fouad
e524e545f2 Add vulkan to SDL_HINT_RENDER_DRIVER 2024-03-02 15:17:09 -08:00
Sam Lantinga
88dcf74588 testyuv: we no longer need to override the HDR headroom for the BT.2020 test 2024-03-02 15:06:28 -08:00
SDL Wiki Bot
27389716ac Sync SDL3 wiki -> header 2024-03-02 23:05:24 +00:00
Sam Lantinga
7f9ff6277c Don't assume HDR headroom for HDR10 surfaces
Applications that support HDR will set the correct values for their content.
2024-03-02 15:02:17 -08:00
Jade Macho
c74f273848 d3d12: Move root sigs to D3D12_Shader_Common.hlsli, fix mismatch 2024-03-02 10:30:29 -08:00
Jade Macho
e2a8209263 GDK: Use WIN_IsRectEmpty (IsRectEmpty is desktop-only) 2024-03-02 10:30:29 -08:00
Jade Macho
290f64b86c GDK: Windows shape is desktop-only 2024-03-02 10:30:29 -08:00
Jade Macho
794f0f1b42 GDK: Fix SDL_pixels.c/_c.h linking error caused by C / C++ mismatch 2024-03-02 10:30:29 -08:00
Jade Macho
23ace600fc GDK: Remove old shader sources, unify shader compilation .bats 2024-03-02 10:30:29 -08:00
Jade Macho
bcbede31ce GDK: SDL_video_capture.c is now SDL_camera.c, thus remove from proj 2024-03-02 10:30:29 -08:00
Jade Macho
e1e5d33420 GDK: Partially revert 2670eb44af
MsgWaitForMultipleObjects is desktop-only.
2024-03-02 10:30:29 -08:00
SDL Wiki Bot
8c015cd3b6 Sync SDL3 wiki -> header 2024-03-02 18:02:26 +00:00
Sam Lantinga
8d023f9869 Updated documentation for new property parameters 2024-03-02 09:56:29 -08:00
Sam Lantinga
2bc2840de5 vulkan: VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16 is a 2-plane format 2024-03-01 20:26:52 -08:00
Sam Lantinga
2bedd7f02e Fixed pitch alignment when updating SDL_PIXELFORMAT_P010 textures 2024-03-01 20:26:52 -08:00
Sam Lantinga
f2cd361e25 testyuv: added validation of P010 YUV format
Also added conversion between RGB and P010, using XRGB2101010 as a bridging format in PQ space
2024-03-01 20:26:52 -08:00
Sam Lantinga
47be24d225 testyuv: added --monochrome and --luminance options for interactive mode 2024-03-01 07:42:34 -08:00
Sam Lantinga
991ad27de8 testyuv: added GetColorspaceForYUVConversionMode() 2024-03-01 07:42:34 -08:00
danginsburg
812e04fb11 Vulkan Renderer - fix validation error with VkSemaphore reused before signaling. Have one semaphore per-submit rather than using the same one. 2024-03-01 06:09:22 -08:00
Ryan C. Gordon
1e8b006d43 stdlib: qsort and bsearch changes.
- Always use internal qsort and bsearch implementation.
- add "_r" reentrant versions.

The reasons for always using the internal versions is that the C runtime
versions' callbacks are not mark STDCALL, so we would have add bridge
functions for them anyhow, The C runtime qsort_r/qsort_s have different
orders of arguments on different platforms, and most importantly: qsort()
isn't a stable sort, and isn't guaranteed to give the same ordering for
two objects marked as equal by the callback...as such, Visual Studio and
glibc can give different sort results for the same data set...in this
sense, having one piece of code shared on all platforms makes sense here,
for reliabillity.

bsearch does not have a standard _r version at all, and suffers from the
same SDLCALL concern. Since the code is simple and we would have to work
around the C runtime, it's easier to just go with the built-in function
and remove all the CMake C runtime tests.

Fixes #9159.
2024-03-01 08:28:12 -05:00
Sam Lantinga
af58ed978e Fixed the documentation for SDL_GetGamepadMappings() 2024-03-01 01:55:56 -08:00
SDL Wiki Bot
7ff9be7398 Sync SDL3 wiki -> header 2024-03-01 01:39:28 +00:00
Sam Lantinga
0454e1fdb4 Vulkan: added support for wrapping existing textures 2024-02-29 17:38:10 -08:00
Sam Lantinga
2adbcce864 Vulkan: wait for all queues to be idle before destroying the device 2024-02-29 14:12:09 -08:00
danginsburg
0115027116 Vulkan Renderer - fix validation errors:
* Make sure to always write pointSize in VS (fixes validation error in testsprite)
* Fix validation error from acquiring swapchain semaphore more than once
* Fix validation error from using incorrect framebuffer size in testautomation

Now passes testautomation with validation.
2024-02-29 10:59:47 -08:00
Sam Lantinga
0c6a1b636e Vulkan: added handling for SDL_MATRIX_COEFFICIENTS_UNSPECIFIED 2024-02-28 19:18:37 -08:00
Sam Lantinga
4017e1370d Vulkan: cleaned up error handling 2024-02-28 19:11:33 -08:00
Sam Lantinga
59bbfc1fdd Vulkan: only advertise YUV formats if the VK_KHR_sampler_ycbcr_conversion extension is available
Also check to see if it's available when given an external Vulkan device
2024-02-28 19:04:00 -08:00
Sam Lantinga
bf853823a2 Removed unused YCbCr_matrix from Vulkan shaders 2024-02-28 18:38:06 -08:00
Sam Lantinga
039144350c Be more precise about what we're testing in testyuv 2024-02-28 17:15:47 -08:00
Sam Lantinga
b30ba1c5d4 Updated RGBtoYUV() to use the full YCbCr conversion formula 2024-02-28 16:58:39 -08:00
Sam Lantinga
4513c32bb3 The ycbcrModel should be based on the transfer matrix, not the color primaries 2024-02-28 16:58:39 -08:00
Sam Lantinga
a241cca9e6 Fixed warning C4090: 'function': different 'const' qualifiers 2024-02-28 11:45:24 -08:00
Sam Lantinga
7117d545a3 Fixed crash if the controller product name is NULL
This happens when the Razer Synapse software emulates a controller with a keyboard
2024-02-28 11:43:22 -08:00
Sam Lantinga
353e76b40b Use the correct colorspace for yuv conversion tests 2024-02-28 10:03:18 -08:00
Sam Lantinga
fc94c3634e Fixed signed/unsigned comparison warning 2024-02-28 09:06:21 -08:00
Sam Lantinga
ba34025423 Use direct3d11 as the default renderer on Windows
The D3D12 renderer initializes but has poor performance or graphical issues on older Intel hardware.

Fixes https://github.com/libsdl-org/SDL/issues/7634
Fixes https://github.com/libsdl-org/SDL/issues/9093
2024-02-28 09:00:36 -08:00
Dan Ginsburg
ad036d43e9 Vulkan Renderer - implement YcBcCr using VK_KHR_sampler_ycbcr_conversion. (#9169)
* Vulkan Renderer - implement YcBcCr using VK_KHR_sampler_ycbcr_conversion.  This simplifies the shader code and will also allow support for additional formats that we don't yet support (such as SDL_PIXELFORMAT_P010 for ffmpeg). The renderer now queries for VK_KHR_sampler_ycbcr_conversion and dependent extensions and will enable it if it's present. It reimplements YUV/NV12 texture support using this extension (these formats are no longer supported if the extension is not present). For each YUV/NV12 texture, a VkSamplerYcbcrConversion object is created from SDL_Colorspace parameters.  This is passed to the VkImageView and also an additional sampler is created for Ycbcr.  Instead of using 1-3 textures, the shaders now all use 1 texture with a combined image sampler (required by the extension).  Further, when using Ycbcr, a separate descriptor set layout is baked with the Ycbcr sampler as an immutable sampler.  The code to copy the images now copies to the individual image planes.  The swizzling between formats is handled in the VkSamplerYcbcrConversion object.
2024-02-28 08:57:09 -08:00
Sam Lantinga
fb3bf1dcbd Fixed device queue initialization when render and present queue families are different 2024-02-28 08:55:56 -08:00
Frank Praznik
945162c6d9 wayland: Small optimization for output removal function
In the case where an output is being removed, the SDL_DisplayData is already known, so no need to retrieve it from the wl_output user data.
2024-02-28 10:43:06 -05:00
SDL Wiki Bot
68588b232c Sync SDL3 wiki -> header 2024-02-28 15:13:26 +00:00
Sam Lantinga
e142bb1b0c The extension strings are const and don't need to be duplicated 2024-02-28 07:12:15 -08:00
Sam Lantinga
0997bdd292 Fixed SDL_calloc() calls (should be count, size) 2024-02-28 07:12:15 -08:00
Sam Lantinga
614630df69 Allow using an external Vulkan device with the vulkan renderer 2024-02-28 07:12:15 -08:00
Anonymous Maarten
e03746b25f cmake: add -Wl,-rpath,${libdir} to Libs section of pc file for Apple platforms 2024-02-28 12:58:02 +01:00
Anonymous Maarten
c8372e20d6 SDLTest_CommonEvent: only set done when it is finished 2024-02-28 12:57:30 +01:00
Sam Lantinga
220340e944 Remove SDL_PIXELFORMAT_P010
It's not supported by any renderer or pixel conversion path
2024-02-27 12:48:33 -08:00
Frank Praznik
c259a20f96 wayland: Remove all references to destroyed outputs from windows
The removal of a wl_output may not be accompanied by leave events for the surfaces present on it. Ensure that no window continues to hold a reference to a removed output.
2024-02-27 12:18:01 -05:00
Semphriss
84aaf63bd3 Fix typo in SDL_filesystem.h 2024-02-27 08:58:45 -08:00
Anonymous Maarten
0a961915dc cmake: testffmpeg requires link to EGL library for EGL feature 2024-02-27 12:28:06 +01:00
Sam Lantinga
24e021c67e testffmpeg: refactored texture creation properties into a single function 2024-02-26 16:01:23 -08:00
Sam Lantinga
ff18d7cfa0 testffmpeg: added pixel format mapping for NV12 and NV21 2024-02-26 15:52:21 -08:00
Sam Lantinga
81608ad077 Vulkan: fixed creating SDL_PIXELFORMAT_P010 textures 2024-02-26 15:51:13 -08:00
Sam Lantinga
f99143f437 Don't quit testffmpeg when alt-tabbing away 2024-02-26 15:21:26 -08:00
Sam Lantinga
80d2ef7384 Fixed uploading Vulkan texture with w*bpp != pitch 2024-02-26 15:18:23 -08:00
Sam Lantinga
3a796c9722 Allow specifying the render driver in the environment for testffmpeg 2024-02-26 15:13:10 -08:00
Sam Lantinga
dc9a3c83e2 Use the mastering display metadata to do proper tone mapping for HDR content 2024-02-26 14:20:34 -08:00
Sam Lantinga
98b1a59a95 Document the HDR tone mapping algorithm 2024-02-26 14:20:34 -08:00
Anonymous Maarten
1f536a1e77 cmake: fix SDL_RENDER_VULKAN reporting
Also fix an error when configuring with `-DSDL_VULKAN=ON
-DSDL_RENDER_VULKAN=FALSE`: the vulkan renderer is now correctly
disabled.
2024-02-26 20:37:10 +01:00
danginsburg
935c197059 Fix testautomation failures (including clip rect) - closes #9145. During merging for prep'ing the final PR for the Vulkan Renderer, I misordered a memcpy that regressed several of the testautomation test. From now on, I will make sure to run testautomation on any future PRs before submitting. 2024-02-26 10:04:10 -08:00
Ryan C. Gordon
e61dfe405f android: Fixed dead URL in comment. 2024-02-26 11:28:32 -05:00
danginsburg
35026cdcba Vulkan Renderer - robustly handle running out of descriptor sets or constant buffer memory. Closes #9131. My previous implementation of descriptor set handling was naive - it attempted to do VULKAN_IssueBatch when running out of descriptor sets or constant buffer space. For one thing, this had a bug and wasn't working (causing the crash), but moreover it would have resulted in having to flush the GPU. Instead, make the descriptor pools and constant buffer mapped buffers be resizeable so that if we need more it will grow to the size that is needed.
# Conflicts:
#	src/render/vulkan/SDL_render_vulkan.c
2024-02-26 08:12:24 -08:00
David Gow
f976881651 Vulkan: Don't invalidate internal state in InvalidateCachedState
The VULKAN_InvalidateCachedState() function seems to be meant to
invalidate any _cached_ state, i.e. global state of the API which may
have been modified outside the renderer.

However, at the moment, the Vulkan renderer also resets a number of
internal variables which track buffers, offsets, etc, in use. As a
result, the renderer can get into an inconsistant state and/or lose
data.

For example, if VULKAN_InvalidateCachedState() is called in between two
calls to VULKAN_UpdateVertexBuffer(), the data from the first call will
be overwritten by that from the second, as the number of the next vertex
buffer to use will be reset to 0. This can result in rendering errors,
as the same vertex data is used incorrectly for several calls.

By no longer resetting this 'internal' state here, those glitches
disappear. However, I haven't tested this with any applications which
mix the Vulkan renderer with their own Vulkan code (do any such
applications exist?), so this may be insufficient in case a full flush
of the renderer state  -- and possibly a wait on the appropriate fence
-- could be required.

Signed-off-by: David Gow <david@ingeniumdigital.com>
2024-02-26 07:54:23 -08:00
David Gow
c172fb5972 Vulkan: Support 'desired' vs 'required' memory flags (Fix #9310)
When selecting a memory type, there are some property flags we need
(e.g., VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, without which we cannot
vkMapMemory), and others we'd simply prefer (e.g.,
VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, which may have a performance
impact, but otherwise shouldn't be required).

By specifying these separately, we can fall back to a memory type which
doesn't have everything we want, but which should still work, rather
than giving up.

Signed-off-by: David Gow <david@ingeniumdigital.com>
2024-02-26 07:52:12 -08:00
David Gow
1558d52a0a Vulkan: Only return memory types which are a superset of what we need
VULKAN_FindMemoryTypeIndex() tries first to get a perfectly matching
memory type, then falls back to selecting any memory type which overlaps
with the requested flags.

However, some of the flags requested are actually required, so if -- for
example -- we request a memory type with
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, but get one without it, all future
calls to vkMapMemory() will fail with:

```
vkMapMemory():  Mapping memory without VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT set. Memory has type 0 which has properties VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT. The Vulkan spec states:
memory must have been created with a memory type that reports VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT.
```

(This occurs, for instance, on the totally non-conformant hasvk driver
for Intel Haswell integrated GPUs, which otherwise works fine.)

Instead, make sure that any memory type found has a superset of the
requested flags, so it'll always be appropriate.

Of course, this makes it _less_ likely for a memory type to be found, so
it does make #9130 worse in some ways. See the next patch for details.

Signed-off-by: David Gow <david@ingeniumdigital.com>
2024-02-26 07:52:12 -08:00
SDL Wiki Bot
fbe7301aba Sync SDL3 wiki -> header 2024-02-25 23:55:23 +00:00
Sam Lantinga
e223e1d498 Added SDL_camera.h to the public Framework headers 2024-02-25 15:54:34 -08:00
Sam Lantinga
be51b7acea Use the maximum potential headroom if EDR content isn't currently being displayed.
Also document that the HDR properties can change dynamically at runtime.
2024-02-25 15:54:34 -08:00
SDL Wiki Bot
e0dadba6f5 Sync SDL3 wiki -> header 2024-02-25 22:26:23 +00:00
Anonymous Maarten
e6d9251ecb docs: improve CMake documentation for Apple 2024-02-25 23:25:11 +01:00
Sam Lantinga
7a9c6c7ce9 Include SDL_PIXELFORMAT_P010 as a supported format for the metal renderer 2024-02-25 13:55:52 -08:00
Sam Lantinga
d211da75ac Fixed crash if app delegate method is called when SDL isn't initialized 2024-02-25 13:38:47 -08:00
Sam Lantinga
9dbbf0a2f7 Implemented clip rect functionality for the Vulkan renderer 2024-02-25 10:13:59 -08:00
Sam Lantinga
141497b14f Added an automated test to verify clip rect functionality 2024-02-25 09:44:41 -08:00
Sam Lantinga
d0af01e7d4 If the viewport changes the cliprect should be updated
The clip rectangle is defined to be viewport relative, so if the viewport changes we need to update it.

Fixes https://github.com/libsdl-org/SDL/issues/9094
2024-02-25 09:37:56 -08:00
Sam Lantinga
1cae52bbac Added JNI native methods to proguard-rules.pro (thanks @AntTheAlchemist!)
Fixes https://github.com/libsdl-org/SDL/issues/3563
2024-02-25 08:40:47 -08:00
David Gow
b8a52c1237 Vulkan: Make sure validation layer name is in-scope
When enabling the Vulkan validation layers, the 'validationLayerName'
variable technically went out of scope before vkCreateInstance() was
called. While most compilers won't clean up stack variables after random
'if' statements, some will, particularly when optimisation or memory
sanitizers are enabled.

This can lead to vkCreateInstance() segfaulting when
SDL_HINT_RENDER_VULKAN_DEBUG is enabled.

Instead, make the validationLayerName visible throughout the entire
VULKAN_CreateDeviceResources() function.

While we're at it, extract the validation layer name out into a
preprocessor #define, so that we are definitely using the same name in
VULKAN_ValidationLayersFound().

Signed-off-by: David Gow <david@ingeniumdigital.com>
2024-02-25 08:24:43 -08:00
Sam Lantinga
276566235c Removed SDL_ClearHints() from the public API
Fixes https://github.com/libsdl-org/SDL/issues/9129
2024-02-24 21:07:50 -08:00
Sam Lantinga
a1ea706215 Added names for the newly supported pixel formats 2024-02-24 20:13:59 -08:00
Sam Lantinga
f6c42406cd SDL_COLORSPACE_HDR10 is the default colorspace for SDL_PIXELFORMAT_P010 surfaces 2024-02-24 20:04:36 -08:00
Sam Lantinga
4c5584174b Fixed error: declaration shadows a local variable [-Werror,-Wshadow] 2024-02-24 20:04:36 -08:00
Sam Lantinga
2b0e7c40ef Verify that we can create pipeline state objects for the D3D12 renderer
Fixes https://github.com/libsdl-org/SDL/issues/9093
2024-02-24 19:55:10 -08:00
Anonymous Maarten
5593ddb6a7 cmake: X11 is for Video, not Audio 2024-02-24 17:31:48 +01:00
scribam
38d24778ed ci: update deprecated node.js 16 actions 2024-02-23 21:53:40 +01:00
scribam
cbe330befd ci: bump cross-platform-actions/action version to v0.23.0 2024-02-23 23:20:14 +03:00
danginsburg
97372b56e8 Vulkan Renderer - handle dynamic resetting of vsync, requires swapchain recreation. 2024-02-23 08:42:04 -08:00
danginsburg
b1431e6702 Vulkan Renderer - implement support for vsync disabled. Closes #9116. 2024-02-23 08:42:04 -08:00
Sam Lantinga
b9a00aa88e Fixed building the Vulkan renderer on Windows with Visual Studio 2024-02-22 17:18:46 -08:00
SDL Wiki Bot
dfd8073a8f Sync SDL3 wiki -> header 2024-02-22 22:59:24 +00:00
Dan Ginsburg
cab20117e6 Vulkan Renderer (#9114)
This pull request adds an implementation of a Vulkan Render backend to SDL.  I have so far tested this primarily on Windows, but also smoke tested on Linux and macOS (MoltenVK).  I have not tried it yet on Android, but it should be usable there as well (sans any bugs I missed).  This began as a port of the SDL Direct3D12 Renderer, which is the closest thing to Vulkan as existed in the SDL codebase. The shaders are more or less identical (with the only differences being in descriptor bindings vs root descriptors).  The shaders are built using the HLSL frontend of glslang.

Everything in the code is pure Vulkan 1.0 (no extensions), with the exception of HDR support which requires the Vulkan instance extension `VK_EXT_swapchain_colorspace`.  The code could have been simplified considerably if I used dynamic rendering, push descriptors, extended dynamic state, and other modern Vulkan-isms, but I felt it was more important to make the code as vanilla Vulkan as possible so that it would run on any Vulkan implementation.

The main differences with the Direct3D12 renderer are:
* Having to manage renderpasses for performing clears.  There is likely some optimization that would still remain for more efficient use of TBDR hardware where there might be some unnecessary load/stores, but it does attempt to do clears using renderpasses.
* Constant buffer data couldn't be directly updated in the command buffer since I didn't want to rely on push descriptors, so there is a persistently mapped buffer with increasing offset per swapchain image where CB data gets written.
* Many more resources are dependent on the swapchain resizing due to i.e. Vulkan requiring the VkFramebuffer to reference the VkImageView of the swapchain, so there is a bit more code around handling that than was necessary in D3D12.
* For NV12/NV21 textures, rather than there being plane data in the texture itself, the UV data is placed in a separate `VkImage`/`VkImageView`.

I've verified that `testcolorspace` works with both sRGB and HDR linear.  I've tested `testoverlay` works with the various YUV/NV12/NV21 formats.  I've tested `testsprite`.  I've checked that window resizing and swapchain out-of-date handling when minimizing are working.  I've run through `testautomation` with the render tests.  I also have run several of the tests with Vulkan validation and synchronization validation.  Surely I will have missed some things, but I think it's in a good state to be merged and build out from here.
2024-02-22 14:58:11 -08:00
Sam Lantinga
2f1f55aeb1 Updated default SDR white point and HDR headroom to better match game content 2024-02-22 14:51:23 -08:00
Sam Lantinga
1fb5b9672e Keep SDR white point and HDR headroom defaults in one place 2024-02-22 14:47:58 -08:00
Sam Lantinga
aeae202207 Make sure we actually have an HDR10 texture in the HDR10 shader
Some content uses the PQ transfer function but different color primaries
2024-02-22 11:50:58 -08:00
Sam Lantinga
f4dd0dbbde Added colorspace conversion from SDL_COLOR_PRIMARIES_SMPTE431 and SDL_COLOR_PRIMARIES_SMPTE432 to SDL_COLOR_PRIMARIES_BT2020 2024-02-22 11:01:03 -08:00
Sam Lantinga
d3930893aa KMSDRM is now a dependent option 2024-02-22 06:25:33 -08:00
Anonymous Maarten
7b1127d1fe cmake: Apple did not test SDL_CAMERA before adding camera support 2024-02-22 07:18:22 -05:00
Anonymous Maarten
e176626bac cmake: only enable SDL drivers when its subsystem is enabled 2024-02-22 07:18:22 -05:00
Anonymous Maarten
99cef7e13b cmake: check SDL subsystem dependencies (and include Camera) 2024-02-22 07:18:22 -05:00
Anonymous Maarten
9a44d44cee cmake: build Windows mediafoundation SDL_camera support 2024-02-22 07:18:22 -05:00
Anonymous Maarten
279a650fae mediafoundation: fix SDL_camera_mediafoundation MinGW compile warnings 2024-02-22 07:18:22 -05:00
Sam Lantinga
78ac14124c Fixed warning C4245: 'function': conversion from 'int' to 'DWORD', signed/unsigned mismatch 2024-02-21 22:21:06 -08:00
SDL Wiki Bot
2132ba8985 Sync SDL3 wiki -> header 2024-02-22 03:26:22 +00:00
Sam Lantinga
0f973f3eb4 Removed SDL_RENDERCMD_SETCOLORSCALE, which ended up being a noop on all renderers 2024-02-21 19:25:49 -08:00
Sam Lantinga
54c2ba6afd Added the Chrome HDR tonemap operator
Also added support for the SDL_PIXELFORMAT_XBGR2101010 pixel format to the D3D12, D3D11, and Metal renderers.
2024-02-21 19:25:49 -08:00
Sam Lantinga
4ba6aeee9d A second take on HDR support with an SDR white point and HDR headroom
This better reflects how HDR content is actually used, e.g. most content is in the SDR range, with specular highlights and bright details beyond the SDR range, in the HDR headroom.

This more closely matches how HDR is handled on Apple platforms, as EDR.

This also greatly simplifies application code which no longer has to think about color scaling. SDR content is rendered at the appropriate brightness automatically, and HDR content is scaled to the correct range for the display HDR headroom.
2024-02-21 19:25:49 -08:00
Ozkan Sezer
3b7533f4a2 SDL_camera_v4l2: allow building against older kernel headers 2024-02-22 00:50:40 +03:00
Anonymous Maarten
58e6eacf97 docs: SDL_INIT_EVERYTHING does not exist anymore 2024-02-21 00:52:04 +01:00
Anonymous Maarten
7eca84d57e cmake: don't use target_compile_features when the CMake thinks the compiler does not support it
This happens when using an older CMake with a new LLVM toolchain (e.g. Android ndk)
2024-02-21 00:51:40 +01:00
Anonymous Maarten
cbf0b1ce81 testcamera: create window and renderer through test library 2024-02-21 00:49:15 +01:00
Anonymous Maarten
ecfbb6719f SDL_test: support SDL_INIT_CAMERA for SDL_CommonInit and SDL_CommonQuit 2024-02-21 00:49:15 +01:00
Ryan C. Gordon
26ffbe43c2 camera: turn OFF DEBUG_CAMERA debug logging. 2024-02-20 16:09:02 -05:00
SDL Wiki Bot
31fe061ab5 Sync SDL3 wiki -> header 2024-02-20 20:57:27 +00:00
Ryan C. Gordon
f59c66a97f testcamera: Allow app to flip between a front and back camera. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon
6296677bc9 camera: Fixed Android hotplug. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon
6c080717f2 camera: Reset permissions to undecided when closing camera.
Otherwise, the permission-granted event will not fire when reopened.
2024-02-20 15:56:26 -05:00
Ryan C. Gordon
db8caa029b camera: Added new function with gendynapi.py. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon
70b89ab70d camera: Added SDL_GetCameraDevicePosition.
Otherwise, as a property, you have to open each camera device to figure out
which ones are which.
2024-02-20 15:56:26 -05:00
Ryan C. Gordon
b1ed49772c camera: Replace testcamera.c with testcameraminimal.c 2024-02-20 15:56:26 -05:00
Ryan C. Gordon
bdcddf4810 camera: Disconnected cameras become zombies that feed blank frames. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon
2613e3da24 camera: Rewrote Android support.
This does something a little weird, in that it doesn't care what
`__ANDROID_API__` is set to, but will attempt to dlopen the system
libraries, like we do for many other platform-specific pieces of SDL.

This allows us to a) not bump the minimum required Android version, which is
extremely ancient but otherwise still working, doing the right thing on old
and new hardware in the field, and b) not require the app to link against
more libraries than it previously did before the feature was available.

The downside is that it's a little messy, but it's okay for now, I think.
2024-02-20 15:56:26 -05:00
Ryan C. Gordon
848dcf8a5f main: Fixed compiler warning on Android.
(the NDK got upset about a function with void params using a bare `()`.)
2024-02-20 15:56:26 -05:00
Ryan C. Gordon
47313bba32 camera: SDL_GetCameraDevices should not report "no devices" like an error. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon
f3485a47b3 android: Add src/main/ files to Android.mk 2024-02-20 15:56:26 -05:00
Ryan C. Gordon
8db2a3b27a camera: Add an optional property that reports if a camera is back or front.
This is useful for iOS and Android, so an app can find the camera it cares
about in the list of devices.
2024-02-20 15:56:26 -05:00
Ryan C. Gordon
0b8617f71d test: Fixed CMake to build testcameraminimal correctly on WinRT. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon
99d1337de2 camera: Reenabled macOS/iOS support, with rewritten CoreMedia implementation. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon
f8fa08d2b1 camera: Fix compiler warnings on some platforms. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon
22dbc0f32f camera: Patched to compile after rebasing to latest in main. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon
7191a97fe3 camera: Windows support, through the Media Foundation API! 2024-02-20 15:56:26 -05:00
Ryan C. Gordon
3dca8a03da camera: Removed some debug logging. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon
67708f9110 camera: Emscripten support!
This also adds code to deal with waiting for the user to approve camera
access, reworks testcameraminimal to use main callbacks, etc.
2024-02-20 15:56:26 -05:00
Ryan C. Gordon
182f707284 include: Fixed doxygen comments on new camera APIs. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon
2cdff93578 v4l2: Corrected SDL_UDEV_AddCallback return check after #8694. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon
0b5875825e camera: framerate support. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon
9ae39d52de camera: Add sources to Xcode and Visual Studio projects.
This still needs updates to actually compile on macOS/iOS, though!
2024-02-20 15:56:26 -05:00
Ryan C. Gordon
87e7046fca camera: Public API functions should say "Format" not "Spec" to match audio. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon
f87d536229 camera: Added more accurate timestamps. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon
d3e6ef3cc6 camera: Massive code reworking.
- Simplified public API, simplified backend interface.
- Camera device hotplug events.
- Thread code is split up so it backends that provide own threads can use it.
- Added "dummy" backend.

Note that CoreMedia (Apple) and Android backends need to be updated, as does
the testcamera app (testcameraminimal works).
2024-02-20 15:56:26 -05:00
Ryan C. Gordon
3d2d5d18f3 pixels: Packed-pixel YUV formats can legit report bits-per-pixel.
This makes the existing SDL_SoftStretch code work with them, at least for
nearest-neighbor scaling; otherwise, it'll mangle the data trying to scale
it as 8bpp data without warning.
2024-02-20 15:56:26 -05:00
Ryan C. Gordon
8e1758260c surface: Fixed a typo in a comment. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon
cb10c80aaf camera: Reworked to operate with a driver interface, like other subsystems. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon
2ad44bd162 camera: Made a pass over all the sources, cleaning up for SDL3 style, etc. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon
7ae955ce68 camera: Renamed everything from "video capture" to "camera", wired to CMake. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon
f49ce4a15d camera: Renamed "video_capture" files to "camera" and moved to own subdir. 2024-02-20 15:56:26 -05:00
Ryan C. Gordon
4d000ae3bd audio: Change references to streams[i] to previously-calculated stream.
Reference PR #9096.
2024-02-20 15:30:01 -05:00
Mathieu Eyraud
751917cb6f Fix null pointer dereference in SDL_BindAudioStreams() 2024-02-20 15:14:07 -05:00
Frank Praznik
8b6eae2d4f cmake: Split and store the libdecor version as individual parts
It is becoming necessary to enable additional features as libdecor continues to evolve, and checking against a single base version will no longer be adequate. Libdecor doesn't provide versioning defines in its headers, so split the version string into parts to allow for discrete version detection and feature enablement at build time.
2024-02-20 11:28:02 -05:00
Sam Lantinga
8073f4aa1d Pass the real error from D3D12_CreatePipelineState() back to the application 2024-02-20 06:24:20 -08:00
Sam Lantinga
376ef4e418 Fixed the WGI driver picking up Xbox controllers handled by RAWINPUT
The WGI driver will see them first, but the RAWINPUT driver has higher priority, so we'll defer to that when it's available.

Fixes https://github.com/libsdl-org/SDL/issues/9091
2024-02-20 06:20:32 -08:00
Ozkan Sezer
cb3a1a82d5 SDL_memcpy.c, SDL_memmove.c, SDL_memset.c: don't use gcc builtins if !HAVE_LIBC
__builtin_memcpy, as well as __builtin_memset and __builtin_memmove, needn't be
inlined but emitted as a libc call, leading to infinitely recursive calls.

Fixes https://github.com/libsdl-org/SDL/issues/9090
2024-02-20 01:23:18 +03:00
Sam Lantinga
bb4ec5250f Added support for non-gamepad controllers to the GameInput driver 2024-02-17 22:32:44 -08:00
Sam Lantinga
f63f99bd2d Setup to handle the guide button once we get an updated GameInput SDK 2024-02-17 21:55:10 -08:00
Sam Lantinga
ae8a910781 Added infrastructure for reporting GameInput touchpads
PlayStation controllers don't seem to report touch info, so we'll need to figure out how to interpret the touch data once it's available.
2024-02-17 21:21:54 -08:00
Sam Lantinga
ae4aa25082 Get the real GameInput device name if possible 2024-02-17 20:12:46 -08:00
Sam Lantinga
419aebebda Added infrastructure for reporting GameInput sensors
IGameInputReading::GetMotionState() isn't implemented yet, so we'll need to figure out how to interpret the motion data once it's available.
2024-02-17 20:12:46 -08:00
Sam Lantinga
85ac0381b7 IGameInputDevice::GetDeviceInfo() can never return a null pointer
The IGameInputDevice instance can't be internally instantiated without it, so it's always guaranteed to be present.
2024-02-17 20:12:14 -08:00
Sam Lantinga
fbe4153214 The HIDAPI driver takes precedence over the GameInput driver
The HIDAPI driver has more functionality for supported controllers.
2024-02-17 19:13:04 -08:00
Sam Lantinga
4a59b17de2 Added infrastructure for querying battery status for GameInput 2024-02-17 19:09:29 -08:00
Sam Lantinga
fd9a4eff9f Updated GameInput device info to match other joystick drivers 2024-02-17 17:52:48 -08:00
Sam Lantinga
8f0f14c312 Added automatic gamepad mapping for the GameInput driver 2024-02-17 17:42:32 -08:00
Sam Lantinga
eb9a7d97f9 The GameInput driver handles Xbox controllers
Don't let the raw input driver handle them when GameInput is active
2024-02-17 17:42:23 -08:00
Sam Lantinga
698b7deaa2 Removed GAMEINPUT_JoystickEffectDataType_HapticFeedback
This refers to the HID Simple Haptics spec, which is currently only implemented by the Surface Dial accessory and WMR game controllers, which aren't currently exposed by the GameInput API.

We can add support for other effects in the future, but for now we don't need this or the SDL_gameinputjoystick_c.h header.
2024-02-17 16:33:45 -08:00
Sam Lantinga
f35ede7281 Generalized the idea of joystick driver priority
Joystick drivers are sorted by priority in the driver list, and higher priority drivers report whether they are handling a device when lower priority drivers want to add it to their device list.

This has been handled ad-hoc with the Windows and HIDAPI drivers, but this formalizes the idea and makes sure that GameInput has the highest priority of the Windows drivers.
2024-02-17 16:06:07 -08:00
Robert Edmonds
7f33464bed opengles2: Call glClearColor() with r,g,b,a, not r,g,g,a 2024-02-17 14:11:59 -08:00
Sam Lantinga
fee140bdfe Added the option for GameInput support to the Win32 SDL build
GameInput is designed to be used by Win32 C applications, so no need to restrict it to the GDK build.
2024-02-17 14:07:42 -08:00
Nikita Krapivin
534f753e20 GameInput backend for SDL (Gamepad-only for now) 2024-02-17 11:33:51 -08:00
Sam Lantinga
7ed1f3554d Define HAVE_LIBC for the platforms with a C library
Allow the Visual Studio project to define HAVE_LIBC=0 to enable building without a C runtime on Windows entirely through Visual Studio project changes.
2024-02-17 11:31:06 -08:00
Sam Lantinga
ed615e92b7 Updated automated test now that getting an invalid property isn't an error 2024-02-17 09:30:50 -08:00
Sam Lantinga
dc7baa415e Show the window after creating the renderer
This hides any window recreation that might need to be done by the OpenGL renderers
2024-02-17 09:21:30 -08:00
Sam Lantinga
ff01d0b568 Fixed building without HAVE_LIBC on Windows
Fixes https://github.com/libsdl-org/SDL/issues/9064
2024-02-17 08:12:10 -08:00
Sam Lantinga
8ce786d2b6 Property query functions don't set an error if they return the default value
You can call SDL_HasProperty() if you want to check to see if a property exists.

Fixes https://github.com/libsdl-org/SDL/issues/9067
2024-02-17 07:59:04 -08:00
Sam Lantinga
202886f873 Make use of the HDR light range when playing HDR video 2024-02-16 20:05:11 -08:00
SDL Wiki Bot
317099b01f Sync SDL3 wiki -> header 2024-02-17 03:51:21 +00:00
Sam Lantinga
cb38649490 Added SDL_PROP_DISPLAY_HDR_WHITE_LEVEL_FLOAT 2024-02-16 19:50:41 -08:00
Michał Janiszewski
631b05b211 Drop stray trailing whitespace for android-project 2024-02-16 09:22:23 -05:00
Ryan C. Gordon
6472e36264 x11: Minor cleanup in new mouse cursor selection code.
- Move legacy name choice to a separate function, so we can `return` a
  string in one line instead of assign a variable and `break` for each item.
- Have the case statement cover SDL_NUM_SYSTEM_CURSORS, and not `default`, so
  compiler will (maybe) warn us if an enum value is added but not included
  here.
- Only choose a legacy name if necessary.

(cherry picked from commit df00a7dd4c)
2024-02-16 08:44:29 -05:00
Simon McVittie
b986bc8be9 emscripten, wayland, x11: Share the table of CSS cursor names
As suggested in #8939.

This results in some minor changes for emscripten and x11. Both
previously mapped SIZEALL to "move", but "move" is not guaranteed to be
a four-pointed arrow: according to the CSS spec, it's actually intended
to be a drag-and-drop cursor, analogous to "alias" and "copy".
Map it to "all-scroll" instead, as in Wayland: while this is *also* not
semantically guaranteed to be a four-pointed arrow, it is at least
*suggested* to make it a four-pointed arrow.

Also, emscripten was previously using two-pointed arrows for resizing
(BOTTOMLEFT mapped to "nesw-resize", and so on). This commit changes
it to use the more specific "sw-resize" and so on, which might be
single-directional.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-16 07:52:43 -05:00
Simon McVittie
7dbd6669c3 wayland: Move calls to WAYLAND_wl_cursor_theme_get_cursor out of the switch
This will make it easier to potentially share the switch statement
between X11 and Wayland.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-16 07:52:43 -05:00
Simon McVittie
40a6c1c0a7 wayland: Use CSS/freedesktop cursor name "default" as a fallback
The "left_ptr" name is an X11 thing, and there's no guarantee that
Wayland cursor themes contain it. In particular, GNOME's Adwaita theme
as of version 46.beta only contains the CSS/freedesktop names.

To test, either move one of the known cursors out of the way, or edit
the switch statement above to use a wrong name for one of them.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-16 07:52:43 -05:00
Simon McVittie
791646535a wayland: Reference CSS cursor name vocabulary
The freedesktop.org cursor spec recommends the same names as CSS, and
GNOME is treating the CSS vocabulary as canonical.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-16 07:52:43 -05:00
Ryan C. Gordon
cb9565354c x11: Use XcursorLibraryLoadCursor to load system cursors when available.
Apparently this is necessary on the latest Gnome to get properly themed
cursors, vs ancient X11 standard cursors, as Gnome has dropped the old
theme names that XCreateFontCursor eventually expected to find.

Fixes #8939.
2024-02-16 02:08:37 -05:00
Sam Lantinga
d451fcd7a7 Fixed HDR video content being too bright on Apple platforms
This probably isn't the exact formula that we need, but it's much closer to correct.
2024-02-15 16:39:13 -08:00
Sam Lantinga
c09daf8388 Removed unused variables 2024-02-15 14:11:04 -08:00
Ozkan Sezer
6efe5f30ed don't let SDL_render.c:render_drivers[] have an empty initializer list. 2024-02-15 20:55:04 +03:00
Ozkan Sezer
aae2d22852 Check the SDL_VIDEO_RENDER_??? macros with #if instead of #ifdef
Allows users to disable them by defining them as 0.

Closes https://github.com/libsdl-org/SDL/issues/8996

(manual port of https://github.com/libsdl-org/SDL/pull/9063 to SDL3.0)
2024-02-15 20:55:02 +03:00
Ryan C. Gordon
8ddddd36cd audio: Deal with race conditions against default device changes.
This catches the case where we obtain a logical device while the default is
changing in another thread, so you accidentally end up with the previous
default physical device locked and returned from ObtainLogicalAudioDevice.
2024-02-15 14:13:26 -05:00
Frank Praznik
4eae38580f cocoa: Remove resize hack when changing the window backing scale
Zeroing the window width and height was necessary in SDL2 to short-circuit the resize event deduplication code when the window backing scale changed, but not the logical size. This is no longer necessary in SDL3, as it will explicitly check for scale changes on resize events and dispatch pixel size/scale changed events as appropriate, even if the window's logical size hasn't changed.
2024-02-14 17:33:06 -05:00
Frank Praznik
f9ba0e1dbd wayland: Don't store wl_output pointers in mode driver data
They aren't used for anything, and cause problems if the video core tries to free them.
2024-02-14 10:42:15 -05:00
Ryan C. Gordon
5e1d9d19a4 audio: Don't use SDL_BindAudioStream inside SDL_OpenAudioDeviceStream().
It has a lot of complex validation and locking we want to avoid here.
2024-02-13 15:23:27 -05:00
Sam Lantinga
5e6ae85b63 Update the draggable state when the hit test callback changes
Fixes https://github.com/libsdl-org/SDL/issues/7617
2024-02-13 09:26:39 -08:00
SDL Wiki Bot
4d4c24acdd Sync SDL3 wiki -> header 2024-02-13 17:07:23 +00:00
Ryan C. Gordon
bc984f78bf android: Remove blocking permission request code. Async only in SDL3!
(this actually still blocks at our internal points of usage, though, for
replacement at a later time.)
2024-02-13 12:06:51 -05:00
Ryan C. Gordon
af61cfd5e0 android: Added SDL_AndroidRequestPermissionAsync. 2024-02-13 12:06:51 -05:00
Frank Praznik
310f21bf84 video: Ensure that all references to a destroyed fullscreen window are removed
Windowing systems that receive fullscreen state changes asynchronously may not receive a configure event notifying SDL that the window has left fullscreen when the window is being destroyed. Ensure that no display holds a reference to a destroyed fullscreen window.
2024-02-13 09:56:07 -05:00
Sam Lantinga
f2695856d6 Use SDL string functions 2024-02-12 19:51:48 -08:00
Sam Lantinga
725c79f3ac Fixed building with SDL_LEAN_AND_MEAN
Fixes https://github.com/libsdl-org/SDL/issues/9054
2024-02-12 19:34:10 -08:00
Sam Lantinga
734d6fa1f3 Fixed documentation of SDL_PROP_WINDOW_CREATE_EXTERNAL_GRAPHICS_CONTEXT_BOOLEAN 2024-02-12 18:53:26 -08:00
Sam Lantinga
ead3cbafd7 Fixed documentation for SDL_HINT_WINDOWS_CLOSE_ON_ALT_F4 (thanks @AntTheAlchemist!) 2024-02-12 18:32:29 -08:00
Sam Lantinga
814a94c349 Fixed error: unused variable 'axes' [-Werror,-Wunused-variable] 2024-02-12 11:18:11 -08:00
Sam Lantinga
b39246936b Added SDL_cocoashape* to Xcode project 2024-02-12 11:17:54 -08:00
Sam Lantinga
f4d97bdb14 Update mouse transparency when the window shape changes
Fixes github.com/libsdl-org/SDL/issues/7617
2024-02-12 10:49:45 -08:00
Sam Lantinga
42cdbf6b21 Explicitly retain and release NSObjects in C structures
Fixes https://github.com/libsdl-org/SDL/issues/9021
Fixes https://github.com/libsdl-org/SDL/issues/9042
2024-02-12 10:20:06 -08:00
Sam Lantinga
87c07a79c0 Changed property name from '-' to '_' 2024-02-12 09:55:40 -08:00
SDL Wiki Bot
59f1e66adc Sync SDL3 wiki -> header 2024-02-12 17:55:23 +00:00
Sam Lantinga
dca2721b91 Removed SDL_HINT_VIDEO_EXTERNAL_CONTEXT
This is replaced with SDL_PROP_WINDOW_CREATE_EXTERNAL_GRAPHICS_CONTEXT in SDL_CreateWindowWithProperties()
2024-02-12 09:54:33 -08:00
Sam Lantinga
2f7c24e4be Removed SDL_HINT_RENDER_SCALE_QUALITY
Textures now default to linear filtering, use SDL_SetTextureScaleMode(texture, SDL_SCALEMODE_NEAREST) if you want nearest pixel mode instead.
2024-02-12 09:54:33 -08:00
Sam Lantinga
20051f805f Removed SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4
Replaced with SDL_HINT_WINDOWS_CLOSE_ON_ALT_F4, defaulting to SDL_TRUE
2024-02-12 09:54:33 -08:00
Sam Lantinga
7cb1ca60ec Removed SDL_HINT_RENDER_OPENGL_SHADERS
Shaders are always used if they are available.
2024-02-12 09:54:33 -08:00
Sam Lantinga
9920e062d5 Removed SDL_HINT_THREAD_STACK_SIZE
The stack size can be specified using SDL_CreateThreadWithStackSize()
2024-02-12 09:54:33 -08:00
Sam Lantinga
9e505252c0 Renamed SDL_HINT_PS2_DYNAMIC_VSYNC SDL_HINT_RENDER_PS2_DYNAMIC_VSYNC 2024-02-12 09:54:33 -08:00
Sam Lantinga
a538936821 Renamed SDL_HINT_LINUX_JOYSTICK_DEADZONES to SDL_HINT_JOYSTICK_LINUX_DEADZONES 2024-02-12 09:54:33 -08:00
Sam Lantinga
980c379a0b Renamed SDL_HINT_LINUX_JOYSTICK_CLASSIC to SDL_HINT_JOYSTICK_LINUX_CLASSIC 2024-02-12 09:54:33 -08:00
Sam Lantinga
1f7936d545 Renamed SDL_HINT_LINUX_HAT_DEADZONES to SDL_HINT_JOYSTICK_LINUX_HAT_DEADZONES 2024-02-12 09:54:33 -08:00
Sam Lantinga
39cfb437ed Renamed SDL_HINT_LINUX_DIGITAL_HATS to SDL_HINT_JOYSTICK_LINUX_DIGITAL_HATS 2024-02-12 09:54:33 -08:00
Sam Lantinga
b557c15bcf Renamed SDL_HINT_JOYSTICK_GAMECUBE_RUMBLE_BRAKE to SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE_RUMBLE_BRAKE 2024-02-12 09:54:33 -08:00
Sam Lantinga
4f628b5b62 Renamed SDL_HINT_GDK_TEXTINPUT_DEFAULT to SDL_HINT_GDK_TEXTINPUT_DEFAULT_TEXT 2024-02-12 09:54:33 -08:00
Sam Lantinga
fd5d761128 Renamed SDL_HINT_DIRECTINPUT_ENABLED to SDL_HINT_JOYSTICK_DIRECTINPUT 2024-02-12 09:54:33 -08:00
Sam Lantinga
a5da7d0dd5 Renamed SDL_HINT_ALLOW_TOPMOST to SDL_HINT_WINDOW_ALLOW_TOPMOST 2024-02-12 09:54:33 -08:00
Sam Lantinga
ef8791cba8 Cleaned up and organized hint documentation 2024-02-12 09:54:33 -08:00
Sam Lantinga
9ce7fe2848 Removed SDL_HINT_ACCELEROMETER_AS_JOYSTICK
Sensors are a first-class object in SDL and we haven't gotten any feedback that this feature is useful these days.

Closes https://github.com/libsdl-org/SDL/pull/7879
2024-02-12 09:54:33 -08:00
Zack Middleton
5af7113842 Rename property define names to have a type suffix
Renamed the following property define names to have a type suffix to
match other property names.

SDL_PROP_TEXTURE_OPENGL_TEXTURE_TARGET (number)
SDL_PROP_TEXTURE_OPENGLES2_TEXTURE_TARGET (number)
SDL_PROP_WINDOW_CREATE_WAYLAND_SCALE_TO_DISPLAY (boolean)
SDL_PROP_WINDOW_RENDERER (pointer)
SDL_PROP_WINDOW_TEXTUREDATA (pointer)
2024-02-12 09:54:11 -08:00
Sam Lantinga
cacac6cc34 Updated structure and field names for consistency
Type names are camel case and field names are snake case except for fields ending in id, which are capitalized.

Fixes https://github.com/libsdl-org/SDL/issues/6955
2024-02-11 08:27:56 -08:00
Sam Lantinga
6f87973b9c Added a reserved field to the SDL_Event structure
This guarantees 64-bit alignment for the timestamp
2024-02-11 08:27:56 -08:00
Ozkan Sezer
97d6e58a19 mark SDL_CleanupWindowTextureData as SDLCALL. 2024-02-11 18:55:40 +03:00
Ozkan Sezer
ee5289ef09 mark SDL_ClipboardTextCallback as SDLCALL 2024-02-11 18:55:40 +03:00
Ozkan Sezer
168322f358 SDL_properties.c: mark CleanupFreeableProperty and CleanupSurface as SDLCALL 2024-02-11 17:29:20 +03:00
Sam Lantinga
bba2a5d360 Added SDL_SetFreeableProperty() for internal use 2024-02-10 08:04:27 -08:00
SDL Wiki Bot
432ce3f167 Sync SDL3 wiki -> header 2024-02-10 15:09:26 +00:00
Sam Lantinga
416803b03b Clarify the lifetime of the shape surface in SDL_SetWindowShape() 2024-02-10 07:08:28 -08:00
Hans-Kristian Arntzen
69f2bd151e Fix broken use of MsgWaitForMultipleObjects.
- Timeout < 0 was not handled properly
- Return value for success is WAIT_OBJECT_0 + nCount, not positive value
2024-02-10 06:55:51 -08:00
Chris Collins
0f81598e9f Wayland: Avoid SEGV if a modifier notification comes before the keymap 2024-02-10 10:39:57 +01:00
Sam Lantinga
f95b7ee4da Renamed SDL_HasWindowSurface to SDL_WindowHasSurface
Fixes https://github.com/libsdl-org/SDL/issues/9034
2024-02-09 17:42:18 -08:00
SDL Wiki Bot
1ec0e22bcd Sync SDL3 wiki -> header 2024-02-10 00:38:20 +00:00
Sam Lantinga
1162097135 Added SDL_RenderViewportSet() to tell whether the viewport was previously set to a specific rectangle.
Fixes https://github.com/libsdl-org/SDL/issues/9029
2024-02-09 16:37:04 -08:00
Sam Lantinga
3ebbf0f409 Guarded ElementAlreadyHandled with #ifdef ENABLE_PHYSICAL_INPUT_PROFILE (thanks @Donione!)
Fixes https://github.com/libsdl-org/SDL/issues/9033
2024-02-09 16:12:33 -08:00
SDL Wiki Bot
9ff8df932a Sync SDL3 wiki -> header 2024-02-10 00:05:26 +00:00
Sam Lantinga
f6b92c9b88 Re-added a simplified version of SDL_SetWindowShape()
In order to handle mouse click transparency this needs to be implemented inside SDL
2024-02-09 16:04:46 -08:00
Sam Lantinga
1143bdc351 Greatly simplified the shape example 2024-02-09 03:04:40 -08:00
Sam Lantinga
b7c61569f8 Redefine XINPUT_CAPABILITIES_EX as an SDL typedef
mingw-w64 has added this from Proton (which added this from SDL), so we need to re-define it as a local symbol to avoid conflicting with mingw-w64 headers.

Fixes https://github.com/libsdl-org/SDL/issues/9031
2024-02-09 01:26:45 -08:00
Sam Lantinga
bfcca2a36e Use saturate() instead of clamp() for slightly faster shader operation 2024-02-08 16:05:42 -08:00
SDL Wiki Bot
1684032c17 Sync SDL3 wiki -> header 2024-02-08 18:39:20 +00:00
Sam Lantinga
4ce7ae31d4 Document that SDL_UpdateJoysticks() needs to be called to handle rumble processing
Related: https://github.com/libsdl-org/SDL/issues/4300
2024-02-08 10:43:00 -08:00
Sam Lantinga
d777becd9d Fixed spacing 2024-02-08 10:26:42 -08:00
Sam Lantinga
91639d855f Don't use the direct3d12 renderer with transparent windows
Fixes https://github.com/libsdl-org/SDL/issues/9024
2024-02-08 09:24:11 -08:00
Sam Lantinga
26e947f8ea Added VIDPID for OpenFFBoard wheel (thanks @groybe!)
Closes https://github.com/libsdl-org/SDL/pull/7987
2024-02-07 16:34:50 -08:00
Sam Lantinga
c951bbe3de Look at all available usages when determining whether to ignore a device 2024-02-07 16:02:12 -08:00
Sam Lantinga
dd726cb097 Moved rgb24_yuv420_std() to the correct header 2024-02-07 14:42:12 -08:00
Sam Lantinga
1673d52351 Fixed building with an older macOS SDK 2024-02-07 13:49:42 -08:00
Sam Lantinga
4ec5aef028 Disable warning C4214: nonstandard extension used: bit field types other than int
This shows up with Visual Studio 2019 and is a non-standard extension that we rely on in this code.
2024-02-07 13:23:29 -08:00
Sam Lantinga
faeb2b1f22 Fixed warning C4204: nonstandard extension used: non-constant aggregate initializer when built with Visual Studio 2019 2024-02-07 13:16:35 -08:00
Sam Lantinga
1269590dfc Clarified that SDL scancodes are unaffected by keyboard layout 2024-02-07 09:33:27 -08:00
Sam Lantinga
1c4c29b7ad Fixed a swap chain leak and a double-free in testffmpeg.c
Also added more debug logging to the direct3d11 renderer
2024-02-06 21:33:57 -08:00
Sam Lantinga
3158342441 Use SDL_Color for SDL_RenderGeometryRaw() and add SDL_RenderGeometryRawFloat()
Eventually we can re-add a fast path for that data down to the individual renderers. Setting color scale would still require converting to float, and most hardware accelerated renderers prefer to consume colors as float, so this requires some thought and performance testing.

Fixes https://github.com/libsdl-org/SDL/issues/9009
2024-02-06 18:16:41 -08:00
Sam Lantinga
9e194c1a1d Added BT.601/SMPTE240 to the color primaries conversion matrices 2024-02-06 18:16:41 -08:00
Sam Lantinga
fb823fbe95 Make sure we're actually using the HDR10 colorspace before using that shader 2024-02-06 18:16:41 -08:00
pastdue
7b74e2eeb8 Emscripten_SetWindowFullscreen: Fix crash due to uninitialized EmscriptenFullscreenStrategy members 2024-02-06 16:25:30 -08:00
SDL Wiki Bot
ed86cec07f Sync SDL3 wiki -> header 2024-02-06 23:41:23 +00:00
Sam Lantinga
985da79d73 Use a more concise representation of YUV -> RGB conversion 2024-02-06 15:40:47 -08:00
Sam Lantinga
8afba41aef Added support for HDR10 video on Apple platforms 2024-02-06 15:40:47 -08:00
Sam Lantinga
2039c46d2c Added support for creating an SDL texture from a CVPixelBufferRef 2024-02-06 15:40:47 -08:00
Sam Lantinga
c79462dc50 Fixed Xcode build warnings 2024-02-06 12:29:44 -08:00
Sam Lantinga
ba074acad4 Implemented scRGB colorspace and HDR support on macOS 2024-02-06 12:29:44 -08:00
SDL Wiki Bot
451dc41427 Sync SDL3 wiki -> header 2024-02-06 10:49:24 +00:00
Sam Lantinga
30e176d6ba Added HDR display properties and related event
Also added an HDR calibration stage to testcolorspace
2024-02-06 02:48:05 -08:00
Sam Lantinga
d4caef5b89 Generalize SDR white level handling into a color scale
This gives applications better control over how and when light levels are adjusted when working with HDR content and display.
2024-02-06 02:48:05 -08:00
meyraud705
82d89ff4fb Fix memory leak in SDL_UpdateSteamVirtualGamepadInfo() 2024-02-06 01:55:47 -08:00
Sam Lantinga
b05ea8e04e Updated direct3d12 renderer with HDR10 and SDR whitelevel support 2024-02-05 13:17:10 -08:00
Sam Lantinga
c3e4481d56 Use a reasonable default for unspecified YUV colorspace 2024-02-05 11:47:17 -08:00
Sam Lantinga
240158f3e8 Scale SDR content to SDR whitelevel when HDR is enabled 2024-02-05 11:47:17 -08:00
Sam Lantinga
e97b2061b4 Converted shader headers to UNIX line endings 2024-02-05 11:47:17 -08:00
Sam Lantinga
e98e5abd2a Added batch file to create D3D12 shaders 2024-02-05 11:47:17 -08:00
Sam Lantinga
809f02e89e SDL_ReadSurfacePixel() now supports large pixel formats 2024-02-05 11:47:17 -08:00
Sam Lantinga
9755e490c0 Workaround for crash at shutdown in testffmpeg
I'm not sure if this is something in SDL crashing or something in ffmpeg, but it's safer to leave the D3D DLLs loaded.
2024-02-05 09:45:39 -08:00
Sam Lantinga
e74171b1ae Added support for HDR10 video playback on direct3d11
Fixes https://github.com/libsdl-org/SDL/issues/8053
2024-02-05 09:45:39 -08:00
meyraud705
f85535b4b6 Use functions from SDL instead of libc 2024-02-05 09:01:28 -05:00
SDL Wiki Bot
a6374123c7 Sync SDL3 wiki -> header 2024-02-04 21:10:23 +00:00
Sam Lantinga
548b382fd9 Fixed slow startup time when using the direct3d12 renderer
On some systems creating the entire set of available pipeline states is very time consuming. We'll only use a few of them in any given program, so we'll just create them on demand.

Fixes https://github.com/libsdl-org/SDL/issues/7634
2024-02-04 13:09:40 -08:00
Sam Lantinga
dab77fe29b Added support for SDL_COLORSPACE_BT709_FULL to the hardware renderers 2024-02-04 13:09:40 -08:00
Sam Lantinga
ec322bee1c Fixed testyuv help message 2024-02-04 13:09:40 -08:00
Sam Lantinga
327b976bc4 SDL_COLORSPACE_JPEG is the default YUV colorspace 2024-02-04 13:09:40 -08:00
Sam Lantinga
5b8e5f8b9f Fixed accidental changing of All to Allu in previous commit (thanks @zturtleman!) 2024-02-03 23:46:22 -08:00
Omar Rashwan
67bbf20add Null check SDL_DBusContext pointer 2024-02-03 14:04:46 -08:00
Sam Lantinga
2ad4646a24 Don't release currentOffscreenRenderTargetView, we don't have a reference to it 2024-02-03 12:49:53 -08:00
Sam Lantinga
9005512c18 Fixed build 2024-02-03 12:39:52 -08:00
Sam Lantinga
7271a2040b Don't force on the D3D11 debug flag 2024-02-03 12:39:11 -08:00
Sam Lantinga
b4d0af9cf3 Removed unused variables 2024-02-03 12:39:11 -08:00
Sam Lantinga
200f87ea0b Only set the colorspace if it's not the default
This avoids property hash table allocation in most cases
2024-02-03 12:00:55 -08:00
Sam Lantinga
c0b27ccef9 Fixed warning C4701: potentially uninitialized local variable 'drawnTextRect' used 2024-02-03 11:49:15 -08:00
Sam Lantinga
8eba5b75ca Fixed warning C4701: potentially uninitialized local variable 'rndctx' used 2024-02-03 11:49:15 -08:00
Sam Lantinga
445cb42acd Fixed warning C4244: 'function': conversion from 'int' to 'Uint16', possible loss of data 2024-02-03 11:49:15 -08:00
Sam Lantinga
45f936c788 Fixed warning C4245: 'initializing': conversion from '__int64' to 'unsigned __int64', signed/unsigned mismatch 2024-02-03 11:49:15 -08:00
Sam Lantinga
74e85e3a51 Fixed warning C4706: assignment within conditional expression 2024-02-03 11:49:15 -08:00
Sam Lantinga
c3e3ad6140 Fixed build warnings 2024-02-03 11:49:15 -08:00
Sam Lantinga
c02aaebccc Fixed warning C4245: 'initializing': conversion from 'int' to 'Uint32', signed/unsigned mismatch 2024-02-03 11:49:15 -08:00
Sam Lantinga
ff5fdf9f53 Fixed warning C4244: 'initializing': conversion from 'int' to 'const Uint8', possible loss of data 2024-02-03 11:49:15 -08:00
Sam Lantinga
9989f92eee Fixed warning C4245: 'initializing': conversion from 'int' to 'SDL_AudioDeviceID', signed/unsigned mismatch 2024-02-03 11:49:15 -08:00
Sam Lantinga
cb811ba463 Fixed warning C4366: The result of the unary '&' operator may be unaligned 2024-02-03 11:49:15 -08:00
Sam Lantinga
62221b3003 Fixed warning C4245: 'return': conversion from 'int' to 'SDL_TimerID', signed/unsigned mismatch 2024-02-03 11:49:15 -08:00
Sam Lantinga
4514aabb41 Fixed warning C4245: 'return': conversion from 'int' to 'Uint64', signed/unsigned mismatch 2024-02-03 11:49:15 -08:00
Sam Lantinga
f107393ed5 Fixed warning C4245: 'return': conversion from 'int' to 'unsigned int', signed/unsigned mismatch 2024-02-03 11:49:15 -08:00
Sam Lantinga
c3e821fa80 Optimized SDL_DuplicatePixels() 2024-02-03 11:49:15 -08:00
Sam Lantinga
89b9d6cbdc SDL_RenderReadPixels() now returns a surface
Fixes https://github.com/libsdl-org/SDL/issues/8977
2024-02-03 11:49:15 -08:00
SDL Wiki Bot
ab571633d1 Sync SDL3 wiki -> header 2024-02-03 15:37:23 +00:00
Sam Lantinga
50a805cdd1 Use YUV colorspaces instead of a global YUV conversion mode
Fixes https://github.com/libsdl-org/SDL/issues/8669
2024-02-03 07:36:18 -08:00
Wohlstand
9e76f23561 SDL_windowsopengl.c: WGL: Fixed null-pointer dereference crash
Fixes #8968

Fixed crash after 594a79c2f9

(cherry picked from commit a29f37c14a)
2024-02-03 06:19:41 -08:00
Joshua Root
e0158f68e4 Fix SDL_mfijoystick build issues
Add missing guards around use of physicalInputProfile.

Add explicit import of Foundation which seems to be needed on some
systems to get the NSArray definition.

Add __unsafe_unretained to ObjC types in struct so the compiler doesn't
complain about that not being allowed with ARC.

Closes: #8979
2024-02-02 22:24:50 -08:00
SDL Wiki Bot
2819988f8b Sync SDL3 wiki -> header 2024-02-03 04:40:24 +00:00
Sam Lantinga
a2c45f61bb Updated scRGB render colorspace documentation 2024-02-02 20:38:48 -08:00
Sam Lantinga
e67e0c5d55 vulkan_metal.h: Make compatible with ObjC ARC (thanks @jmroot!)
(re)Fixes #6598

We need to remember to apply this again once we update from upstream headers.
2024-02-02 18:29:59 -08:00
Sam Lantinga
f9c57e16b0 Don't test 10-bit pixel format conversion
We either need to explicitly test using the sRGB colorspace or update the tests for HDR10 color conversion. We'll just disable them for now, as these formats aren't commonly used in games.
2024-02-02 18:24:15 -08:00
Sam Lantinga
b8fe96fa81 Fixed build warning 2024-02-02 18:24:05 -08:00
Sam Lantinga
ba86d9f235 When changing surface format, use the default colorspace for the new format 2024-02-02 17:56:33 -08:00
Sam Lantinga
25fd5da1a7 Removed maxCLL and maxFALL properties, moved them to SDL_image for HDR image loading 2024-02-02 15:13:09 -08:00
SDL Wiki Bot
943ab983cb Sync SDL3 wiki -> header 2024-02-02 23:10:26 +00:00
Sam Lantinga
5d48f9a63a Added SDL_CopyProperties() 2024-02-02 15:09:12 -08:00
SDL Wiki Bot
c007c7ed55 Sync SDL3 wiki -> header 2024-02-02 21:14:23 +00:00
Sam Lantinga
aa8f609ff3 Clamp HDR colors to the SDR range for SDR renderers 2024-02-02 13:13:53 -08:00
Sam Lantinga
9591b2cfb4 Finalized the SDL render API colorspaces
The renderer will always use the sRGB colorspace for drawing, and will default to the sRGB output colorspace. If you want blending in linear space and HDR support, you can select the scRGB output colorspace, which is supported by the direct3d11 and direct3d12
2024-02-02 13:13:53 -08:00
Simon McVittie
7c089f4e57 testautomation_math: Fix misleading log output
These originally checked for expected ± EPSILON as logged, but since
commit 880c6939 they check for expected ± max_err, where max_err may
need to be greater than EPSILON for very large expected results like
the ones in exp_regularCases().

Also, EPSILON is so small that the default precision of the %f format
(6 decimal places) would never actually have shown its effect, so log
it in scientific notation instead.

Fixes: 880c6939 "testautomation_math: do relative comparison + more precise correct trigonometric values"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-02 07:44:04 -08:00
Simon McVittie
b66dba2a9d test: Don't accept results that are much less than expected
While looking at the other tests in this file, I noticed that instead
of checking for a result in the range of expected ± FLT_EPSILON as I
would have expected, these tests would accept any result strictly less
than expected + FLT_EPSILON, for example a wrong result that is very
large and negative. This is presumably not what was intended, so add
the SDL_fabs() that I assume was meant to be here.

Fixes: 474c8d00 "testautomation: don't do float equality tests"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-02 07:44:04 -08:00
Anonymous Maarten
f1f9e27128 testautomation_math: do relative comparison + more precise correct trigonometric values
If the magnitude of the expected result is small, then we can safely
assume that the actual calculated result matches it to 10 decimal
places.

However, if the magnitude is very large, as it is for some of our exp()
tests, then 10 decimal places represents an unrealistically high level
of precision, for example 24 decimal digits for the test that is
expected to return approximately 6.6e14. IEEE 754 floating point only
has a precision of about 16 decimal digits, causing test failure on
x86 compilers that use an i387 80-bit extended-precision register for
the result and therefore get a slightly different answer.

To avoid this, scale the required precision with the magnitude of the
expected result, so that we accept a maximum error of either 10 decimal
places or 1 part in 1e10, whichever is greater.

[smcv: Added longer commit message explaining why we need this]
(cherry picked from commit 880c69392a)
2024-02-02 07:44:04 -08:00
Simon McVittie
babca704e0 testautomation: Don't expect exp to yield exact floating point results
In the Steam Runtime 1 'scout' environment, when compiling for i386
using the default gcc-4.6, Exp(34.125) matches the desired value to the
precision shown in the log (6 decimal places) but is not an exact match
for the desired value.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-02 07:44:04 -08:00
Sam Lantinga
f6f9468d84 Fixed warning C4701: potentially uninitialized local variable 'srcpixel' used 2024-02-01 21:24:11 -08:00
Sam Lantinga
d383299779 Fixed build on older Windows SDK 2024-02-01 20:48:53 -08:00
Sam Lantinga
d04fea8b87 Even more miscellaneous gamepad buttons! 2024-02-01 20:34:05 -08:00
Sam Lantinga
cb70e972e3 Added miscellaneous gamepad buttons for additional macro buttons on some controllers 2024-02-01 20:15:01 -08:00
Sam Lantinga
d6a48e4958 Don't use the system iconv on Apple mobile platforms
Fixes https://github.com/libsdl-org/SDL/issues/8964
2024-02-01 15:53:27 -08:00
Sam Lantinga
ea0853d23d Added an HDR gradient test to testcolorspace 2024-02-01 15:36:49 -08:00
Sam Lantinga
dc607c666b Fixed creating HDR textures with SDL_CreateTexture() 2024-02-01 15:36:49 -08:00
SDL Wiki Bot
dcfb069c75 Sync SDL3 wiki -> header 2024-02-01 20:18:29 +00:00
Sam Lantinga
7561116873 Added support for floating point texture formats 2024-02-01 12:17:35 -08:00
Sam Lantinga
90597aeaef HDR10 colorspace isn't currently supported
You can't do blending directly in PQ space, which means you have to create a scene render target in linear space and use shaders to convert PQ texture data to linear, etc. All of this is out of scope for the SDL 2D renderer at the moment.
2024-02-01 12:17:35 -08:00
Sam Lantinga
19dde63e7c Added a simple linear scale for tonemapped HDR to SDR surface conversion 2024-02-01 12:17:35 -08:00
Sam Lantinga
fc35b7e121 Convert to sRGB if trying to create a texture from an HDR surface 2024-02-01 12:17:35 -08:00
Sam Lantinga
c1f3c81003 Make the color primary conversion code reusable
Also added conversion from rec709 to rec2020 primaries
2024-02-01 12:17:35 -08:00
Sam Lantinga
496ed01bdb Detect blending in HDR10 colorspace 2024-02-01 12:17:35 -08:00
Sam Lantinga
dd28ab0489 Added SDL_SetRenderDrawColorspace() and SDL_GetRenderDrawColorspace() 2024-02-01 12:17:35 -08:00
Sam Lantinga
9c8b47b726 Cache the draw color state in the software and PSP renderers
Converting the color from float is a bit expensive, so let's cache that state
2024-02-01 12:17:35 -08:00
Sam Lantinga
dacfaa91b4 Make sure to round color values when converting to Uint8 2024-02-01 12:17:35 -08:00
Ozkan Sezer
c00b6a8e20 SDL_kmsdrmvideo.c: clean-up includes, add clarifying note after 5ab879f 2024-02-01 11:04:10 +03:00
SDL Wiki Bot
a4969e393e Sync SDL3 wiki -> header 2024-02-01 02:08:27 +00:00
Sam Lantinga
6f443e2aca Added support for the scRGB colorspace on D3D11 and D3D12 2024-01-31 18:07:00 -08:00
Sam Lantinga
12c31898c1 Update colors in SDL_RenderGeometryRaw() if we're doing interpolation in linear space
Testing: Modified testgeometry to clear the background to 0.5 and then changed the triangle color to 0.5, and verified that they were the same color when using the D3D11 renderer.
2024-01-31 11:02:45 -08:00
Sam Lantinga
77549dc91e Fixed some places using SDL_SetRenderDrawColor() instead of SDL_SetRenderDrawColorFloat() 2024-01-31 11:02:45 -08:00
Sam Lantinga
4b3c530dd1 Fixed out of bounds access
This can happen if we try to blit from a surface with an unknown pixel format
2024-01-31 09:55:52 -08:00
Sam Lantinga
3c45544a14 Added a slow blit function to handle large pixel formats and colorspace conversion 2024-01-31 09:50:46 -08:00
Sam Lantinga
49cc4c14e9 Use the default colorspace if we have to convert texture pixels 2024-01-31 09:50:46 -08:00
Sam Lantinga
c1f97c8e07 Fixed testgeometry after color format change (thanks @sezero!) 2024-01-30 23:31:48 -08:00
Frank Praznik
482a27bc00 wayland: Throttle to 20hz if the frame callback never fires
Matches SDL2, and should be enough to keep most games from desyncing/timing out.

A proper fix for FIFO presentation without the frame callback mess is being worked on upstream, so this whole hack should be rendered obsolete in the near future.
2024-01-30 17:12:20 -05:00
Amun
4a759b340f Fixes in SDL_ColorSpace (SDL_pixels.h) 2024-01-30 11:16:53 -08:00
Frank Praznik
9462eec57b pipewire: Don't assert if the default capture device is a sink or vice versa
When no source devices are connected, the default source string can contain a sink name. If the default source and sink match, it will be caught as a sink device first and handled correctly, but if the default sink/source don't match, which happens when the sink is an HDMI output and the source is still an onboard audio chipset output name, an assert can result since the requested source device won't be flagged as a capture device. Rather than asserting, simply don't assign default devices that don't match the correct capabilities, as it's not an uncommon scenario and can be handled gracefully.

Additionally, if asserting is a no-op in release mode, sinks can be returned as sources and vice versa, which is incorrect.
2024-01-30 13:32:22 -05:00
SDL Wiki Bot
d15fb9e063 Sync SDL3 wiki -> header 2024-01-30 17:49:26 +00:00
Sam Lantinga
f257eb4481 Added the concept of colorspace to the SDL renderer
This allows color operations to happen in linear space between sRGB input and sRGB output. This is currently supported on the direct3d11, direct3d12 and opengl renderers.

This is a good resource on blending in linear space vs sRGB space:
https://blog.johnnovak.net/2016/09/21/what-every-coder-should-know-about-gamma/

Also added testcolorspace to verify colorspace changes
2024-01-30 09:48:02 -08:00
Sam Lantinga
554f0625d3 Renderer colors now have floating point precision 2024-01-30 09:48:02 -08:00
Francisco Javier Trujillo Mata
da8fc70a83 Fixing viewport 2024-01-29 20:41:25 -08:00
Francisco Javier Trujillo Mata
851c1a5e9c Fix scissor usage 2024-01-29 20:41:25 -08:00
Francisco Javier Trujillo Mata
dc35ee9d54 Fix color 2024-01-29 20:41:25 -08:00
Sam Lantinga
61a3a163db Fixed typo (thanks @Akaricchi!) 2024-01-29 18:48:41 -08:00
SDL Wiki Bot
7fbd85ad5c Sync SDL3 wiki -> header 2024-01-29 02:25:21 +00:00
Sam Lantinga
61b5c38e6e Added the initial concept of colorspace to SDL 2024-01-28 18:24:39 -08:00
Xander
a3bfd5329c Fix broken mingw i686 buildscript 2024-01-28 17:29:33 -08:00
Xander
59d7dd3615 Fix broken mingw x86_64 buildscript 2024-01-28 17:29:33 -08:00
Frank Praznik
fbf10afb31 wayland: Consolidate window creation logic
The fractional scale manager and viewport are both created for a surface under the same circumstances, so consolidate the logic.
2024-01-28 18:15:39 -05:00
Frank Praznik
2e96307b27 wayland: Always create a viewport for the surface, if possible
Toggling viewports on and off can cause visual anomalies such as flicker when moving windows between displays on a mixed-DPI configuration or toggling the scaled fullscreen modes. If the viewport protocol is avilable, always create a viewport for the surface, unless it is an unscaled external surface, in which case the surface should be left untouched as an application may wish to attach its own viewport or use integer scaling.

This allows for the removal of several helper functions as well.
2024-01-28 17:52:35 -05:00
Frank Praznik
94240c197d docs: Hint envvars needs to use the hint string, not the macro name 2024-01-28 15:12:03 -05:00
SDL Wiki Bot
00a8ca403e Sync SDL3 wiki -> header 2024-01-28 18:32:23 +00:00
Frank Praznik
fbebbab90d wayland: Only set the explicit logical window size when using display scaling
Otherwise, the standard width/height is already in points/screen units.
2024-01-28 13:31:42 -05:00
Frank Praznik
879ba46ade wayland: Make sure the logical window size can't go to zero.
libdecor can send a size of zero as a valid value, the use of which will close the window. Make sure the minimum width/height are clamped to a minimum of 1.
2024-01-28 13:31:42 -05:00
Frank Praznik
b97cda226f wayland: Refactor internal variable names for better readability
Add descriptions in the internal window struct as well.
2024-01-28 13:31:42 -05:00
Frank Praznik
344ec60f8f tests: Fix window centering test with Wayland display scaling mode
The usable fullscreen bounds need to be queried after window creation, as Wayland can send different usable bounds depending on the focused window's scaling mode.
2024-01-28 13:31:42 -05:00
Frank Praznik
5b8ca05f1a wayland: Add a forced screen space scaling mode
Add a mode that forces Wayland windows to output with scaling that forces 1:1 pixel mapping.

This is intended to allow legacy applications to be displayed without desktop scaling being applied, and may have issues with some display configurations, as this forces the window to behave in a way that Wayland desktops were not designed to accommodate (rounding errors can result from certain combinations of window/scale values, the window may be unusably small, jump in size at times, or appear to be larger than the desktop space, and cursor precision may be reduced).

Windows flagged as DPI-aware are not affected by this.

The automated video test suite passes with the hint turned on.
2024-01-28 13:31:42 -05:00
Sam Lantinga
9f7eb6c4c1 Fixed testautomation log callback calling convention 2024-01-27 22:44:13 -08:00
Sam Lantinga
12bdb2b4d0 Added the environment variable SDL_LOGGING to control default log output 2024-01-27 19:30:22 -08:00
Ryan C. Gordon
dcd26a80e5 windows: Minor tweaks that makes Windows XP vidmodes work again.
(thanks @madebr!)

Fixes #8328.
Reference Issue #8666.
2024-01-27 20:15:08 -05:00
Ryan C. Gordon
6ca596cfc1 windows: Manage MapVirtualKey vs Windows XP.
Reference Issue #8666.
2024-01-27 20:15:08 -05:00
Ryan C. Gordon
1c5bc53738 windows: Manage WideCharToMultiByte vs Windows XP.
Reference Issue #8666.
2024-01-27 20:15:08 -05:00
Ryan C. Gordon
2144c2ac71 windows: Added WIN_IsWindowsXP, for extreme runtime compatibility checks.
Reference Issue #8666.
2024-01-27 20:15:08 -05:00
Ryan C. Gordon
56fa22c63b windows: OS version checks now cache results.
So these only have to talk to the Win32 API once per check, per process.
2024-01-27 20:15:08 -05:00
Sam Lantinga
4fba663368 Simplified the default log category logic
Now it's much clearer and easier to tweak the defaults
2024-01-27 15:45:38 -08:00
Sam Lantinga
a7a98d8bbb Document that the default log priority is error, not critical 2024-01-27 15:45:38 -08:00
SDL Wiki Bot
fd14a20a4b Sync SDL3 wiki -> header 2024-01-27 23:26:26 +00:00
Sam Lantinga
17768c51fc Revert "Sync SDL3 wiki -> header"
This reverts commit 5e96e410d6.
2024-01-27 15:25:29 -08:00
Ozkan Sezer
2a4db8c415 SDL_rwops.c (SDL_IsRegularFile): fix WinRT build failure due to S_ISREG
(cherry picked from commit fcd1c155cc)
2024-01-28 02:22:00 +03:00
Charlie Volow
5ae2ffc127 document that text input is on by default
See:
https://discourse.libsdl.org/t/text-input-is-active-by-default-hampering-frame-rate/24396
https://discourse.libsdl.org/t/restoring-text-input-to-the-default-state/42690
2024-01-27 15:18:05 -08:00
SDL Wiki Bot
5e96e410d6 Sync SDL3 wiki -> header 2024-01-27 23:12:19 +00:00
Sam Lantinga
f66fe7e221 Replaced SDL_GetJoystickCaps() with joystick properties
Fixes https://github.com/libsdl-org/SDL/issues/8927
2024-01-27 15:11:52 -08:00
Ozkan Sezer
019dc53764 SDL_RWFromFile, stdio: reject if the file is not a regular file.
Fixes https://github.com/libsdl-org/SDL/issues/8935
(cherry picked from commit 230ae797a7)
2024-01-28 01:44:50 +03:00
SDL Wiki Bot
aba3038353 Sync SDL3 wiki -> header 2024-01-27 21:01:19 +00:00
Sam Lantinga
3b55c7d1f4 Shortened SDL property names 2024-01-27 13:00:50 -08:00
SDL Wiki Bot
1885e6b2e0 Sync SDL3 wiki -> header 2024-01-27 20:47:21 +00:00
Sam Lantinga
8a4284b7df Clarified the use of SDL_RENDERER_SOFTWARE when creating a renderer
Fixes https://github.com/libsdl-org/sdlwiki/issues/458
2024-01-27 12:46:41 -08:00
Sam Lantinga
2d94b4f490 Make sure we set datasize on error in SDL_LoadFile_RW() 2024-01-27 12:19:59 -08:00
Sam Lantinga
dff76bf295 Enable text input on video initialization without popping up an on-screen keyboard
Fixes https://github.com/libsdl-org/SDL/issues/8561

(cherry picked from commit 4ff3b28273)
2024-01-27 12:00:39 -08:00
Sam Lantinga
b9ea2dde44 Added VisionOS as a supported target to the Xcode project
Also added SDL_PLATFORM_VISIONOS to the platform definitions and generally switched from TARGET_OS_* macros to SDL_PLATFORM_* macros.
2024-01-27 11:07:21 -08:00
Ryan C. Gordon
7a7875c904 wasapi: A few tweaks to buffer management.
These were previously applied, in a different form, in SDL2.

Reference Issue #8924.
2024-01-27 14:05:09 -05:00
Frank Praznik
e71e16950a wayland: Use the preferred order of displays exposed by KDE
KDE provides the kde_output_order_v1 protocol, which tells clients the preferred order of all connected displays. Sort SDL displays according to the provided list at init time.
2024-01-27 02:10:49 -05:00
Sam Lantinga
e0c2cca629 Fixed fullscreen windows having rounded corners and 1px transparent borders on Windows 11.
When an app makes a fullscreen window on Windows, the window is really just resized to the monitor dimensions and positioned at 0, 0 and positioned on top of everything, including the taskbar. Added disabling rounded corners and some new DWM controlled border color (which seems to be defaulted to 1px transparent, but can be set to the theme color by users). Previous settings are restored when exiting fullscreen mode.
2024-01-26 23:05:31 -08:00
Sam Lantinga
a1a4948fda Fixed the size and position of minimized windows on Windows 2024-01-26 22:36:32 -08:00
Caiyi Hsu
5ba839e83b fix XRandR refresh rate calculation 2024-01-26 20:44:23 -08:00
Anonymous Maarten
44a2c4d512 Only retain SDL_* + platform macro's in rename_macros.py 2024-01-26 18:05:49 +01:00
Anonymous Maarten
c5794cd911 ci: bump actions version tag 2024-01-26 02:33:20 +01:00
Anonymous Maarten
33f86d81fc Add all macros from SDL2's SDL_config.h to rename_macros.py 2024-01-26 02:32:00 +01:00
Sam Lantinga
aeac8774f7 Missed one 2024-01-25 16:53:19 -08:00
Sam Lantinga
d0dd60c8ba Updated new pixel format names to be more consistent with the others 2024-01-25 16:51:22 -08:00
Sam Lantinga
0f78aa7c30 Add some high bit-depth pixel formats
These are not fully supported yet, just preparing for future work.
2024-01-25 16:40:46 -08:00
Ozkan Sezer
5ab879f89a SDL_kmsdrmvideo.c: move SDL_kmsdrmvulkan.h include to before all others
Fixes vulkan redefinition errors:

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

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

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

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

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

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

This partially reverts commit 31d133db.

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

This partially reverts commit 31d133db.

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

This partially reverts commits b6ae281e and 31d133db.

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

Removes some unnecessary abstractions in the process.
2024-01-22 12:37:24 -05:00
Sam Lantinga
99ce8af439 Fixed warning C4244: '=': conversion from 'Sint64' to 'int', possible loss of data
(cherry picked from commit 12bab1c981)
2024-01-22 08:39:47 -08:00
Sam Lantinga
a28a42cfc6 Fixed declaration of SDL_HapticRumbleSupported 2024-01-21 11:36:38 -08:00
Sam Lantinga
052b958bf2 Made SDL_HapticEffect const in the API
Also added some additional parameter validation to haptic effect functions
2024-01-21 11:29:40 -08:00
Sam Lantinga
fa5bfe577c Fixed warnings building for UWP 2024-01-21 06:55:29 -08:00
Sam Lantinga
3e541eab22 Fixed error: 'fq' may be used uninitialized [-Werror=maybe-uninitialized] 2024-01-21 06:55:29 -08:00
Sam Lantinga
8f20ef5b43 Re-enable C runtime with Mingw, and disable the problematic math test 2024-01-21 06:55:29 -08:00
Sam Lantinga
1f177be1e4 Disable the Mingw C runtime by default
Mingw seems to have a bad pow implementation in the C runtime:
'Pow(-72.300000,12.000000), expected [20401381050275984310272.000000], got 20401381050275996893184.000000': Failed
2024-01-21 06:55:29 -08:00
Sam Lantinga
5e70ee29cc Build SDL with the static C runtime on Visual Studio 2024-01-21 06:55:29 -08:00
Sam Lantinga
e2f35a16c2 Added <string.h> for declaration of memset() and memcpy() 2024-01-21 06:55:29 -08:00
Sam Lantinga
7a069cc4b0 Allow optimizing memcpy and memset where possible
Modern C runtimes have well optimized memset and memcpy, so use those instead of dispatching into SDL's versions. In addition, some compilers can analyze memset and memcpy calls and directly turn them into optimized assembly.
2024-01-21 06:55:29 -08:00
Frank Praznik
8d25c2d260 video: Fix window manager initiated fullscreen window moves
Distinguish between and handle fullscreen window moves initiated by the window manager vs the application to avoid cases where the window snaps back to the original display when moved due to the use of old coordinates.
2024-01-20 13:31:43 -05:00
Sam Lantinga
8c7f5b73e8 Fixed build
The flip directions aren't 1 and -1, just use SDL_FLIP_NONE for now
2024-01-20 08:42:52 -08:00
SDL Wiki Bot
4d6e2d8b73 Sync SDL3 wiki -> header 2024-01-20 14:33:19 +00:00
Sam Lantinga
308906ba25 Added SDL_FlipSurface() to flip a surface vertically or horizontally
Fixes https://github.com/libsdl-org/SDL/issues/8857
2024-01-20 06:31:37 -08:00
Sylvain
2cd583ee13 Prevent asan warning on qsort():
'src/stdlib/SDL_qsort.c:27:5: runtime error: null pointer passed as argument 1, which is declared to never be null`
2024-01-20 11:26:02 +01:00
Sam Lantinga
5db543a66a Just use the khronos headers for the checks that need them 2024-01-19 23:55:05 -08:00
Sam Lantinga
4b82bed259 Fixed building with the steamrt/scout SDK 2024-01-19 23:02:48 -08:00
Sam Lantinga
116c60c5b0 Run EGL/GLES cmake tests with the Khronos headers available 2024-01-19 22:31:40 -08:00
Sam Lantinga
b552f26e6a Fix building with the steamrt/scout SDK 2024-01-19 22:31:40 -08:00
Sylvain
7b02d328fa Fixed overflow in SDL_SoftStretch() (see #8878) 2024-01-20 06:38:34 +01:00
Sam Lantinga
64972b4184 Fixed build 2024-01-19 17:21:05 -08:00
Sam Lantinga
6a00ae7e58 Fixed rendering diagonal lines within a viewport
The drawing uses the origin of the viewport as the coordinate origin, so we only need to clip against the size of the viewport.

Also added a unit test to catch this case in the future
2024-01-19 16:29:38 -08:00
Sam Lantinga
8d9c7d8ebe SDL_UpdateFullscreenMode: Only restore mouse position when exiting fullscreen if the fullscreen mode actually changed
- Previously we would skip most of UpdateFullscreenMode if not entering fullscreen and the window was not set as fullscreen for any display
  which prevented running this.

This prevents warping the mouse when hiding a non-fullscreen window
2024-01-19 15:26:46 -08:00
Sam Lantinga
a73132177d Make sure the render target isn't bound as a resource
Fixes https://github.com/libsdl-org/SDL/issues/3380
2024-01-19 15:17:30 -08:00
Sam Lantinga
09ba55b462 Fixed crash scaling very large surfaces
Fixes https://github.com/libsdl-org/SDL/issues/8878
2024-01-19 13:06:12 -08:00
Sam Lantinga
aa3fc6e904 Fixed D-pad on Xbox One controllers using the HIDAPI driver 2024-01-19 11:43:01 -08:00
Sylvain Becker
3639743d89 Fixed bug #7614: Segmentation Fault in SDL_BlitSurface (#7808)
Update SDL_BlitSurface to use Intersect functions
2024-01-19 08:39:57 -08:00
Sam Lantinga
bd5d4d61ed Fixed potential overflow in software triangle rendering 2024-01-19 08:31:56 -08:00
Sam Lantinga
b566bfce07 Fixed warning C4152: nonstandard extension, function/data pointer conversion in expression 2024-01-19 06:49:53 -08:00
Sam Lantinga
9fc1135e3b Fixed warning C4127: conditional expression is constant 2024-01-19 06:44:32 -08:00
Sam Lantinga
1dbe54c4e6 Fixed warning C4244: 'function': conversion from 'SDL_ThreadID' to 'DWORD', possible loss of data 2024-01-19 06:28:54 -08:00
Sam Lantinga
f86b3ac605 Fixed types used in documentation (thanks @Dragon-Baroque!) 2024-01-19 05:23:38 -08:00
yuanhecai
129b459b2c Fix compilation problems about yuv_rgb_lsx.c 2024-01-18 19:41:36 -08:00
Simon McVittie
81ac656b7c SDL_CalculateRGBSize, SDL_CalculateYUVSize: set the error indicator
These functions historically didn't set the error indicator on overflow.

Before commit 447b508a "error: SDL's allocators now call SDL_OutOfMemory
on error", their callers would call SDL_OutOfMemory() instead, which was
assumed to be close enough in meaning: "that's a silly amount of memory
that would overflow size_t" is similar to "that's more memory than
is available". Now that responsibility for calling SDL_OutOfMemory()
has been pushed down into SDL_calloc() and friends, the functions that
check for overflows might as well set more specific errors.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-01-18 13:21:50 -08:00
Simon McVittie
e9a0edc847 testautomation_surface: Really make width * bpp overflow
A surface of width (0x7fff'ffff) / 2 = 0x3fff'ffff is not quite large
enough to make the pitch overflow in the way we wanted to test here:
with a 32-bit format, that makes each row 0xffff'fffc bytes, which
(just) fits in a 32-bit unsigned size_t. Increasing it to 0x4000'0000
pixels per row is enough to trigger the overflow we intended to test.

In SDL 2, this test bug was hidden by the fact that allocating
0xffff'fffc bytes on a 32-bit platform is very likely to fail, and SDL 2
reported both "malloc() failed" and "this amount of memory is too large
for a size_t" with the same error code.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-01-18 13:21:50 -08:00
Simon McVittie
eb059538f8 testautomation_surface: Really make pitch + alignment overflow
Adding 3 bytes of alignment to 0x7fff'ffff is not enough to make it
overflow a 4-byte unsigned size_t, so this test was not exercising
the intended failure mode. We cannot actually make this overflow
with a signed 32-bit width and an 8-bit format: the maximum width is
not enough to achieve that. However, if we switch to a 24-bit format,
we can make the calculation overflow.

In SDL 2, this test bug was hidden by the fact that allocating
0x7fff'ffff bytes on a 32-bit platform will usually fail, and SDL 2
reported both "malloc() failed" and "this amount of memory is too large
for a size_t" with the same error code.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-01-18 13:21:50 -08:00
Ozkan Sezer
4fdc291f5d Add spaces around SDL_PRI??? to avoid potential compiler warnings. 2024-01-18 23:41:10 +03:00
Ryan C. Gordon
949b4fc349 x11: XI_Motion should mark the global mouse position as changed.
Otherwise we'll miss it when XWarpPointer() is used. x11vnc may do this to
manage mouse input in some circumstances, so it can be possible for _all_
mouse motion to go through this path, breaking SDL_GetGlobalMouseState().

Thanks to @chrismile for all the detective work to figure this out!

Fixes #8827.

(cherry picked from commit cc7fe8c255)
2024-01-18 15:15:43 -05:00
Sam Lantinga
87f559e021 Updated Xcode projects after dbdc65fc95 2024-01-18 11:01:35 -08:00
Anonymous Maarten
49adb23ad9 Build yuv_rgb_lsx.c with -mlsx 2024-01-18 10:59:13 -08:00
Anonymous Maarten
dbdc65fc95 video: move standard c, sse and lsx implementations of yuv2rgb to its own source 2024-01-18 10:59:13 -08:00
Sam Lantinga
a31dc6dfcb Switched SDL_TouchID and SDL_FingerID to be Uint64 with 0 being an invalid value 2024-01-18 10:55:24 -08:00
Edoardo Lolletti
b19d43a74d Add SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING to migration readme 2024-01-18 10:19:18 -08:00
Edoardo Lolletti
b384973936 Remove no longer needed hint 2024-01-18 10:19:18 -08:00
Edoardo Lolletti
42d6cf9ce7 Update thread naming on windows 2024-01-18 10:19:18 -08:00
Sam Lantinga
cda2bffeee Re-add SDL_HAPTIC_SQUARE for SDL 3.0
Fixes https://github.com/libsdl-org/SDL/issues/8753
Closes https://github.com/libsdl-org/SDL/pull/8831
Closes https://github.com/libsdl-org/SDL/pull/8783
2024-01-18 09:24:03 -08:00
Sam Lantinga
df4b855af5 Updated SDL_TLSID to use the same type as other IDs in SDL 2024-01-18 08:18:37 -08:00
Sam Lantinga
fc0c774976 Renamed SDL_ThreadID() to SDL_GetCurrentThreadID()
Also renamed SDL_threadID to SDL_ThreadID and made it Uint64 for consistency with other ID types
2024-01-18 08:18:37 -08:00
Sam Lantinga
d6a41f8f31 Updated SDL_TimerID to use the same type as other IDs in SDL 2024-01-18 07:08:15 -08:00
SDL Wiki Bot
bc3a71d400 Sync SDL3 wiki -> header 2024-01-18 15:01:21 +00:00
Sam Lantinga
464f4d19fe Removed obsolete XInput mapping hint 2024-01-18 07:00:21 -08:00
Sam Lantinga
f8dfee01bb Made SDL_ReadSurfacePixel a public function
Fixes https://github.com/libsdl-org/SDL/issues/8320
2024-01-18 07:00:10 -08:00
Ozkan Sezer
f7ba340999 remove several instances of unnecessary emptry str "" after SDL_PRI??? 2024-01-18 17:25:50 +03:00
Sam Lantinga
c540c77756 Removed SDL_INIT_EVERYTHING
Fixes https://github.com/libsdl-org/SDL/issues/8709
2024-01-18 06:17:58 -08:00
Sam Lantinga
26996e2c02 We've decided to keep separate functions for creating a thread with and without stack size specified.
Fixes https://github.com/libsdl-org/SDL/issues/6652
2024-01-18 06:11:55 -08:00
Sam Lantinga
a2665f54c8 Updated the atomic API for SDL 3.0 naming conventions
Fixes https://github.com/libsdl-org/SDL/issues/7388
2024-01-18 04:41:34 -08:00
SDL Wiki Bot
4e60fc9b2b Sync SDL3 wiki -> header 2024-01-18 12:07:19 +00:00
Sam Lantinga
fb898d6df0 Clarify that desktop mode is the non-exclusive borderless fullscreen mode
Fixes https://github.com/libsdl-org/SDL/issues/8413
2024-01-18 04:06:32 -08:00
SDL Wiki Bot
b5bcf45a65 Sync SDL3 wiki -> header 2024-01-18 12:02:08 +00:00
Sam Lantinga
4fee6cb274 Added documentation for custom event cleanup in SDL_FlushEvent() 2024-01-18 04:00:48 -08:00
Sam Lantinga
fd34bc56f9 cocoa: Fix SDL_CocoaWindowData keyboard_focus being left pointing to a destroyed SDL window if input focus not previously reset for that window
- If a window being destroyed is a child of an inactive window and was the last keyboard focus of the window, that window will be left with a stale pointer
  to the destroyed window that it will attempt to restore the next time that window is focused. SDL_DestroyWindow will have already taken care of moving
  focus if this window is the current SDL keyboard focus so this change intentionally does not set focus.

- Like Cocoa_HideWindow, this attempts to move the focus to the closest parent window that is not hidden or destroying.
2024-01-18 03:36:54 -08:00
Sam Lantinga
0a99ad7a68 cocoa: Fix Cocoa_RaiseWindow not making child window key if SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED is true
- We intentionally don't raise the application when raising a child window to allow raising a child window to the top without setting the application active but the
  child window should still be set as key window for the application if desired.
2024-01-18 03:36:52 -08:00
SDL Wiki Bot
20e8411b12 Sync SDL3 wiki -> header 2024-01-18 11:27:24 +00:00
Sam Lantinga
f4a0bc02d5 Re-added prototypes for stub API functions 2024-01-18 03:26:11 -08:00
Sam Lantinga
f224af5ac5 Updated Haptic API for SDL 3.0 conventions
Also removed the XInput haptic support since using the haptic API for rumble is no longer supported.
2024-01-18 03:26:11 -08:00
Sam Lantinga
8ca9134115 Removed unnecessary NULL assignment 2024-01-18 03:26:11 -08:00
Sam Lantinga
75dd7e1658 Note that we only allow disabling major subsystems 2024-01-17 09:24:04 -08:00
Sam Lantinga
130b361904 Removed SDL_MISC_DISABLED 2024-01-17 09:24:04 -08:00
Sam Lantinga
20fa5e6ad0 Removed SDL_LOCALE_DISABLED 2024-01-17 09:24:04 -08:00
Sam Lantinga
6efadfdb77 Removed SDL_FILESYSTEM_DISABLED 2024-01-17 09:24:04 -08:00
Sam Lantinga
3d951134a3 Removed SDL_FILE_DISABLED
This didn't actually do anything except break functionality on Apple platforms
2024-01-17 09:24:04 -08:00
Sam Lantinga
ac367be171 Updated CMakeLists.txt now that timers and threads can't be disabled 2024-01-17 09:24:04 -08:00
Sam Lantinga
e2080f74fd Fixed building with the joystick subsystem disabled 2024-01-17 09:24:04 -08:00
Sam Lantinga
a0967c017f Fixed building with the video subsystem disabled 2024-01-17 09:24:04 -08:00
Sam Lantinga
31f34e9504 Removed SDL_ATOMIC_DISABLED
It turns out that because we redefine SDL functions internally, it is safe to call SDL mutex functions while initializing the jump table
2024-01-17 09:24:04 -08:00
Sam Lantinga
6e1b11368d Removed SDL_CPUINFO_DISABLED
CPU info is a core part of the SDL API, and shouldn't be disabled
2024-01-17 09:24:04 -08:00
Sam Lantinga
52d6587084 Removed SDL_EVENTS_DISABLED
Events are a core part of the SDL API, and shouldn't be disabled
2024-01-17 09:24:04 -08:00
Sam Lantinga
ba02722755 Removed SDL_LOADSO_DISABLED
Loading shared libraries is core functionality on platforms that support it.
2024-01-17 09:24:04 -08:00
Sam Lantinga
0d7df16812 Timers are a required platform feature
Many SDL subsystems depend on being able to see time passing. If you are porting to a new platform, you'll need to fill in a timer implementation as part of the initial port.

Fixes https://github.com/libsdl-org/SDL/issues/8850
2024-01-16 20:50:08 -08:00
Sam Lantinga
518b070aa9 Fixed drop event coordinate conversion 2024-01-16 14:07:42 -08:00
SDL Wiki Bot
3ca8cee874 Sync SDL3 wiki -> header 2024-01-16 20:27:25 +00:00
Ryan C. Gordon
8bf74280e0 docs: Note SDL_UpdateWindowSurfaceRects can update beyond specified areas.
Reference Issue #8825.
2024-01-16 15:26:13 -05:00
Sam Lantinga
9408299bad Set the number of audio devices to 0 if audio hasn't been initialized
This updates GetAudioDevices() to have the same behavior as SDL_GetJoysticks() where the return value will only be NULL if there is an error. Returning no devices will return a valid array containing NULL.
2024-01-16 12:15:13 -08:00
Sam Lantinga
be0ba78c56 Convert the coordinates in drop events as well (thanks @Dragon-Baroque!) 2024-01-16 12:00:36 -08:00
Sylvain
e6c8872fdc Fixed bug #7614: Segmentation Fault in SDL_BlitSurface 2024-01-16 07:09:35 -08:00
Sylvain
ce0e0675de Fixed bug #8301 - Software renderer draws long lines incorrectly / SDL_RENDERLINEMETHOD_GEOMETRY 2024-01-16 07:06:29 -08:00
Sam Lantinga
6e48d4532c Added raw input device handle for WM_INPUT mouse button handling 2024-01-15 19:47:55 -08:00
Sam Lantinga
cf5e0637b5 Touchpads already have their right/left buttons swapped in raw input
Fixes https://github.com/libsdl-org/SDL/issues/8597
2024-01-15 19:41:46 -08:00
Sam Lantinga
fb2d7ed83e Restore window minimum and maximum size if it is recreated
Fixes https://github.com/libsdl-org/SDL/issues/8805
2024-01-15 16:33:49 -08:00
Francisco Javier Trujillo Mata
915afae514 Remove force using one thread 2024-01-15 15:05:03 -08:00
Francisco Javier Trujillo Mata
64a3e2d17d Remove ps2_driver from workflow 2024-01-15 15:05:03 -08:00
SDL Wiki Bot
464a41411e Sync SDL3 wiki -> header 2024-01-15 18:55:24 +00:00
Frank Praznik
4f3d4bd110 wayland: Add the ability to import and wrap external surfaces
Add the ability to import and wrap external surfaces from external toolkits such as Qt and GTK.

Wayland surfaces and windows are more intrinsically tied to the client library than other windowing systems, so it is necessary to provide a way to initialize SDL with an existing wl_display object, which needs to be set prior to video system initialization, or export the internal SDL wl_display object for use by external applications or toolkits. For this, the global property SDL_PROPERTY_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER is used.

A Wayland example was added to testnative, and a basic example of Qt 6 interoperation is provided in the Wayland readme to demonstrate the use of external windows with both SDL owning the wl_display, and an external toolkit owning it.
2024-01-15 13:54:35 -05:00
SDL Wiki Bot
99f6bcf504 Sync SDL3 wiki -> header 2024-01-15 04:32:24 +00:00
chalonverse
3a4ac15a27 Make Xbox GDK code public (and fix some GDK code rot) (#8844) 2024-01-14 20:31:41 -08:00
Frank Praznik
649556befa win32: Let windows manage the floating state unless explicitly overridden
Windows doesn't inform applications if the window is in the docked/tiled state, so let windows manage the window size when restoring from a fixed-size state, unless the application explicitly requested a new size/position.

Fixes the video_getSetWindowState test.
2024-01-13 15:24:25 -08:00
Frank Praznik
d4a9748740 win32: Fix test failures
WM_WINDOWPOSCHANGING needs to return 0 when a resize was initiated programmatically

Checking the SWP_NOMOVE and SWP_NOSIZE flags in the WINDOWPOS struct when handling WM_WINDOWPOSCHANGED to avoid sending redundant resize and move events is unreliable, as they can be set even when the window has moved or changed size, such as when leaving fullscreen, or programmatically resizing a window without STYLE_RESIZABLE set.

Fixes the video_getSetWindowSize and video_setWindowCenteredOnDisplay tests.
2024-01-13 15:24:25 -08:00
Sylvain
101f903bb1 testgeometry: allow to use arrows to move the triangle 2024-01-12 11:53:34 -08:00
Sylvain
4033a0a83b Prevent ASAN warning:
like SDL_triangle.c:305:30: runtime error: left shift of negative value -672
(even if the value was correctly computed)
2024-01-12 11:53:34 -08:00
Sam Lantinga
f0b9c7f0f0 Let Windows track floating window state
This fixes restoring window size and position after moving it to a tiled location (which isn't maximized) and then back.
2024-01-12 10:58:30 -08:00
Sam Lantinga
98be55894e Moved window state change handling from WM_WINDOWPOSCHANGING to WM_WINDOWPOSCHANGED
Applications might override WM_WINDOWPOSCHANGING which would prevent us from getting the correct window state.

This also fixes cases where the window doesn't get WM_SHOWWINDOW, as described in Raymond Chen's blog post:
https://devblogs.microsoft.com/oldnewthing/20080115-00/?p=23813
2024-01-12 09:38:28 -08:00
Sam Lantinga
7efeb36131 Pass the frame DPI to WIN_AdjustWindowRectForHWND() 2024-01-12 09:33:05 -08:00
Sam Lantinga
e4ee1cade7 Revert "SDL_windowsevents.c: fixed -Werror=unused-variable"
This reverts commit f8cce4ead4.
2024-01-12 09:33:05 -08:00
Ozkan Sezer
f8cce4ead4 SDL_windowsevents.c: fixed -Werror=unused-variable 2024-01-12 18:56:10 +03:00
Sam Lantinga
277fded7ba Refactor AdjustWindowRectEx() into WIN_AdjustWindowRectForHWND()
Also include the window EXSTYLE to calls to AdjustWindowRectEx()
2024-01-12 07:07:27 -08:00
Sam Lantinga
312160935d Removed deprecated use of __IPHONEOS__ (thanks @Dragon-Baroque!) 2024-01-12 06:51:44 -08:00
Sam Lantinga
483155bbf9 Fixed borderless window client area calculation 2024-01-11 13:49:28 -08:00
Sylvain
cf0d1d7234 Fixed ASAN warning, runtime error: left shift of 160 by 24 places cannot be represented in type 'int' 2024-01-11 09:00:19 -08:00
George Broughton
0c6b070761 Capture debug macros off by default 2024-01-11 10:22:36 -05:00
Sam Lantinga
b5bc64aa55 Fixed pause key on Windows (thanks Mikhail!) 2024-01-10 16:13:01 -08:00
Caleb Cornett
d766f68cb3 Fix compile error with XInputOnGameInput.h 2024-01-10 12:51:27 -08:00
Frank Praznik
ec2159d492 tests: Clean up the window creation properties in the Wayland custom surface example 2024-01-10 11:17:06 -05:00
Sam Lantinga
9a77813df0 WinMain is specified by the Win32 API as having extern "C" linkage
Fixes https://github.com/libsdl-org/SDL/issues/8814
2024-01-10 06:25:49 -08:00
Sam Lantinga
6407e0cc37 Added attribution for GIP protocol handling (thanks @medusalix!) 2024-01-09 11:43:12 -08:00
Frank Praznik
3a219caf3d wayland: Restore accidentally removed line of code 2024-01-08 18:01:06 -05:00
Sam Lantinga
ccae9c1ef6 Only initialize audio drivers that have been requested
If testautomation is running with only a specific audio driver enabled, we shouldn't try to open other ones, as they might fail.

Fixes https://github.com/libsdl-org/SDL/issues/8797

(cherry picked from commit 4c11307a4e)
2024-01-08 14:35:42 -08:00
Sam Lantinga
590d0bec6f Revert "Make sure new windows have mouse and keyboard focus if there's no windowing system"
This reverts commit 5948ea997f.

This isn't needed, the proper focus logic is in SDL_ShowWindow()
2024-01-08 14:32:28 -08:00
Sam Lantinga
5948ea997f Make sure new windows have mouse and keyboard focus if there's no windowing system 2024-01-08 13:54:18 -08:00
SDL Wiki Bot
05d18aab1c Sync SDL3 wiki -> header 2024-01-08 19:55:19 +00:00
Frank Praznik
4b6df89238 wayland: Add a property to allow creation of a wl_egl_window object even if OpenGL is not enabled
Useful if the application handles OpenGL outside of SDL and wants to use the window without having to pull in Wayland as a dependency.
2024-01-08 14:54:47 -05:00
Frank Praznik
f7dd0f9491 wayland: Allow the creation of roleless window surfaces for custom application use
Allow for the creation of SDL windows with a roleless surface that applications can use for their own purposes, such as with a windowing protocol other than XDG toplevel.

The property `wayland.surface_role_custom` will create a window with a surface that SDL can render to and handles input for, but is not associated with a toplevel window, so applications can use it for their own, custom purposes (e.g. wlr_layer_shell).

A test/minimal example is included in tests/testwaylandcustom.c
2024-01-08 14:54:47 -05:00
Frank Praznik
4417250d0d wayland: Remove the registry from the window properties
A Wayland registry object can only have one listener attached at a time, so an application attempting to use the backend SDL registry object for its own purposes will just result in an error. Remove this property, as it is of no use to applications and will only result in errors.

If an application needs the registry, it needs to get the wl_display object via `SDL.window.wayland.display` and use wl_display_get_registry() to create a new registry object that it can attach its own listeners to.
2024-01-08 14:54:47 -05:00
Frank Praznik
392796e49c wayland: Eliminate redundant protocol checks
If the xdg_wm_base protocol isn't present, the window won't be assigned a valid surface type at creation time, which makes these checks redundant.

The libdecor path was already cleaned up in this manner some time ago.
2024-01-08 14:54:47 -05:00
Ryan C. Gordon
82f2c4d581 render: Renamed SDL_GetTextureRenderer to SDL_GetRendererFromTexture. 2024-01-08 14:16:16 -05:00
SDL Wiki Bot
95066ce2a0 Sync SDL3 wiki -> header 2024-01-08 19:10:31 +00:00
Ryan C. Gordon
df438a3170 opengl: OpenGL renderers need to support texture target in properties.
Otherwise this has to become an awkward heuristic in sdl2-compat.
2024-01-08 14:08:35 -05:00
Simon McVittie
8e7c0b34d7 test: If SDL_CreateRenderer() fails, say why
Helps: https://github.com/libsdl-org/SDL/issues/8799
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-01-08 11:02:12 -08:00
Simon McVittie
022ff075b9 test: When listing test-cases, say which ones are disabled
When a test has been disabled because it's known not to work reliably
or it's a test for unimplemented functionality, we probably don't want
to encourage developers and testers to run it and report its failures
as a bug.

Helps: #8798, #8800
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-01-08 09:44:09 -08:00
SDL Wiki Bot
44adab7dfd Sync SDL3 wiki -> header 2024-01-08 17:36:24 +00:00
Simon McVittie
059fb560ba gamepad: Clarify range and direction of axes
It would be easy to assume that all APIs that reference
SDL_JOYSTICK_AXIS_MAX work the same way, but they do not: triggers
generally use the full signed 16-bit range in the lower-level joystick
API, but are normalized to be non-negative by the higher-level gamepad
API.

We also never said explicitly which direction is positive here.
Experimentally, it's right (X), down (Y), and pressed (triggers).

Resolves: https://github.com/libsdl-org/SDL/issues/8793
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-01-08 09:35:25 -08:00
SDL Wiki Bot
4942027117 Sync SDL3 wiki -> header 2024-01-08 17:34:23 +00:00
Ryan C. Gordon
e056f52f7d include: Remove string literals from properties documentation.
I'm going to let the wiki bridge clean up the word wrapping for me, here. :)
2024-01-08 12:33:29 -05:00
SDL Wiki Bot
e8c595af5c Sync SDL3 wiki -> header 2024-01-08 17:16:19 +00:00
Ryan C. Gordon
adef35b9ec include: Attempt to make new properties documentation wiki bridge friendly. 2024-01-08 12:14:08 -05:00
SDL Wiki Bot
4ffec098b7 Sync SDL3 wiki -> header 2024-01-08 15:18:26 +00:00
Ryan C. Gordon
9bc7cfc755 render: Added SDL_GetTextureRenderer(). 2024-01-08 10:17:38 -05:00
Sam Lantinga
7eae08cfc4 Removed SDL_GL_BindTexture() and SDL_GL_UnbindTexture()
Now that we have the OpenGL texture properties, you can directly bind them yourself.

Fixes https://github.com/libsdl-org/SDL/issues/2124
2024-01-07 20:19:19 -08:00
SDL Wiki Bot
4d5bffc323 Sync SDL3 wiki -> header 2024-01-08 01:02:25 +00:00
Sam Lantinga
1a13dae219 Added constant definitions for SDL properties
Fixes https://github.com/libsdl-org/SDL/issues/8622
2024-01-07 16:59:41 -08:00
Sam Lantinga
3deefa6b43 Updated documentation for SDL_HINT_SHUTDOWN_DBUS_ON_QUIT 2024-01-07 14:20:16 -08:00
Semphris
2348e8b6a2 Add hint to make SDL handle dbus_shutdown() 2024-01-07 14:11:33 -08:00
Sam Lantinga
d3daba791a Don't try to send the PS third-party feature request to the Logitech G815 keyboard
Fixes https://github.com/libsdl-org/SDL/issues/8373
2024-01-06 08:29:01 -08:00
Sam Lantinga
014a63b4b5 Renamed ShowTextInput/HideTextInput to ShowScreenKeyboard/HideScreenKeyboard on Android
This better reflects the actual implementation and makes SDL_HINT_ENABLE_SCREEN_KEYBOARD work on Android.

Fixes https://github.com/libsdl-org/SDL/issues/8652
2024-01-06 08:11:22 -08:00
Sam Lantinga
3a9a52fe6c updateKeyboard should use the SDL window's screen instead of the view window's screen, which may be nil.
Fixes https://github.com/libsdl-org/SDL/issues/8200
2024-01-06 07:31:10 -08:00
Sam Lantinga
e100992c17 Added mapping for the RX Gamepad, e.g. Pandora Box 7
Fixes https://github.com/libsdl-org/SDL/issues/8217
2024-01-06 06:18:13 -08:00
J. Neuschäfer
139a0931a3 Fix memory barriers on ARMv5
The ARM926EJ-S Technical Reference Manual states:

> You can only access CP15 registers with MRC and MCR instructions in a
> privileged mode. CDP, LDC, STC, MCRR, and MRRC instructions, and unprivileged
> MRC or MCR instructions to CP15 cause the Undefined instruction exception to
> be taken.

Furthermore, `MCR p15, 0, <Rd>, c7, c10, 5` (later called Data Memory Barrier)
is not specified for the ARM926. Thus, SDL should not use these cache
instructions on ARMv5.
2024-01-05 09:00:47 -08:00
Sam Lantinga
21c80ac843 Added a practical example of confirm/cancel gamepad button handling 2024-01-04 22:51:43 -08:00
Sam Lantinga
787a15f760 Fix Mac child windows that are created hidden showing if their parent window is shown
- Child windows are added and removed dynamically from the window hierarchy when they're shown/hidden. Adding a hidden child window to a visible
  parent is fine, but adding a hidden child window to a hidden parent will cause the child to show when the parent window is shown as it's still a part of
  the window hierarchy.

- For some reason, not adding the child window to the parent entirely causes the child to not focus correctly the first time it's shown. Adding then immediately
  calling orderOut to remove the child window from the hierarchy does work correctly so we do this to work around the weird issue.
2024-01-04 12:44:57 -08:00
Sam Lantinga
d6b1fc9576 Add SDL_MAC_REGISTER_ACTIVATION_HANDLERS hint to allow disabling the normal application startup/activation/deactivation handlers 2024-01-04 12:44:54 -08:00
Sam Lantinga
7c5e694022 Ignore a new warning in Visual Studio 2022 2024-01-04 12:44:48 -08:00
Frank Praznik
73d02184d7 docs: Add Wayland to the SysWM migration example
Wayland will be increasingly encountered going forward and needs to be handled by applications requesting window handles to initialize the Vulkan WSI and such, so include it in the migration example to reflect current best practices.
2024-01-04 14:59:14 -05:00
Sam Lantinga
c03c01e9b2 Make sure we get mouse events as soon as possible 2024-01-04 09:12:55 -08:00
Anonymous Maarten
5cbdeab799 Rename SDL_mslibc_x64.asm -> SDL_mslibc_x64.masm
The .masm suffix should give meson sufficient info about the file
being MASM instead of NASM/YASM.
2024-01-04 17:46:07 +01:00
Frank Praznik
ed62d6e7de cocoa: Set the titled flag on fullscreen space windows
For some reason, fullscreen space windows won't get any mouse button events unless the NSWindowStyleMaskTitled flag is set when entering fullscreen, even though they successfully become key and receive mouse motion events. Make sure the flag is always set when entering fullscreen space state.
2024-01-03 21:12:34 -05:00
Ozkan Sezer
b4b5dbd92f testcontroller.c: fixed warnings. 2024-01-03 14:40:20 +03:00
Sam Lantinga
31851a50d2 Fixed dropping raw input because of mixing GetRawInputBuffer() and WM_INPUT handling
It turns out that when you enable raw input and then process Windows messages, you'll get the currently pending input in GetRawInputBuffer(), and you'll get any new input that occurs while processing messages as WM_INPUT.

The fix for this is to create a dedicated thread to handle raw input and only use GetRawInputBuffer() in that thread. A nice side effect of this is that we'll get mouse input at the lowest latency possible, but raw mouse events will now occur on a separate thread, outside of the normal event loop processing.

Improved fix for https://github.com/libsdl-org/SDL/issues/8756
2024-01-03 02:20:23 -08:00
Nour Fouad
987744aae8 Fix Duplicated includes 2024-01-02 16:34:11 -08:00
Sam Lantinga
2b369a14ab Fixed allocation and alignment of raw input buffers 2024-01-02 09:25:28 -08:00
Vicki Pfau
bec1b8f849 Add basic rumble support to Steam Deck 2024-01-01 21:46:38 -08:00
Sam Lantinga
8fe4a45edf Use GetRawInputBuffer() instead processing raw input one at a time
This is a huge performance improvement for high polling rate mice, like the Razer Viper 8K mouse.

Fixes https://github.com/libsdl-org/SDL/issues/8756
2024-01-01 20:41:15 -08:00
Sam Lantinga
87b8f09657 Fixed warning: no previous prototype for function 'SDL_PrivateGetGamepadButtonFromString' [-Wmissing-prototypes] 2024-01-01 14:56:55 -08:00
Sam Lantinga
c2951655ff Fixed warning: missing field 'window' initializer [-Wmissing-field-initializers] 2024-01-01 14:55:42 -08:00
Sam Lantinga
5b3ee51c6c Updated copyright for 2024 2024-01-01 13:15:26 -08:00
Sam Lantinga
a7b79c483c Remove unused 'window' variable from -[Cocoa_WindowListener windowWillExitFullScreen] 2024-01-01 13:15:39 -08:00
Amir Kadyrov
dd2d809407 AndroidShowToast: make OneShotTask members private final 2024-01-01 08:31:34 -08:00
Sam Lantinga
44c2f344d6 Fixed build 2023-12-30 11:47:56 -08:00
Sam Lantinga
2faae8457d The C standard defines a boolean expression as a signed integer value.
Microsoft came to the same conclusion:
https://devblogs.microsoft.com/oldnewthing/20110328-00/?p=11113

Fixes https://github.com/libsdl-org/SDL/issues/8761
2023-12-30 11:44:40 -08:00
Sam Lantinga
e3d50619f8 Fixed fatal error: SDL_pen.h: No such file or directory 2023-12-29 20:04:40 -08:00
Sam Lantinga
dfe1a37bab Fixed error: 'static' is not at beginning of declaration [-Werror=old-style-declaration] 2023-12-29 19:40:45 -08:00
Sam Lantinga
423b1fafcd Fixed warning C4047: 'function': '__x_ABI_CWindows_CGaming_CInput_CIRawGameController **' differs in levels of indirection from '__x_ABI_CWindows_CGaming_CInput_CIRawGameController *'
This warning happens with old and buggy versions of the Windows SDK
2023-12-29 18:07:30 -08:00
Sam Lantinga
7681695875 Revert "Fixed signed/unsigned warnings with Visual Studio when comparing SDL_bool with boolean expressions"
This reverts commit 61db102da9.

This causes the build to fail:
SDL_waylandwindow.c:1876:45: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
            wind->fullscreen_was_positioned = SDL_TRUE;
2023-12-29 17:14:05 -08:00
Frank Praznik
8f94102b04 tests: Use unsigned format specifiers for printing flags 2023-12-29 14:41:38 -05:00
Frank Praznik
5d0c893723 wayland: Remove bitfield specifiers from boolean values
If SDL_bool is no longer unsigned, this won't work as the valid values are only 1 and -1.
2023-12-29 14:18:55 -05:00
Sam Lantinga
530b41d531 Fixed warnings in SDL_pen.c 2023-12-29 10:37:28 -08:00
Sam Lantinga
9906d6d3bc Fixed warning C4244: '=': conversion from 'SDL_bool' to 'Uint8', possible loss of data 2023-12-29 10:37:28 -08:00
Sam Lantinga
ebd7f9adbd Fixed warning C4245: 'initializing': conversion from 'int' to 'Uint32', signed/unsigned mismatch in SDL_video.c 2023-12-29 10:37:28 -08:00
Sam Lantinga
dc1c27885e Fixed warning C4389: '!=': signed/unsigned mismatch in SDL_blit.c 2023-12-29 09:26:36 -08:00
Sam Lantinga
e813c72b3c Fixed warning C4245: 'return': conversion from 'int' to 'SDL_JoystickID', signed/unsigned mismatch 2023-12-29 09:25:57 -08:00
Sam Lantinga
dce626f469 Fixed warning C4244: 'function': conversion from 'int' to 'Uint16', possible loss of data 2023-12-29 09:24:52 -08:00
Sam Lantinga
7f376277e5 Fixed warning C4244: 'initializing': conversion from 'SDL_bool' to 'Uint8', possible loss of data 2023-12-29 09:24:22 -08:00
Sam Lantinga
61db102da9 Fixed signed/unsigned warnings with Visual Studio when comparing SDL_bool with boolean expressions 2023-12-29 09:23:47 -08:00
Sam Lantinga
d71454da17 Store the surface properties in the reserved pointer of a surface
This prevents us from exposing the properties publicly and allows us to repurpose the pointer later if necessary.

Fixes https://github.com/libsdl-org/SDL/issues/8758
2023-12-29 08:17:06 -08:00
Frank Praznik
b6a92c113f wayland: Don't apply old libdecor window dimensions
Don't overwrite the current dimensions unless they've actually changed, or programmatically set dimensions can be overwritten.
2023-12-29 08:59:45 -05:00
Sam Lantinga
39e24e52c8 Fixed example of creating a window with properties 2023-12-28 16:35:31 -08:00
Sam Lantinga
dc450ba908 Added an example of creating a window with position 2023-12-28 16:34:13 -08:00
Sam Lantinga
ce4fe32ce3 Added documentation for getting the X11 display from an SDL window 2023-12-28 16:26:55 -08:00
Sam Lantinga
327d31a5d9 Added documentation for getting the NSWindow from an SDL window 2023-12-28 16:09:59 -08:00
Sam Lantinga
3976bbef2a Added documentation for getting the X11 window from an SDL window 2023-12-28 15:56:37 -08:00
Sam Lantinga
ffb8515c21 Use the Valve code name for the Steam Deck controller 2023-12-28 15:41:02 -08:00
Sam Lantinga
43c40d30a2 Added comment for the BDA Pro Ex controller 2023-12-28 15:22:28 -08:00
Sam Lantinga
61704b5862 Removed an assertion it's possible to hit 2023-12-28 15:22:28 -08:00
Sam Lantinga
c24b33d8d9 Fixed building with older Windows SDK 2023-12-28 15:14:34 -08:00
Sam Lantinga
70ba3f2830 Report the D-Pad for HIDAPI gamepads as a hat
This makes it easier for games that don't use the gamepad API to handle D-Pad navigation, and is consistent with many other non-HIDAPI mappings.

Fixes https://github.com/libsdl-org/SDL/issues/8754
2023-12-28 14:14:51 -08:00
Sam Lantinga
ce329d60e4 Added support for alpha blending using palette alpha
Fixes https://github.com/libsdl-org/SDL_image/issues/409
2023-12-28 09:33:02 -08:00
Frank Praznik
9c3e831e33 uikit: Send fullscreen enter/leave events
Send fullscreen enter/leave events, which will implicitly update the fullscreen flag. Manually setting the flag will suppress attempts to send the events later, as the flag is used for deduplication purposes in the event code.
2023-12-27 17:23:49 -05:00
SDL Wiki Bot
5df3eac925 Sync SDL3 wiki -> header 2023-12-27 20:21:11 +00:00
Sam Lantinga
0dfdf1f3f2 Fixed crash if joystick functions are passed a NULL joystick 2023-12-27 11:25:54 -08:00
Reilly Brogan
4ce935b910 Fix static build with libdecor 0.2.0 2023-12-26 16:29:36 -08:00
Susko3
5d6d149862 Allow passing in extrainfo value to GetMouseMessageSource()
This saves a syscall in WM_INPUT handling
2023-12-26 13:42:19 -08:00
Susko3
e0df963ef0 Fix wrong bit count in comment
If we're counting bits from 0, then the MSB is bit 31!
2023-12-26 13:42:19 -08:00
Susko3
c2a55cd2c5 Add missing (void) in functions params 2023-12-26 13:42:19 -08:00
Susko3
a3c8f2f6cb Consolidate mouse-touch event checking logic
Saves one `GetMessageExtraInfo()` syscall when handling WM_INPUT events.

Will provide consistent results across various event types.
2023-12-26 13:42:19 -08:00
Susko3
d747daf03d Use correct touch check flag
Matches the one in `GetMouseMessageSource()`.
From my testing on Windows 11, the lower 8 bits in touch events cycle
trough the values 0x8c-0x95 in order.
2023-12-26 13:42:19 -08:00
Susko3
a961066d0b Add basic touch/finger support to testpen.c
Reuses the pen code as much as possible.

Seems like the right place, see
https://github.com/libsdl-org/SDL/pull/8749#issuecomment-1869671334.
2023-12-26 13:42:19 -08:00
Sam Lantinga
a3b5eb07b2 Removed extern "C" linkage from main() declaration
According to the C++ spec, main() should not have any linkage specifier:
https://en.cppreference.com/w/cpp/language/main_function

Fixes https://github.com/libsdl-org/SDL/issues/8738
2023-12-26 10:19:22 -08:00
Sam Lantinga
50e309bb17 Include SDL_events.h in SDL_main.h
Applications shouldn't need to include it separately if they want to process events using the main callbacks.

Fixes https://github.com/libsdl-org/SDL/issues/8746
2023-12-26 10:11:48 -08:00
Alynne
cae657140c Add Access Controller 2023-12-26 09:58:09 -08:00
Sam Lantinga
74418e1aa8 Made the cursor list check a compile time assert instead of a runtime one
This will catch this being out of date more quickly in the future
2023-12-26 09:57:11 -08:00
Sam Lantinga
d6fb0d91d8 Added testpen to the Visual Studio solution 2023-12-26 09:55:09 -08:00
Susko3
bbdd41f287 Fix windows touch using wrong axis for normalisation
Regressed with 9302d7732d
2023-12-26 09:12:17 -08:00
Susko3
a28ac29aa0 Add missing cursor types
The flowing assert would trip:
    SDL_assert(SDL_arraysize(cursorNames) == SDL_NUM_SYSTEM_CURSORS)
2023-12-26 09:12:17 -08:00
Tyson Whitehead
6daf2e943f Try SDL_UDEV_deviceclass to detect joysticks even if in a container
The udev container issue is mostly to do with device notifications
and netlink. The device classification stuff just pokes file in /sys
and /run/udev. Doesn't hurt to try it first for classifying joysticks
and then fall to the guess heuristics if it fails.
2023-12-24 22:39:16 -08:00
Sam Lantinga
1bf78ed544 We get a resize event when the view enters fullscreen mode on iOS
The call stack is:

We want to use this instead of the desktop mode because the view may be in a different orientation than the device orientation, which the desktop mode is based on.
2023-12-24 17:45:35 -08:00
Sam Lantinga
e3b5999bb4 Use the application requested size to determine automatic orientation on iOS
Fixes https://github.com/libsdl-org/SDL/issues/8201
2023-12-24 17:14:16 -08:00
Sam Lantinga
278e3f9184 Whoops, fixed setting fullscreen flag 2023-12-24 17:12:01 -08:00
Sam Lantinga
69e60e0f1b Fixed setting fullscreen mode on iOS
Needed to update the actual window flags based on the requested state (@Kontrabant)
2023-12-24 16:24:22 -08:00
Sam Lantinga
0e5ea3cc4b Fixed infinite recursion when adding an accelerometer as joystick on iOS
Fixes https://github.com/libsdl-org/SDL/issues/8716
2023-12-24 11:19:16 -08:00
Sam Lantinga
c3d84c3342 Record the initial input report mode and only restore simple mode if that's what we started with
Fixes https://github.com/libsdl-org/SDL/issues/8108
Closes https://github.com/libsdl-org/SDL/pull/8115
2023-12-24 08:12:14 -08:00
Julian Uy
10a8b750a0 Use common generic syscond for platforms with no cond implementation 2023-12-24 06:52:42 -08:00
Julian Uy
4914e5bb78 PS2 use WaitSemaEx for waiting for semaphore with timeout 2023-12-24 06:52:27 -08:00
Sam Lantinga
bb0e0ae080 Added a runtime check for BLUETOOTH_CONNECT in addition to BLUETOOTH (thanks @perepujal!)
Fixes https://github.com/libsdl-org/SDL/issues/8731
2023-12-24 06:50:42 -08:00
Sylvain
312f98c2a1 Make sure the string is terminated, fixed invalid read in SDL_PrivateParseGamepadConfigString() 2023-12-23 12:55:21 -08:00
Frank Praznik
199f7cc3b1 x11: Ignore border extents when the border hint is unset
Old extent events can arrive after the border hint has been unset. Ignore the reported values in this case to avoid reporting bogus border sizes.
2023-12-22 12:19:28 -05:00
SDL Wiki Bot
07e9603398 Sync SDL3 wiki -> header 2023-12-22 17:14:22 +00:00
Sylvain
ffd82fb7c4 Add scaleMode to SDL_SoftStretch(), remove SDL_SoftStretchLinear(). 2023-12-22 09:13:21 -08:00
Sylvain
5dba04b29b Remove SDL_{Set,Get}SurfaceScale().
Add Scale parameter to SDL_BlitSurfaceScaled() and SDL_BlitSurfaceScaledUnchecked()
(see #8732)
2023-12-22 02:08:49 -08:00
Frank Praznik
e66896406d cocoa: Set appropriate flags on fullscreen spaces windows
Don't mark fullscreen windows as having a title bar if the window is borderless, or it can end up in a weird, pseudo-decorated state when leaving fullscreen if the borders were toggled back on while the window was fullscreen.

Setting the window styling when about to leave fullscreen caused issues with this as well and is no longer needed, as it is ensured that the window's resizable state won't change while in a fullscreen space, or in a transition period.
2023-12-21 17:44:23 -05:00
Frank Praznik
57fcb9044c video: Remove more assumptions about window state in the video layer
Don't check the fullscreen flag when toggling resizable, bordered, always on top, minimum size and maximum size, as the flag doesn't reflect pending async changes that may be in progress.

These properties can be made to be safely toggled while the window is in fullscreen mode and applied when returning to windowed mode, which ensures that requested window settings aren't lost if calling these functions while async fullscreen changes are in flight.
2023-12-21 17:44:23 -05:00
Dimitriy Ryazantcev
cb90653695 win32: use USER_DEFAULT_SCREEN_DPI instead of explicit 96 value 2023-12-21 08:32:10 -08:00
Lukas Senionis
a2e05480d6 Use crc16 return value when calculating GUID
Fixes the regression introduced by 919cd56b20
2023-12-21 07:00:13 -08:00
Sam Lantinga
2ad50e9675 Make the SDL3 surface ABI compatible with SDL2
We'll use properties for new data associated with a surface, which lets us preserve ABI compatibility with SDL2 and any surfaces created by applications and passed in to SDL functions.
2023-12-21 06:58:22 -08:00
Sam Lantinga
f72d6a7fd9 Use more verbose names for properties, to match upcoming public property names 2023-12-21 06:58:22 -08:00
Sam Lantinga
1f1ee6f77c Use the original manufacturer and product strings for the joystick CRC
This allows the most information possible for the CRC string, which is used to differentiate controllers with the same VID/PID.

Fixes https://github.com/libsdl-org/SDL/issues/8724
2023-12-20 19:22:37 -08:00
Sam Lantinga
4bb5e1f0f9 Added migration notes for migrating Steam Input support from SDL2 to SDL3 2023-12-20 14:15:09 -08:00
Sylvain
56f111dffc Fix compilation / same as sdl2-compat
testautomation_platform.c:351:28: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  351 |     result = SDL_SetError("%s", testError);
      |                            ^~
/home/slvn/release/Release_SDL/sdl2-compat/test/testautomation_platform.c:364:64: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  364 |                             "SDL_GetError(): expected message '%s', was message: '%s'",
2023-12-20 22:28:50 +03:00
Sam Lantinga
72c366bf3d Fixed whitespace 2023-12-20 11:06:34 -08:00
Dimitriy Ryazantcev
3152b98e87 win32: minor fixup in WIN_UpdateKeymap()
Remove unused defines in SDL_windowsevents.c
2023-12-20 11:01:45 -08:00
SDL Wiki Bot
2c4360ce8f Sync SDL3 wiki -> header 2023-12-20 18:41:23 +00:00
Sam Lantinga
c981a597dc Added Steam Input API support for game controllers
Added support for getting the real controller info, as well as the function SDL_GetGamepadSteamHandle() to get the Steam Input API handle, from the virtual gamepads provided by Steam.

Also added an event SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED which is triggered when a controller's API handle changes, e.g. the controllers were reassigned slots in the Steam UI.
2023-12-20 10:40:28 -08:00
Vicki Pfau
a8f4f40d08 Sync more Steam Controller header definitions for the Steam Deck 2023-12-19 20:18:37 -08:00
Sam Lantinga
e6e54b22c8 Ignore all surface comparison output files in the testautomation directory 2023-12-19 08:48:44 -08:00
Sam Lantinga
9d13be743b Make sure we're rendering whenever the activity might be visible, even if we don't have focus.
This fixes rendering when a system dialog is over the application
2023-12-18 19:21:00 -08:00
Frank Praznik
69ec0322d3 win32: Make leaving fullscreen when the window already isn't fullscreen a no-op
Otherwise, the styling on external windows may end up being overridden.
2023-12-18 11:47:59 -05:00
Frank Praznik
8f79e0b7f8 win32: Fix high-DPI debug logging 2023-12-18 11:31:37 -05:00
Sylvain
a4496f7dcf Update doc: SDL_SoftStretch() and SDL_SoftStretchLinear() #8667 2023-12-18 06:35:52 -08:00
Dimitriy Ryazantcev
43309d38ed joystick: Extract 0x02a9 and 0x0291 PIDs into separate defines.
Cleanup controller list comments block.
2023-12-18 05:43:38 -08:00
Sylvain
84a0d5f623 Added SDL_SetSurfaceScaleMode() and SDL_GetSurfaceScaleMode() to control scale mode using SDL_BlitSurfaceScaled() 2023-12-17 15:39:53 -08:00
Sam Lantinga
4d5949dcf6 Added a controller name for the Steam virtual gamepad 2023-12-17 10:07:46 -08:00
Sam Lantinga
695846f2ed Pass through the name of the controller for the XInput mapping 2023-12-17 09:33:53 -08:00
Frank Praznik
1745289b1b x11: Don't move the window when restoring and ensure that resize and position events are sent when entering or leaving fullscreen
Account for the border sizes when restoring the window and only turn off resize events when entering or leaving fullscreen until the frame extents are changed, and only if they are, or previously were, non-zero.

This necessitated further refinement to the sync algorithm as well, but as a result, the sync function no longer occasionally times out if creating a window and immediately recreating it when initializing a renderer, and some rare, spurious size and position failures in the centered window and state automated tests seem to be fixed.
2023-12-17 11:39:49 -05:00
Dimitriy Ryazantcev
08a7ca4d53 XInput: Use XInputGetCapabilitiesEx instead of fragile GuessXInputDevice
XInputGetCapabilitiesEx (ordinal 108) is available in XInput 1.4 that is shipped with Windows 8 and newer.
2023-12-17 08:32:10 -08:00
Sam Lantinga
7f75178908 Verify that the %p format specifier works for 64-bit pointers 2023-12-17 08:14:20 -08:00
Sam Lantinga
72b7acfe8a Don't create a TLS error buffer if we're just clearing the error
Fixes https://github.com/libsdl-org/SDL/issues/7600
2023-12-16 21:28:43 -08:00
Matt Guerrette
240e7747c8 Fix #8702: Add SDL_hidapi_steamdeck.c to Xcode target
This commit fixes a linker issue when building SDL 3.0 using Xcode
2023-12-16 20:25:33 -08:00
Frank Praznik
b937c54b66 win32: Set all size and position variables for external windows 2023-12-15 16:41:20 -05:00
Sam Lantinga
8c285828e5 Fixed return value for SDL_UDEV_AddCallback()
Fixes https://github.com/libsdl-org/SDL/issues/8694
2023-12-15 10:06:01 -08:00
Sam Lantinga
cbf9012c74 Fixed build 2023-12-15 10:03:11 -08:00
Sam Lantinga
5547007915 Added test for inverted cursor 2023-12-15 09:59:50 -08:00
Dimitriy Ryazantcev
0ab13f2498 joystick: fixup for Wireless Xbox 360 Controller VID/PID detection in WGI backend.
It turns out that returned PID is zero in this case and it breaks SDL_IsXInputDevice/HIDAPI_IsDevicePresent checks
2023-12-15 08:57:09 -08:00
Dimitriy Ryazantcev
627d134b9e Add support for monochrome cursors with inverted pixels under Windows.
Fixes #8157
2023-12-15 08:56:17 -08:00
Frank Praznik
21879faf48 wayland: Handle mouse focus when receiving touch events
Compositors may switch from mouse to touch mode when a touch event is received, causing a pointer leave event and subsequent loss of mouse focus.

Don't relinquish mouse focus on surfaces with active touch events. If there are active touch events when pointer focus is lost, the keyboard focus is used as a fallback for relinquishing mouse focus: if, in this case, the keyboard focus is then lost and there are no active touches, mouse focus is lost, and if all touches are raised and there is no keyboard or pointer focus, then the window loses mouse focus.
2023-12-14 14:17:33 -05:00
Sam Lantinga
58a5f5cbe8 Allow sendCommand() to be overridden by derived classes
In this case it's used to prevent switching to windowed mode when destroying and recreating the main window
2023-12-13 10:13:17 -08:00
Sam Lantinga
e6d8ef1a5b Revert "Back out Steam virtual gamepad changes"
This reverts commit 34eb24ebc4.
2023-12-13 09:45:39 -08:00
Sam Lantinga
b0e7b7db6f Don't unload graphics libraries until after the window has been destroyed.
This fixes creating a window after the first window has been destroyed on Android. The graphics library had been unloaded, so eglDestroySurface() wasn't called, leaving a surface attached to the window, which would prevent attaching new EGL surfaces to the window (eglCreateWindowSurface() would fail with BAD_ALLOC)
2023-12-12 23:17:41 -08:00
Max Maisel
69288038ed Refactor away some additional integer types. 2023-12-12 12:51:37 -08:00
Max Maisel
f3048e3cd2 Add new file to vcxproj files. 2023-12-12 12:51:37 -08:00
Max Maisel
5a21febecb Add new steam deck HIDAPI controller to controller database. 2023-12-12 12:51:37 -08:00
Max Maisel
67d44c1017 Disable lizard mode while steam deck HID device is opened. 2023-12-12 12:51:37 -08:00
Max Maisel
6dd6827343 Translate steam deck HID reports to SDL events. 2023-12-12 12:51:37 -08:00
Max Maisel
94f621e030 Implement steam deck HIDAPI initialization. 2023-12-12 12:51:37 -08:00
Max Maisel
c1a7d0f96e Add steam deck detection and HIDAPI driver scaffold. 2023-12-12 12:51:37 -08:00
Sam Lantinga
0baee3e676 Reversed test to be easier to read, more efficient, and match other code 2023-12-12 12:25:51 -08:00
Frank Praznik
bddbd1e317 cocoa: Check the resizable flag along with zoomed status when resizing
isZoomed always returns true if the window is not resizable, so the resizable flag needs to be checked as well.
2023-12-12 14:35:49 -05:00
Frank Praznik
835c733f4d video: Only sync when programmatically entering/exiting fullscreen
Otherwise, the sync function can be recursively entered when the fullscreen state is updated by a window manager event.
2023-12-12 12:58:05 -05:00
Dimitriy Ryazantcev
c790572674 Use existing XUSB driver software PID 0x02a1 instead of PID 0x02fe
0x02fe is actually PID of Xbox Wireless Adapter for Windows 10 (Model 1790) and creates confusion.

Here is USB descriptor dump: https://github.com/DJm00n/ControllersInfo/blob/master/xboxone/DescriptorDump_Adapter%20(Xbox%20Wireless%20Adapter%20for%20Windows).txt
2023-12-11 11:45:05 -08:00
Sam Lantinga
581d1cab25 You should call present when using a software renderer as well.
Fixes https://github.com/libsdl-org/SDL/issues/8676
2023-12-11 08:43:31 -08:00
Sam Lantinga
5173b0c2cc Make built-in joystick device lists extendable by using hints
Fixes https://github.com/libsdl-org/SDL/issues/8595
2023-12-10 12:53:03 -08:00
Sam Lantinga
34eb24ebc4 Back out Steam virtual gamepad changes
We are planning a different approach to handle these
2023-12-10 08:35:35 -08:00
Sam Lantinga
7529d25b2b Use the Steam virtual gamepad slot as the gamepad player index 2023-12-09 21:00:32 -08:00
Sam Lantinga
445f08a0fb Print the gamepad player index when opening a gamepad 2023-12-09 21:00:11 -08:00
Sam Lantinga
17723381da Sort Steam virtual gamepads by Steam controller slot
This makes sure that games launched by Steam see the first controller first, and the controllers in the game match up with the controllers in the Steam UI.

Fixes https://github.com/libsdl-org/SDL/issues/8672
2023-12-09 20:33:05 -08:00
Ryan C. Gordon
f3d8a2def5 audio: Fixed resource leak in unlikely failure case during device add. 2023-12-09 15:41:45 -05:00
Frank Praznik
63ae84e140 x11: Improve sync algorithm
Track and check move and resize requests separately, and consider them done if either the window is already at the expected location, or at least one configure event which moved or resized the window was processed. The avoids a timeout condition if resizing the window caused it to be implicitly moved in order to keep it within desktop bounds.

The automated positioning test now runs on GNOME/X11 without any sync requests timing out.
2023-12-08 13:14:55 -05:00
Frank Praznik
7e5511d3cd x11: Move unrelated variables out of XFixes #ifdef 2023-12-08 05:16:49 -05:00
Sam Lantinga
3c5e9e6112 We can wait up to 500ms in onNativeSurfaceDestroyed(), so wait at least that long in onDestroy() 2023-12-07 14:30:44 -08:00
Sam Lantinga
53cda988f4 Clear any errors from a previous run
The error is thread-local, and the java thread may run onCreate initialization multiple times depending on the Android life cycle
2023-12-07 14:30:40 -08:00
Anonymous Maarten
a197efe3a7 pen: fix leak caused by pen subsystem 2023-12-07 20:38:00 +01:00
Anonymous Maarten
fbb0914b78 wayland+x11: free system cursors when quiting video 2023-12-07 20:38:00 +01:00
Anonymous Maarten
7484d02a2e testshape: use SDL_test to create multiple windows 2023-12-07 20:38:00 +01:00
SDL Wiki Bot
20250aecc5 Sync SDL3 wiki -> header 2023-12-07 18:27:25 +00:00
Frank Praznik
4fd778119b video: Implement asynchronous windowing
SDL window size, state, and position functions have been considered immediate, with their effects assuming to have taken effect upon successful return of the function. However, several windowing systems handle these requests asynchronously, resulting in the functions blocking until the changes have taken effect, potentially for long periods of time. Additionally, some windowing systems treat these as requests, and can potentially deny or fulfill the request in a manner differently than the application expects, such as not allowing a window to be positioned or sized beyond desktop borders, prohibiting fullscreen, and so on.

With these changes, applications can make requests of the window manager that do not block, with the understanding that an associated event will be sent if the request is fulfilled. Currently, size, position, maximize, minimize, and fullscreen calls are handled as asynchronous requests, with events being returned if the request is honored. If the application requires that the change take effect immediately, it can call the new SDL_SyncWindow function, which will attempt to block until the request is fulfilled, or some arbitrary timeout period elapses, the duration of which depends not only on the windowing system, but on the operation requested as well (e.g. a 100ms timeout is fine for most X11 events, but maximizing a window can take considerably longer for some reason). There is also a new hint 'SDL_VIDEO_SYNC_ALL_WINDOW_OPS' that will mimic the old behavior by synchronizing after every window operation with, again, the understanding that using this may result in the associated calls blocking for a relatively long period.

The deferred model also results in the window size and position getters not reporting false coordinates anymore, as they only forward what the window manager reports vs allowing applications to set arbitrary values, and fullscreen enter/leave events that were initiated via the window manager update the window state appropriately, where they didn't before.

Care was taken to ensure that order of operations is maintained, and that requests are not ignored or dropped. This does require some implicit internal synchronization in the various backends if many requests are made in a short period, as some state and behavior depends on other bits of state that need to be known at that particular point in time, but this isn't something that typical applications will hit, unless they are sending a lot of window state in a short time as the tests do.

The automated tests developed to test the previous behavior also resulted in previously undefined behavior being defined and normalized across platforms, particularly when it comes to the sizing and positioning of windows when they are in a fixed-size state, such as maximized or fullscreen. Size and position requests made when the window is not in a movable or resizable state will be deferred until it can be applied, so no requests are lost. These changes fix another long-standing issue with renderers recreating maximized windows, where the original non-maximized size was lost, resulting in the window being restored to the wrong size. All automated video tests pass across all platforms.

Overall, the "make a request/get an event" model better reflects how most windowing systems work, and some backends avoid spending significant time blocking while waiting for operations to complete.
2023-12-07 10:26:19 -08:00
Sam Lantinga
ace385a134 Revert "Fixed warning C33010: Unchecked lower bound for enum scancode used as index."
This reverts commit c484140f56.

Fixes clang warning: comparison of unsigned enum expression < 0 is always false [-Wtautological-compare]
2023-12-06 09:17:47 -08:00
Ozkan Sezer
e482f00a17 SDL_string.c (SDL_vsscanf): fix gcc build 2023-12-06 01:32:00 +03:00
Sam Lantinga
f00ecf5f19 Fixed building with older Windows SDK 2023-12-05 11:00:18 -08:00
Sam Lantinga
7ca43995a1 Fixed warning C4028: formal parameter 1 different from declaration 2023-12-05 10:55:29 -08:00
Sam Lantinga
aab7432f5f Fixed analyze warnings for SDL_dynapi_procs.h 2023-12-05 09:31:13 -08:00
Sam Lantinga
c484140f56 Fixed warning C33010: Unchecked lower bound for enum scancode used as index. 2023-12-05 09:31:13 -08:00
Sam Lantinga
02a116217d Fixed Arithmetic overflow: Using operator '-' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '-' to avoid overflow (io.2). 2023-12-05 09:31:13 -08:00
Sam Lantinga
91da942b33 Fixed warning C28251: Inconsistent annotation for 'SDL_RWvprintf_REAL': this instance has no annotations. 2023-12-05 09:31:13 -08:00
Sam Lantinga
b8840801cc Fixed analyze warnings in SDL_xinputhaptic.c
warning C6340: Mismatch on sign: 'int' passed as _Param_(4) when some unsigned type is required in call to 'SDL_snprintf_REAL'.
warning C6340: Mismatch on sign: 'const unsigned char' passed as _Param_(4) when some signed type is required in call to 'SDL_snprintf_REAL'.
warning C26451: Arithmetic overflow: Using operator '*' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow (io.2).
2023-12-05 09:31:13 -08:00
Sam Lantinga
8e0d728c67 Fixed warning C26451: Arithmetic overflow: Using operator '-' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '-' to avoid overflow (io.2). 2023-12-05 09:31:13 -08:00
Sam Lantinga
6a736d7766 Fixed warning C6340: Mismatch on sign: 'unsigned char' passed as _Param_(2) when some signed type is required in call to 'SDL_SetError_REAL'. 2023-12-05 09:31:13 -08:00
Sam Lantinga
1fcc75ba81 Fixed warning C6340: Mismatch on sign: 'unsigned char' passed as _Param_(4) when some signed type is required in call to 'SDL_snprintf_REAL'. 2023-12-05 09:31:13 -08:00
Sam Lantinga
7f2e16db8b Fixed warning C6340: Mismatch on sign: 'const unsigned short' passed as _Param_(2) when some signed type is required in call to 'SDL_SetError_REAL'. 2023-12-05 09:31:13 -08:00
Sam Lantinga
163de8e697 Fixed warning C6001: Using uninitialized memory 'rdi'. 2023-12-05 09:31:13 -08:00
Sam Lantinga
e29393e407 Fixed warning C6001: Using uninitialized memory 'devName'. 2023-12-05 09:31:13 -08:00
Sam Lantinga
0f34ca2e71 Fixed analyze warnings in SDL_xinputjoystick.c
warning C6340: Mismatch on sign: 'int' passed as _Param_(4) when some unsigned type is required in call to 'SDL_snprintf_REAL'.
warning C6001: Using uninitialized memory 'devName'.
warning C6340: Mismatch on sign: 'unsigned char' passed as _Param_(4) when some signed type is required in call to 'SDL_snprintf_REAL'.
warning C6221: Implicit cast between semantically different integer types:  comparing HRESULT to an integer.  Consider using SUCCEEDED or FAILED macros instead.
2023-12-05 09:31:13 -08:00
Sam Lantinga
2b5c7db645 Fixed analyze warnings in SDL_render_d3d12.c
warning C6011: Dereferencing NULL pointer 'data->swapChain'.
warning C6011: Dereferencing NULL pointer 'data->debugInterface'.
2023-12-05 09:31:13 -08:00
Sam Lantinga
a28769759b Fixed warning C26052: Potentially unconstrained access using expression '(signed char *)info' 2023-12-05 09:31:13 -08:00
Sam Lantinga
6ee34380f4 Fixed warning C6011: Dereferencing NULL pointer 'viewport'. 2023-12-05 09:31:13 -08:00
Sam Lantinga
230581f4a8 Fixed warning C26451: Arithmetic overflow: Using operator '+' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '+' to avoid overflow (io.2). 2023-12-05 09:31:13 -08:00
Sam Lantinga
3775d9be4b Fixed warning C28251: Inconsistent annotation for 'SDL_LogMessageV_REAL': this instance has no annotations. 2023-12-05 09:31:13 -08:00
Sam Lantinga
b512182222 Fixed warning C6340: Mismatch on sign: 'unsigned int' passed as _Param_(2) when some signed type is required in call to 'SDL_SetError_REAL'. 2023-12-05 09:31:13 -08:00
Sam Lantinga
8a82f7e837 Fixed warning C33005: VARIANT '&valueX' was provided as an _In_ or _InOut_ parameter but was not initialized 2023-12-05 09:31:13 -08:00
Sam Lantinga
fda039e6f8 Fixed analyzer warnings for SDL_string.c
warning C28251: Inconsistent annotation for 'SDL_vsscanf_REAL': this instance has no annotations. See c:\projects\sdl-experimental\include\sdl3\sdl_stdinc.h(597).
warning C28252: Inconsistent annotation for 'SDL_vsnprintf_REAL': _Param_(3) has 'SAL_IsFormatString("printf")' on the prior instance. See c:\projects\sdl-experimental\include\sdl3\sdl_stdinc.h(600).
warning C28253: Inconsistent annotation for 'SDL_vswprintf_REAL': _Param_(3) has 'SAL_IsFormatString("printf")' on this instance. See c:\projects\sdl-experimental\include\sdl3\sdl_stdinc.h(601).
warning C28251: Inconsistent annotation for 'SDL_vasprintf_REAL': this instance has no annotations. See c:\projects\sdl-experimental\include\sdl3\sdl_stdinc.h(603).
2023-12-05 09:31:13 -08:00
Sam Lantinga
22f44aefe7 Fixed warning C6340: Mismatch on sign: 'int' passed as _Param_(3) when some unsigned type is required in call to 'SDL_sscanf_REAL'. 2023-12-05 09:31:13 -08:00
Sam Lantinga
eab2d97d07 Fixed warning C26451: Arithmetic overflow: Using operator '*' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow (io.2). 2023-12-05 09:31:13 -08:00
Sam Lantinga
41bfcad5d7 Fixed warning C6340: Mismatch on sign: 'unsigned short' passed as _Param_(2) when some signed type is required in call to 'SDL_SetError_REAL'. 2023-12-05 09:31:13 -08:00
Sam Lantinga
54dc73aa88 Fixed warning C6386: Buffer overrun while writing to 'palette_saved_alpha': the writable size is 'sizeof(Uint8)*((palette_saved_alpha_ncolors))' bytes, but '2' bytes might be written. 2023-12-05 09:31:13 -08:00
Sam Lantinga
0dad56354c Fixed warning C6326: Potential comparison of a constant with another constant. 2023-12-05 09:31:13 -08:00
Sam Lantinga
c9b243fb56 Fixed warning C6263: Using _alloca in a loop: this can quickly overflow stack. 2023-12-05 09:31:13 -08:00
Sam Lantinga
4ccc53edfe Fixed warning C6011: Dereferencing NULL pointer 'display'. 2023-12-05 09:31:13 -08:00
Sam Lantinga
3db4695ac7 warning C6340: Mismatch on sign: 'unsigned int' passed as _Param_(3) when some signed type is required in call to 'SDL_LogDebug_REAL'. 2023-12-05 09:31:13 -08:00
Sam Lantinga
c7d81d936a Fixed warning C6031: Return value ignored: 'GetKeyboardState'. 2023-12-05 09:31:13 -08:00
Sam Lantinga
69b9d44bdc Fixed warning C26451: Arithmetic overflow: Using operator '-' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '-' to avoid overflow (io.2). 2023-12-05 09:31:13 -08:00
Sam Lantinga
a9b87ee201 Fixed warning C28159: Consider using 'GetTickCount64' instead of 'GetTickCount'. Reason: GetTickCount overflows roughly every 49 days. Code that does not take that into account can loop indefinitely. GetTickCount64 operates on 64 bit values and does not have that problem 2023-12-05 09:31:13 -08:00
Sam Lantinga
21f273ecc7 Fixed warning C6255: _alloca indicates failure by raising a stack overflow exception. Consider using _malloca instead. 2023-12-05 09:31:13 -08:00
Sam Lantinga
0c4cb3d153 Fixed warning C26451: Arithmetic overflow: Using operator '<<' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '<<' to avoid overflow (io.2). 2023-12-05 09:31:13 -08:00
Sam Lantinga
06f8f9a891 Fixed warning C6326: Potential comparison of a constant with another constant.
Also fixed warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>.  Did you intend to use the bitwise-and operator?
2023-12-05 09:31:13 -08:00
Sam Lantinga
3e54061fa8 Fixed warning C6011: Dereferencing NULL pointer 'SDL_disabled_events[hi]'. 2023-12-05 09:31:13 -08:00
Sam Lantinga
226f8fde09 Fixed warning C28182: Dereferencing NULL pointer. 'streams[j]' contains the same NULL value as 'stream' did. 2023-12-05 09:31:13 -08:00
Sam Lantinga
fe6b3ab0b0 Fixed warning C6031: Return value ignored: 'CLSIDFromString'. 2023-12-05 09:31:13 -08:00
Sam Lantinga
f3b0149756 Fixed warning C26451: Arithmetic overflow: Using operator '*' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow (io.2). 2023-12-05 09:31:13 -08:00
Sam Lantinga
6cfce101fb Don't call the property cleanup function if setting the property fails
Fixes https://github.com/libsdl-org/SDL/issues/8659
2023-12-04 07:48:13 -08:00
Sam Lantinga
14380ec48a Fixed signed/unsigned comparison warning 2023-12-03 15:07:08 -08:00
Sam Lantinga
ac0751a652 Added SDL_strnstr() 2023-12-03 15:06:46 -08:00
Sylvain
7c71e72193 SDL_render: Call InvalidateCachedState to initialise some of driverdata values (eg '*_dirty' to 1).
At the earliest place, immediatly after driverdata is set.
(Doing it in SDL_render.c, after creation, would be too late, because there're renderers that already use/change those values in the CreateRender() function).
2023-12-02 21:42:17 +01:00
Sam Lantinga
058213366b Make sure we use alpha of 0 when clearing a transparent window with no content 2023-12-01 10:51:54 -08:00
Sam Lantinga
ecd56bb8f0 Removed SDL_GetErrorMsg(), trivially implemented in application code 2023-12-01 09:08:23 -08:00
Sam Lantinga
66e532fa61 Handle out of memory errors without any allocation 2023-12-01 09:05:04 -08:00
foobit
579681a372 fixed SDL_SCANCODE_LEFT array position in scancodes_windows.h 2023-12-01 08:24:13 -08:00
SDL Wiki Bot
675423f096 Sync SDL3 wiki -> header 2023-12-01 06:39:09 +00:00
Dimitriy Ryazantcev
744a29b88f WGI: Cleanup code a bit (#8647) 2023-11-30 11:53:00 -08:00
SDL Wiki Bot
e4582e6edc Sync SDL3 wiki -> header 2023-11-30 15:22:19 +00:00
Ryan C. Gordon
df0fd55891 wikiheaders.pl: README files are no longer in Windows endline format. 2023-11-30 10:10:04 -05:00
Ryan C. Gordon
1072b6e86e docs: fixed typo 2023-11-30 10:08:23 -05:00
Ryan C. Gordon
f184dea16c uikit: Patched to compile. 2023-11-30 00:27:17 -05:00
Ryan C. Gordon
447b508a77 error: SDL's allocators now call SDL_OutOfMemory on error.
This means the allocator's caller doesn't need to use SDL_OutOfMemory directly
if the allocation fails.

This applies to the usual allocators: SDL_malloc, SDL_calloc, SDL_realloc
(all of these regardless of if the app supplied a custom allocator or we're
using system malloc() or an internal copy of dlmalloc under the hood),
SDL_aligned_alloc, SDL_small_alloc, SDL_strdup, SDL_asprintf, SDL_wcsdup...
probably others. If it returns something you can pass to SDL_free, it should
work.

The caller might still need to use SDL_OutOfMemory if something that wasn't
SDL allocated the memory: operator new in C++ code, Objective-C's alloc
message, win32 GlobalAlloc, etc.

Fixes #8642.
2023-11-30 00:14:27 -05:00
Ryan C. Gordon
70b65d4170 cocoa: Resync modifier keypressed on NSEventTypeFlagsChanged event.
Fixes #7507.
2023-11-29 21:38:41 -05:00
Ryan C. Gordon
d1b831e232 include: Clarified documentation for two functions. 2023-11-29 20:50:44 -05:00
Ryan C. Gordon
daa38dc793 touch: Replace GetNumTouchDevices/GetTouchDevice with a single function.
Now it returns an array and optional count, to match other SDL3 APIs.

SDL_GetTouchName() was replaced with a function that takes an instance ID
instead of an index, too.
2023-11-29 20:50:44 -05:00
Ryan C. Gordon
dd47da8a5c gamepad: Replace GetNumMappings/GetMappingByIndex with a single function.
Now it returns an array and optional count, to match other SDL3 APIs.
2023-11-29 20:50:44 -05:00
Ryan C. Gordon
dfee3f9e92 render: Replaced SDL_RenderFlush with SDL_FlushRenderer.
This uses the same `SDL_VerbNoun` format as the rest of SDL3, and also
adds stronger effort to invalidate cached state in the backend, so cooperation
improves with apps that are using lowlevel rendering APIs directly.

Fixes #367.
2023-11-29 14:24:26 -05:00
Ryan C. Gordon
eef5c53668 docs: Moved CREDITS and INSTALL to markdown format. 2023-11-29 12:31:27 -05:00
Ryan C. Gordon
f32575dfab docs: Convert everything to Unix-style endlines.
Fixes #8640.
2023-11-29 11:29:57 -05:00
Ryan C. Gordon
c5daf8adb1 testcontroller: Don't query the mapping list until after they are available.
The included ones need to wait until SDL_Init has run, or you'll get an empty
list, and we might also be adding more from an external gamecontrollerdb.txt
file, too.
2023-11-29 10:33:31 -05:00
Cameron Cawley
df05d5eff4 Fix scroll wheel handling in testmouse 2023-11-28 14:41:16 -08:00
Ozkan Sezer
63d4bd4e57 SDL_SendKeyboardText: remove workaround from 1e12d7c, fix use of iscntrl 2023-11-29 00:39:24 +03:00
Anonymous Maarten
fea6e7afb1 cmake: copy sources to binary directory in separate target
Don't do it in POST_BUILD to avoid multiple parallel builds
stepping on each others toes.
Also don't use copy_if_different, but unconditionally copy it.
The build system should take care of dependencies.
2023-11-28 22:16:54 +01:00
Dimitriy Ryazantcev
9faa7977bd UWP: Add support for supplementary Unicode characters input
Characters outside Basic Multilingual Plane (BMP) are coded as so called "surrogate pair" in two separate UTF-16 character events.
2023-11-28 12:33:21 -08:00
Dimitriy Ryazantcev
7b628ea4d5 Win32: Simplify Unicode text input code 2023-11-28 12:33:21 -08:00
Sam Lantinga
411c70abb1 Fix the target membership of SDL_pen.h (thanks kanjitalk755!)
Closes https://github.com/libsdl-org/SDL/pull/8599
2023-11-28 12:20:43 -08:00
shenleban tongying
3e6513c773 document the purpose of SDL_SetTextInputRect 2023-11-28 12:06:16 -08:00
Sam Lantinga
1e12d7cfb6 Make sure we don't pass UTF-8 to SDL_iscntrl()
This function is only valid for values <= 127.

Closes https://github.com/libsdl-org/SDL/pull/8637
2023-11-28 11:39:35 -08:00
Dimitriy Ryazantcev
9a206adbee UWP: Use Windows.UI.Core.CoreDispatcher.AcceleratorKeyActivated event for keyboard
Only in this case we can see Left Alt and Right Alt keys.

Stole the idea from DirectXTK12 repo:
https://github.com/microsoft/DirectXTK12/blob/main/Src/Keyboard.cpp
2023-11-28 11:31:19 -08:00
Dimitriy Ryazantcev
309ea2d5f9 UWP: Simplify Win32 scan code to SDL scan code mapping 2023-11-28 11:31:19 -08:00
Dimitriy Ryazantcev
acc5bb89f8 [Win32] Better keyboard button mapping to SDL scan codes
Using official mappings from the Microsoft docs:
https://learn.microsoft.com/windows/win32/inputdev/about-keyboard-input#scan-codes
2023-11-28 11:31:19 -08:00
Dimitriy Ryazantcev
6b28065e9e Reformat Win32 scan code table 2023-11-28 11:31:19 -08:00
Dimitriy Ryazantcev
7e86b6aef2 Win32: Fix keymap for keyboard layouts that can print UTF-16 surrogates and ligatures
Old implementation with `MapVirtualKey(..., MAPVK_VK_TO_CHAR) & 0x7FFFF` simply returned `A`..`Z` for VK_A..VK_Z and
completely useless <U+0002 START OF TEXT> (`WCH_LGTR 0xF002` without high-order bit) in case of ligature.

See https://kbdlayout.info/features/ligatures for a list of affected keyboard layouts.
More info on `MAPVK_VK_TO_CHAR`: https://stackoverflow.com/a/72464584/1795050
2023-11-28 11:11:33 -08:00
Ryan C. Gordon
08c6ac1b16 test: SDLTest_PrintEvent now reports key event mod state.
(cherry picked from commit d42fa25a9e)
2023-11-28 13:11:57 -05:00
Sam Lantinga
571e9796b9 Fixed the GameCube HIDAPI controller mapping
Fixes https://github.com/libsdl-org/SDL/issues/8617
Closes https://github.com/libsdl-org/SDL/pull/8623
Closes https://github.com/libsdl-org/SDL/pull/7930
2023-11-28 10:07:06 -08:00
Sam Lantinga
dd984dcd9f Removed HIDAPI controller mappings
These are already provided internally by SDL
2023-11-28 09:54:35 -08:00
Ryan C. Gordon
3817f5126e cocoa: Use -[NSApplicationDelegate applicationSupportsSecureRestorableState].
This prevents warnings at startup on macOS Sonoma (14.0).

(cherry picked from commit 7d25a443c4)
2023-11-28 12:41:35 -05:00
Ryan C. Gordon
c5b0ff77d7 test: testwm2 now displays keyboard mod state.
(cherry picked from commit 258849c9bc)
2023-11-28 12:10:57 -05:00
Anonymous Maarten
5772e00c3f cmake: disable oss by default on OpenBSD, not FreeBSD
This fixes ed3fad1880
2023-11-28 16:45:33 +01:00
Jake S. Del Mastro
ceac93ade2 Set framebuffer_srgb_capable to the actual value obtained (#8634)
(cherry picked from commit 594a79c2f9)
2023-11-28 05:49:40 -08:00
Anonymous Maarten
ed3fad1880 cmake: disable oss by default on Linux, NetBSD and FreeBSD 2023-11-27 22:04:04 +01:00
Sylvain
6bb40f1d8d SDL_VideoCapture: allow add/remove device at runtime on linux 2023-11-27 16:01:10 -05:00
Sam Lantinga
f0e47f8ee0 Added support for the NACON Revolution 5 Pro controller 2023-11-27 12:10:00 -08:00
Ozkan Sezer
2f806c89b5 initial import of hidapi netbsd uhid native backend from mainstream
c19ae126d8
https://github.com/libusb/hidapi/pull/612
2023-11-26 20:20:28 +03:00
Christoph Reichenbach
1b284cd415 X11 pen detection: fix misclassification due to improper init
xinput2_device_is_pen() was testing against default-zero values
in the X11 Atom cache on at least the first round of
detections, leading to imprecise detection.

The patch fixes two aspects of initialisation:

1. Ensure that the selector cache is always initialised in
xinput2_device_is_pen().

2. Ensure that all X11 Atoms used in SDL_x11pen.c are instantiated if
missing. This ensures that they are never None and avoids potential
failures to detect hot-plugged tablet devices.

Acknowledgements: @tilman3 for narrowing down the issue and an
initial fix
2023-11-26 14:10:04 +03:00
Anonymous Maarten
c4ca64deaf ci: do 'brew update' & don't run dependent checks on installed things 2023-11-26 06:01:26 +01:00
Ozkan Sezer
d486de6349 cmake: fixed iconv detection test program
Fixes https://github.com/libsdl-org/SDL/issues/8614
2023-11-26 01:55:28 +03:00
Ryan C. Gordon
42a8139fd6 render: Clip bresenham lines against a real viewport thing.
You can't just use renderer->view->viewport, because it might be (0,0), -1x-1.

I _think_ this is more right?

Fixes #8609.
2023-11-25 01:51:35 -05:00
Ryan C. Gordon
4a40a272bd render: Patched to compile.
Bad cherry-pick on my part, sorry!

Fixes #8609.
2023-11-24 22:47:44 -05:00
Ryan C. Gordon
983f178b7d render: Clip lines before Bresenham algorithm generates points.
Otherwise, a massive line might generate gigabytes worth of points to render,
which the backend would simply throw away anyhow.

Fixes #8113.

(cherry picked from commit 4339647d90)
2023-11-24 19:34:47 -05:00
Ryan C. Gordon
db7f6425d0 rect: Avoid numeric overflow on massive lines in SDL_IntersectRectAndLine.
Reference Issue #8301.
Reference Issue #8113.

(cherry picked from commit a391dd5fef)
2023-11-24 19:34:20 -05:00
Anonymous Maarten
e548044a82 ci: add NetBSD to test matrix
Co-authored-by: Ozkan Sezer <sezeroz@gmail.com>
2023-11-24 21:34:56 +01:00
Anonymous Maarten
dd5b8db3a6 SDL_hidapi requires libusb >= 1.0.16
Co-authored-by: Ozkan Sezer <sezeroz@gmail.com>
2023-11-24 21:31:59 +01:00
Ryan C. Gordon
6ba90f7775 render: Batching is always enabled now!
Make sure your app uses SDL_RenderFlush() before it talks to D3D/OpenGL/etc!

Fixes #8584.
2023-11-23 20:37:52 -05:00
Ryan C. Gordon
b24d6bd59a opengl: Creating a texture trashes the cached texturing state, fix it.
Reference Issue #7194.

(cherry picked from commit e9b4869372)
2023-11-23 20:01:02 -05:00
Ryan C. Gordon
dcf04559db render: GL-based renderers should treat adaptive vsync as vsync being enabled.
Fixes #8004.
2023-11-23 18:28:43 -05:00
Ryan C. Gordon
74a2542564 x11: Deal with difference in GLX_EXT_swap_control_tear behavior.
Mesa and Nvidia handle it differently, and one or the other may fix their
implementation in the future, so test which way it works at runtime.

Reference Issue #8004.
2023-11-23 13:56:51 -05:00
Ozkan Sezer
08fac5b1b2 SDL_PenModifyForWacomID: return zero as axis_flags upon failure.
Fixes uninitialized warning in testautomation_pen.c:
testautomation_pen.c:1512: warning: 'mask' may be used uninitialized in this function
2023-11-23 11:56:50 +03:00
Ozkan Sezer
aaba01aee4 hidapi: syncing with mainstream:
- macos, pthread_barrier_wait: properly check the wait condition
- windows: Assert that struct has the correct size
- windows: Fix printf/string-related issues
- other miscellaneous stuff irrelevant in SDL. (for symmetry...)
2023-11-23 11:35:02 +03:00
Ozkan Sezer
5730eb67f0 add HAVE_GCC_DIAGNOSTIC_PRAGMA to SDL_internal.h, use it 2023-11-23 11:33:20 +03:00
Ozkan Sezer
42c8366fdc revise iconv detection:
- check libiconv with a linkage test with iconv.h included
- check libc iconv with a linkage test with iconv.h included
  and LIBICONV_PLUG defined (in case libiconv header is in
  include path)
- add new configuration option to prefer iconv from libiconv,
  if available, over the libc version: SDL_LIBICONV, defaults
  to disabled.
- remove FindIconv + pkg_check_modules for iconv, and use our
  manual iconv finding only
- change FreeBSD specific LIBICONV_PLUG define in SDL_iconv.c
  to configuration result.
2023-11-23 04:30:56 +03:00
Anonymous Maarten
a45b371de0 cmake: create and install SDL3::Jar target for Android 2023-11-23 02:13:08 +01:00
Ozkan Sezer
53544cabaa psp: fix copy/paste error from SDL2 in PSP_VideoQuit(). 2023-11-23 04:11:24 +03:00
Ryan C. Gordon
6cde96f9a0 psp: Hook up event subsystem init/quit.
Fixes #8554.

(cherry picked from commit 0e9d050296)
2023-11-22 18:03:29 -05:00
Ryan C. Gordon
e9659f5738 Removed some function declarations that don't actually exist.
Reference Issue #8554.

(cherry picked from commit 87875a49b4)
2023-11-22 17:58:54 -05:00
Ryan C. Gordon
3264e64738 SDL_RunApp: Make sure argc/argv are stable if the caller didn't define them.
Fixes #8246.
2023-11-22 17:34:39 -05:00
Sam Lantinga
eca79e38db Removed test shape images 2023-11-22 14:11:10 -08:00
Sam Lantinga
81fc7ded78 Removed the window shape API for SDL 3.0
Fixes https://github.com/libsdl-org/SDL/issues/6654
Fixes https://github.com/libsdl-org/SDL/issues/6897
2023-11-22 14:11:10 -08:00
Sam Lantinga
45938bbfa5 Corrected comment 2023-11-22 10:35:15 -08:00
zoeyjodon
059e550e98 Fix 3DS Analog Values (#8581) 2023-11-22 10:34:01 -08:00
zoey jodon
dbf14df80f Fix joysticks returning invalid device IDs 2023-11-22 10:33:11 -08:00
Anonymous Maarten
d2db3f3993 ci: cache android ndk archive 2023-11-22 19:22:31 +01:00
Anonymous Maarten
d6291d4d42 alloca: use alloca from <stdlib.h> on NetBSD
The only generally portable way to do this is to use -std=gnu99,
"#include <stdlib.h>", and write "alloca".
__builtin_alloca does not seem to be available on NetBSD
2023-11-22 06:33:50 +03:00
Anonymous Maarten
f26a93211f SDL_bsdjoystick: fix -Wundef warning on FreeBSD 2023-11-22 06:23:00 +03:00
Ozkan Sezer
d1def7f033 cmake: add openbsd wscons sources to build, if supported 2023-11-22 06:21:28 +03:00
Ozkan Sezer
86d77bbcc5 kmsdrm: restrict KMSDRM_ReleaseVT/KMSDRM_AcquireVT to SDL_INPUT_LINUXEV 2023-11-22 06:21:28 +03:00
Ozkan Sezer
94ad1a4ae4 SDL_bsdjoystick.c: fix -Wundef warning. 2023-11-22 06:21:28 +03:00
Sam Lantinga
e761770c24 No, this wasn't right 2023-11-21 15:26:53 -08:00
Sam Lantinga
b7d7e54895 Fixed uninitialized variable 2023-11-21 15:26:34 -08:00
Sam Lantinga
119e02f314 Always use 'm' for controllers provided by the MFI joystick driver
This makes sure that SDL_JoystickGUIDUsesVersion() returns false and we don't try to match against other similar controllers using old mappings.
2023-11-21 15:19:23 -08:00
Sam Lantinga
75df4cc5c2 Don't tickle PS4 Bluetooth controllers in simple mode
The 8BitDo Zero 2 only sends reports when state changes, so trips the disconnected Bluetooth controller detection. The expected use case is that most people will have official PS4 controllers in enhanced report mode, so disconnected Bluetooth controller detection will still work for those.

Fixes https://github.com/libsdl-org/SDL/issues/8556
2023-11-21 13:25:02 -08:00
Dimitriy Ryazantcev
0d431015bf Extract BMP magic into separate define 2023-11-21 08:37:33 -08:00
Dimitriy Ryazantcev
0413f6fc49 Use SDL_iscntrl() call instead of manual code that is doing the same (#8593) 2023-11-21 08:36:32 -08:00
Zack Middleton
fd91178d7f Make size cursors be double arrows on Wayland
I added fallbacks as they are listed under "to be discussed" in the spec
but I don't know if they're necessary.

https://www.freedesktop.org/wiki/Specifications/cursor-spec/
2023-11-21 08:34:30 -08:00
Zack Middleton
5e9b0820f3 Add cursors for X11/Wayland window resizing 2023-11-21 08:34:13 -08:00
Dimitriy Ryazantcev
91e122316c Use SDL_small_alloc() instead of SDL_stack_alloc() in CreateMaskBitmap() 2023-11-21 07:42:01 -08:00
Ionuț Leonte
b76f8de298 Hit testing tweaks for X11 and Wayland (#8582)
Hit testing on X11 and Wayland should now behave more like it
does on Windows - the current active zone is tracked on mouse
motion events and the cursor is changed accordingly when hovering
a "special" zone (such as the resize handles).
2023-11-20 13:33:11 -08:00
Ryan C. Gordon
5b1c68c2f3 testshader: Don't make local variables with the same name as GL entry points.
Reference Issue #2706.

(cherry picked from commit cb5b8c9747)
2023-11-20 15:12:37 -05:00
Sam Lantinga
30a2291d59 Fixed compatibility with sdl2-compat (thanks @sezero!) 2023-11-20 08:46:12 -08:00
Dimitriy Ryazantcev
49d58bc73a Cleanup WIN_CreateCursor() code a bit
Generate bimap mask from the alpha channel.
2023-11-19 12:41:12 -08:00
Frank Praznik
4722269fb6 tests: Print window occluded log events 2023-11-18 10:50:39 -05:00
Cameron Cawley
5db781cc3d Use the correct pixel formats for OpenGL ES on big endian 2023-11-17 15:02:44 -08:00
Cameron Cawley
05e7dcf8f8 Support returning <8bpp surfaces in SDL_LoadBMP_RW 2023-11-17 08:45:32 -08:00
Cameron Cawley
773ec1cfcb Extend blitting support for all <8bpp formats 2023-11-17 08:45:32 -08:00
Cameron Cawley
753bbd199e Add SDL_PIXELFORMAT_INDEX2LSB and SDL_PIXELFORMAT_INDEX2MSB 2023-11-17 08:45:32 -08:00
Cameron Cawley
fda69e5e79 Test both MSB and LSB indexed surfaces in testautomation 2023-11-17 08:45:32 -08:00
Ozkan Sezer
39870031d1 use format string attributes for functions accepting va_list params, too 2023-11-17 15:56:10 +03:00
Sam Lantinga
666301f9f9 Fixed build with older macOS SDK 2023-11-16 21:01:28 -08:00
Sam Lantinga
238987df3b Always use physicalInputProfile on OS versions that support it
Also cleaned up @available warnings in the GCController support
2023-11-16 16:08:53 -08:00
Sam Lantinga
e424dcca4b More fixing the build with older macOS SDKs 2023-11-16 12:04:45 -08:00
Sam Lantinga
4ebb0c6dac Revert "Fixed build"
This reverts commit 7abacc9f9f.
2023-11-16 12:03:39 -08:00
Sam Lantinga
7abacc9f9f Fixed build 2023-11-16 11:44:59 -08:00
Sam Lantinga
ac1f896f89 Fixed building with older macOS SDK 2023-11-16 10:49:13 -08:00
Sam Lantinga
8043dad369 Fixed build warning 2023-11-16 10:28:54 -08:00
Sam Lantinga
5c8c3931f2 Removed outdated information about SDL_GetWindowWMInfo() 2023-11-16 09:56:16 -08:00
Sam Lantinga
e0d0d140b2 Fixed SDL_GetWindowWMInfo() code example 2023-11-16 09:55:06 -08:00
Sam Lantinga
f61c0f3dc1 SDL_HINT_TV_REMOTE_AS_JOYSTICK should only affect Siri Remotes on Apple TV
Other gamepads like the iBuffalo Classic USB Gamepad will not have a standard profile, but shouldn't be ignored when this hint is enabled.
2023-11-16 09:19:27 -08:00
Sam Lantinga
51fc134cad Added support for the second generation Siri Remote on Apple TV 2023-11-16 09:07:29 -08:00
Sam Lantinga
bfba9de43a Revert "Map Siri Remote touchpad to D-Pad for consistency with physicalInputProfile mapping"
This reverts commit 2999634f29.

The physicalInputProfile mapping maps the touchpad to left thumbstick now, as the 2nd generation Siri Remote has both touchpad and cardinal direction D-Pad functionality
2023-11-16 09:07:29 -08:00
Ryan C. Gordon
f2c12fe5f3 Removed TODO.txt
This is obviously not how we track bugs at this point.  :)
2023-11-16 08:47:37 -05:00
Sam Lantinga
d4448fe3d2 Update virtual joystick test now that we're just using abxy for mappings, for compatibility 2023-11-16 00:02:47 -08:00
Sam Lantinga
f40f272107 Fixed build 2023-11-15 23:58:39 -08:00
Sam Lantinga
34bdd321bf Improved navigation while setting up controller mapping
* Moving forward and backward don't clear the current binding
* Use the tertiary face button to delete the current binding
* More small improvements to make navigation more intuitive
2023-11-15 23:46:31 -08:00
Sam Lantinga
57e5c7f6ee We'll just use the legacy names for face buttons in the mappings
This fixes being able to accidentally rebind the face buttons in testcontroller
2023-11-15 22:09:09 -08:00
Sam Lantinga
051ed397d1 Removed testautomation_syswm.c from the Xcode project 2023-11-15 21:51:22 -08:00
Sam Lantinga
fb08c22abf Disable controller state debug messages 2023-11-15 21:46:45 -08:00
Sam Lantinga
2999634f29 Map Siri Remote touchpad to D-Pad for consistency with physicalInputProfile mapping 2023-11-15 21:04:25 -08:00
Sam Lantinga
2ff9255f29 Print the GUID for controllers that don't have a mapping 2023-11-15 21:04:25 -08:00
Sam Lantinga
64939d3586 Switch the menu button on the Apple TV remote to the B button to match UI guidelines 2023-11-15 21:04:25 -08:00
Sam Lantinga
0fe5713964 Improved GCController handling on Apple platforms
Automatically map controllers as gamepads when using the GCController framework and prefer the physicalInputProfile when possible.

Testing with macOS 13.4.1, macOS 14.1.1, iOS 15.7.4, tvOS 17.1:
* iBuffalo Classic USB Gamepad (macOS only)
* Logitech F310 (macOS only)
* Apple TV remote (tvOS only)
* Nimbus MFi controller
* PS4 DualShock controller
* PS5 DualSense controller
* Xbox Series X controller
* Xbox Elite Series 2 controller
* Nintendo Switch Pro controller
* Nintendo Switch Joy-Con controllers
2023-11-15 21:04:25 -08:00
Sam Lantinga
aaf54b09a1 Revert "Cleanup WIN_CreateCursor() code a bit"
This reverts commit 876c97454a.

This caused the blank cursor to be entirely black
2023-11-15 11:32:06 -08:00
Ryan C. Gordon
e923a458ea audio: Protect against race conditions when closing a physical device.
This specifically deals with two threads closing the same device at the same
time, and a thread trying to reopen the device as it's still in process of
being closed. This can happen in normal usage if a device is disconnected:
the OS might send a disconnect event, while the device thread also attempts
to manage a disconnect as system calls start to report failure.

This effort is necessary because we have to release the device lock during
close to allow the device thread to unblock and cleanly shutdown. But the
good news is that all the places that call ClosePhysicalAudioDevice can now
safely hold the device lock on entry, and that one function will manage the
lock tapdancing.
2023-11-15 14:17:14 -05:00
Ryan C. Gordon
8fa0746d4a audio: Fix postmix state when migrating to new default devices.
Otherwise buffers might not be allocated, etc.
2023-11-15 14:17:13 -05:00
Frank Praznik
078995bbe0 x11: Set the skip taskbar and skip pager atoms on utility windows
Some compositors apparently still need these set to keep the window out of the taskbar and pager, even with the utility window atom being set.
2023-11-15 04:43:37 -05:00
Ryan C. Gordon
a58af6d0d1 wasapi: Reference devices when proxying to management thread.
Otherwise, a disconnect/default change on another thread may cause the
device pointer to become invalid by the time the management thread runs the
task.
2023-11-14 16:20:14 -05:00
Sam Lantinga
34392db9c3 Fixed IOS_SupportedHIDDevice() returning SDL_FALSE before initialization 2023-11-14 10:57:47 -08:00
Sam Lantinga
708f18d49e Added SDL_HINT_JOYSTICK_IOKIT and SDL_HINT_JOYSTICK_MFI to control whether the IOKit and GCController drivers should be used for joystick support.
This can be used to work around issues where the Apple GCController driver doesn't work for some controllers but there's no way to know which GCController maps to which IOKit device.
2023-11-14 10:28:19 -08:00
Louis M
bd4966999b Replacing SDL_SCANCODE_AUDIOMUTE by SDL_SCANCODE_MUTE on Windows
(cherry picked from commit 925362a2fc)
2023-11-14 09:27:43 -08:00
Sam Lantinga
15504da0b8 Fixed mouse wheel scrolling direction on iOS 2023-11-14 09:10:56 -08:00
Sam Lantinga
f5600fd9f4 Fall back to using the physical profile for Apple controllers if they don't match a standard profile
We may want to flip this to be the default, but it needs more testing.
2023-11-14 06:29:09 -08:00
Sam Lantinga
924de4df48 Enable transparent windows when using the D3D11 renderer
Note that this will not work with D3D12, as DXGI_SWAP_EFFECT_DISCARD is not available there.
2023-11-14 06:06:51 -08:00
Sam Lantinga
1c64366b80 Added SDL_CreateRendererWithProperties() and SDL_CreateTextureWithProperties() 2023-11-14 06:06:51 -08:00
Sam Lantinga
7203641597 Note that the SDL window properties are read-only 2023-11-14 06:06:51 -08:00
Sam Lantinga
e0c45c6c98 Renamed SDL_WINDOW_FOREIGN to SDL_WINDOW_EXTERNAL 2023-11-14 06:06:51 -08:00
Sam Lantinga
229b7b9d50 SDL_CreateWindowWithPosition() and SDL_CreateWindowFrom() have been replaced with SDL_CreateWindowWithProperties()
This is a more general interface that can be extended in the future as needed.
2023-11-14 06:06:51 -08:00
Sam Lantinga
2c1fbe1967 Revert "Check to make sure the Windows joystick device has buttons and axes"
This reverts commit ad0af48883.

It turns out the ROG PUGIO II actually enumerates as a gamepad, so this change didn't have any effect anyway. We're getting lots of reports of people's racing pedals and similar devices no longer showing up, so we'll revert this again.

Fixes https://github.com/libsdl-org/SDL/issues/8227
Fixes https://github.com/libsdl-org/SDL/issues/8484
2023-11-13 21:33:09 -08:00
Sam Lantinga
edd044e901 Fixed the ROG PUGIO II showing up as a game controller
This mouse actually enumerates as a gamepad with 2 axes, 8 buttons and a hat.

We'll ignore it like the other ROG mice, unless someone specifically wants to use it as a gamepad.
2023-11-13 21:32:41 -08:00
Frank Praznik
861b1ebd12 properties: Use a mutex instead of an RWLock to guard the hash table
The hash table can be recursively locked from the same thread, which can cause issues with RWLocks, as locking them recursively can result in undefined behavior or deadlocks. Use a mutex instead, as it can be safely recursively locked.
2023-11-13 18:28:24 -05:00
Ryan C. Gordon
dd8ab67bd9 Sync wiki -> headers. 2023-11-13 15:46:29 -05:00
Ryan C. Gordon
91460fc13d include: Fixed up documentation in SDL_pen.h 2023-11-13 15:40:55 -05:00
Dimitriy Ryazantcev
876c97454a Cleanup WIN_CreateCursor() code a bit
Closes #6476
2023-11-13 11:46:50 -08:00
Ryan C. Gordon
8766aa39d6 Sync wiki -> headers. 2023-11-13 13:03:42 -05:00
Ryan C. Gordon
e5ffd6d8eb include: Removed \link and \endlink Doxygen tags. 2023-11-13 13:01:25 -05:00
Sam Lantinga
1c4723ac66 SDL_CreateWindowFrom() now takes a set of properties that describe the native window and options. 2023-11-12 21:58:58 -08:00
Sam Lantinga
6afae6681b Allow casting properties of different types 2023-11-12 21:58:58 -08:00
Sam Lantinga
bd269b0f41 Added SDL_SetBooleanProperty() and SDL_GetBooleanProperty() 2023-11-12 21:58:58 -08:00
Ryan C. Gordon
c47ac5b2df include: Fixed copy/paste error 2023-11-12 23:41:22 -05:00
Ryan C. Gordon
0efb3d90e0 audio: removed a fixed FIXME comment. 2023-11-12 23:41:22 -05:00
nia
69cae07cc1 cpuinfo: Fix detection of physical memory above 2GB on NetBSD
Rework the code to clearly prefer 64-bit sysctls first, then
legacy sysctls, and eliminate a second ifdef.

Signed-off-by: Nia Alarie <nia@NetBSD.org>
2023-11-12 18:12:18 -08:00
Ozkan Sezer
45fc828c95 move SDL_EVENT_WINDOW_PEN_ENTER and SDL_EVENT_WINDOW_PEN_LEAVE down
... to preserve compatibility with sdl2-compat.
2023-11-12 12:22:43 -08:00
Sam Lantinga
0907f345cb Added property types: pointer, string, number, float 2023-11-12 10:48:38 -08:00
Christoph Reichenbach
7c80ac6df7 API for pressure-sensitive pens + XInput2/Wayland
This patch adds an API for querying pressure-
sensitive pens, cf. SDL_pen.h:
- Enumerate all pens
- Get pen capabilities, names, GUIDs
- Distinguishes pens and erasers
- Distinguish attached and detached pens
- Pressure and tilt support
- Rotation, distance, throttle wheel support
  (throttle wheel untested)
- Pen type and meta-information reporting
  (partially tested)

Pen event reporting:
- Three new event structures: PenTip, PenMotion, and
  PenButton
- Report location with sub-pixel precision
- Include axis and button status, is-eraser flag

Internal pen tracker, intended to be independent
of platform APIs, cf. SDL_pen_c.h:
- Track known pens
- Handle pen hotplugging

Automatic test:
- testautomation_pen.c

Other features:
- XInput2 implementation, incl. hotplugging
- Wayland implementation, incl. hotplugging
- Backward compatibility: pen events default to
  emulating pens with mouse ID SDL_PEN_MOUSEID
- Can be toggled via SDL_HINT_PEN_NOT_MOUSE
- Test/demo program (testpen)
- Wacom pen feature identification by pen ID

Acknowledgements:
- Ping Cheng (Wacom) provided extensive feedback
  on Wacom pen features and detection so that
  hopefully untested Wacom devices have a
  realistic chance of working out of the box.
2023-11-12 09:52:02 -08:00
Sam Lantinga
d3e43668d0 Revert "Sync SDL3 wiki -> header"
This reverts commit 43571769f1.
2023-11-12 09:02:22 -08:00
SDL Wiki Bot
43571769f1 Sync SDL3 wiki -> header 2023-11-12 15:55:10 +00:00
Sam Lantinga
843873626c Handle window resizing on the render thread in D3D11 and D3D12
This prevents crashing when a separate thread is being used for rendering

Discussion and sample code in https://github.com/libsdl-org/SDL/issues/8528
2023-11-11 12:49:53 -08:00
Sam Lantinga
f66f61de01 Fixed missing "0" in the button list 2023-11-11 08:30:13 -08:00
Sylvain Becker
04b6b2979f Re-add SDL_assert() with non boolean ptr syntax (#8530) 2023-11-11 12:28:24 +03:00
Sam Lantinga
b374105975 Replaced SDL_GetTextureDXGIResource() with texture properties
Fixes https://github.com/libsdl-org/SDL/issues/8529
2023-11-10 20:38:13 -08:00
Sam Lantinga
09d1e9defb Only update the battery status for Bluetooth Switch Pro controllers
Controllers that are plugged in are in the wired state
2023-11-10 17:09:39 -08:00
Sam Lantinga
87794d03ad Added shortened name for "Nintendo Co., Ltd." 2023-11-10 17:04:37 -08:00
Sam Lantinga
fbb6934905 Added support for the Dragonrise GameCube adapter with VID 0x1843 2023-11-10 16:39:32 -08:00
Sam Lantinga
d98e1bdfe1 Use the standard gamepad type for Switch Pro controllers using the GameCube form factor 2023-11-10 16:39:32 -08:00
Sam Lantinga
a5a47d3bee Fixed crash if there is no controller mapping 2023-11-10 16:39:32 -08:00
Sam Lantinga
312faf9305 Updated documentation for the controller face buttons 2023-11-10 16:39:32 -08:00
Sam Lantinga
2991b9f6ac SDL now represents gamepad buttons as positional elements with a separate label
This gives applications and binding systems a clearer view of what the hardware is so they can make intelligent decisions about how to present things to the user.

Gamepad mappings continue to use abxy for the face buttons for simplicity and compatibility with earlier versions of SDL, however the "SDL_GAMECONTROLLER_USE_BUTTON_LABELS" hint no longer has any effect.

Fixes https://github.com/libsdl-org/SDL/issues/6117
2023-11-10 12:21:43 -08:00
meyraud705
8708ba7393 Don't leak if realloc fails 2023-11-10 06:33:39 -08:00
Mathieu Eyraud
36b2d2e463 Fix memory leak in SDL_SendDrop() 2023-11-10 06:32:43 -08:00
Mathieu Eyraud
dfb87e1099 Fix uninitialised variable 'properties'
If SDL_CreateHashTable() fails, properties->lock is not initialised, SDL_FreeProperties() is called and destroys the uninitialised lock.
2023-11-10 06:32:15 -08:00
Mathieu Eyraud
e54c5e0204 Fix condition in SDLTest_TrackAllocations() 2023-11-10 06:31:44 -08:00
Ryan C. Gordon
89408a9705 wasapi: ResetWasapiDevice no longer blocks on management thread.
It just proxies all its necessary releases and frees to these without
blocking, and sets the appropriate fields to NULL so they can be used again
immediately, regardless of when the old stuff actually gets released.
2023-11-09 20:27:58 -05:00
Ryan C. Gordon
aa7baf63aa Sync wiki -> headers. 2023-11-09 20:11:23 -05:00
Frank Praznik
74f3643bfa wayland: Add missing break to switch statement 2023-11-09 19:48:56 -05:00
Anonymous Maarten
2d6bae70b4 Older gcc does not support #pragma GCC diagnostic inside functions 2023-11-09 23:33:28 +01:00
Sylvain
d8600f717e Pointer as bool (libsdl-org#7214) 2023-11-09 14:18:36 -08:00
Anonymous Maarten
23db971681 x11: Ignore deprecated declaration of XKeycodeToKeysym 2023-11-09 18:45:54 +01:00
Anonymous Maarten
61c39ce848 ci: re-enable Intel compilers on ci 2023-11-09 18:05:15 +01:00
Sam Lantinga
4ac3f5c07e Updated Xcode project with the video capture API 2023-11-09 09:01:29 -08:00
Sylvain
59f93e20a7 Add SDL Video Capture, with back-end for linux/macos/ios/android 2023-11-09 08:36:23 -08:00
Sam Lantinga
3ab98a3572 Removed debug print statements (thanks @stsp!) 2023-11-08 20:43:44 -08:00
Sam Lantinga
f4b61fff30 Implemented VT switching for KMSDRM on Linux
Fixes https://github.com/libsdl-org/SDL/issues/3844
2023-11-08 20:35:16 -08:00
Anonymous Maarten
391a3d23d0 cmake: the compile-time pdb does not have a suffix, if set 2023-11-09 03:28:20 +01:00
Anonymous Maarten
a6541166bc cmake: also install pdb files of static libraries 2023-11-09 02:17:07 +01:00
Anonymous Maarten
2e3f574f8f cmake: don't add the C runtime library to the .obj file (when using MSVC)
Using /Zl, the obj files will no longer add a link requirement to the C
runtime libraries. Meanwhile, also add /NODEFAULTLIB for non-UWP MSVC
toolchains.

Because /Zl is a compile option, it can also be used when building a
static SDL3 library, and SDL3_test.
2023-11-09 02:10:58 +01:00
Sam Lantinga
bea34c5380 Fixed a memory leak at window creation.
Windows updates the desktop display mode once at video init (in WIN_InitModes()) and once when creating a window (in WIN_RefreshDisplays())

Fixes https://github.com/libsdl-org/SDL/issues/7982
Fixes https://github.com/libsdl-org/SDL/issues/8189
2023-11-08 14:26:07 -08:00
Sam Lantinga
b5347c3364 Fixed emscripten and iOS builds 2023-11-08 14:14:41 -08:00
Sam Lantinga
02f356439d Allow the application to draw while Windows is in a modal move/resize loop
If you're using the application main callbacks, your SDL_AppIterate() function will be called while Windows is moving and resizing your window. If not, then SDL will send an SDL_EVENT_WINDOW_EXPOSED event for your window and you can use an event watcher to redraw your window directly from the callback.

Fixes https://github.com/libsdl-org/SDL/issues/1059
Closes https://github.com/libsdl-org/SDL/pull/4836
2023-11-08 13:32:56 -08:00
Sam Lantinga
1934417b4d Show the existing mapping when a controller is connected 2023-11-08 12:38:54 -08:00
Sam Lantinga
407a3cb4e0 Fixed infinite recursion initializing properties 2023-11-08 12:38:04 -08:00
Sam Lantinga
979214363f Added SDL_GetGlobalProperties()
We'll undoubtedly want to have global properties available
2023-11-08 12:01:48 -08:00
Sam Lantinga
151cdfa99f Added the "SDL.window.wayland.registry" property
Fixes https://github.com/libsdl-org/SDL/issues/8393
2023-11-08 12:01:48 -08:00
Sam Lantinga
6c91b28e71 Added the "SDL.renderer.d3d12.command_queue" property
Fixes https://github.com/libsdl-org/SDL/issues/8491
2023-11-08 12:01:48 -08:00
Sam Lantinga
4e8d1ec983 Fixed crash trying to create a metal view with the dummy driver 2023-11-08 12:01:48 -08:00
Sam Lantinga
fd4a2cce9e SDL_syswm.h has been removed and replaced with window properties 2023-11-08 12:01:48 -08:00
Sam Lantinga
aea6e6de6f Simplified SDL_SetProperty() and added SDL_SetPropertyWithCleanup()
Most of the time people won't need to set a cleanup callback, so we can simplify the more commonly used API.
2023-11-08 12:01:48 -08:00
Sam Lantinga
a1941fad6c Replaced SDL_RenderGetD3D11Device(), SDL_RenderGetD3D12Device(), and SDL_RenderGetD3D9Device() with renderer properties. 2023-11-08 12:01:48 -08:00
Sam Lantinga
0cd4b7d3e3 Added display properties 2023-11-08 12:01:48 -08:00
Sam Lantinga
a02afbaea5 Clean up window properties when the window is destroyed 2023-11-08 12:01:48 -08:00
Sam Lantinga
8668943746 Standardized property names for internal SDL properties 2023-11-08 12:01:48 -08:00
Sam Lantinga
a4c6b38fef Fixed FreeBSD build 2023-11-08 07:46:02 -08:00
Sam Lantinga
d9e6dcc650 Fixed FreeBSD build 2023-11-08 04:45:29 -08:00
Sam Lantinga
7cc3e94eb2 Store the requested muted state 2023-11-08 03:36:47 -08:00
Sam Lantinga
ce9e1bd324 Don't mute the console input if we can't read the keyboard
This makes sure you can hit Ctrl-C if you don't have permission to access the raw keyboard device.

Fixes https://github.com/libsdl-org/SDL/issues/4812
2023-11-08 03:29:10 -08:00
Wohlstand
0a1b6b270f sdlchecks.cmake: Clarified the reason why shared X11 mode doesn't work
#6778
2023-11-08 02:57:28 -08:00
Sam Lantinga
80b2bbad21 Removed useless branch test
Fixes https://github.com/libsdl-org/SDL/issues/8286

(cherry picked from commit e5ccc80aba)
(cherry picked from commit 7e11bd1ac1)
2023-11-08 01:36:14 -08:00
Sam Lantinga
15bc12165a Actually we need to enumerate the 8BitDo Xbox SKUs
At the point we're calling SDL_IsJoystickXboxSeriesX(), we don't know for sure that the controller is an Xbox controller.

Fixes https://github.com/libsdl-org/SDL/issues/8174
2023-11-08 00:42:42 -08:00
Sam Lantinga
8049af3355 Assume all 8BitDo Xbox controllers have a share button
Fixes https://github.com/libsdl-org/SDL/issues/8174
2023-11-08 00:34:50 -08:00
Sam Lantinga
ed1e0c1530 Make sure joysticks are locked when adding and removing them
Fixes https://github.com/libsdl-org/SDL/issues/8146
2023-11-08 00:13:16 -08:00
Sam Lantinga
415283ef38 Fixed checking for linux/input.h 2023-11-08 00:13:16 -08:00
Sam Lantinga
fea2504a37 Prioritize the pipewire audio driver over ALSA
ALSA is used very rarely anymore and the pipewire ALSA emulation isn't as good as using pipewire directly. The Pulseaudio emulation is very good, and Pulseaudio is still commonly available on Linux systems, so we'll default to that first and fall back to pipewire if it's not available. We'll finally try ALSA, to handle very old systems.

Fixes https://github.com/libsdl-org/SDL/issues/7541
2023-11-07 22:02:27 -08:00
Sam Lantinga
04e98d2236 Added missing calls to SDL_InvalidParamError("surface") 2023-11-07 21:57:15 -08:00
Sam Lantinga
521bbcc15e Destroy the window surface if we've created it for the software renderer
Fixes https://github.com/libsdl-org/SDL/issues/8011
2023-11-07 21:44:18 -08:00
Sam Lantinga
28e623c504 Added a mapping for the Atari VCS controller connected over Bluetooth (thanks @WizzardSK!)
Fixes https://github.com/libsdl-org/SDL/issues/7116
2023-11-07 18:08:11 -08:00
Sam Lantinga
4106697774 Make sure we include the null terminator in XLookupStringAsUTF8()
Fixes https://github.com/libsdl-org/SDL/issues/6728
2023-11-07 16:24:08 -08:00
Sam Lantinga
b5057edf29 Remove unused SDL_TextureModulate enum
Fixes https://github.com/libsdl-org/SDL/issues/6387
2023-11-07 09:23:26 -08:00
Sam Lantinga
9458cbf75e Removed unused SDL_OSEvent 2023-11-07 09:14:35 -08:00
Frank Praznik
1a57f6bb29 wayland: Remove QtWayland extensions
These were added a very long time ago and seem to serve no purpose now, as the functionality they provided is now in core Wayland protocols, current information on their usage and status is nonexistent, no modern compositor seems to support them, and the code paths are untested and subject to bit-rot at this point. It also causes duplicate symbol issues when statically linking an application to both Qt and SDL.
2023-11-07 11:00:32 -05:00
Ozkan Sezer
5f920d6639 fix emscripten build after commit 07cb7c10 2023-11-07 07:55:30 +03:00
Sam Lantinga
22016b4eae Enable the 5th player LED on the DualSense controller
Fixes https://github.com/libsdl-org/SDL/issues/5152
2023-11-06 20:14:50 -08:00
Sam Lantinga
66cf30c2de Removed misleading comment
Fixes https://github.com/libsdl-org/SDL/issues/5069
2023-11-06 19:33:40 -08:00
Sam Lantinga
dbcd390cdf Log drag and drop position updates in SDL test programs 2023-11-06 18:53:06 -08:00
Sam Lantinga
07cb7c10a1 Fixed connecting and disconnecting real-joysticks closing virtual joysticks in Emscripten (thanks David!)
Emscripten was using its own, private integer in order to allocate
new SDL_JoystickIDs.  SDL keeps a similar integer for allocating
joystick-ids, one which is shared across multiple joystick backends.

SDL 2.0.13 introduces a new joystick-backend, a Virtual joystick
backend, which allows for software-driven joysticks, and which is
designed to sit alongside joystick-backends that provide access to
physical joysticks.

The Emscripten and the Virtual backends were, at times, getting
allocated the same SDL_JoystickIDs, if and when both backends were used
simultaneously.  This could happen if, for example, an application
was using a virtual joystick in order to drive a touch-screen
based joystick, while also supporting physical joysticks through the
Emscripten backend.

When two joysticks end up with the same SDL_JoystickID, conflicts
can occur.  For example, disconnecting a physical joystick with
the same SDL_JoystickID as a virtual one, can lead to the virtual
joystick being closed, inadvertently.

This fix makes the Emscripten backend use SDL's cross-joystick-backend
integer counter, which is shared among joystick backends, for allocating
new SDL_JoystickIDs, rather than a private, Emscripten-specific
counter.

Fixes https://github.com/libsdl-org/SDL/issues/3647
2023-11-06 17:12:51 -08:00
Ryan C. Gordon
869257a5c1 SDL_migration.cocci: Added a thing for SDL_Vulkan_CreateSurface. 2023-11-06 19:16:38 -05:00
Ryan C. Gordon
c6d9fb1ad7 hidapi: Avoid memcpy'ing to NULL.
(This fix was originally from @themightyoarfish on GitHub. Thanks!)

Fixes #8428.
Reference PR #8431.
2023-11-06 13:48:07 -05:00
Ryan C. Gordon
4d1aecc225 vulkan: Patched to compile on iOS. 2023-11-06 13:35:19 -05:00
SDL Wiki Bot
fccec65afe Sync SDL3 wiki -> header 2023-11-06 18:32:15 +00:00
Ryan C. Gordon
2f92807087 vulkan: SDL_Vulkan_CreateSurface now accepts an app-provided allocator.
Fixes #3638.
2023-11-06 13:31:20 -05:00
Ryan C. Gordon
c53843a961 docs: Remove Doxygen \brief tags.
Doxygen and the wiki bridge don't need them; they'll both just use the first
line/sentence instead.

Fixes #8446.
2023-11-06 10:26:06 -05:00
Ozkan Sezer
c132295ad7 SDL_FlushEventMemory is not a public procedure. 2023-11-06 17:40:56 +03:00
Ryan C. Gordon
7ac281f800 Sync wiki -> headers. 2023-11-06 09:33:05 -05:00
Sam Lantinga
f7d40b7594 Added 10-bit pixel formats in addition to SDL_PIXELFORMAT_ARGB2101010
Added SDL_PIXELFORMAT_XRGB2101010, SDL_PIXELFORMAT_XBGR2101010, SDL_PIXELFORMAT_ABGR2101010

Fixes https://github.com/libsdl-org/SDL/issues/3553
2023-11-06 00:41:09 -08:00
Sam Lantinga
3e4d7e48b0 Fixed memory leak in XInput code
Fixes https://github.com/libsdl-org/SDL/issues/3597
2023-11-06 00:40:19 -08:00
Sam Lantinga
bc3d9e99f3 Only save ibus_addr_file after we've successfully read an address from it.
Fixes https://github.com/libsdl-org/SDL/issues/3359
2023-11-05 22:12:37 -08:00
Sam Lantinga
04dfca958a Added a note to events indicating that memory is owned by SDL 2023-11-05 21:25:43 -08:00
Sam Lantinga
20cd789bab Improved migration documentation for the event memory change. 2023-11-05 21:20:48 -08:00
Anonymous Maarten
459f17257c cmake: fix MSVC unrecognized option link warning 2023-11-06 01:58:26 +01:00
Anonymous Maarten
761390b62f cmake: detect linker id, and assume MSVC does not support version scripts 2023-11-06 00:41:00 +01:00
Ozkan Sezer
d2e005ee13 dynapi: remove duplicated SDL_LoadWAV entries 2023-11-05 20:32:50 +03:00
Frank Praznik
21ff699251 test: Fix popup test crash on exit
If the done signal is emitted by the common event handler, the window and all of its children have already been destroyed, so don't try to render with invalid renderer objects.
2023-11-05 12:29:22 -05:00
Sam Lantinga
70c149c88f Automatically clean up memory associated with events 2023-11-05 09:14:11 -08:00
Ozkan Sezer
1a83bf2399 fix a possible memory leak in SDL_vasprintf() 2023-11-05 20:01:02 +03:00
Jamie Madill
59b37d0e5b cmake: fix Windows unrecognized option link warning
This fixes a warning that could show up on some MS linkers which use a
slightly different warning message than expected.

Amends check_linker_supports_version_file to include the "unrecognized
option" warning message.
2023-11-05 16:28:22 +00:00
Sam Lantinga
9302d7732d Fixed touch normalized coordinates
When converting normalized coordinates to pixel coordinates, the valid range is 0 to (width or height) - 1, and the pixel coordinate of width or height is past the edge of the window.

Fixes https://github.com/libsdl-org/SDL/issues/2913
2023-11-05 06:55:39 -08:00
SDL Wiki Bot
ff3c20a799 Sync SDL3 wiki -> header 2023-11-05 14:11:05 +00:00
SDL Wiki Bot
17a0fe3a0c Sync SDL3 wiki -> header 2023-11-05 14:06:05 +00:00
SDL Wiki Bot
14d2471a8f Sync SDL3 wiki -> header 2023-11-05 14:04:05 +00:00
SDL Wiki Bot
2ad22eeeb5 Sync SDL3 wiki -> header 2023-11-05 14:02:06 +00:00
Sam Lantinga
930438dfb7 Added note that the #ifdef is for !__IOS__ 2023-11-05 00:33:08 -07:00
kanjitalk755
c56583fe45 Fix duplicate symbol on iOS/tvOS 2023-11-05 00:31:27 -07:00
kanjitalk755
2b62f25a6f Add SDL_sysmain_callbacks.c to the Xcode project 2023-11-05 00:31:27 -07:00
kanjitalk755
4ab31ca678 Fix dropping file event 2023-11-05 00:14:56 -07:00
Sam Lantinga
5dce4bc716 Makes SDLInputConnection and DummyEdit public classes (thanks Cole!)
I've added an additional patch that expands on the same basic idea as the first one; it makes SDLInputConnection and DummyEdit into public classes so that they can be overridden from the Xamarin end if their functionality needs to be extended. (In my case, I need to change the type of software keyboard that's displayed.)

Fixes https://github.com/libsdl-org/SDL/issues/2785
2023-11-04 23:22:55 -07:00
Sam Lantinga
d3f2eb2aba Use XINPUT_STATE instead of XINPUT_STATE_EX (thanks Andrew!)
XINPUT_STATE_EX isn't actually a thing, we can just use the normal XINPUT_STATE

Fixes https://github.com/libsdl-org/SDL/issues/2797

(cherry picked from commit e8f4045d0b)
2023-11-04 22:28:09 -07:00
Sam Lantinga
3a482ebae0 Add createSDLMainRunnable() to SDLActivity (thanks Cole!)
This patch adds a new createSDLMainRunnable() method to SDLActivity.

Currently, SDL on Android expects to find SDL_main somewhere in native code. When using SDL in a Xamarin application, however, what we really want to do is write our entrypoint in managed code. The easiest way to do this is to allow subclasses of SDLActivity to provide their own Runnable to the SDL thread, as in the attached patch.

Fixes https://github.com/libsdl-org/SDL/issues/2785
2023-11-04 21:18:16 -07:00
Sam Lantinga
b9784feb24 Fixed potential uninitialized memory access (thanks Mathieu!)
GetRawInputDeviceList() can return a different number of devices than was allocated.

Fixes https://github.com/libsdl-org/SDL/issues/2759
2023-11-04 21:11:53 -07:00
Sam Lantinga
75ea3a8d32 Dynamically allocate long text for SDL_EVENT_TEXT_INPUT events
This prevents input text from being split across Unicode combining or modifier characters, and in practice allocations will rarely happen.
2023-11-04 20:55:10 -07:00
Sam Lantinga
2a1660ab51 Additional cleanup for SDL_RWprintf() (thanks @sezero!) 2023-11-04 20:47:08 -07:00
Ryan C. Gordon
e5f2cea234 Sync wiki -> headers 2023-11-04 22:18:38 -04:00
Sam Lantinga
ad842dd5ad Fixed a typo in SDL_log.h 2023-11-04 16:46:08 -07:00
Sam Lantinga
f9d11807c0 Added SDL_RWprintf() and SDL_RWvprintf() to do formatted printing to an SDL_rwops stream
Fixes https://github.com/libsdl-org/SDL/issues/2390
2023-11-04 16:46:08 -07:00
Frank Praznik
52c4e3eab3 events: Update self-referential pointers when copying event objects
Pointers to static internal data need to be updated when copying events, or the cleanup code will attempt to free old stack data that went out of scope.
2023-11-04 18:07:24 -04:00
Sam Lantinga
91f0456391 Add the source application for drag and drop events (thanks Nathan!)
This is only implemented on iOS, but is useful for third party application integrations.

Fixes https://github.com/libsdl-org/SDL/issues/2024
2023-11-04 13:00:41 -07:00
Ryan C. Gordon
1a8bf31a69 include: Fixing whitespace on SDL_MixAudioFormat. 2023-11-04 15:06:41 -04:00
Sam Lantinga
d07a264a9b Use the default UCS2/UCS4 conversion rather than non-portable INTERNAL encoding
Fxies https://github.com/libsdl-org/SDL/issues/1497
2023-11-04 12:01:30 -07:00
Ryan C. Gordon
780b6612a9 wayland: Wayland_Vulkan_GetInstanceExtensions didn't set the count variable.
Fixes #8468.
2023-11-04 14:53:24 -04:00
Sam Lantinga
46b940d571 Updated documentation to note that the event callback is called on the same thread as the main iteration callback 2023-11-04 11:31:54 -07:00
Sam Lantinga
4481754359 Make sure we only dispatch events on the main thread when using application callbacks 2023-11-04 11:27:58 -07:00
Sam Lantinga
274da8561c Updated the migration guide to note that you can check the return value of SDL_AddEventWatch() 2023-11-04 10:42:28 -07:00
Sam Lantinga
ad9dcdbbce Clarify that you should use the other field when reading the event 2023-11-04 09:58:35 -07:00
Ryan C. Gordon
a19029e3c1 docs: Updated README-main-functions.md based on feedback. 2023-11-04 10:03:10 -04:00
Ryan C. Gordon
019468dc59 main: Check for SDL_AddEventWatch failure, now that it can report it. 2023-11-04 10:03:10 -04:00
Sam Lantinga
7e445da569 Added SDL_CleanupEvent()
This is used to free any dynamically allocated memory in events.
2023-11-04 06:47:24 -07:00
Ivan Mogilko
c4bf05fd9d Added subsystem refcount tests to testautomation 2023-11-04 00:52:08 -07:00
Ivan Mogilko
7f65ed6461 Handle subsystem dependencies recursively
Existing code is erroneous, because it adds or removes dependency's ref count based on number of InitSubSystem/QuitSubSystem calls, while ref count diff should depend on number of inited or quit dependents.
Recursive approach seems to be simplest solution that guarantees proper ref count.
2023-11-04 00:52:08 -07:00
Sam Lantinga
a6b85c81cc Fixed build 2023-11-03 22:38:01 -07:00
SDL Wiki Bot
3ab6670cb1 Sync SDL3 wiki -> header 2023-11-04 05:36:15 +00:00
Sam Lantinga
f439ccfc1a Updated return values for SDL event functions
SDL_PollEvent(), SDL_WaitEvent(), and SDL_WaitEventTimeout() all return SDL_bool.
SDL_AddEventWatch() returns an int result code.

Also improved timeout accuracy in SDL_WaitEventTimeout()
2023-11-03 22:31:42 -07:00
Sam Lantinga
e0379c3b37 Grab events in large chunks in SDL_IterateMainCallbacks()
This is more efficient, especially since we're just going to discard them.
2023-11-03 21:47:44 -07:00
Sam Lantinga
ad5264e54f Don't run SDL_IterateMainCallbacks() if the init call returns an exit code
This fixes a crash in testsprite if you pass invalid command line parameters.
2023-11-03 21:35:42 -07:00
Sam Lantinga
dad1a84be4 Fixed building Vivante video driver 2023-11-03 14:56:15 -07:00
Sam Lantinga
fe175d025f Fixed building Vivante video driver 2023-11-03 14:54:11 -07:00
Sam Lantinga
0b460f34ba The HP HyperX controllers have a share button 2023-11-03 14:47:20 -07:00
Sam Lantinga
f3261fedcc Code cleanup now that SDL_bool is equivalent to a C boolean expression 2023-11-03 09:54:04 -07:00
Sam Lantinga
a76d8e39aa Changed SDL_bool from an enum to unsigned int
Fixes https://github.com/libsdl-org/SDL/issues/7957
2023-11-03 09:54:04 -07:00
SDL Wiki Bot
cf7e5bd0e8 Sync SDL3 wiki -> header 2023-11-03 15:41:14 +00:00
Ryan C. Gordon
853c28e624 docs: Added first draft of README-main-functions.md
Reference PR #8247.
2023-11-03 11:39:53 -04:00
Ryan C. Gordon
70d75b4a23 Sync wiki -> headers 2023-11-03 10:13:46 -04:00
Sam Lantinga
ea02630143 More audio migration clarification 2023-11-03 00:28:05 -07:00
Sam Lantinga
14980b25a8 Clarify documentation for audio callback migration 2023-11-02 22:32:25 -07:00
Anonymous Maarten
6cf84e2c5b cmake: fold HAVE_INPUT_EVENTS into HAVE_LINUX_INPUT_H 2023-11-02 21:31:37 +01:00
Ozkan Sezer
5e869d1b35 fix Cocoa_Vulkan_GetInstanceExtensions prototype for Mac 2023-11-02 22:12:56 +03:00
Ryan C. Gordon
07a776f255 include: Fixed documentation for SDL_Vulkan_GetInstanceExtensions. 2023-11-02 15:12:24 -04:00
Ryan C. Gordon
5b3a2c6df6 docs: Updated SDL_Vulkan_GetInstanceExtensions info in README-migration.md.
Reference PR #8457.
2023-11-02 14:57:13 -04:00
ilyas-taouaou
9224a0a2d8 Fix emscripten, android, uikit and windows 2023-11-02 14:27:36 -04:00
ilyas-taouaou
d0d8b28df1 Change SDL_Vulkan_GetInstanceExtensions 2023-11-02 14:27:36 -04:00
Ozkan Sezer
338974bb29 SDL_test_memory.c: fix build against older windows SDKs. 2023-11-02 21:00:02 +03:00
Sam Lantinga
618d15bce6 Fixed typo 2023-11-02 10:33:44 -07:00
Sam Lantinga
ad0af48883 Check to make sure the Windows joystick device has buttons and axes
This reverts commit e5a15f94e2.

It turns out removing this check allows mice like the ROG PUGIO II to show up as game controllers. We need to find a different way to differentiate between gaming mice and pedals.

Since these mice show up as controllers, and potentially causing games to use them instead of real controllers, we'll go ahead revert this change for now.

Reopens https://github.com/libsdl-org/SDL/issues/8227
2023-11-02 08:33:15 -07:00
Ryan C. Gordon
ac6b32bb02 gendynapi.py: Discard SDLMAIN_DECLSPEC functions.
Otherwise SDL_main and SDL_App* functions look like exported symbols instead
of functions the app is meant to implement.

Reference PR #8247.
2023-11-01 21:47:42 -04:00
Ryan C. Gordon
9c664b0062 main: Added _optional_ callback entry points.
This lets apps optionally have a handful of callbacks for their entry points instead of a single main function. If used, the actual main/SDL_main/whatever entry point will be implemented in the single-header library SDL_main.h and the app will implement four separate functions:

First:

    int SDL_AppInit(int argc, char **argv);

This will be called once before anything else. argc/argv work like they always do. If this returns 0, the app runs. If it returns < 0, the app calls SDL_AppQuit and terminates with an exit code that reports an error to the platform. If it returns > 0, the app calls SDL_AppQuit and terminates with an exit code that reports success to the platform. This function should not go into an infinite mainloop; it should do any one-time startup it requires and then return.

Then:

     int SDL_AppIterate(void);

This is called over and over, possibly at the refresh rate of the display or some other metric that the platform dictates. This is where the heart of your app runs. It should return as quickly as reasonably possible, but it's not a "run one memcpy and that's all the time you have" sort of thing. The app should do any game updates, and render a frame of video. If it returns < 0, SDL will call SDL_AppQuit and terminate the process with an exit code that reports an error to the platform. If it returns > 0, the app calls SDL_AppQuit and terminates with an exit code that reports success to the platform. If it returns 0, then SDL_AppIterate will be called again at some regular frequency. The platform may choose to run this more or less (perhaps less in the background, etc), or it might just call this function in a loop as fast as possible. You do not check the event queue in this function (SDL_AppEvent exists for that).

Next:

    int SDL_AppEvent(const SDL_Event *event);

This will be called once for each event pushed into the SDL queue. This may be called from any thread, and possibly in parallel to SDL_AppIterate. The fields in event do not need to be free'd (as you would normally need to do for SDL_EVENT_DROP_FILE, etc), and your app should not call SDL_PollEvent, SDL_PumpEvent, etc, as SDL will manage this for you. Return values are the same as from SDL_AppIterate(), so you can terminate in response to SDL_EVENT_QUIT, etc.

Finally:

    void SDL_AppQuit(void);

This is called once before terminating the app--assuming the app isn't being forcibly killed or crashed--as a last chance to clean up. After this returns, SDL will call SDL_Quit so the app doesn't have to (but it's safe for the app to call it, too). Process termination proceeds as if the app returned normally from main(), so atexit handles will run, if your platform supports that.

The app does not implement SDL_main if using this. To turn this on, define SDL_MAIN_USE_CALLBACKS before including SDL_main.h. Defines like SDL_MAIN_HANDLED and SDL_MAIN_NOIMPL are also respected for callbacks, if the app wants to do some sort of magic main implementation thing.

In theory, on most platforms these can be implemented in the app itself, but this saves some #ifdefs in the app and lets everyone struggle less against some platforms, and might be more efficient in the long run, too.

On some platforms, it's possible this is the only reasonable way to go, but we haven't actually hit one that 100% requires it yet (but we will, if we want to write a RetroArch backend, for example).

Using the callback entry points works on every platform, because on platforms that don't require them, we can fake them with a simple loop in an internal implementation of the usual SDL_main.

The primary way we expect people to write SDL apps is with SDL_main, and this is not intended to replace it. If the app chooses to use this, it just removes some platform-specific details they might have to otherwise manage, and maybe removes a barrier to entry on some future platform.

Fixes #6785.
Reference PR #8247.
2023-11-01 18:40:41 -04:00
Sam Lantinga
9323417e9c Fixed gendyapi.py parsing of SDL_RELEASE_GENERIC 2023-11-01 08:36:51 -07:00
Ryan C. Gordon
759cdf6159 audio: Fixed GetFirstAudioDeviceAdded().
It forgot to check for the type of device needed.
2023-11-01 00:39:51 -04:00
Ryan C. Gordon
0e614d9179 audio: Massive reworking on thread locking.
This cleans up a ton of race conditions, and starts moving towards something
we can use with Clang's -Wthread-safety (but that has a ways to go still).
2023-11-01 00:10:25 -04:00
Ryan C. Gordon
40fb76196c audio: Don't let simplified audio streams bind to new devices.
This can happen if you close the stream's underlying device directly, which
removes the binding but doesn't destroy the object.

In this case, the stream remains valid until destroyed, but still should not
be able to be bound to a new device.
2023-10-31 10:52:50 -04:00
Ryan C. Gordon
24e3328cca audio: Don't reset device ID counter on subsystem init/quit.
Otherwise you risk a buggy app holding an obsolete device ID that now refers
to a different device after reinit.
2023-10-31 10:50:37 -04:00
Anonymous Maarten
5d95cbde37 cmake: reset check state before testing -fobjc-arc 2023-10-30 21:14:39 +01:00
Anonymous Maarten
f18120c83c cmake: check -fobjc-arc compiler flag on Apple platforms 2023-10-30 19:59:28 +01:00
Anonymous Maarten
4aacc4b92e cmake: file(RELATIVE_PATH) needs 2 absolute paths 2023-10-30 19:50:35 +01:00
Ryan C. Gordon
dcc8805c21 testaudio: Fixed compiler warning on Visual Studio. 2023-10-30 13:09:56 -04:00
Ryan C. Gordon
9cb259e865 audio: Never SDL_PushEvent from anywhere but SDL_UpdateAudio().
Fixes some corner-case deadlocks.
2023-10-30 13:08:10 -04:00
Frank Praznik
875e45e70b wayland: Sanity check pointers and protocols before confining 2023-10-29 14:24:47 -04:00
Frank Praznik
0e87b71d08 wayland: Check the relative pointer handle before destroying
If the relative protocol is unsupported, this will always be null and the destroy function won't be called.
2023-10-29 14:15:23 -04:00
Anonymous Maarten
6127ac0871 Use SDL_DISABLE_ALLOCA instead of HAVE_ALLOCA in SDL_stdinc.h 2023-10-28 18:54:12 +02:00
Sam Lantinga
552bee47cb Clear any previous errors if we successfully show a message box 2023-10-27 10:11:23 -07:00
Sam Lantinga
343da852a6 Don't try to use the Wayland messagebox if we're not in Wayland
Also cleaned up some potential file handle leaks when querying the zenity version
2023-10-27 10:11:23 -07:00
Ryan C. Gordon
f63e9a8a3f wasapi: Handle disconnected devices that get reconnected.
The device ID strings don't change between connects, so we need to move the
old device object out of the way if it still exists as a zombie, and let
the reconnected device get itself a fresh object.
2023-10-27 01:30:27 -04:00
Ryan C. Gordon
5fa7b291d4 wasapi: Fixed memory leak if new audio devices fail to add. 2023-10-27 01:30:13 -04:00
Ryan C. Gordon
468c386686 wasapi: Handle disconnect notifications from the management thread, too.
These are also pretty heavyweight, don't do them from the notification
thread, which can deadlock everything.
2023-10-27 01:28:51 -04:00
Ryan C. Gordon
ce3be02b48 wasapi: If device is marked as a zombie, don't try to resuscitate it. 2023-10-27 01:27:22 -04:00
Ryan C. Gordon
85923049a6 wasapi: Patched to compile. 2023-10-26 23:09:11 -04:00
Ryan C. Gordon
9bec57309c wasapi: Proxy default device change handling to management thread.
This does a ton of work that can deadlock, because several crucial WASAPI
things that we want to do in response to this will block until the
notification callback has returned, so we can't call them from the handler
directly, or we'll be waiting until the thing that called us returns.
2023-10-26 23:03:27 -04:00
Ryan C. Gordon
c45b5121ce audio: Fixed potential race condition.
We need to check if the device is ready to close before releasing the lock,
in case other things are messing with the list of logical devices.
2023-10-26 23:03:27 -04:00
Sam Lantinga
8b6da3c701 Fixed making the EGL context current when resuming on Android
Make sure that we don't have the context cached as current on the current thread.
2023-10-26 17:07:40 -07:00
SDL Wiki Bot
2e9eb1073d Sync SDL3 wiki -> header 2023-10-26 18:23:13 +00:00
Ryan C. Gordon
e6116d399a mutex: Removed SDL_MUTEX_MAXWAIT.
Fixes #8436.
2023-10-26 14:21:53 -04:00
SDL Wiki Bot
82f48be3ef Sync SDL3 wiki -> header 2023-10-26 12:58:14 +00:00
Ryan C. Gordon
899eb0d042 thread: Locking mutexes and rwlocks are now void functions.
Almost nothing checks these return values, and there's no reason a valid
lock should fail to operate. The cases where a lock isn't valid (it's a
bogus pointer, it was previously destroyed, a thread is unlocking a lock it
doesn't own, etc) are undefined behavior and always were, and should be
treated as an application bug.

Reference Issue #8096.
2023-10-26 08:57:34 -04:00
Frank Praznik
082ef41566 alsa: Fix crash from invalid handle pointer
ALSA expects handles to be of type ALSA_Device, and passing the handle for the default device as a plain string causes a crash as it attempts to deference the string contents itself as a pointer to a string.

Create immutable static ALSA_Device structs for the default devices and pass those as the handles. They are not placed in the hotplug list, and the audio layer doesn't attempt to free ALSA handles, so there is no need to worry about them being erroneously freed.
2023-10-25 19:37:43 -04:00
Ozkan Sezer
a9aa15c792 CI: change FreeBSD CI runner to cross-platform-actions. 2023-10-26 01:03:40 +03:00
Sam Lantinga
23ceae94c9 Fixed Xbox 360 Controller support using libusb on Linux 2023-10-25 14:50:07 -07:00
Ryan C. Gordon
ace0c2c297 mutex: Fixed bug where generic SDL_TryLockMutex would incorrectly block.
Fixes #8433.
2023-10-25 13:03:46 -04:00
Sam Lantinga
f52b330ed8 Added support for the HP HyperX Clutch Gladiate controller 2023-10-25 09:00:26 -07:00
Ryan C. Gordon
b61706373c n3ds: Check that audio thread name starts with "SDLAudioP"
The string has a number after it, so a basic SDL_strcmp() will never match.

Reference PR #8346.

(cherry picked from commit cba6090398)
2023-10-24 23:58:30 -04:00
ds-sloth
6827b3331d n3ds systhread - use 80kb thread stack size as default, remove hard cap
(cherry picked from commit 3823ba1ded)
2023-10-24 23:57:12 -04:00
ds-sloth
e4cd1d4059 n3ds systhread - prefer to put audio thread on system core
(cherry picked from commit 301ee21f33)
2023-10-24 23:56:34 -04:00
ds-sloth
1023d8ec84 SDL_n3dsaudio.c - don't risk leaving current_priority uninitialized
(cherry picked from commit 6623c87d0b)
2023-10-24 23:48:53 -04:00
ds-sloth
07171be596 SDL_n3dsaudio.h: use triple buffering
(cherry picked from commit 070f57820f)
2023-10-24 23:48:17 -04:00
ds-sloth
6efe957159 SDL_n3dsaudio.c: separate mixer locks from audio device locks
(cherry picked from commit 62266dbd4f)

(SDL3 audio backends don't have the LockDevice interfaces, so this just
ended up being a comment.)
2023-10-24 23:47:13 -04:00
Sam Lantinga
39a961ba41 Added support for "%[]" sscanf syntax
Fixes https://github.com/libsdl-org/SDL/issues/8423
2023-10-24 17:28:15 -07:00
Sam Lantinga
124a0050b6 Fixed warning: no previous prototype for function 'SDL_UpdateAudio' 2023-10-24 14:22:41 -07:00
Ryan C. Gordon
b16165a33f rwlock: SDL_UnlockRWLock was incorrectly tagged with SDL_RELEASE_SHARED.
It needs to be SDL_RELEASE_GENERIC, because it releases both exclusive
(writer) and shared (reader) locks.

Without this fix, clang's `-Wthread-safety` tests generate incorrect warnings.

Reference Issue #8096.
2023-10-24 14:42:02 -04:00
Ryan C. Gordon
865dd04068 pulseaudio: Don't use a hash for device change detection.
Both strings are _right there_ for comparing, so we can just set a flag to
note the device definitely changed.

Also simplified string management further; hotplug thread now makes a copy
of the string before releasing the lock if there was a change event, so when
the lock releases further events don't see a NULL and assume it's a new
device, causing a lot of work to ripple out and decide nothing has changed,
until the system stabilizes again. Now, it just does the right thing once.
2023-10-24 00:36:30 -04:00
Sam Lantinga
b8cc51875a Fixed build 2023-10-23 19:36:14 -07:00
Sam Lantinga
0413e21e54 Fixed audio device removed events for ALSA
We don't match dev->name by string, since we might use the same string for both capture and output devices. Instead use the device pointer itself as the handle.

@icculus, are we guaranteed the device pointer is valid in ALSA_OpenDevice()?
2023-10-23 19:05:27 -07:00
Sam Lantinga
5ba03d377a Revert "Fixed audio device removed events for ALSA"
This reverts commit e57fef8f0b.

We actually need to match on a unique handle
2023-10-23 19:05:27 -07:00
Ryan C. Gordon
a774694be0 pulseaudio: Simplified default device change detection code.
This reduces allocations, simplifies some code, and makes it quick to decide
from the hotplug thread if there was _actually_ a device change.
2023-10-23 22:02:27 -04:00
Sam Lantinga
e57fef8f0b Fixed audio device removed events for ALSA 2023-10-23 18:42:48 -07:00
Sam Lantinga
4280d4b359 Fixed warning C4210: nonstandard extension used: function given file scope
Resurrected SDL_audio_c.h, we knew it would be back...
2023-10-23 17:04:14 -07:00
Ryan C. Gordon
182cfc3265 pulseaudio: Rework how we manage default devices and hotplug.
This fixes problems where Pulse callbacks don't fire in the order we expect,
or fail to fire at all, and avoids extra round trips to the Pulse server to
lookup information we could have trivially obtained already.

The end result is we would occasionally miss default device changes, etc, and
this resolves that better.
2023-10-23 19:17:50 -04:00
Ryan C. Gordon
b2ae1e835f pulseaudio: Change debug printf calls to use SDL_Log instead. 2023-10-23 19:17:49 -04:00
Sam Lantinga
38afd48daf Added a single source of SDL object IDs
This ensures that we don't accidentally interpret an ID from one system as an ID in another system.
Audio device IDs are not covered here, since they have a unique numbering system.
2023-10-23 10:49:37 -07:00
Sam Lantinga
e07f6c0a17 SDL_IsJoystickProductWheel() returns SDL_TRUE for Asetek wheelbases (thanks @IOBYTE!) 2023-10-23 10:42:36 -07:00
Sam Lantinga
c98a14fdeb Renamed display added/removed events for consistency with the rest of the API
Fixes https://github.com/libsdl-org/SDL/issues/8425
2023-10-23 09:14:54 -07:00
Sam Lantinga
c2a3112b6f Added "--substring" to the help for rename_symbols.py 2023-10-23 09:14:54 -07:00
Sam Lantinga
a844d90942 Add missing error reporting in Android_JNI_FileOpen()
Fixes https://github.com/libsdl-org/SDL/issues/8427
2023-10-23 08:27:57 -07:00
Ryan C. Gordon
4ac38d13dd alsa: Don't touch free'd memory in hotplug thread. 2023-10-23 00:59:40 -04:00
Ryan C. Gordon
43d41c9dcb audio: Another attempt to make device add/remove work vs event watchers.
This patch reverts the previous reversion, and then adds code to queue up
events to be sent the next time SDL pumps the event queue. This guarantees
that the event watcher/filter _never_ runs from an SDL audio device thread
or some other backend-specific internal thread.
2023-10-23 00:38:41 -04:00
Ryan C. Gordon
9abc692156 audio: Another attempt to deal with device destruction from device thread.
This only happens when closing a device from an event watcher, when the
device reports failure from its own thread.
2023-10-22 17:01:49 -04:00
Ryan C. Gordon
33c9eeec7c Revert "audio: Device threads don't increment physical device refcounts."
This reverts commit 76f81797b7.

This worked in the normal cases, but:

A device thread that calls SDL_DisconnectAudioDevice due to failure will fire
the disconnect event from the device thread...and if there's an event watcher
that uses that moment to close the device, we still end up in the same
situation, where the device thread tries to join on itself.

Better solutions are still pending.
2023-10-22 16:15:27 -04:00
Sam Lantinga
e5a15f94e2 Revert "Check to make sure the Windows joystick device has buttons and axes"
This reverts commit 642504bc59.

We have SDL_HINT_JOYSTICK_ROG_CHAKRAM to ignore or allow the ROG Chakram X mouse to be used as a joystick.

Fixes https://github.com/libsdl-org/SDL/issues/8227
2023-10-22 09:21:07 -07:00
Sam Lantinga
70fd8e2ba2 Lock joysticks when adding gamepad mappings
Fixes https://github.com/libsdl-org/SDL/issues/8412
2023-10-19 22:36:44 -07:00
Ryan C. Gordon
76f81797b7 audio: Device threads don't increment physical device refcounts.
Otherwise, they risk the device thread joining on itself.

Now we make sure the reference is held at the logical device level until
the physical device is closed, so it can't destroy the device in normal
usage until the thread is joined, etc.
2023-10-19 15:47:29 -04:00
SDL Wiki Bot
594fda4120 Sync SDL3 wiki -> header 2023-10-19 17:13:15 +00:00
Sam Lantinga
0d7c5a2c56 Updated Android API documentation 2023-10-19 10:12:34 -07:00
Sam Lantinga
0df888c584 Moved Android low latency audio behind a hint "SDL_ANDROID_LOW_LATENCY_AUDIO" 2023-10-19 08:54:11 -07:00
SDL Wiki Bot
142366c837 Sync SDL3 wiki -> header 2023-10-19 14:03:06 +00:00
Sam Lantinga
3a4c9d6990 Fixed build error when API logging is enabled 2023-10-18 22:30:16 -07:00
Sam Lantinga
1f8f82b379 Removed redundant thread-safety information 2023-10-18 22:19:50 -07:00
SDL Wiki Bot
a6edc75fe7 Sync SDL3 wiki -> header 2023-10-19 05:18:12 +00:00
Sam Lantinga
3c8edeb79b Clarified SDL property thread-safety information 2023-10-18 22:17:02 -07:00
SDL Wiki Bot
4fa821cb3e Sync SDL3 wiki -> header 2023-10-19 05:14:13 +00:00
Sam Lantinga
1c70760c0b Added thread-safety information for the new SDL properties API 2023-10-18 22:13:33 -07:00
Sam Lantinga
15533dce05 Cleaned up warnings from check_stdlib_usage.py 2023-10-18 21:38:14 -07:00
Ryan C. Gordon
bf269571fc jack: Removed FIXME comment that has since been fixed. 2023-10-18 15:47:01 -04:00
Ryan C. Gordon
797b70877d audio: Remove stub header SDL_audio_c.h.
It was a leftover, that just included SDL_sysaudio.h, in modern times.
2023-10-18 15:46:07 -04:00
Ryan C. Gordon
9d7c57234a audio: Cleaned out most remaining /* */ comments for // style.
Fully committing to it...!

This left SDL_wave.* alone for now, since there's a ton of comments in there
and this code hasn't changed much from SDL2 so far. But as SDL2 ages out a
little more, I'll likely switch this over, too.
2023-10-18 15:39:01 -04:00
Ryan C. Gordon
0ff67dc21b video: Fix compiler warning about SDL_ReadSurfacePixel not being declared.
(this was legal before, but the Android NDK wants to make sure we didn't mean
for this function to be marked `static` since it didn't have a formal
declaration before its definition and might only be used in the one source
file.)
2023-10-18 15:02:01 -04:00
Ryan C. Gordon
81c77396af opensles: Patched to compile. 2023-10-18 14:56:32 -04:00
Ryan C. Gordon
442e84916a opensles: Fixed capitalization to match other SDL backends. 2023-10-18 13:57:32 -04:00
Ryan C. Gordon
34914bfb49 alsa: Clean up device handles, now that hotplug thread cleanup is in place. 2023-10-18 13:53:42 -04:00
Sam Lantinga
48d80efb51 Fixed warning C4701: potentially uninitialized local variable 'props' used 2023-10-18 09:04:05 -07:00
Ozkan Sezer
f7dc63bcc3 audio: another windows wasapi build fix. 2023-10-18 18:32:00 +03:00
Ozkan Sezer
dd98330076 audio: fix windows wasapi build. 2023-10-18 18:20:00 +03:00
Ryan C. Gordon
7a52f7b3fd audio: Split Deinitialize into two stages.
First stage happens before we destroy objects, and is generally used to
shut down hotplug. The second stage is the usual deinit, which cleans up
the lowlevel API, unloads shared libraries, etc.
2023-10-18 10:43:45 -04:00
Ryan C. Gordon
e55e556f32 alsa: Fixed minor memory leak.
The default device handles aren't free'd anywhere, so don't strdup them;
everything else is managed by the hotplug thread, which does its own freeing.
2023-10-17 23:28:50 -04:00
Sam Lantinga
b45a0d9016 Updated the documentation for SDL_LoadWAV_RW() 2023-10-17 20:27:49 -07:00
Cameron Gutman
435e7ce663 Check for device disconnection in HIDAPI_JoystickOpen()
HIDAPI joystick drivers may call HIDAPI_JoystickDisconnected() in their
UpdateDevice() function during HIDAPI_JoystickOpen(). If they do this
today, the opened joystick will end up partially initialized (no name,
path, mapping GUID, etc.) because HIDAPI_GetDeviceByIndex() will no
longer be able to find the SDL_HIDAPI_Device for the removed joystick.

Worse still, joystick->hwdata->device becomes a dangling freed pointer
the next time HIDAPI_UpdateDeviceList() is called. This leads to a UAF
when the application or SDL calls SDL_JoystickClose() on this joystick.

Fix all this by checking if the device no longer has any associated
joysticks after calling UpdateDevice() and failing the open call if so.
2023-10-17 21:54:09 -05:00
Ryan C. Gordon
b733adb503 audio: Fix device refcounting vs ProvidesOwnCallbackThread backends. 2023-10-16 20:17:04 -04:00
Ryan C. Gordon
c6f08c2553 testaudio: Removed debugging code. 2023-10-16 15:25:34 -04:00
Ryan C. Gordon
d5dac0ad27 testaudio: Deal with a texture being unexpectedly NULL when scaling.
This happens to work because our current textures are all 128x128, but in
theory one shouldn't hit this case anyhow...right?!

Reference Issue #8344.
2023-10-16 14:03:58 -04:00
Ryan C. Gordon
b19e68c8ec testaudio: Properly display playback progress, regardless of data source. 2023-10-16 13:56:43 -04:00
Ryan C. Gordon
8c39269279 audio: Fix audio stream format when binding to a capture device.
Fixes #8402.
2023-10-16 13:34:40 -04:00
Ryan C. Gordon
f26b838a3e jack: Check for sample rate and buffer size changes from the server.
Reference Issue #8344.
2023-10-16 13:10:54 -04:00
Ryan C. Gordon
063cb0df6b audio: Fixed comment typo. "deref" should be "unref" 2023-10-16 13:09:55 -04:00
Ryan C. Gordon
354611a0c6 testaudio: Fixed some bugs Valgrind pointed out. 2023-10-16 10:04:02 -04:00
Ryan C. Gordon
a17f3ba916 audio: Reworked audio device disconnect management.
- No more tapdance to either join the audio device thread or have it detach
itself. Significant simplication of and fixes to the locking code to prevent
deadlocks.
- Physical devices now keep a refcount. Each logical device increments it,
as does the existence of a device thread, etc. Last unref destroys the
device and takes it out of the device_hash. Since there's a lot of moving
parts that might be holding a reference to a physical device, this seemed
like a safer way to protect the object.
- Disconnected devices now continue to function as zombie devices. Playback
devices will still consume data (and just throw it away), and capture devices
will continue to produce data (which always be silence). This helps apps
that don't handle disconnect events; the device still stops playing/capturing,
but bound audio streams will still consume data so they don't allocate more
data infinitely, and apps that depend on an audio callback firing regularly
to make progress won't hang.

Please note that disconnected audio devices must now be explicitly closed!
They always _should_ have been, but before this commit, SDL3 would destroy the
disconnected device for you (and manually closing afterwards was a safe no-op).

Reference Issue #8331.
Fixes #8386.

(and probably others).
2023-10-16 10:04:02 -04:00
Zhile Zhu
6ddd96a4d0 Fix some wrong gamepad/controller event enums 2023-10-16 08:35:54 -04:00
Ryan C. Gordon
8df68b4120 hashtable: Moved over to single-line comments. 2023-10-15 15:41:04 -04:00
Ryan C. Gordon
1c6d996108 testaudio: if the SDL_Renderer is already gone, don't destroy SDL_Textures. 2023-10-14 23:17:59 -04:00
Ryan C. Gordon
b22ffb9797 audio: Fix some logic errors in the new device hashtable code.
Fixes #8395.
2023-10-14 23:11:10 -04:00
Anonymous Maarten
e526dc64bd Don't set unused variable 2023-10-15 01:36:49 +02:00
Ryan C. Gordon
6664437748 hashtable: Don't rearrange bucket elements during SDL_FindInHashTable.
This is a race condition if the hashtable isn't protected by a mutex, and it
makes a read/write operation out of something what appears to be read-only,
which is dangerously surprising from an interface viewpoint.

The downside is that if you have an item that is frequently accessed that
isn't in the first slot of a bucket, each find operation will take longer
instead of common items bubbling to the front of the bucket. Then again,
if you have several common things being looked up in rotation, they'll just
be doing unnecessary shuffling here. In this case, it might be better to
just use a larger hashtable or a better hashing function (or just look up the
thing you need once instead of multiple times).

Fixes #8391.
2023-10-14 13:56:56 -04:00
Ryan C. Gordon
8ac5c84ad1 audio: device thread shouldn't touch thread_alive after object is free'd.
Reference Issue #8386.
2023-10-14 13:49:08 -04:00
Ryan C. Gordon
b17151eb16 testaudio: Don't crash if renderer is NULL (happens during shutdown). 2023-10-14 13:43:22 -04:00
Ryan C. Gordon
7f408e57ee audio: Keep all available devices in a hashtable instead of linked lists.
All devices are in a single hash, whether playback or capture, or physical
or logical. Lookups are keyed on device ID and map to either
`SDL_AudioDevice *` for physical devices or `SDL_LogicalAudioDevice *` for
logical devices (as an implementation detail, you can determine which object
type you have by checking a specific bit in the device ID).

This simplifies a bunch of code, makes some cases significantly more
efficient, and solves the problem of having to lock each physical
device while the device list rwlock is held to find logical devices by ID.

Device IDs hash perfectly evenly, too, being incrementing integers.
2023-10-14 13:34:42 -04:00
Ryan C. Gordon
0aba2c97db hashtable: SDL_IterateHashTable might as well provide both key and value.
And SDL_IterateHashTableKey is only necessary for stackable hashtables, since
non-stackable ones can either iterate each unique key/value pair with
SDL_IterateHashTable, or get a specific key/value pair by using
SDL_FindInHashTable.
2023-10-14 13:23:03 -04:00
Ryan C. Gordon
95a9271dbf audio: Never lock a device while holding the device_list_lock.
Fixes various not-necessarily-corner cases ending in deadlock.
2023-10-13 14:18:21 -04:00
kanjitalk755
9aeabb0b05 Fix macOS build error by #8269 2023-10-12 19:35:05 -07:00
Anonymous Maarten
382751c4b5 testffmpeg: print usage of options to change audio/video codec 2023-10-13 02:30:14 +02:00
Sam Lantinga
f91bde64d5 testffmpeg: Only enable blending if we're using a texture format that supports it 2023-10-12 14:26:46 -07:00
Sam Lantinga
516d6f9efc testffmpeg: added support for YUVA formats using swscale
Fixes https://github.com/libsdl-org/SDL/issues/8377
2023-10-12 14:10:25 -07:00
Ryan C. Gordon
ac71831350 Sync wiki -> headers 2023-10-12 15:20:53 -04:00
Sam Lantinga
d18f910248 testffmpeg: added the ability to specify audio and video codecs 2023-10-12 11:38:14 -07:00
Frank Praznik
72034b9a07 wayland: Fix primary selection handling when the protocol isn't supported
The primary selection protocol is optional, so the function pointers to the internal Wayland functions should only be set if the protocol is supported. This allows graceful fall-back to the generic SDL implementation in other cases.

Fixes the clipboard tests under Weston.
2023-10-12 12:32:27 -04:00
kanjitalk755
e152129787 Fixes #8190.
From #7249, reverted the hunks other than #7239.
2023-10-12 07:17:32 -07:00
Sam Lantinga
b79db0a6ea Fixed potential wraparound issue with property IDs 2023-10-12 06:22:34 -07:00
Anonymous Maarten
c9ccf0670c Add unsupported functions to dynapi 2023-10-12 14:00:47 +02:00
Anonymous Maarten
25ce87979d Always provide an implementation for all SDL3 symbols 2023-10-12 14:00:47 +02:00
Anonymous Maarten
3a36433a3c cmake: test -Wl,--version-script with minimal version script
Android ndk 26 errors when a symbol in the version script is not defined.
2023-10-12 14:00:47 +02:00
Anonymous Maarten
0efa196989 dynapi: implement SDL_DYNAPI_entry even when building SDL without dynapi support 2023-10-12 14:00:47 +02:00
Sam Lantinga
bf64fecf19 testffmpeg: allow resizing of the video window 2023-10-12 00:04:00 -07:00
Sam Lantinga
efa9a45048 Clarified that testffmpeg will resize the window to the video size 2023-10-11 23:38:08 -07:00
Sam Lantinga
4368f70ff9 Added properties to various SDL objects
The following objects now have properties that can be user modified:
* SDL_AudioStream
* SDL_Gamepad
* SDL_Joystick
* SDL_RWops
* SDL_Renderer
* SDL_Sensor
* SDL_Surface
* SDL_Texture
* SDL_Window
2023-10-11 22:38:00 -07:00
Sam Lantinga
973c8b3273 Added SDL properties API
Fixes https://github.com/libsdl-org/SDL/issues/7799
2023-10-11 22:38:00 -07:00
Ryan C. Gordon
2bca4671a6 audio: Allow audio streams to be created when the subsystem isn't initialized.
You are on your own to destroy them, though!
2023-10-11 22:43:53 -04:00
Anonymous Maarten
1ae33f6751 cmake: optionally install pdb's 2023-10-12 02:26:48 +02:00
Sam Lantinga
0d5cad91b1 We need audio converters initialized in SDL_InitAudio()
These are used separately from audio streams, e.g. SDL_OutputAudioThreadIterate(), so they should always be initialized when audio is initialized.
2023-10-11 15:11:34 -07:00
Ryan C. Gordon
1c3a0ade74 audio: Whoops, this stream format change is only for capture devices. 2023-10-11 15:11:20 -04:00
Ryan C. Gordon
10fab3a39e pulseaudio: Stop the threaded mainloop before destroying the context.
Otherwise, we might trigger an assertion in libpulse.

Reference Issue #8348.
2023-10-11 14:32:47 -04:00
Sam Lantinga
0b71898cb1 Make it clear that the string comparison isn't a boolean check 2023-10-11 10:18:12 -07:00
Sam Lantinga
6c8ad975c7 Like mutexes, operations on NULL rwlocks are no-ops
Fixes a crash when performing operations on a NULL rwlock before rwlock implementation is chosen
2023-10-11 09:49:44 -07:00
Sam Lantinga
c552cc6847 We don't require the audio system to be initialized for audio format conversion
This is helpful for tools pipelines where audio devices are never used.
2023-10-11 09:23:23 -07:00
Frank Praznik
9a5f7b17c6 Use SDL wrapped getenv function 2023-10-11 11:23:24 -04:00
Ryan C. Gordon
044046bc50 audio: Fixed assertions when capture devices have wrong audio formats.
Fixes #8376.
2023-10-11 10:37:28 -04:00
Ryan C. Gordon
bb2f767f5d testaudio: Make program usable without a 3-button mouse. 2023-10-11 10:02:07 -04:00
Ryan C. Gordon
321fc18417 README-migration.md: Added note about SDL_HasRDTSC removal.
Fixes #8374.
2023-10-11 01:20:18 -04:00
Ryan C. Gordon
82f54af617 x11: Properly check for XInput2 support before using it.
This specifically fixes a crash in X11_WarpMouseInternal if XInput2 was
missing at runtime, but also cleans up a few other existing checks.

Fixes #8378.
2023-10-11 01:01:07 -04:00
Sam Lantinga
b654427537 Added support for the PowerA Nintendo Switch Nano Wired Controller 2023-10-10 17:04:00 -07:00
Sam Lantinga
dc2a5f6ab2 Fixed error C2054: expected '(' to follow 'inline' 2023-10-10 16:38:12 -07:00
Sam Lantinga
a7ae1de9a6 Fixed warning C4028: formal parameter different from declaration 2023-10-10 16:37:17 -07:00
Sam Lantinga
3a47fb7208 The sensor and joystick instance ID generator isn't guarded by a lock. 2023-10-10 15:46:46 -07:00
Anonymous Maarten
aee4862958 ci: stop FreeBSD job after 30 minutes 2023-10-11 00:22:30 +02:00
Sam Lantinga
99fa0d6cae Disable low latency audio by default when using AAudio on Android
Some devices have flat sounding audio when low latency mode is enabled. In particular this was reported on the Samsung SM-T290 running Android 11.
2023-10-10 15:17:58 -07:00
Anonymous Maarten
ebfbd7327b testffmpeg: use SDL_test to parse arguments and track memory 2023-10-10 21:58:10 +02:00
Anonymous Maarten
ee53e4d319 cmake: check ffmpeg capability instead of version 2023-10-10 21:58:10 +02:00
Sam Lantinga
2d62c65a75 Fixed build warning 2023-10-10 12:37:38 -07:00
Simon McVittie
bf72704bfd audio: Disable NEON sample conversion until test failures are fixed
We need to do this early in the file, so that it will be taken into
account when deciding whether to define NEED_SCALAR_CONVERTER_FALLBACKS
and therefore provide a non-SIMD fallback.

Mitigates: https://github.com/libsdl-org/SDL/issues/8352
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-10-10 13:12:55 -04:00
Ryan C. Gordon
0fe95cfba3 Sync wiki -> header 2023-10-10 10:49:24 -04:00
Sam Lantinga
adcace6f95 Added a "--software" option to testffmpeg
This allows easy performance comparison between hardware and software decoding
2023-10-10 04:07:22 -07:00
Ozkan Sezer
86ada8a9f0 fix testffmpeg.c build. 2023-10-10 14:02:40 +03:00
Sam Lantinga
303f4e965c testffmpeg works with ffmpeg 5.1.3 and newer 2023-10-10 03:58:57 -07:00
Sam Lantinga
2bd478ae65 Added SDL_GetTextureDXGIResource() to get the DXGI resource associated with a render texture.
Also switched the D3D11 and D3D12 renderers to use real NV12 textures for NV12 data.

The combination of these two changes allows us to implement 0-copy video decode and playback for D3D11 in testffmpeg without any access to the renderer internals.
2023-10-10 03:32:46 -07:00
Sam Lantinga
a842446f62 Added support for 0-copy decode and display using D3D11
FIXME: We need a way to do this that doesn't involve reaching into the D3D11 texture internals
2023-10-10 03:32:46 -07:00
Sam Lantinga
d830cd140b Added support for 0-copy decode and display using Apple VideoToolbox 2023-10-10 03:32:46 -07:00
Sam Lantinga
1bf913b29a Added support for 0-copy decode and display using VAAPI and EGL 2023-10-10 03:32:46 -07:00
Sam Lantinga
ce8161e0cf Make sure we're building with ffmpeg 6.0 or newer 2023-10-10 03:32:46 -07:00
Sam Lantinga
ed6381b68d Allow setting any number of sprites over the video
Default to no sprites over the video
2023-10-10 03:32:46 -07:00
Anonymous Maarten
ebf5e08fa1 cmake: use *_STATIC_* variables when linking to a static ffmpeg 2023-10-10 03:32:46 -07:00
Sam Lantinga
88f2fb9dcf Added an example of video decoding with ffmpeg 2023-10-10 03:32:46 -07:00
Simon McVittie
d88bf687a8 surface: Document the in-memory layout of the pixels
I don't think we ever explicitly said this.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-10-10 03:24:43 -07:00
Simon McVittie
3698630bbc pixels: Document the naming convention
Whenever I have to fix something endianness-related, I always get
confused about whether the byte-oriented format that guarantees to put
red in byte 0 is RGBA8888 or RGBA32. (The answer is that it's RGBA32.)

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-10-10 03:24:43 -07:00
Simon McVittie
04edb38cdf shape: Use SDL[Test]_ReadSurfacePixel
This avoids assuming that the pixels are suitably aligned for direct
access, which there's no guarantee that they are; in particular,
3-bytes-per-pixel RGB images are likely to have 3 out of 4 pixels
misaligned. On x86, dereferencing a misaligned pointer does what you
would expect, but on other architectures it's undefined whether it will
work, crash with SIGBUS, or silently give a wrong answer.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-10-10 03:23:20 -07:00
Simon McVittie
f5745c3a67 surface: Add a private SDL_ReadSurfacePixel
This shares its implementation with SDLTest_ReadSurfacePixel: the same
code is compiled twice, to get it into the static test library and also
the public shared library.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-10-10 03:23:20 -07:00
Simon McVittie
0d68f45879 test: Extract SDLTest_ReadSurfacePixel
This is essentially the same as was added in d95d2d70, but with clearer
error handling. It's implemented in a private header file so that it
can be shared with SDL_shape, which also wants this functionality.

Resolves: https://github.com/libsdl-org/SDL/issues/8319
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-10-10 03:23:20 -07:00
Ryan C. Gordon
55a1458ed0 audio: Changes to one logical device must update all sibling logical devices.
Fixes #8226.
2023-10-09 20:28:58 -04:00
Ryan C. Gordon
8e03ea4383 hashtable: Use Create/Destroy naming, in the SDL3 style. 2023-10-09 19:20:43 -04:00
Ryan C. Gordon
568902b64e hashtable: Added src/SDL_hashtable.[ch].
Reference Issue #7799.
2023-10-09 19:19:01 -04:00
Ryan C. Gordon
8745a9949b add-source-to-projects.pl: Fix adding files in the base src dir. 2023-10-09 19:19:01 -04:00
Frank Praznik
836927edf8 wayland: Try to skip the Wayland driver if not connecting to or in a Wayland session
When initializing the Wayland driver, check if the application is being started in, or trying to connect to, a Wayland session and skip to another driver if not. If neither WAYLAND_DISPLAY nor XDG_SESSION_TYPE are set, try to start anyway, and if the Wayland library is missing or no Wayland sessions are started, initialization will fail later in the process as it previously did.

This fixes the case where a Wayland session is running on a different VT, but an application wishes to run via KMSDRM on the current VT.
2023-10-09 12:47:11 -04:00
Etaash Mathamsetty
2a9480c815 wayland: Add null check for zenity version string 2023-10-06 14:51:55 -07:00
Mathieu Eyraud
f30392da5b Fix assertion in LINUX_JoystickSetSensorsEnabled()
Calling LINUX_JoystickSetSensorsEnabled() after the joystick is unplugged will trigger this assertion.
2023-10-05 13:06:48 -07:00
Simon McVittie
4e59bf6cb9 SDLTest_CompareSurfaces: Output RGBA values of first differing pixel
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-10-05 15:10:32 +02:00
Simon McVittie
b2ddfbbec3 SDLTest_CompareSurfaces: If surfaces differ, log their formats
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-10-05 15:10:32 +02:00
Simon McVittie
b028fd9604 SDLTest_CompareSurfaces: Log better messages if NULL or different sizes
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-10-05 15:10:32 +02:00
Anonymous Maarten
183606d3d4 testdrawchessboard: clean up renderer and window 2023-10-05 13:41:01 +02:00
Anonymous Maarten
4f0642bf47 triangle: don't read destination pixel when you're going to discard it anyways 2023-10-05 13:40:09 +02:00
Anonymous Maarten
4cd0c13823 blit_slow: don't read destination pixel when you're going to discard it anyways 2023-10-04 19:41:50 -07:00
Ryan C. Gordon
49abb9c1fa aaudio: Fixed a comment. 2023-10-04 14:06:28 -04:00
Mathieu Eyraud
0eb8651d5e Do not report gyro/accelerometer if we can't read axes info 2023-10-04 08:43:39 -07:00
Ryan C. Gordon
ff57867516 audio: Fixed copy/paste error that was checking wrong variable.
Fixes #8342.
2023-10-03 14:58:24 -04:00
Ryan C. Gordon
d2d4914ac3 audio: WaitDevice/WaitCaptureDevice now returns a result.
This is an attempt to centralize all the error handling, instead of
implicitly counting on WaitDevice implementations to disconnect the device
to report an error.
2023-10-03 10:35:18 -04:00
Ryan C. Gordon
a0820ed833 directsound: Cleaned up WaitDevice.
This should retry until GetCurrentPosition succeeds. Otherwise, we would be
going on to the next iteration too soon.

Also generally streamlined the code while I was in here.
2023-10-03 10:18:16 -04:00
Ryan C. Gordon
6c33a05bdb audio: Removed unused AllowsArbitraryDeviceNames variable. 2023-10-02 23:07:00 -04:00
Ryan C. Gordon
f1fc198278 audio: Destroy the logical audio device before sending DEVICE_REMOVED event.
This prevents catastrophe if someone tries to close the device in an event
filter in response to the event.

Note that this means SDL_GetAudioStreamDevice() for any stream on this
device will return 0 during the event filter!

Fixes #8331.
2023-10-02 22:12:28 -04:00
Frank Praznik
64ec208479 Fix log message spelling 2023-10-02 19:47:39 -04:00
Frank Praznik
9111c5e178 tests: Disable mouse warp test under Wayland
Wayland does not allow warping the mouse pointer, thus these tests are unreliable and should be skipped.
2023-10-02 19:44:02 -04:00
Ryan C. Gordon
de5068f4e4 audio: Commented out a currently-incorrect assert.
Fixes #8326.
2023-10-02 19:41:48 -04:00
Anonymous Maarten
3abb464f10 ci: disable Intel compilers 2023-10-02 09:13:35 +02:00
Sam Lantinga
251f8fa272 Revert "Do a better job of finding default ALSA devices"
This reverts commit d65861f049.

The default device is the one with the name "default"
2023-10-01 08:49:51 -07:00
Sam Lantinga
8857b0f13a Use the device audio format for the lowest latency 2023-09-30 16:24:49 -07:00
Sam Lantinga
806e11ac00 Update sample processing bookkeeping when recovering the AAudio audio device 2023-09-30 15:04:21 -07:00
Ryan C. Gordon
482c238953 aaudio: Deal with device recovery.
Android claims to work with multiple devices, but doesn't actually appear to
(at least, afaict), and it will report tons of devices that all just seem
to play to the current default output, so for now, turn this off and only
expose a default device.

And then, with that default output, attempt to recover on errors by throwing
away the current AAudioStream and building a new one.

This let me plug/unplug a set of headphones from the headphone jack and audio
would switch correctly to the new output.
2023-09-30 16:41:31 -04:00
Ryan C. Gordon
a8813b58a6 aaudio: Change an int to an SDL_bool. 2023-09-30 16:41:31 -04:00
Sam Lantinga
8923305f34 We don't need to wait a full 10 ms, just delay a bit 2023-09-30 12:14:09 -07:00
Sam Lantinga
6a152676bb Wait a bit when snd_pcm_avail() returns 0
The hardware might report that it's ready and still need a bit of time to start processing samples
2023-09-30 10:48:44 -07:00
Ryan C. Gordon
b4372de186 alsa: Cleaned up remaining debug logging. 2023-09-30 12:35:46 -04:00
Ryan C. Gordon
a063c943dc pulseaudio: Use pa_stream_begin_write to avoid an extra buffer copy. 2023-09-30 12:31:45 -04:00
Ryan C. Gordon
0471a93706 alsa: Simplified PlayDevice and CaptureFromDevice. 2023-09-30 12:23:28 -04:00
Ryan C. Gordon
776d9d0ee3 alsa: Convert /* */ comments to // comments. 2023-09-30 12:02:51 -04:00
Ryan C. Gordon
64fee85c69 alsa: More efficient audio thread iteration.
Now we sleep the thread in WaitDevice until ALSA reawakens it because it
needs more data, and we feed it exactly as much as it can take at that
point.

Like the recent PulseAudio changes, this is both more efficient, reliable,
and consistent.
2023-09-30 11:52:50 -04:00
Ozkan Sezer
47cba08259 VisualC/pkg-support/cmake: remove subdir from public header include path 2023-09-30 14:33:02 +03:00
Ryan C. Gordon
61e9a9dd56 pulseaudio: Just feed the device whenever it asks for any amount of data.
In practice, this seems to buffer a little upfront and then gives a pretty
consistent request flow after that of 1/4 of the requested buffer size without
variation, which is significantly better than the previous code that would
vary a little each frame.

Plus, as long as the device asks for _anything_, we won't block forever, and
if it asks for more than our expected buffer size, we'll run multiple times
to satisfy it, so this is likely more robust against dropouts in general, too.
2023-09-29 22:34:11 -04:00
Ryan C. Gordon
4f76f9b0a7 pulseaudio: Use correct buffer size of stream, wait less between fills.
The wait approach is still wonky, but this fixes the hangs on bluetooth
devices for now.
2023-09-29 22:14:54 -04:00
Simon McVittie
d95d2d7051 SDLTest_CompareSurfaces: Decode pixels correctly on big-endian platforms
Previously, if acting on a surface with less than 32 bits per pixel,
this code was placing the pixel value from the surface in the first
few bytes of the Uint32 to be decoded, and unrelated data from a
subsequent pixel in the remaining bytes.

Because SDL_GetRGBA takes the bits to be decoded from the
least-significant bits of the given value, ignoring the higher-order
bits if any, this happened to be correct on little-endian platforms,
where the first few bytes store the least-significant bits of an
integer.

However, it was incorrect on big-endian, where the first few bytes are
the most-significant bits of an integer.

The previous implementation also assumed that unaligned access to a
32-bit quantity is possible, which is not the case on all CPUs (but
happens to be true on x86).

These issues were not discovered until now because
SDLTest_CompareSurfaces() is only used in testautomation, which until
recently was not being run routinely at build-time, because it contained
other assumptions that can fail in an autobuilder or CI environment.

Resolves: https://github.com/libsdl-org/SDL/issues/8315
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-09-29 06:55:17 -07:00
Sam Lantinga
d65861f049 Do a better job of finding default ALSA devices 2023-09-28 21:25:11 -07:00
Sam Lantinga
ba65ef5ce7 Recover from -EPIPE in snd_pcm_avail() 2023-09-28 20:16:59 -07:00
Anonymous Maarten
5be5000fa1 cmake: make HEADERS_DIR a required argument of SDL_generate_manpages 2023-09-29 03:42:33 +02:00
Anonymous Maarten
5c1a91a4e1 ci: make sure perl is installed + build docs with MSVC toolchain 2023-09-28 23:32:35 +02:00
Simon McVittie
6248472c0c test: Accept small numerical differences in more mathematical tests
We can't rely on irrational numbers like pi being represented exactly,
particularly when compiling for i386, where the i387 floating-point
interface carries out calculations in registers that have higher
precision than the actual double-precision variable. The 1980s were a
strange time.

Resolves: https://github.com/libsdl-org/SDL/issues/8311
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-09-28 09:37:12 -07:00
Ryan C. Gordon
a2c5dc6507 pulseaudio: Added typedef needed for compat with ancient Pulse installs. 2023-09-28 12:10:16 -04:00
Ryan C. Gordon
f24551f6d1 pulseaudio: More workarounds for extremely old Pulse installs. 2023-09-28 11:53:00 -04:00
Ryan C. Gordon
441a5b707b audio: Adjusted const/static fields on some variables. 2023-09-28 10:24:42 -04:00
Ryan C. Gordon
280c2c1d7d pulseaudio: Revert "pulseaudio: Require PulseAudio 5.0 or later for SDL3."
This reverts commit 6fd0613ac8.

Turns out that the Steam Runtime is still on PulseAudio 1.1, and the only
thing we (currently) need a newer Pulse for is pa_threaded_mainloop_set_name,
so let's just go back to treating that symbol as optional.

We might need to force a higher version at some point, but it's not worth it
over this.
2023-09-28 10:19:24 -04:00
Ryan C. Gordon
4db2b968af audio: simple-copy path should check if device is paused.
Otherwise, we get into situations where all bound streams need to change
their output formats when a device pauses...and it makes the fast case
slow: when pausing a single input, it needs to silence and then convert a
silent buffer, instead of just zeroing out the device buffer and being done.
2023-09-27 16:24:33 -04:00
Ryan C. Gordon
505dc4c39c wasapi: Deal with device failures when we aren't holding the device lock.
Since these get proxied to a different thread, if we wait for that thread
to finish while holding the lock, and the management thread _also_ requests
the lock, we're screwed.

WaitDevice never holds the lock by design, so just mark devices as failed
and clean up or recover them in there.
2023-09-27 14:33:09 -04:00
Sam Lantinga
ea5f59c234 Removed unused code
It looks like we don't need to watch for hanging writes now that we're using the callback mechanism.
2023-09-27 10:18:34 -07:00
Sam Lantinga
a6854098f7 Fixed stuttering on Android when using the AAudio driver
The audio processing thread isn't scheduled in lock-step with the audio callback so sometimes the callback would consume the same data twice and sometimes the audio processing thread would write to the same buffer twice.

Also handle variable sizes in the audio callback so the Android audio system doesn't have to do additional buffering to match our buffer size requirements.
2023-09-27 10:18:34 -07:00
Ryan C. Gordon
a5175e5ed0 audio: Fixed bug when setting up mixing formats.
Reference Issue #8226.
2023-09-27 11:50:23 -04:00
Frank Praznik
9667aa18e6 wayland: Check that the data device supports the release method before calling it 2023-09-26 11:22:33 -04:00
Frank Praznik
4454dc400b wayland: Null all Wayland manager objects after freeing 2023-09-26 11:22:33 -04:00
Ryan C. Gordon
e1789b320e video: Streamline a little deinit code.
Fixes #8290.
2023-09-25 16:26:14 -04:00
Frank Praznik
2a1058713c Bump libdecor feature check to look for 0.2.0
The version of libdecor tagged with support for the suspended event and min/max getters is 0.2.0, so update the checks to reflect this.
2023-09-25 12:07:54 -04:00
Anonymous Maarten
f5886f11d0 cmake: let every test depends on pretest 2023-09-25 18:02:40 +02:00
Anonymous Maarten
f45761908a Move check for SDL_Delay upper bounds to testtimer 2023-09-25 18:02:40 +02:00
Anonymous Maarten
a84389f6bb libm: use union for infinity 2023-09-25 18:02:40 +02:00
Anonymous Maarten
474c8d0073 testautomation: don't do float equality tests 2023-09-25 18:02:40 +02:00
Anonymous Maarten
a6bc6b882c ci: always upload the artifacts 2023-09-25 18:02:40 +02:00
Anonymous Maarten
85e3099ba4 testautomation: only require accelated renderer with non-dummy video driver 2023-09-25 18:02:40 +02:00
Anonymous Maarten
26fd231151 ci: run tests on msvc workflow
No tests were run, because the top CMakeLists.txt was not doing enable-testing().
2023-09-25 18:02:40 +02:00
Anonymous Maarten
0e955a9127 cmake: run testautomation with CTest 2023-09-25 18:02:40 +02:00
Sam Lantinga
1375d2049d SDL_iconv_string() defaults to UTF-8
Fixes https://github.com/libsdl-org/SDL/issues/8287
2023-09-24 17:27:23 -07:00
Sam Lantinga
70a1bc6973 Check for NULL before dereferencing newly allocated memory
Fixes https://github.com/libsdl-org/SDL/issues/8289
2023-09-24 17:17:49 -07:00
Frank Praznik
752f14e5a6 wayland: Convert some memcpy calls to copyp 2023-09-24 11:44:35 -04:00
Frank Praznik
9284a03053 wayland: Remove some unnecessary helper functions 2023-09-24 11:44:35 -04:00
Ryan C. Gordon
399bc709b7 build-scripts.pl: Added add-source-to-projects.pl
This insert files to the Xcode and Visual Studio projects, so you can add
sources to the build without having to find a Mac or Windows machine with
the appropriate tools installed, and manually update four different sets of
projects across them.

This doesn't touch CMake, but you can add files to that with a text editor
(hopefully) without drama.

This, like all Perl code, is fragile. Report bugs and don't push it too hard.
2023-09-22 23:08:46 -04:00
Ryan C. Gordon
ac68271871 Visual-WinRT: dos2unix the project files to match other Visual Studio targets. 2023-09-22 23:08:46 -04:00
Sam Lantinga
34719cba96 Fixed crash in hid_init() if the HIDDeviceManager isn't available 2023-09-22 10:14:16 -07:00
Sam Lantinga
2e92e94ebb Make sure we update device->sample_frames in SDL_AudioDeviceFormatChangedAlreadyLocked()
WASAPI_GetDeviceBuf() will fail if we don't request the correct buffer size
2023-09-21 11:32:37 -07:00
Frank Praznik
9964e5c5b0 wayland: Don't retrieve the drag offer strings with every pointer motion event
Querying the drag offer with every pointer movement would require refactoring to work with the portal implementation, however, there is little point, as the event layer just discards the file name. Remove the existing code and note that a new implementation is needed if the name ever starts to be passed though.

In the event that this is reimplemented, it should cache the filenames, as otherwise, this could potentially hammer the DBus interface hundreds or even thousands of times per second.
2023-09-21 14:05:16 -04:00
Sam Lantinga
bac7eeaaae Added missing include 2023-09-20 14:13:50 -07:00
Ryan C. Gordon
a541e2ac10 audio: Change a few SDL_memcpy calls to SDL_copyp. 2023-09-20 17:02:44 -04:00
Ryan C. Gordon
54125c1408 audio: Only update bound audiostreams' formats when necessary.
Saves locks and copies during audio thread iteration. We've added asserts
that can evaporate out in release mode to make sure everything stays in sync.
2023-09-20 17:02:44 -04:00
Ryan C. Gordon
e0b0f9a36e testaudio: Fix mouseover testing.
Not sure how this line got lost.
2023-09-20 17:02:44 -04:00
Frank Praznik
2f3deec245 wayland: Don't process drag & drop events from surfaces not owned by SDL
Libdecor creates subsurfaces of the primary SDL surface, but events from these surfaces should be ignored, or applications will get drag & drop events when dragged over drop shadows and such.
2023-09-20 15:00:40 -04:00
Frank Praznik
42bdced05d events: Log file drop position events and print the pointer coordinates 2023-09-20 15:00:40 -04:00
Frank Praznik
c10d93d3a0 wayland: Replace magic constant with define 2023-09-20 15:00:40 -04:00
Ryan C. Gordon
5008521538 emscripten: Restore compatibility with existing emsdk releases. 2023-09-20 14:32:41 -04:00
Jaswant Panchumarti
953b55dd6d Use EM_ASM_PTR when the return value is a pointer
- closes https://github.com/libsdl-org/SDL/issues/8241
2023-09-20 14:25:35 -04:00
Ryan C. Gordon
a4541a255e audio: SDL_GetAudioStreamQueued now returns bytes, not frames.
Reference #8266.
2023-09-20 14:15:47 -04:00
Ryan C. Gordon
703aefbce0 Sync SDL3 wiki -> header 2023-09-20 14:08:32 -04:00
Colin Kinloch
99421b64d0 linux: Add portal drag and drop 2023-09-20 11:41:48 -04:00
Michael Bradshaw
952c5059b5 Remove stray Â
Presumably this is an accidental character due to the copyright symbol and conversion to/from different encodings. The *.c file does not have this character.
2023-09-20 08:32:53 -07:00
Simon McVittie
eebd5d18a2 linux: Handle upower's UP_DEVICE_STATE_PENDING_CHARGE, PENDING_DISCHARGE
On my laptop, the battery is configured to stop charging at around 80%
most of the time, to increase the overall useful lifetime of the battery.
When in that state, upower reports UP_DEVICE_STATE_PENDING_CHARGE
(numeric value 5), which SDL previously mapped to SDL_POWERSTATE_UNKNOWN.
This made the platform_testGetPowerInfo automated test fail, because
it assumes that SDL_POWERSTATE_UNKNOWN means no battery is connected,
and does not expect to see a percentage.

Map UP_DEVICE_STATE_PENDING_CHARGE (5) to SDL_POWERSTATE_CHARGED, which
seems close enough.

Also map UP_DEVICE_STATE_PENDING_DISCHARGE (6) to
SDL_POWERSTATE_ON_BATTERY, which matches how at least GNOME presents it.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-09-20 08:32:03 -07:00
Ryan C. Gordon
f8fdb20d8f audio: Destroy all existing SDL_AudioStreams on shutdown. 2023-09-20 10:47:11 -04:00
Ryan C. Gordon
62d4459972 audio: Removed declarations of functions that don't exist anymore. 2023-09-20 10:21:03 -04:00
Ryan C. Gordon
b656720bc6 loopwave: Use SDL_GetAudioStreamQueued() for more accurate results. 2023-09-20 10:15:03 -04:00
Ryan C. Gordon
34b931f7eb audio: Added SDL_GetAudioStreamQueued 2023-09-20 10:15:03 -04:00
Ryan C. Gordon
23206b9e3f audio: Added SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED
This fires if an opened device changes formats (which it can on Windows,
if the user changes this in the system control panel, and WASAPI can
report), or if a default device migrates to new hardware and the format
doesn't match.

This will fire for all logical devices on a physical device (and if it's
a format change and not a default device change, it'll fire for the
physical device too, but that's honestly not that useful and might change).

Fixes #8267.
2023-09-20 10:12:10 -04:00
Ryan C. Gordon
c7e6d7a1f7 audio: Changed debug logging output.
("preconverted bytes" makes it sounds like we already converted them before
the call instead of "bytes that haven't yet hit the stage where we convert
them. Just dump the wording completely.)
2023-09-20 10:04:23 -04:00
Ryan C. Gordon
87ec6acf2d audio: Added a FIXME 2023-09-20 10:04:19 -04:00
Ryan C. Gordon
ac88ffb7ea audio: don't allocate buffer in SDL_SetAudioPostmixCallback for NULL callback. 2023-09-20 10:03:02 -04:00
Ryan C. Gordon
2a950f6ae6 audio: Replace some SDL_memcpy calls with SDL_copyp. 2023-09-20 10:01:52 -04:00
Ryan C. Gordon
0dc0434a3e audio: Fixed race condition in subsystem shutdown.
This makes sure new devices can't be created when we're in the process of
shutting down.
2023-09-20 10:00:44 -04:00
Ryan C. Gordon
23f60203a3 audio: precalculate if we can use simple copies instead of the full mixer.
This just saves a bunch of conditionals (and an atomic get!) per iteration
of the audio thread.
2023-09-20 09:58:27 -04:00
Ryan C. Gordon
36b0f11414 audio: Optimize setting device formats during audio thread iteration.
The API entry point does a ton of unnecessary validation just to eventually
do a memcpy().
2023-09-20 09:09:15 -04:00
Anonymous Maarten
4c3e84897f testspriteminimal: make standalone by embedding icon.bmp 2023-09-19 17:58:25 +02:00
Anonymous Maarten
2a01f9dcb5 tests: plug leaks when running with --trackmem
(using SDL_VIDEO_DRIVER=x11/wayland on Linux)
2023-09-19 17:58:25 +02:00
Anonymous Maarten
f42bbeca24 SDL_test: track stack frames of allocations on Windows 2023-09-19 17:58:25 +02:00
Anonymous Maarten
12c0be028e SDL_test: clear text cache on exit event 2023-09-19 17:58:25 +02:00
Anonymous Maarten
b4bfb18318 SDL_test: free state before logging allocations 2023-09-19 17:58:25 +02:00
Anonymous Maarten
248b1edd3f SDL_test: destroy windows in SDL_CommonQuit
Not destroying the windows, caused a leak in checkkeys when
exiting by clicking somewhere in the window:
Allocation 0: 8 bytes
	0x7f46f56d2fe8: SDL_realloc_REAL+0x3d
	0x7f46f565deb7: GetMouseInputSource+0x88
	0x7f46f565e07b: SDL_PrivateSendMouseButton+0x56
	0x7f46f565e5aa: SDL_SendMouseButton+0x44
	0x7f46f57fb0a4: pointer_handle_button_common+0x1bb
	0x7f46f57fb0f3: pointer_handle_button+0x41
	0x7f46f5123be6: ffi_prep_go_closure+0x2c6
	0x7f46f51204bf: SDL_InitSubSystem+0x19
	0x7f46f512318e: ffi_call+0x12e
2023-09-19 17:58:25 +02:00
Anonymous Maarten
98da2dd303 SDL_test: don't warn about expected allocations when running with --trackmem
Since 9f4baeea53, the TLS storage is cleaned up when running SDL_Quit().
2023-09-19 17:58:25 +02:00
Sam Lantinga
6a381567b0 Support audio rate conversion up to 384KHz 2023-09-18 22:21:54 -07:00
Sam Lantinga
b2b548a1fc Don't hang if IAudioRenderClient_GetBuffer() fails indefinitely 2023-09-18 20:55:28 -07:00
Sam Lantinga
a3a5e17282 Fixed build warning '=': conversion from 'Uint32' to 'Uint16', possible loss of data 2023-09-18 13:56:51 -07:00
Sam Lantinga
6d3e21c27c Fixed android build warnings 2023-09-18 13:22:15 -07:00
Sam Lantinga
fca2f53189 Fixed warning: this function declaration is not a prototype 2023-09-18 13:09:28 -07:00
Sam Lantinga
a72dfa6a5f Fixed sensor timestamp units for third-party PS5 controllers 2023-09-18 12:55:43 -07:00
Sam Lantinga
f6756047a4 Fixed error: array subscript 2 is above array bounds of ‘const Uint8[2]’
Smart compilers don't like dereferencing off the end of arrays
2023-09-18 12:19:18 -07:00
Sam Lantinga
7059a55ccc Fixed sensor timestamp calculation for third-party PS5 controllers 2023-09-18 11:50:56 -07:00
Sam Lantinga
c0443e5d12 Fixed crash in SDL_IMMDevice_FindByDevID()
Either devid or handle->immdevice_id was NULL, crashing SDL_wcscmp()
2023-09-18 09:47:57 -07:00
Sam Lantinga
fde8499f69 Use around 20ms for the audio buffer size
This value is well tested in production software. Larger values introduce audio latency and smaller values cause underflows on many setups.
2023-09-18 09:25:56 -07:00
Frank Praznik
e5739d7d1f video: Remove SDL_GetFocusWindow()
It was rarely used and performed an identical function to SDL_GetKeyboardFocus(), but with worse time complexity.
2023-09-18 11:14:42 -04:00
Mathieu Eyraud
39c2f97373 Fix NULL dereference in SDL_OpenAudio 2023-09-18 09:44:59 -04:00
Sam Lantinga
9a23d0e3f6 Added new audio files to the Xcode project 2023-09-17 13:16:19 -07:00
Brick
a62e62f97a Refactored SDL_audiocvt.c 2023-09-17 13:13:23 -07:00
Ryan C. Gordon
31229fd47f include: Added a note about SDL's iOS app delegate functions.
Fixes #8250.
2023-09-15 09:50:24 -04:00
Guldoman
65aaf3a9ab x11: Always update clipboard owner
This allows utilities like clipboard managers to keep track of the 
changes.
2023-09-15 05:21:14 -07:00
Sam Lantinga
f622f21e6f Fixed build 2023-09-15 05:17:33 -07:00
Sam Lantinga
5774c9638c Prefer hidraw over libusb when libusb whitelisting is not enabled
Since opening devices via libusb will unbind them from other drivers, we will either whitelist specific devices that we want to support via libusb or we will prefer other drivers over libusb.
2023-09-15 05:14:26 -07:00
Sam Lantinga
9301f7ace2 hidapi/libusb: only enumerate each interface once
If a device has multiple altsettings, like an Xbox Series X controller, make sure we only enumerate each interface once, not once for each altsetting.
2023-09-15 05:07:05 -07:00
Sam Lantinga
859dc14add Replaced SDL_GetGamepadBindForAxis() and SDL_GetGamepadBindForButton() with SDL_GetGamepadBindings() 2023-09-13 23:01:28 -07:00
Sam Lantinga
9e50048ab6 Revert "Removed SDL_GamepadBinding from the API"
This reverts commit eb0955ef89.
2023-09-13 22:42:47 -07:00
Sam Lantinga
9f17d1a9d8 Don't reference the same function in "see also" 2023-09-13 11:01:00 -07:00
Ozkan Sezer
86505ea630 fix SDL_AudioStreamCallback documentation 2023-09-13 18:35:30 +03:00
SDL Wiki Bot
d885d5c310 Sync SDL3 wiki -> header 2023-09-13 15:04:13 +00:00
Ryan C. Gordon
2f43f7bc53 audio: Allow querying of device buffer size. 2023-09-13 11:03:17 -04:00
Ryan C. Gordon
cf95721130 audio: Added a hint to let apps force device buffer size.
This is a hint because apps might (probably mistakenly) believe they need this
to migrate from SDL2, but most things don't need to specify this.
2023-09-13 10:42:08 -04:00
Ryan C. Gordon
47d8c77c67 audio: Choose better default sample frame counts.
This might still need tweaking, but this is probably better than it was.
2023-09-13 10:27:11 -04:00
Ryan C. Gordon
8b26e95f91 audio: Change SDL_AudioStreamCallback
Now it offers the total requested bytes in addition to the amount
immediately needed (and immediately needed might be zero if the stream
already has enough queued to satisfy the request.
2023-09-13 10:11:23 -04:00
Ryan C. Gordon
9da34e8fb5 docs: Updated README-emscripten.md.
This is updated from the rewrite in the SDL2 branch.
2023-09-12 21:27:40 -04:00
Max Bachmann
fd1c54a004 detect fanatec steering wheels 2023-09-12 15:35:35 -07:00
Ryan C. Gordon
cb44146089 docs: Whoops, this got added by the wiki bridge by accident! 2023-09-12 17:36:02 -04:00
Sam Lantinga
cd633b9a88 Renamed SDL_IsAudioDevicePaused() to SDL_AudioDevicePaused()
This aligns with the SDL3 convention of removing "Is" from self-explanatory function names

Also improved some documentation in SDL_audio.h
2023-09-12 12:11:09 -07:00
SDL Wiki Bot
c6cad07faa Sync SDL3 wiki -> header 2023-09-12 18:28:12 +00:00
Ryan C. Gordon
a6e52f9e48 Sync SDL3 wiki -> header 2023-09-12 14:27:21 -04:00
Dan Ginsburg
2de2e9d031 Fix flickering of window when using desktop-fullscreen and borderless window on multiple monitors on Linux. Closes #8186. 2023-09-12 07:37:39 -07:00
danginsburg
723835d16a Windows: fix for client rect resizing larger each time we came from exclusive fullscreen -> windowed on a monitor with HiDPI set. The problem was we were using the monitor DPI rather than the window DPI so AdjustWindowRectExForDpi was giving us an incorrect size which would be too large for the client rect. Closes #8237. 2023-09-12 07:36:55 -07:00
Ryan C. Gordon
ce27363df2 wikiheaders: Sort undocumented functions.
Otherwise they appear in random order, which isn't ideal in general, but
also this breaks the wiki/header bridge because it can't produce identical
conversions per-run.
2023-09-12 09:58:10 -04:00
Sam Huang
e22282b097 Added README about transparent windows in Win32 2023-09-11 22:35:05 -07:00
Sam Lantinga
1d1c6e6305 Turn off COREAUDIO debug logging by default 2023-09-11 09:03:48 -07:00
Frank Praznik
52efefca04 wayland: Fix drag offer leak
The data device leave function is intended for drag offers, not selections, and the function as was previously written was a no-op.
2023-09-09 18:49:47 -04:00
Ryan C. Gordon
3a992af446 audio: Added a postmix callback to logical devices.
You can see it in action in testaudio by mousing over a logical device; it
will show a visualizer for the current PCM (whatever is currently being
recorded on a capture device, or whatever is being mixed for output on
playback devices).

Fixes #8122.
2023-09-09 16:26:37 -04:00
Simon McVittie
7207bdce5d render: Enable clipping for zero-sized rectangles
Battle for Wesnoth apparently relies on being able to disable rendering
of UI elements by setting the clip rectangle to be empty.

Resolves: https://github.com/libsdl-org/SDL/issues/6896
Fixes: 00f05dcf "render: only enable clipping when the rectangle is valid"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-09-09 11:12:55 -07:00
Anonymous Maarten
22d81fb3e9 cmake: use MSVC_RUNTIME_LIBRARY to force MT 2023-09-09 19:14:12 +02:00
Anonymous Maarten
a2e17852d9 cmake: make sure SDL_GetPrefPath is run before testfilesystem
60 seconds timeout ought to be sufficient.
2023-09-08 09:05:58 -04:00
Anonymous Maarten
2fb266e0a4 ci: run tests in parallel 2023-09-08 09:05:58 -04:00
Ryan C. Gordon
ad1313e751 testaudio: Patched to compile.
(this was a piece of PR #8213 that accidentally creeped into main.)
2023-09-07 16:03:49 -04:00
Ryan C. Gordon
5747ddc012 testaudio: Clean up some messy memory management. 2023-09-07 10:50:11 -04:00
Ryan C. Gordon
fafbea1ced audio: Move internal float32 mixing to a simplified function 2023-09-07 10:48:04 -04:00
Ryan C. Gordon
116b0ec977 include: minor tweak to audio API documentation 2023-09-07 10:45:45 -04:00
Ryan C. Gordon
fb13770353 include: Replaced old Bugzilla URL. 2023-09-07 10:44:30 -04:00
Ryan C. Gordon
38c8fc05c5 audio: Remove ChooseMixStrategy.
This is adds complexity and fragility for small optimization wins.

The biggest win is the extremely common case of a single stream providing
the only output, so we'll check for that and skip silencing/mixing/converting.

Otherwise, just use a single mixer path.
2023-09-07 10:44:30 -04:00
Anonymous Maarten
b00cbd76aa wikiheaders.pl: create Unsupported.md file with list of functions undocumented in either the headers or the wiki 2023-09-06 15:51:08 -04:00
Frank Praznik
37e1fc3b58 wayland: Ensure that the toplevel window is recreated when switching decoration modes
If a compositor tries to change the decoration mode when initially creating a window, the hidden flag might not yet be unset if the decoration mode is changed during the initial roundtrip in Wayland_ShowWindow(). As hiding the window destroys the decoration manager object, the hidden flag check is unnecessary, as the decoration configuration listener will never be entered when the window is hidden.
2023-09-06 13:35:44 -04:00
Brick
f2ca9a615b Added SDL_AUDIO_FRAMESIZE 2023-09-05 17:56:58 -07:00
Brick
53122593f8 Added SDL_AUDIO_BYTESIZE 2023-09-05 17:56:58 -07:00
SDL Wiki Bot
544351c98e Sync SDL3 wiki -> header 2023-09-05 21:19:16 +00:00
Sam Lantinga
2e7d2b94eb Clarify that SDL_BlitSurface() ignores the width and height in dstrect 2023-09-05 14:18:43 -07:00
Makarenko Oleg
a2c1984d37 Detect Simagic wheel bases as wheels (#8198)
Simagic DirectDrive wheel bases have the same vendor + product id's
2023-09-04 12:11:13 -07:00
Ozkan Sezer
1d8dfbb223 avoid type redefinition errors after PR/8181 2023-09-04 21:29:40 +03:00
Oleg
266b91d2fd Detect Logitech G923 Playstation as wheel
G923 have two different versions - Xbox version is already present in the wheel list, but not the PS version.
2023-09-04 11:05:28 -07:00
Oleg
cde67ea49a Detect Logitech PRO Racing Wheel for Xbox (PC mode) as wheel
Logitech PRO Racing Wheel have two different versions - for Playstation and Xbox. Vendor + Product ID for Playstation version already present in SDL sources, but not an Xbox version
2023-09-04 11:01:17 -07:00
Sam Lantinga
3a932141e4 Restore audio format binary compatibility with SDL 2.0 2023-09-04 10:16:53 -07:00
Anonymous Maarten
e85206ffd8 wikiheaders.pl: add --rev= option to pass revision string
This way, git is not required anymore to calculate the git revision
2023-09-04 18:56:00 +02:00
Sam Lantinga
233789b0d1 Audio types have the same naming convention as other SDL endian types, e.g. [S|U][BITS][LE|BE]
Native endian types have no LE/BE suffix
2023-09-04 09:48:44 -07:00
SDL Wiki Bot
36b5f3e35c Sync SDL3 wiki -> header 2023-09-04 14:47:15 +00:00
Brick
0e552761b7 Renamed AudioStreamSpeed to AudioStreamFrequencyRatio 2023-09-04 07:46:18 -07:00
Brick
47bcb078f5 Fixed some incorrect SDL_AUDIO_F32 uses 2023-09-04 07:46:18 -07:00
Brick
2833f2e7b5 Fixed OOB access in audio_convertAccuracy test 2023-09-04 07:46:18 -07:00
SDL Wiki Bot
8387fae698 Sync SDL3 wiki -> header 2023-09-03 15:11:13 +00:00
Frank Praznik
8321813452 docs: Add note about Wayland application icons
Wayland doesn't support programmatically setting the app icon, so note this restriction and specify that a desktop entry file that points to the desired icon image is required.
2023-09-03 11:10:29 -04:00
Sam Lantinga
825d344756 Make sure that the same timestamp is used for all PS5 events from the same packet 2023-09-01 17:49:39 -07:00
Brick
9c1430324c Removed SDL_dataqueue 2023-09-01 14:38:45 -04:00
Brick
28b28bd8f4 Added audio_formatChange test 2023-09-01 14:38:45 -04:00
Brick
a59152688a Try and avoid overflow when handling very large audio streams 2023-09-01 14:38:45 -04:00
Brick
5394a805f4 Improved testaudiostreamdynamicresample
Tweaked color palette
2023-09-01 14:38:45 -04:00
Brick
e55844274d Added SDL_(Get|Set)AudioStreamSpeed 2023-09-01 14:38:45 -04:00
Brick
43c3c5736d Track the formats of data in an SDL_AudioStream 2023-09-01 14:38:45 -04:00
Brick
337fed3df6 Tweaked ResampleFrame_SSE
Use _mm_unpack(lo|hi)_ps instead of _mm_shuffle_ps
2023-09-01 14:38:45 -04:00
Ryan C. Gordon
fd7cd91dc9 audio: Mix multiple streams in float32 to prevent clipping.
This only does this work if actually mixing; if the physical device only
has a single stream bound to it, it'll just write the data to the hardware
without the extra drama.

Fixes #8123.
2023-08-31 23:46:33 -04:00
Ryan C. Gordon
9097573e37 audio: Choose a mixing strategy on each iteration.
Currently it's SILENCE (just zero out the mix buffer), COPYONE (one stream
writes directly into the hardware's buffer), or MIX (everything gets mixed
together before sending to the hardware).

Devices that aren't doing anything result in SILENCE. Devices playing
one thing result in COPYONE.

This lets the two most common states take what are likely significantly
faster approaches.

There will likely be some other strategies later (like when we offer a
postmix callback, etc).
2023-08-31 14:47:06 -04:00
Sam Lantinga
bbe2e012a2 Don't provide the SDL3 header path
The recommended way to include SDL.h is #include <SDL3/SDL.h>, and having both paths available was confusing for people trying to port to SDL3.

Thanks for the feedback!
https://github.com/exult/exult/issues/379#issuecomment-1701066992
2023-08-31 11:41:37 -07:00
Sam Lantinga
c17a35f096 Fixed typo 2023-08-31 09:32:39 -07:00
Sam Lantinga
4f72255eb1 Fixed README.md link 2023-08-31 09:31:56 -07:00
Sam Lantinga
e0ab597549 Simplified SDL_main.h migration notes
Thanks for the feedback!
https://github.com/exult/exult/issues/379#issuecomment-1701066992
2023-08-31 09:29:59 -07:00
Sam Lantinga
d44bde61e5 Added SDL migration information to the top level README.md
Thanks for the feedback!
https://github.com/exult/exult/issues/379#issuecomment-1701066992
2023-08-31 09:28:54 -07:00
Jeremy Demeule
6ff31e10cf metal: Add hint to select low power device instead of the default one (#8182)
On some system like MacBook Pro Intel with AMD card, asking for the default device will always return the AMD GPU.
This is not an issue for 99% of the case when the renderer context is here to provide the maximum performance level like for game.
However, for video application using GPU for 1 quad and 1 texture, using the discrete GPU for that lead to an important power consumption (4 to 8W), heat increase, and fan noise.
With this patch, I successfully amend ffplay to only use the integrated GPU (i.e. the Intel one), instead of the discrete GPU (i.e. the AMD one).
2023-08-31 01:23:45 -07:00
Sam Lantinga
8a8aed477d Make sure that we process touch events that position the mouse
Fixes https://github.com/libsdl-org/SDL/issues/8176
2023-08-30 21:31:19 -07:00
SDL Wiki Bot
f84c87f204 Sync SDL3 wiki -> header 2023-08-31 03:26:13 +00:00
Sam Lantinga
a7eea9997d macOS: Don't raise the parent top-level window when raising a child window, only raise the child window to the top of the parent 2023-08-30 20:29:57 -07:00
Sam Lantinga
a5e7214795 Add SDL_WINDOW_NOT_FOCUSABLE flag to set that the window should not be able to gain key focus
- Also adds SDL_SetWindowFocusable() to set/clear flag on existing windows
2023-08-30 20:29:51 -07:00
Ryan C. Gordon
b385dc3b68 n3dsaudio: Patched to compile. 2023-08-30 19:53:54 -04:00
Ryan C. Gordon
4e0c7c91fc audio: PlayDevice() should return an error code.
Higher level code treats errors as fatal and disconnects the device.
2023-08-30 19:17:19 -04:00
Anonymous Maarten
a94d724f17 wayland: add SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL 2023-08-30 23:03:03 +02:00
Anonymous Maarten
da5d93d3da wayland: don't define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_* macro's
They mess with #ifdef conditional in headers.
2023-08-30 13:43:50 -07:00
Anonymous Maarten
f002f7d12e ci: build emscripten with Debug buid type 2023-08-29 23:18:37 +02:00
Ryan C. Gordon
3699b12ed0 audio: Fixed some "is_*" variables to be cleaner and/or more specific.
Requested at https://github.com/libsdl-org/SDL/pull/8165#discussion_r1306700881_
2023-08-29 10:46:14 -04:00
Ryan C. Gordon
2471d8cc2a audio: Fixed logic error in SDL_OpenAudioDeviceStream. 2023-08-27 19:30:47 -04:00
Anonymous Maarten
1b03a2430a testsurround: fix order of arguments of callback 2023-08-28 00:12:59 +02:00
Sam Lantinga
82db2b58f9 Renamed audio stream callback and moved the userdata parameter first
In general SDL API callbacks are called with the userdata paramter first, to mimic C++ method call convention
2023-08-27 14:43:21 -07:00
SDL Wiki Bot
5bdad5210f Sync SDL3 wiki -> header 2023-08-27 20:55:12 +00:00
Ryan C. Gordon
58c859f64d audio: Rename SDL_GetAudioStreamBinding to SDL_GetAudioStreamDevice. 2023-08-27 16:54:30 -04:00
Ryan C. Gordon
efd2023a72 audio: Fixed documentation. 2023-08-27 16:54:30 -04:00
Ryan C. Gordon
1e775e0eef audio: Replace SDL_CreateAndBindAudioStream with SDL_OpenAudioDeviceStream.
This is meant to offer a simplified API for people that are either migrating
directly from SDL2 with minimal effort or just want to make noise without
any of the fancy new API features.

Users of this API can just deal with a single SDL_AudioStream as their only
object/handle into the audio subsystem.

They are still allowed to open multiple devices (or open the same device
multiple times), but cannot change stream bindings on logical devices opened
through this function.

Destroying the single audio stream will also close the logical device behind
the scenes.
2023-08-27 16:54:30 -04:00
Sam Lantinga
bd088c2f99 Revert "Clarify whether an audio function expects a physical or logical device ID"
This reverts commit 506a133d84.

Physical and logical audio devices are intended to be interchangeable at the API level.
2023-08-27 13:42:20 -07:00
Brick
82e481b520 Added --randmem test parameter 2023-08-27 13:08:15 -07:00
Brick
ea68bb8027 Add some additional checks to audio_convertAudio 2023-08-27 13:08:15 -07:00
Brick
f8286df167 Fixed ResampleFrame_SSE doing unnecessary work 2023-08-27 13:08:15 -07:00
Brick
b1d63be538 Fixed audio_resampleLoss test 2023-08-27 13:08:15 -07:00
Sam Huang
c191d6c306 Better Win32 transparent window support 2023-08-27 13:06:42 -07:00
Ozkan Sezer
923d612ca1 hidapi: sync macOS code with mainstream.
this merges mainstream commit 4009466d59c41f (mainstream PR/611)
2023-08-27 22:33:32 +03:00
Ozkan Sezer
363f4fa9c1 avoid type redefinition errors after commit ee806597b9.
(Reference issue: https://github.com/libsdl-org/SDL/issues/8142)
2023-08-27 22:22:10 +03:00
Sam Lantinga
615824a806 Updated documentation now that SDL_GetAudioDevices() has been split into separate functions for output and capture devices 2023-08-26 17:30:57 -07:00
Sam Lantinga
506a133d84 Clarify whether an audio function expects a physical or logical device ID 2023-08-26 17:03:01 -07:00
Ozkan Sezer
3b1d1e4e31 hidapi: sync the hidraw changes with mainstream
Apply mainstream commit 8a4de63b (mainstream PR/601) to our hidapi.
The patch is a direct apply of the mentioned commit, with one sdl-
specific part guarded by HIDAPI_IGNORE_DEVICE adapted accordingly.
2023-08-26 08:09:10 -07:00
Ozkan Sezer
f617918e0a cmake: check linkage to libusb too, instead of libusb.h presence only.
avoids false positives when using a cross-toolchain file
2023-08-26 17:03:42 +02:00
Brick
041dbd6b5f Fixed GetResamplerAvailableOutputFrames
Non-euclidean division is a pain
2023-08-26 09:04:47 -04:00
Ryan C. Gordon
b49d0a607e x11: Avoid including full Vulkan headers.
This dramatically improves compile times of the X11 backend.

Reference Issue #8142.
2023-08-25 19:45:45 -04:00
Ryan C. Gordon
4d2f9f3a32 yuv_rgb: Comment out unused code.
This drops literal seconds off compiling this one C file!

Reference Issue #8142.
2023-08-25 19:42:46 -04:00
Ryan C. Gordon
3c3486e2ac wayland: Don't include full Vulkan headers when not necessary.
Reference Issue #8142.
2023-08-25 19:42:08 -04:00
Ryan C. Gordon
f066bbe98a x11: Don't include system headers twice.
SDL_x11dyn.h also handles this.
2023-08-25 19:41:18 -04:00
Ozkan Sezer
d86d02bbbf updated dynapi after SDL_GDKGetDefaultUser addition 2023-08-25 19:03:32 +03:00
Sam Lantinga
4355f9cec5 Fixed warning C4389: '!=': signed/unsigned mismatch 2023-08-25 08:49:49 -07:00
Sam Lantinga
5755de07a6 Fixed build warnings 2023-08-25 08:45:33 -07:00
Sam Lantinga
0f80d47bbd Fixed thread-safety warning 2023-08-25 08:21:54 -07:00
Sam Lantinga
ee806597b9 Removed SDL_vulkan_internal.h from SDL_sysvideo.h
Reference: https://github.com/libsdl-org/SDL/issues/8142
2023-08-25 08:18:29 -07:00
Sam Lantinga
34860b932b Fixed testautomation --filter pixels_allocFreeFormat 2023-08-25 08:06:08 -07:00
Ethan Lee
6f8a6a31ca gdk: GetBasePath should be a UTF8 version of Win32 GetBasePath 2023-08-25 10:47:16 -04:00
SDL Wiki Bot
e30e5c77e6 Sync SDL3 wiki -> header 2023-08-25 14:42:25 +00:00
Ethan Lee
c0cd8c8142 gdk: Add SDL_GDKGetDefaultUser, SDL_GetPrefPath implementation 2023-08-25 10:40:16 -04:00
Brick
106abce69f Refactored GetAudioStreamDataInternal buffer handling
The final conversion step should now always go straight into the output buffer.
2023-08-25 08:43:56 -04:00
Brick
e44f54ec54 Avoid using hex-floats 2023-08-25 08:43:56 -04:00
Brick
5b696996cd Added ResampleFrame_SSE 2023-08-25 08:43:56 -04:00
Brick
958b3cfaea Tweaked and enabled audio_convertAudio test 2023-08-25 08:43:56 -04:00
Brick
7dbb9b65b1 audio_convertAccuracy: Shuffle the data in case of a bad SIMD implementation 2023-08-25 08:43:56 -04:00
Brick
f6a4080ff5 audio_resampleLoss: Add support for multiple channels 2023-08-25 08:43:56 -04:00
Brick
4f894e748e audio_resampleLoss: SDL_GetAudioStreamData now returns the correct length 2023-08-25 08:43:56 -04:00
Brick
ab83f75bb9 Make sure GetAudioStreamDataInternal is called with a valid length 2023-08-25 08:43:56 -04:00
Brick
6a73f74b6b Rebuild full ResamplerFilter (left wing + right wing) at runtime 2023-08-25 08:43:56 -04:00
Brick
0c15ce0060 Add a missing int cast 2023-08-25 08:43:56 -04:00
Brick
b74ee86b1d Optimized ResampleAudio, with special cases for 1 and 2 channels
This would also benefit from some SIMD, since it's just a bunch of multiply-adds
2023-08-25 08:43:56 -04:00
Brick
fba6e1e3d3 Removed ResamplerFilterDifference
It takes 1 extra multiply to calculate the correct interpolation,
but I think the improvement in cache locality (and binary size) outweighs that.
2023-08-25 08:43:56 -04:00
Brick
9f7a22fa45 Removed 64-bit handling from AudioConvertByteswap 2023-08-25 08:43:56 -04:00
Brick
1f5327a9fb Removed future_buffer, left_padding, and right_padding from SDL_AudioStream 2023-08-25 08:43:56 -04:00
Brick
71ad52d6db Lowered SDL_GetAudioStreamData to 32 KB
No particular reason for this number, but 1 MB was a bit silly
2023-08-25 08:43:56 -04:00
Sam Lantinga
69aec8c915 Fixed the report format for the Razer Wolverine V2 Pro 2023-08-24 11:37:50 -07:00
Sam Lantinga
7c2669c9d9 Accept key events from any source
This allows TV remotes to navigate SDL applications (with source HDMI)

Fixes https://github.com/libsdl-org/SDL/issues/8137
2023-08-24 10:09:02 -07:00
Sam Lantinga
1e9d314482 Updated to Android minSdkVersion 19 and targetSdkVersion 34
This is updated to meet the latest requirements for apps on the Google Play store
2023-08-24 08:23:06 -07:00
Sam Lantinga
8924d0d927 Added missing function prototype for SDL_WriteS64BE() 2023-08-23 21:19:25 -07:00
Sam Lantinga
845f3c7450 Fixed mismatch between stdlib calloc() and SDL free()
Fixes https://github.com/libsdl-org/SDL/issues/8145
2023-08-23 14:49:29 -07:00
Ryan C. Gordon
fb79211732 emscriptenaudio: Fire the capture silence_callback at an interval.
Previously it was using setTimeout, not setInterval, so it would only fire
once, which was obviously a mistake.
2023-08-23 16:12:30 -04:00
Ryan C. Gordon
5191b20541 emscriptenaudio: Don't bother undefining things about to be unreachable.
Since the top-level table is getting undefined, all the things in it will
be unreachable and eligible for garbage collection without explicitly
nulling them out.
2023-08-23 16:11:08 -04:00
Ryan C. Gordon
fd75a4ca05 emscriptenaudio: Deal with blocked audio devices better.
Now, if the AudioContext starts in a "suspended" state, because the browser
blocked it from playing by default, we we run the audio "thread" in a timer
and throw away the generated audio. Once the AudioContext is allowed to
resume, we clear this timer.

The end result is that the app will continue to drain its audio queue
instead of consuming more memory over time (and, if it relies on an audio
callback to make progress, continue to run!), with the effect that the
page is merely silent but otherwise functioning as intended.

Once the user interacts with the page and the browser permits the the
AudioContext to run for real, audio should still be in sync, instead of
just starting to play audio that might now be at least several seconds behind.
2023-08-23 14:32:23 -04:00
Ryan C. Gordon
981b8a337a emscriptenaudio: Remove unnecessary functions. 2023-08-23 14:32:23 -04:00
Sam Huang
c7588e4261 Transparent window for Win32 + OpenGL (#8143)
* Transparent window for Win32 + OpenGL via DWM
2023-08-23 07:42:59 -07:00
Ryan C. Gordon
f9581178de cmake: fixed a typo. 2023-08-22 10:52:06 -04:00
Brick
e6c878824c Fixed ResampleAudio interpolation factor calculation 2023-08-22 08:34:22 -04:00
Brick
4983638630 Misc audio tweaks/cleanup 2023-08-21 16:02:54 -04:00
Brick
72d9d53def Invert the inner ResampleAudio loops to avoid doing unnecessary work 2023-08-21 16:02:54 -04:00
Brick
88123a5109 The history buffer should always have the maximum possible padding frames 2023-08-21 16:02:54 -04:00
Brick
96e47f1657 Clamp results of GetResampler(AvailableOutput|NeededInput)Frames 2023-08-21 16:02:54 -04:00
Brick
d2b9c8b80d Fixed maths in testaudiostreamdynamicresample (and just show the actual scale) 2023-08-21 16:02:54 -04:00
Brick
14e38b17d6 Removed assertions from inner ResampleAudio loop 2023-08-21 16:02:54 -04:00
Brick
9d413dfdc2 The history buffer doesn't need to be so large 2023-08-21 16:02:54 -04:00
Brick
2788e848f8 Allow resampling less than 1 frame of input 2023-08-21 16:02:54 -04:00
Brick
383084e0ad Pre-calculate resampling rate, and use it instead of .freq in most places 2023-08-21 16:02:54 -04:00
Brick
40a6a445ce Update resample_offset inside ResampleAudio 2023-08-21 16:02:54 -04:00
Brick
47fea7f06b Used fixed-point arithmetic in ResampleAudio 2023-08-21 16:02:54 -04:00
Brick
7bb4e806ea Clear resample_offset in SDL_ClearAudioStream, not SetAudioStreamFormat
Not entirely sure if ClearAudioStream is the right place, but SetAudioStreamFormat was the wrong place
2023-08-21 16:02:54 -04:00
Brick
b9541b9eab Improved ResampleAudio
* filterindex2 was off-by-one
* Generate ResamplerFilter using doubles
* Transpose ResamplerFilter to improve access patterns
2023-08-21 16:02:54 -04:00
Brick
cdaa19869d Track offset within the current sample when resampling 2023-08-21 16:02:54 -04:00
Frank Praznik
d60ebb06d1 mouse: Ensure that the dummy default cursor is removed from the cursor list
In the case where a dummy cursor is created as the default cursor, make sure it is removed from the cursor list when freeing the default cursor.
2023-08-16 13:46:14 -04:00
Frank Praznik
e58c2731fe mouse: Free the default cursor when destroyed
The default cursor was being leaked on destruction as it is not in the cursor list, and subsequently SDL_DestroyCursor() wouldn't call the free function for it.
2023-08-16 12:51:59 -04:00
Ryan C. Gordon
789ce17e11 audio: Don't resample in chunks for now.
This needs a little reworking to not lose sample frames.

Reference Issue #8036.
2023-08-16 10:26:08 -04:00
Ryan C. Gordon
cbab33482a audio: Don't call SDL_AudioStream callbacks for empty data sets.
Fixes #8095.
2023-08-14 18:16:58 -04:00
Sam Lantinga
3e1ae0c867 Clearified the libusb whitelist default logic 2023-08-14 12:19:37 -07:00
Brick
f4520821ef Removed some unnecessary integer casts 2023-08-14 15:07:18 -04:00
Brick
0989b7e86d Avoid using designated initializers 2023-08-14 15:07:18 -04:00
Brick
c6c1e673c0 Optimized SDL_Convert_*_to_*_Scalar
They are now all branch-less and avoid float multiplication/conversion where possible
2023-08-14 15:07:18 -04:00
Brick
f97b920b31 Optimized SDL_Convert_*_to_*_SSE2
Some of the SDL_Convert_F32_to_*_SSE2 do not explicitly clamp the input,
but instead rely on saturating casts.
Inputs very far outside the valid [-1.0, 1.0] range may produce
an incorrect result, but I believe that is an acceptable trade-off.
2023-08-14 15:07:18 -04:00
Brick
300d1ec3ed Added audio_convertAccuracy test 2023-08-14 15:07:18 -04:00
Brick
32cecc2eac Fixed assertion in audio_convertAudio 2023-08-14 15:07:18 -04:00
Brick
33f11e21ee Removed assertions in AudioConvert(To|From)Float 2023-08-14 15:07:18 -04:00
Anonymous Maarten
c2f388fd88 cmake: add SDL_HIDAPI_LIBUSB_SHARED option + test on ci 2023-08-14 19:37:58 +02:00
Frank Praznik
371cc2d173 wayland: Remove unnecessary flag and state settings
The video core applies pending minimized/maximized/restored state to windows when they transition from the hidden to shown state, so no need to handle it internally anymore.
2023-08-14 13:20:24 -04:00
Frank Praznik
fe85e6e754 cocoa: Send a maximized event instead of restored if a deminiaturized window is zoomed 2023-08-14 13:20:24 -04:00
Frank Praznik
ddddcb78cb cocoa: Use the close method to hide a miniaturized window
The 'orderOut' method has no effect on miniaturized windows, so 'close' must be used to remove the window from the desktop, dock, and window list in this case.

SDL holds a strong reference to the window (oneShot/releasedWhenClosed are 'NO'), and calling 'close' doesn't send a 'windowShouldClose' message, so it's safe to use for this purpose as nothing is implicitly released.
2023-08-14 13:20:24 -04:00
Frank Praznik
be8c42cfd7 Clarify that a window being 'hidden' means that it is unmapped/ordered out
SDL considers a hidden window to be unmapped and blocks or defers certain operations until the window is shown again, however, the X11 and Cocoa backends would set the hidden flag when the window was minimized, which blocked the functionality of SDL_RestoreWindow().

Specify that a window with the hidden flag set is unmapped and not visible on the desktop or in the dock/taskbar without a call to SDL_ShowWindow(), and don't set the hidden flag in the X11 and Cocoa backends when the window is in the minimized state, but still mapped to the desktop.
2023-08-14 13:20:24 -04:00
Ikko Eltociear Ashimine
a44338cbc1 Fix typo in SDL_audiocvt.c
accomodate -> accommodate
2023-08-14 10:13:53 -07:00
Ozkan Sezer
f464eb2c54 SDL_hidapi.c: change 'use_libusb_whitelist_default' into a macro.
Avoids 'initializer element is not constant' error from older compilers.
2023-08-14 17:01:24 +03:00
Anonymous Maarten
6607a3cfac Disable cache in python http server
Co-authored-by: Érico Porto <ericoporto2008@gmail.com>
2023-08-14 03:50:06 +02:00
Ethan Lee
181d5d285a hidapi: Enable libusb support by default.
Now that we have a whitelisting system for libusb devices, it should be safe to support it whenever it's available.
2023-08-13 14:16:11 -07:00
Ethan Lee
f0f15e365d hidapi: Use a whitelist for libusb when other backends are available 2023-08-13 14:16:11 -07:00
capehill
c3f7a7dc46 Convert audio using SDL_AUDIO_F32SYS format instead of SDL_AUDIO_F32
This fixes audio playback noise on big endian systems
as SDL_AUDIO_F32 means SDL_AUDIO_F32LSB.
2023-08-13 14:08:18 -07:00
Vlad-Stefan Harbuz
796713b9d5 xxd.py: always write \n line endings
Previously, `open()` was used with the default option of `newline=None`,
which means that “any '\n' characters written are translated to the
system default line separator”. Now, `xxd.py` always writes `\n` line
endings. This eliminates the need for the .gitattributes file.
2023-08-13 13:51:31 -07:00
David CARLIER
723bcd0a8b SDL_TriggerBreakppoint for riscv arch (both 32/64) version.
`ebreak` acts like int3 for x86, giving control of running process to debuggers.
2023-08-13 11:36:49 -04:00
Anonymous Maarten
ec0042081e Add .gitattributes file
On Windows, cmake/xxd.py generates text files with \r\n eol.
Because the in-repo files were stored with \n, and git considered
them as binary files, they were always considered out of date.

An alternative fix could be to let xxd.py generate binary files with \n.
But a .gitattributes file should also avoid people accidentally
converting line endings.
2023-08-12 17:37:52 +02:00
Anonymous Maarten
a5d9db0cd0 cmake: build tests for UWP 2023-08-12 17:37:52 +02:00
Anonymous Maarten
b7889a7389 winrt: use windowsio in non-libc mode
CMake's SDL_build_config.h force disables HAVE_STDIO_H when buiding
winrt in non-libc mode.

Becase CreateFileEx is not available in UWP mode, use CreateFile2
instead.
2023-08-12 17:37:52 +02:00
Anonymous Maarten
ea8757a748 Make testaudiostreamdynamicresample compatible with emscripten 2023-08-12 17:37:20 +02:00
Anonymous Maarten
1a7a74fb2e cmake: build emscripten tests as html page 2023-08-12 17:37:20 +02:00
Anonymous Maarten
64d570f027 Add minimal http server for emscripten test apps 2023-08-12 17:37:20 +02:00
Anonymous Maarten
8e898c4a21 SDL_test does not parse --samples argument 2023-08-12 17:37:20 +02:00
Ryan C. Gordon
91cd5478be audio: Fix resampler overflowing input buffer.
This usually manifests as a clicking sound, because it often produces
a value outside the range -1.0f to 1.0f based on whatever random data
is past the buffer, which later stages of audio conversion will clamp
to a maximum value for the audio format. Since this tends to be a single
bad sample generated at the end of the resampled buffer, it sounds like
a repeating click in streamed data.

I'd like a more efficient means to clamp this value to not overflow the
buffer, but this puts out the immediate fire.
2023-08-12 00:57:35 -04:00
Ryan C. Gordon
f290c85b22 testaudiocapture: Make sure we convert captured audio to output format.
Fixes #8114.
2023-08-11 16:52:23 -04:00
Ryan C. Gordon
b75c751dfc rwlock: Make generic implmentations work on single-threaded platforms.
Fixes #8101.
2023-08-11 15:03:32 -04:00
Sam Lantinga
80850af7ce The controller update complete events are no longer disabled by default 2023-08-10 17:45:00 -07:00
Sam Lantinga
3f486224a9 Fixed refresh rate calculation for KMSDRM 2023-08-10 15:39:38 -07:00
Anonymous Maarten
342ec51131 Fix overflow when doing SDL_sscanf("%hd", ...)
An overflow occured in the stdlib_sscanf test, when using msys2 clang32 toolchain.
2023-08-10 15:06:42 -07:00
Sam Lantinga
9129e1d557 Fixed crash when setting the default cursor twice
This happens in the KMSDRM driver, once after video init, setting a blank default cursor, and once when creating a window when the KMSDRM mouse is initialized.

Also fixed a memory leak freeing the default cursor at shutdown
2023-08-10 12:13:40 -07:00
Sam Lantinga
8e99a4f4f5 Undo variable rename 2023-08-10 11:45:20 -07:00
Sam Lantinga
be67f0de10 Fixed crashes related to the default cursor on WinRT and KMSDRM
Fixes https://github.com/libsdl-org/SDL/issues/8104
2023-08-10 11:40:36 -07:00
Mathieu Eyraud
94b3f78c44 Fix out of bound read of 'has_hat' array 2023-08-10 08:25:01 -07:00
Sam Lantinga
94f48f19b0 Use more specific build destinations when creating an xcframework 2023-08-10 01:52:10 -07:00
Sam Lantinga
dabd45997e Back out change supporting multiple names for binding elements
testcontroller expects to be able to call SDL_GetGamepadStringForButton() and find that name in the binding string

We can revisit this later if it becomes important to use new names in bindings. @smcv
2023-08-09 11:25:37 -07:00
Simon McVittie
efe15588d5 Relabel back paddles as left or right
The sequence order of the four paddles is not obvious, with SDL and Xbox
controllers swapping the order of P2 and P3 relative to each other.
If we group them into left and right, then it becomes more obvious.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-08-09 11:03:30 -07:00
Anonymous Maarten
be884f0c95 ci: disable visionos.yml by renaming the file 2023-08-09 19:17:20 +02:00
Anonymous Maarten
ac094d00f5 ci: add workflow_dispatch event to visionos workflow 2023-08-09 18:59:10 +02:00
Simon McVittie
9be9e2292b build: Consistently use pathlib APIs in cmake/xxd.py
The ability to pass a pathlib.Path to open() was new in Python 3.6,
and the oldest branch of the Steam Runtime only has Python 3.5 available.
Even without considering retrocomputing, using the Path.open method is
more consistent with how we read the input 2 lines earlier.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-08-09 15:44:05 +02:00
Sam Lantinga
a9f6950657 Fixed deadlock shutting down Android sensors 2023-08-08 23:01:55 -07:00
Sam Lantinga
d9f09e77f2 Actually make the sensors magical! 2023-08-08 22:34:41 -07:00
Ravbug
690eae7d22 Implement visionOS support 2023-08-08 22:25:04 -07:00
Sam Lantinga
e385d6da0a Fixed build warning 2023-08-08 22:20:49 -07:00
Sam Lantinga
6b93e788fa Improved sensor thread-safety
This fixes an issue where the main thread would hang indefinitely when polling events if sensors were initialized and shutdown on another thread.
2023-08-08 22:09:47 -07:00
Sam Lantinga
4ee0e5a984 Fixed thread-safety warnings 2023-08-08 22:09:47 -07:00
Sam Lantinga
12deed91f8 Added information on how to enable thread-safety analysis 2023-08-08 22:09:46 -07:00
Ryan C. Gordon
5735d2b03b coreaudio: Fixed assertion when device fails/quits mid-iteration.
Fixes #8094.
2023-08-08 23:57:42 -04:00
Ryan C. Gordon
1022fd6e04 testaudio: the test framework opens an audio device at startup; close it.
Not opening a device at all would be more desirable, though.
2023-08-08 21:42:48 -04:00
Ryan C. Gordon
0714da37a4 audio: Fix audio stream callback calculations when future buffer has space.
We were subtracting backwards.  :/
2023-08-08 21:42:48 -04:00
Anonymous Maarten
917e036f6f MSVC has __declspec(deprecated) 2023-08-09 02:54:18 +02:00
Sam Lantinga
279ff8909f Changed example code to avoid potential divide by zero 2023-08-08 16:52:09 -07:00
Sam Lantinga
8a1afc9b10 Fixed Android not sending controller event timestamps 2023-08-08 09:47:49 -07:00
Sam Lantinga
463c456b98 Fill the correct member with the joystick ID in SDL_EVENT_JOYSTICK_UPDATE_COMPLETE 2023-08-08 09:47:49 -07:00
Simon McVittie
55cf1abaa6 test: Don't flag testsurround as suitable for non-interactive use
According to #8088 it has no value as an automated test, and by
default it takes long enough to hit the default test timeout.

Resolves: #8088
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-08-08 08:45:57 -07:00
Sam Lantinga
a2d594269c Fixed pixel format compatibility with SDL2 2023-08-07 22:45:21 -07:00
Sam Lantinga
79a190aa23 Fixed setting invalid bpp for FOURCC formats in SDL_GetMasksForPixelFormatEnum() 2023-08-07 22:20:40 -07:00
SDL Wiki Bot
8fdebdd3e0 Sync SDL3 wiki -> header 2023-08-08 03:37:14 +00:00
Sam Lantinga
b903ccf945 SDL_rwops read/write functions return size_t again
The current status is stored in the SDL_rwops 'status' field to be able to determine whether a 0 return value is caused by end of file, an error, or a non-blocking source not being ready.

The functions to read sized datatypes now return SDL_bool so you can detect read errors.

Fixes https://github.com/libsdl-org/SDL/issues/6729
2023-08-07 20:36:21 -07:00
Brick
c03f5b4b69 Fixed rounding up in SDL_PrintFloat
This wasn't caught by the 9.9999999 case, because that value is actually just equal to 10.0
2023-08-07 14:15:19 -07:00
Sam Lantinga
75a020aa6b Only query serial number and firmware versions from Sony PS5 controllers
I don't know of any specific issue with this, but third party PS4 controllers have had issues with reports that are specific to Sony hardware, so this is a speculative change to prevent issues with future controllers.

If it turns out that these reports are valid and useful for third party controllers, we can back this change out.
2023-08-07 14:06:10 -07:00
Sam Lantinga
fa189d302e Added the Victrix Pro FS for PS4/PS5 to the controller list 2023-08-07 14:04:34 -07:00
Sam Lantinga
26205b659d Fixed PS4/PS5 touchpad for third party controllers
We should always report touchpad and battery status if they are available. We just want to make sure we don't enable enhanced reports unless the application wants that behavior.
2023-08-07 10:48:52 -07:00
Ryan C. Gordon
6af0448af9 include: fixed a typo in SDL_RenderGetMetalCommandEncoder docs.
(cherry picked from commit 8087c0a5d2)
2023-08-06 10:45:46 -04:00
Ozkan Sezer
f3cb46b083 SDL_thread.h: do not conflict with sdl2-compat::sdl3_include_wrapper.h
The windows hacks in there will not be needed any longer
2023-08-06 14:11:02 +03:00
Sam Lantinga
080b1dfbdb Revert "Improved fallback for SDL_COMPILE_TIME_ASSERT() (thanks @icculus!)"
This reverts commit 9d453daa23.

Oops, it totally doesn't work:
error: unused variable 'SDL_compile_time_assert_SDL_copyp' [-Werror=unused-variable]
2023-08-05 19:23:30 -07:00
Sam Lantinga
9d453daa23 Improved fallback for SDL_COMPILE_TIME_ASSERT() (thanks @icculus!) 2023-08-05 19:18:31 -07:00
Sam Lantinga
1fb2419882 Removed reference to renamed function 2023-08-05 19:11:10 -07:00
Ryan C. Gordon
e7d56dd0b2 audio: Renamed new API SDL_UnpauseAudioDevice to SDL_ResumeAudioDevice. 2023-08-05 19:20:14 -04:00
Mathieu Eyraud
2b0c0f5b6b Don't pass NULL to strncmp 2023-08-05 18:17:21 -04:00
Mathieu Eyraud
778e8185cd Fix size of memcpy in SDL_AudioDeviceFormatChangedAlreadyLocked
And add diagnostic that allows to find this kind of issue in clang-tidy
2023-08-05 14:14:45 -04:00
SDL Wiki Bot
4bb426abad Sync SDL3 wiki -> header 2023-08-05 17:45:14 +00:00
meyraud705
3a752ce650 Reapply "Changed 'freesrc' parameter from int to SDL_bool" to SDL_wave.c
Commit bea99d4 was partially reverted by 905c4ff "audio: First shot at the SDL3 audio subsystem redesign!"
2023-08-05 13:44:48 -04:00
Ozkan Sezer
2ba03b4db0 fix build after previous commit. 2023-08-05 18:15:10 +03:00
Ozkan Sezer
0026adffd4 apply force_align_arg_pointer attribute to correct version of SDL_RunApp 2023-08-05 18:10:10 +03:00
Ozkan Sezer
77446e2029 Unaligned stacks on i686-w64-mingw32 may lead to crashes
Port of original SDL2 patch by Christopher Wellons (@skeeto, #7607)
to SDL3.
2023-08-05 17:39:30 +03:00
Sam Lantinga
d3bcc3f057 Fixed build errors when OpenGL isn't enabled 2023-08-05 00:25:12 -07:00
SDL Wiki Bot
35ad68e126 Sync SDL3 wiki -> header 2023-08-04 17:40:16 +00:00
Frank Praznik
70323a8350 Add a function to display the system menu for a window
Add SDL_ShowWindowSystemMenu() to display the system-level menu for windows. Typically, this is done by right-clicking on the system provided window decorations, however, if an application is rendering its own client-side decorations, there is currently no way to display it. This menu is provided by the system and can provide privileged desktop functionality such as moving or pinning a window to a specific workspace or display, setting the always-on-top property, or taking screenshots. In many cases, there are no APIs which allow applications to perform these actions manually.

Implemented for Wayland via functionality provided by the xdg_toplevel protocol, Win32 via the undocumented message 0x313 (typically called WM_POPUPSYSTEMMENU), and X11 via the "_GTK_SHOW_WINDOW_MENU" atom (supported in GNOME and KDE).
2023-08-04 13:39:45 -04:00
Ryan C. Gordon
be5f66c84e testaudio: Fixed soundboard icon, which had a colorkey issue. 2023-08-03 21:35:38 -04:00
SDL Wiki Bot
c0a88930bf Sync SDL3 wiki -> header 2023-08-04 01:28:15 +00:00
Ryan C. Gordon
18c59cc969 Merge the SDL3 audio subsystem redesign!
This rips up the entire SDL audio subsystem! While we still feed the audio device from a separate thread, the audio callback into the app is now gone a totally optional alternative.

Now the app will bind an SDL_AudioStream to a given device and feed data to it. As many streams as one likes can be bound to a device; SDL will mix them all into a single buffer and feed the device from there.

So not only does this function as a basic mixer, it also means that multiple device opens are handled seamlessly (so if you want to open the device for your game, but you also link to a library that provides VoIP and it wants to open the device separately, you don't have to worry about stepping on each other, or that the OS will fail to allow multiple opens of the same device, etc).

Merged from pull request #7704.

Fixes #7379.
Reference Issue #6889.
Reference Issue #6632.
2023-08-03 21:27:54 -04:00
Sam Lantinga
99b0e31788 The Steam Controller D-Pad is only pressed when the button is pressed down 2023-08-03 13:07:51 -07:00
Sam Lantinga
103073d694 Set NSBluetoothAlwaysUsageDescription for testcontroller
This allows testing Steam Controller support on iOS/tvOS, once you enable SDL_JOYSTICK_HIDAPI in SDL_build_config_ios.h
2023-08-03 13:07:51 -07:00
Sam Lantinga
ca02bb6c8c We don't need testdropfile-Info.plist 2023-08-03 13:07:51 -07:00
Sam Lantinga
e063f662e9 Enable the controller update complete events
It's not intuitive from a developer's point of view that you wouldn't get these events. If they're impacting performance they can be explicitly disabled for applications that don't want them.
2023-08-03 10:19:54 -07:00
Sam Lantinga
06bea1eb55 Added a gamepad mapping for the G-Shark GS-GP702
Fixes https://github.com/libsdl-org/SDL/issues/8068
2023-08-02 14:35:39 -07:00
Ryan C. Gordon
5ca3c50bf0 testaudio: Fix compiler warning. 2023-08-02 15:23:37 -04:00
Ryan C. Gordon
1b1f02c5aa testaudio: Apparently compilers don't like this possibly being NULL now...? 2023-08-02 15:07:40 -04:00
Ryan C. Gordon
2de9253b6c test: Added testaudio 2023-08-02 15:02:32 -04:00
Ozkan Sezer
fb3ab3f113 SDL_video.c: move ngage video before offscreen.
Reference issue: https://github.com/libsdl-org/SDL/pull/8069.
2023-08-02 17:02:02 +03:00
Sam Lantinga
843572d993 Don't mark autorelease keys as virtual
Also make sure we time out the hardware_timestamp even if SDL_HardwareKeyboardKeyPressed() isn't called.
2023-08-02 01:32:13 -07:00
Sam Lantinga
648de4f9b8 Fixed duplicate key press/release events on iOS
When a hardware keyboard is attached, it can take over 100 ms for the keyboard event to generate text input. In that case we want to record that we recently received a keyboard event so we don't synthesize duplicate virtual key press/release events for the input text.
2023-08-02 01:08:00 -07:00
Sam Lantinga
a8abe612ed Only pass keypresses up the responder chain when text input is active
This is another attempt to make sure we don't cause beeps from unhandled key presses while still allowing full text input functionalty.

If this isn't selective enough, we might need to go up the responder chain to see what's going to handle the event before passing it along.

Fixes https://github.com/libsdl-org/SDL/pull/6962
2023-08-02 00:19:57 -07:00
Sam Lantinga
c3288d113e Synchronize on-screen keyboard state with text input active state
When a hardware keyboard is attached to an iPad, you can easily trigger a set of on-screen keyboard transitions that will take place over time, and we need to track whether we're currently showing or hiding the keyboard and make sure we don't clobber the existing state during those transitions.

Testing:
* Connected a hardware keyboard to an iPad
* Launched checkkeys
* Noted the keyboard bar was active at the bottom of the screen and text input was active
* Tapped with both fingers to quickly toggle text input off and back on
* Noted the keyboard bar slid down and then back up, and text input was active
* Tapped on the keyboard bar to bring up the full on-screen keyboard and then closed it so the keyboard bar was still active, and text input was still active
* Tapped on the screen to turn text input off, noted the keyboard bar slid down
* Tapped with both fingers to quickly toggle text input on and back off
* Noted that the keyboard bar slid up and then back down, and text input was inactive
* Tapped on the screen to turn text input on, tapped on the keyboard bar to bring up the full on-screen keyboard, and text input was active
* Pressed a key on the physical keyboard, the on-screen keyboard closed, the key press and release was delivered (with no text input) and then the keyboard bar slid up, and text input was active again

Fixes https://github.com/libsdl-org/SDL/issues/7979
2023-08-02 00:11:17 -07:00
Sam Lantinga
5fb92ef2f7 Fixed whitespace 2023-08-02 00:11:17 -07:00
Sam Lantinga
f5ea6ae18d Revert "Stop beep when running iOS apps on ARM-based Macs"
This reverts commit bbf38bbbc3, which prevented text input from working when a hardware keyboard was connected, since key strokes don't get to the text input field.

Fixes https://github.com/libsdl-org/SDL/issues/7958
2023-08-02 00:08:07 -07:00
Sam Lantinga
546508b9b4 Allow test programs to run at full resolution on iPads 2023-08-01 21:52:23 -07:00
Sam Lantinga
68a4bb01e0 Allocate displays as an array of pointers instead of an array of objects
This fixes current_mode from pointing at the wrong data when displays are moved around
2023-08-01 19:24:29 -07:00
Sam Lantinga
07578fde3d Fixed crash if a display is enumerated twice
This can happen if a monitor is in the process of becoming primary because another monitor was disconnected.
2023-08-01 18:28:55 -07:00
Ozkan Sezer
a509771a87 fix ios CI workflow after commit e4460e897f 2023-08-01 08:51:02 +03:00
Sam Lantinga
72ce76905a The scheme isn't always the same as the framework name (e.g. xmp_lite vs xmp-lite) 2023-07-31 22:31:06 -07:00
Sam Lantinga
e4460e897f By default Xcode expects the framework target name to be the name of the project. 2023-07-31 22:03:50 -07:00
Sam Lantinga
ac683773dc Added missing tests to the "All" target 2023-07-31 21:39:26 -07:00
Sam Lantinga
7dd56eaafe Removed unnecessary reference to testoverlay-Info.plist 2023-07-31 21:36:09 -07:00
Sam Lantinga
e1c7f524ef Reduce the number of times SDL3 is duplicated in the xcframework script 2023-07-31 21:25:23 -07:00
Sam Lantinga
65538011ca Make Xcode targets more specific
This makes sure they show up in the scheme selection menu when included with other libraries in top level Xcode projects
2023-07-31 21:17:03 -07:00
Sam Lantinga
efe114c300 Revert "Renamed the xcframework target from "SDL.xcframework" to "xcframework""
This reverts commit 73ed1d21a9.
2023-07-31 21:11:18 -07:00
Sam Lantinga
73ed1d21a9 Renamed the xcframework target from "SDL.xcframework" to "xcframework" 2023-07-31 20:54:08 -07:00
Sam Lantinga
76b4d8a0d8 Build the Framework instead of a static library for iOS and tvOS 2023-07-31 20:53:43 -07:00
Sam Lantinga
d1bf979160 Removed unnecessary setting from the "Create DMG" target 2023-07-31 18:51:13 -07:00
Sam Lantinga
c94cb3a5d8 Simplified the Xcode project to a single Framework target
Static and shared libraries can be built using CMake support in SDL 3.0

Built tests for macOS, iOS, and tvOS
2023-07-31 18:38:18 -07:00
Anonymous Maarten
ea60474c65 cmake: don't build SDL3-static Apple framework 2023-08-01 01:35:57 +00:00
SDL Wiki Bot
8f00d7856d Sync SDL3 wiki -> header 2023-07-31 23:40:15 +00:00
Semphris
d4a867a256 Rename SDL_GetPath to SDL_GetUserFolder
The documentation has been edited accordingly, and certain parts have been clarified.
2023-07-31 16:39:33 -07:00
Sam Lantinga
71099149b8 Fall back to Xlib if XRandR isn't available
This fixes video initialization on headless systems with VNC

Fixes https://github.com/libsdl-org/SDL/issues/8054
2023-07-31 14:38:48 -07:00
Sam Lantinga
b7f32f74ce Note the removal of the SDL_RENDERER_TARGETTEXTURE flag
Render targets are a core feature of SDL 3.0, so this flag has been removed.

The OpenGL ES renderer still doesn't support them, but we'll deal with that later.

Fixes https://github.com/libsdl-org/SDL/issues/8059
2023-07-31 08:36:44 -07:00
Ryan C. Gordon
0eda582160 testaudiostreamdynamicresample: Load sample.wav correctly. 2023-07-30 23:00:52 -04:00
Ryan C. Gordon
87eae9a0a1 aaudio: We need a mixbuf on capture devices, too. 2023-07-30 20:24:27 -04:00
Frank Praznik
fb68e84646 wayland: Fix memory leaks
Fix some memory leaks reported by Valgrind due to not destroying objects.
2023-07-30 12:46:02 -04:00
Ryan C. Gordon
b0edd23c00 testsurround: Log available audio output devices at the start. 2023-07-30 11:57:30 -04:00
Ryan C. Gordon
ae3090c387 androidaudio: Move Init/bootstrap code to bottom of source code.
I can't ever find this when it's in the middle! It's a "me" problem.  :)
2023-07-30 11:56:43 -04:00
Ryan C. Gordon
18fc0db9e5 aaudio: Rearranged source code to match other backends. 2023-07-30 11:56:43 -04:00
Ryan C. Gordon
2507c1d68b aaudio: Disconnect playing devices if error callback fires. 2023-07-30 11:56:42 -04:00
Ryan C. Gordon
32a3fc3783 aaudio: Use the callback interface.
This is allegedly lower-latency than the AAudioStream_write interface,
but more importantly, it let me set this up to block in WaitDevice.

Also turned on the low-latency performance mode, which trades battery life
for a more efficient audio thread to some unspecified degree.
2023-07-30 11:56:42 -04:00
Ryan C. Gordon
b49ce86765 audio: Fixed compiler warning on Android NDK. 2023-07-30 11:56:42 -04:00
Ryan C. Gordon
1c074e8d97 android: Fixed audio device detection. 2023-07-30 11:56:42 -04:00
Ryan C. Gordon
82ce05ad01 pulseaudio: Be more aggressive with hotplug thread synchronization.
(Borrowed from the SDL2 branch.)
2023-07-30 11:56:41 -04:00
Ryan C. Gordon
5cbdf1168e androidaudio: Fixed incorrect JNI call (thanks, @madebr!) 2023-07-30 11:56:41 -04:00
Ryan C. Gordon
660054f3dc include: Correct comment about audio device hotplug events. 2023-07-30 11:56:41 -04:00
Ryan C. Gordon
ab68428a64 aaudio: Fixed for older SDKs and Android releases. 2023-07-30 11:56:41 -04:00
Ryan C. Gordon
5ff87c6d4a android: Reworked audio backends for SDL3 audio API.
This involved moving an `#ifdef` out of SDL_audio.c for thread priority,
so the default ThreadInit now does the usual stuff for non-Android platforms,
the Android platforms provide an implementatin of ThreadInit with their
side of the `#ifdef` and other platforms that implement ThreadInit
incorporated the appropriate code...which is why WASAPI is touched in here.

The Android bits compile, but have not been tested, and there was some
reworkings in the Java bits, so this might need some further fixes still.
2023-07-30 11:56:41 -04:00
Ryan C. Gordon
54af687210 testautomation_audio.c: Patched to compile. :/ 2023-07-30 11:56:40 -04:00
Ryan C. Gordon
5e82090662 testautomation_audio.c: Apparently we aren't updating test code for C99 atm. 2023-07-30 11:56:40 -04:00
Ryan C. Gordon
7f4488f625 wasapi: More fixes for Clang warnings. 2023-07-30 11:56:40 -04:00
Ryan C. Gordon
29a0c689c9 wasapi: Patched to compile with Clang. 2023-07-30 11:56:40 -04:00
Ryan C. Gordon
4aa95c21bc pspaudio: Patched to compile. 2023-07-30 11:56:40 -04:00
Ryan C. Gordon
9a2a0a1463 ps2audio: Delete errant character that got inserted before previous commit. 2023-07-30 11:56:39 -04:00
Ryan C. Gordon
2c578bd0d5 qnxaudio: Rewrite for SDL3 audio APIs.
I have no way to compile or test this atm, so this will likely need
further attention. I ended up cleaning this up a ton and adding missing
features, so the code changes are pretty dramatic vs a simple conversion
to SDL3...so tread carefully in here.
2023-07-30 11:56:39 -04:00
Ryan C. Gordon
455eef4cd9 audio: Use AtomicAdd for device counts, don't treat as a refcount. 2023-07-30 11:56:39 -04:00
Ryan C. Gordon
095ea57f94 pspaudio: Patched to compile. 2023-07-30 11:56:39 -04:00
Ryan C. Gordon
d7cf63db67 ps2audio: Patched to compile. 2023-07-30 11:56:38 -04:00
Ryan C. Gordon
027b9e8787 coreaudio: (maybe) patched to compile on iOS. 2023-07-30 11:56:38 -04:00
Ryan C. Gordon
4836c2db07 pspaudio: Patched to compile. 2023-07-30 11:56:38 -04:00
Ryan C. Gordon
86ca412436 n3dsaudio: Patched to compile. 2023-07-30 11:56:38 -04:00
Ryan C. Gordon
66bcee2ca9 testaudiostreamdynamicresample.c: Fixed MSVC compiler warning. 2023-07-30 11:56:38 -04:00
Ryan C. Gordon
dbf993d358 vitaaudio: patched to compile. 2023-07-30 11:56:37 -04:00
Ryan C. Gordon
5707e14716 audio: Fix up some things that broke when rebasing the branch against main. 2023-07-30 11:56:37 -04:00
Ryan C. Gordon
6567285eae SDL_migration.cocci: Fix up SDL_(Pause|Unpause)Audio. 2023-07-30 11:56:37 -04:00
Ryan C. Gordon
0b6255551e test: Fixed incorrect SDL_OpenAudioDevice call in testautomation. 2023-07-30 11:56:37 -04:00
Ryan C. Gordon
107fd941cd vitaaudio: Clean up correctly in CloseDevice. 2023-07-30 11:56:37 -04:00
Ryan C. Gordon
9fa4a6ef87 netbsdaudio: Minor fix. 2023-07-30 11:56:36 -04:00
Ryan C. Gordon
b0d89868c6 n3dsaudio: Updated (but untested!) for SDL3 audio API. 2023-07-30 11:56:36 -04:00
Ryan C. Gordon
ba27176106 vitaaudio: Untested attempt to move Vita audio to SDL3's audio API. 2023-07-30 11:56:36 -04:00
Ryan C. Gordon
0b58e96d9e wasapi: Patched WinRT to compile. 2023-07-30 11:56:36 -04:00
Ryan C. Gordon
d6b4f48488 visualc: Turn on multiprocessor compilation. 2023-07-30 11:56:35 -04:00
Ryan C. Gordon
c58d95c343 wasapi: Reworked for new SDL3 audio API, other win32 fixes.
The WinRT code has _also_ be updated, but it has not been
tested or compiled, yet.
2023-07-30 11:56:35 -04:00
Ryan C. Gordon
dc04f85646 audio: whoops, that should be an int. 2023-07-30 11:56:35 -04:00
Ryan C. Gordon
be0dc630b7 audio: Fixed incorrect assertion 2023-07-30 11:56:35 -04:00
Ryan C. Gordon
77b3fb06ee directsound: First shot at updating for SDL3 audio API.
This does an enormous amount of work in SDL_immdevice.c to simplify and
clean up that interface, while moving some of its responsibilities to the
higher level SDL_audio.c. I hope I saw the whole picture here, and this
wasn't foolhardy of me.

WASAPI has not been updated for these changes, or for SDL3 at all, yet. As
such, it continues to be broken for now. It will be updated soon.

This code compiles with my cross compiler, but hasn't been built with
Visual Studio, or tested in any form, so there might be obvious fixes
following along shortly.
2023-07-30 11:56:35 -04:00
Ryan C. Gordon
4399b71715 audio: Generalize how backends can lookup an SDL_AudioDevice. 2023-07-30 11:56:34 -04:00
Ryan C. Gordon
2fb122fe46 audio: backends now "find" instead of "obtain" devices by handle.
Every single case of this didn't want the device locked, so just looking
it up without having to immediately unlock it afterwards is better here.

Often these devices are passed on to other functions that want to lock them
themselves anyhow (disconnects, default changes, etc).
2023-07-30 11:56:34 -04:00
Ryan C. Gordon
c3f5a5fc72 dummyaudio: SDL3ify style 2023-07-30 11:56:34 -04:00
Ryan C. Gordon
7d65ff86e2 diskaudio: Adjusted for later SDL3 audio API redesign changes. 2023-07-30 11:56:34 -04:00
Ryan C. Gordon
4ba9c2eade dummyaudio: Configurable delay, other SDL3 API fixes. 2023-07-30 11:56:33 -04:00
Ryan C. Gordon
fb395d3ad7 sndio: Updated to the SDL3 audio API. 2023-07-30 11:56:32 -04:00
Ryan C. Gordon
1a55282051 dsp: Some minor logic fixes 2023-07-30 11:56:11 -04:00
Ryan C. Gordon
6bc85577d7 netbsdaudio: Updated for SDL3 audio API. 2023-07-30 11:56:10 -04:00
Ryan C. Gordon
0f6e59312b netbsdaudio: Removed email address from source code.
Not to diminish their contribution, but I'm about to tear this code up
and would rather the bug reports go to the SDL project.
2023-07-30 11:56:10 -04:00
Ryan C. Gordon
51ae78c0af haikuaudio: Updated for SDL3 audio API. 2023-07-30 11:56:10 -04:00
Ryan C. Gordon
fc7ed18ca1 emscriptenaudio: don't forget to finalize the audio thread 2023-07-30 11:56:10 -04:00
Ryan C. Gordon
4233c41ce2 pulseaudio: Removed unnecessary variable. 2023-07-30 11:56:10 -04:00
Ryan C. Gordon
a0528cd5ed emscriptenaudio: Updated for SDL3 audio API. 2023-07-30 11:56:09 -04:00
Ryan C. Gordon
79cc29ba35 wave: Don't check if format->channels > INT_MAX, it's a Uint16. 2023-07-30 11:56:09 -04:00
Ryan C. Gordon
1bfe97c235 pspaudio: Updated for SDL3 audio API.
However, this still blocks in PlayDevice and leaves WaitDevice as a no-op,
which isn't ideal, since the device lock is held during PlayDevice.

Ideally, this should be fixed.
2023-07-30 11:56:09 -04:00
Ryan C. Gordon
121a2dce15 audio: Make sure device->hidden is NULL after CloseDevice 2023-07-30 11:56:09 -04:00
Ryan C. Gordon
3d6ba0cafd ps2audio: Removed free of buffer that hasn't been allocated yet. 2023-07-30 11:56:08 -04:00
Ryan C. Gordon
00ed6f8827 test: Fixed compiler warnings for unused vars. 2023-07-30 11:56:08 -04:00
Ryan C. Gordon
6f12f68ec9 ps2audio: SDL3ified the style 2023-07-30 11:56:08 -04:00
Ryan C. Gordon
4993743a02 ps2audio: Renamed _this to device 2023-07-30 11:56:08 -04:00
Ryan C. Gordon
74568cdb2b ps2audio: Updated (but untested) for SDL3 audio API. 2023-07-30 11:56:08 -04:00
Ryan C. Gordon
c83b68ef26 jack: renamed _this to device. 2023-07-30 11:56:07 -04:00
Ryan C. Gordon
3f4f004794 audio: Remove an assertion that no longer makes sense.
One may happen to call SDL_AudioThreadFinalize when thread_alive is not set.
2023-07-30 11:56:07 -04:00
Ryan C. Gordon
86243b2589 jack: Use ProvidesOwnCallbackThread.
We were firing a semaphore from the JACK-provided thread to otherwise work
within the standard SDL2 device thread, but there's no need for this in SDL3.
2023-07-30 11:56:07 -04:00
Ryan C. Gordon
18906a32b8 jack: First shot at updating for SDL3 audio API. 2023-07-30 11:56:07 -04:00
Ryan C. Gordon
a2b488359e dsp: Removed debug logging 2023-07-30 11:56:06 -04:00
Ryan C. Gordon
6fd71185cd dsp: Updated for new SDL3 audio API. 2023-07-30 11:56:06 -04:00
Ryan C. Gordon
3482d1215a alsa: Don't ever block in CaptureFromDevice. 2023-07-30 11:56:06 -04:00
Ryan C. Gordon
65d296ef1a audio: Use SDL_powerof2 instead of reinventing it. 2023-07-30 11:56:06 -04:00
Ryan C. Gordon
409b544505 alsa: Updated for new SDL3 audio API 2023-07-30 11:56:06 -04:00
Ryan C. Gordon
0999a090a7 audio: More tweaking of device->thread_alive 2023-07-30 11:56:05 -04:00
Ryan C. Gordon
f94ffd6092 audio: Fixed logic error 2023-07-30 11:56:05 -04:00
Ryan C. Gordon
4deb2970c9 alsa: Renamed _this to device 2023-07-30 11:56:05 -04:00
Ryan C. Gordon
0fb9e4baae audio: Remove no-longer-used SupportsNonPow2Samples 2023-07-30 11:56:05 -04:00
Ryan C. Gordon
c653e57768 coreaudio: rewritten for SDL3 audio redesign! 2023-07-30 11:56:04 -04:00
Ryan C. Gordon
533777eff5 audio: SDL_sysaudio.h comment conversion. 2023-07-30 11:56:04 -04:00
Ryan C. Gordon
8473e522e0 audio: unify device thread naming. 2023-07-30 11:56:04 -04:00
Ryan C. Gordon
258bc9efed audio: PlayDevice now passes the buffer, too, for convenience. 2023-07-30 11:56:04 -04:00
Ryan C. Gordon
e518149d14 audio: Fixed locking in SDL_AudioDeviceDisconnected 2023-07-30 11:56:03 -04:00
Ryan C. Gordon
22afa5735f audio: FreeDeviceHandle should pass the whole device, for convenience. 2023-07-30 11:56:03 -04:00
Ryan C. Gordon
9e3c5f93e0 coreaudio: Change _this to device 2023-07-30 11:56:03 -04:00
Ryan C. Gordon
e969160de0 audio: unset a freed variable to NULL 2023-07-30 11:56:03 -04:00
Ryan C. Gordon
1fc01b0300 audio: Try to definitely have a default device set up. 2023-07-30 11:56:03 -04:00
Ryan C. Gordon
b60a56d368 audio: take first reported device if no default was specified. 2023-07-30 11:56:02 -04:00
Ryan C. Gordon
a8323ebe68 audio: Better handling of ProvidesOwnCallbackThread backends. 2023-07-30 11:56:02 -04:00
Ryan C. Gordon
1dffb72c1d pipewire: Hooked up default device change notifications. 2023-07-30 11:56:02 -04:00
Ryan C. Gordon
a93fcf2444 audio: fixed flushed stream reporting bytes but not being able to get them.
This would happen when you had ~1 frame of audio left in the stream, and
resampling needs would cause this to not be enough to produce audio.

But since we're already flushed, we can just add silence padding to let the
app extract these last bits.
2023-07-30 11:56:02 -04:00
Ryan C. Gordon
ad6c1781fc pulseaudio: Minor cleanups. 2023-07-30 11:56:02 -04:00
Ryan C. Gordon
cfc8a0d17d pipewire: First shot at moving to the new SDL3 audio interfaces.
This needs a little work still, but it mostly works.
2023-07-30 11:56:01 -04:00
Ryan C. Gordon
13202642a3 aaudio: Fixed capitialization, plus some minor cleanups. 2023-07-30 11:56:01 -04:00
Ryan C. Gordon
3e9991b535 audio: Make sure we don't write to a NULL pointer.
(This _probably_ never happens in the current codebase, but just in case.)
2023-07-30 11:56:01 -04:00
Ryan C. Gordon
943351affb pulseaudio: GetDefaultAudioInfo isn't a thing anymore. 2023-07-30 11:56:01 -04:00
Ryan C. Gordon
11dfc4d737 test: Update testautomation_audio for SDL3 audio API. 2023-07-30 11:56:00 -04:00
Ryan C. Gordon
29afc2e42b test: Update testresample for SDL3 audio API. 2023-07-30 11:56:00 -04:00
Ryan C. Gordon
3a02eecced test: Update testsurround for SDL3 audio API. 2023-07-30 11:56:00 -04:00
Ryan C. Gordon
e1c78718d4 test: testaudiocapture is updated for the SDL3 audio API. 2023-07-30 11:56:00 -04:00
Ryan C. Gordon
f48cb716c2 pulseaudio: a couple minor tweaks. 2023-07-30 11:55:59 -04:00
Ryan C. Gordon
dac25fe9eb audio: Seperate audio capture into Wait/Read operations.
Before it would just block in read operations, but separating this out
matches what output devices already do, and also lets us separate out the
unlocked waiting part from the fast part that holds the device lock.
2023-07-30 11:55:59 -04:00
Ryan C. Gordon
3e10c0005d audio: Capture devices should respect logical device pausing. 2023-07-30 11:55:59 -04:00
Ryan C. Gordon
7e700531c5 audio: Allow SDL_OpenAudioDevice to accept a NULL spec.
This means "I don't care what format I get at all" and will just use
the device's current (and/or default) format.

This can be useful, since audio streams cover the differences anyhow.
2023-07-30 11:55:59 -04:00
Ryan C. Gordon
bb1cbbd33a test: Update testaudioinfo for SDL3 audio API. 2023-07-30 11:55:58 -04:00
Ryan C. Gordon
883aee32c5 audio: Let default formats differ for output and capture devices. 2023-07-30 11:55:58 -04:00
Ryan C. Gordon
62cf24eeb9 pulseaudio: Listen for server events in addition to sources and sinks.
This gets us default device change notifications more efficiently, presumably.
2023-07-30 11:55:58 -04:00
Ryan C. Gordon
924f370bd7 pulseaudio: Fix deadlock in HotplugThread.
If we wait for context subscription to finish, we might miss the signal
telling us to terminate the thread...this can happen if an app initializes
the audio subsystem and then quits immediately.

So just go right into the main loop of the thread; the subscription will
finish when it finishes and then events will flow.
2023-07-30 11:55:58 -04:00
Ryan C. Gordon
5d4e9e5f80 test: Updated testaudiostreamdynamicresample to SDL3 audio API. 2023-07-30 11:55:58 -04:00
Ryan C. Gordon
f883b9fc64 test: Updated testaudiohotplug to SDL3 audio API. 2023-07-30 11:55:57 -04:00
Ryan C. Gordon
2be5f726d4 audio: Removed debug logging. 2023-07-30 11:55:57 -04:00
Ryan C. Gordon
323ecce123 docs: Added migration note about SDL_AUDIODEVICEREMOVED. 2023-07-30 11:55:57 -04:00
Ryan C. Gordon
47b0321ebf test: Removed loopwavequeue.c; obsolete in SDL3. 2023-07-30 11:55:57 -04:00
Ryan C. Gordon
0e5a1d4f29 pulseaudio: Removed debug logging. 2023-07-30 11:55:57 -04:00
Ryan C. Gordon
f598626e46 test: loopwave shouldn't use an audiostream callback. 2023-07-30 11:55:56 -04:00
Ryan C. Gordon
eee407caf8 docs: migration guide note that SDL_LoadWAV has a different return type. 2023-07-30 11:55:56 -04:00
Ryan C. Gordon
b03c493fc4 test: Updated testmultiaudio to new SDL3 audio API 2023-07-30 11:55:56 -04:00
Ryan C. Gordon
fe1daf6fb5 audio: Mark disconnected default devices as "zombies".
Zombie devices just sit there doing nothing until a new default device
is chosen, and then they migrate all their logical devices before being
destroyed.

This lets the system deal with the likely outcome of a USB headset being
the default audio device, and when its cable is yanked out, the backend
will likely announce this _before_ it chooses a new default (or, perhaps,
the only device in the system got yanked out and there _isn't_ a new
default to be had until the user plugs the cable back in).

This lets the audio device hold on without disturbing the app until it can
seamlessly migrate audio, and it also means the backend does not have to
be careful in how it announces device events, since SDL will manage the
time between a device loss and its replacement.

Note that this _only_ applies to things opened as the default device
(SDL_AUDIO_DEVICE_DEFAULT_OUTPUT, etc). If those USB headphones are the
default, and one SDL_OpenAudioDevice() call asked for them specifically and
the other just said "give me the system default," the explicitly requested
open will get a device-lost notification immediately. The other open will
live on as a zombie until it can migrate to the new default.

This drops the complexity of the PulseAudio hotplug thread dramatically,
back to what it was previously, since it no longer needs to fight against
Pulse's asychronous nature, but just report device disconnects and new
default choices as they arrive.

loopwave has been updated to not check for device removals anymore; since
it opens the default device, this is now managed for it; it no longer
needs to close and reopen a device, and as far as it knows, the device
is never lost in the first place.
2023-07-30 11:55:56 -04:00
Ryan C. Gordon
cdd2ba81de audio: Fixed adding new physical devices to a double-linked list.
(Forgot to hook up existing node's `prev` field when adding the new device
to the head of the list. Doh.)
2023-07-30 11:55:55 -04:00
Ryan C. Gordon
db39cbf208 audio: Allow SDL_GetAudioDeviceFormat() to query the default devices.
Officially removed SDL_GetDefaultAudioInfo(), as its functionality that
isn't obsolete is now offered elsewhere.
2023-07-30 11:55:55 -04:00
Ryan C. Gordon
ee10bab3cd audio: An enormous amount of work on managing default devices. 2023-07-30 11:55:55 -04:00
Ryan C. Gordon
c7a44eea83 audio: Fixed logic error. 2023-07-30 11:55:55 -04:00
Ryan C. Gordon
089cd87cb5 audio: Make sure device count stays correct as hardware disconnects. 2023-07-30 11:55:54 -04:00
Ryan C. Gordon
e50cb72eb6 docs: Note that audio opening doesn't implicitly init SDL now. 2023-07-30 11:55:54 -04:00
Ryan C. Gordon
97b2f747d0 docs: Corrections to audio section of README-migration.md 2023-07-30 11:55:54 -04:00
Ryan C. Gordon
464640440f audio: Added SDL_GetAudioStreamBinding.
Now you can open a device, bind a stream, and forget about the device ID
until you're ready to shutdown, where you can query the stream for it.
2023-07-30 11:55:54 -04:00
Ryan C. Gordon
01f7b53865 audio: Readded (logical) device pausing. 2023-07-30 11:55:53 -04:00
Ryan C. Gordon
fd4c9f4e11 audio: documentation improvements. 2023-07-30 11:55:53 -04:00
Ryan C. Gordon
4b78b789a7 audio: Switch SDL_audio.c and SDL_audiocvt.c to C99-ish syntax.
These files are completely different from SDL2, and no clean merging
is likely to happen there anyhow, so there's really no harm in just
switching them over completely to SDL3's new policy of allowing `//`
comments and mixed variable declarations.

Feels deeply sacrilegious, though.
2023-07-30 11:55:53 -04:00
Ryan C. Gordon
d96a1db7d7 audio: Opening via a logical device ID should also track default device.
As these will change devices as the default device changes, in the future,
we would want the original and new logical device to stay together.
2023-07-30 11:55:53 -04:00
Ryan C. Gordon
b2e020958f audio: Wrap device access in opening of logical devices.
Now you open an audio device and attach streams, as planned, but each
open generates a new logical device. Each logical device has its own
streams that are managed as a group, but all streams on all logical
devices are mixed into a single buffer for a single OS-level open of
the physical device.

This allows multiple opens of a device that won't interfere with each
other and also clean up just what the opener assigned to their logical
device, so all their streams will go away on close but other opens will
continue to mix as they were.

More or less, this makes things work as expected at the app level, but
also gives them the power to group audio streams, and (once added) pause
them all at once, etc.
2023-07-30 11:55:53 -04:00
Ryan C. Gordon
7ee2459927 audio: Check for unlikely failure case in WAV loaded.
I don't think this can fail at the moment, but if WaveCheckFormat goes
out of sync with this switch statement at some point, this seems like
a good failsafe.
2023-07-30 11:55:52 -04:00
Ryan C. Gordon
3d65a2cefe audio: Made SDL_LoadWAV a real function, not just a macro. 2023-07-30 11:55:52 -04:00
Ryan C. Gordon
26525f5fd3 audio: Readd SDL_AudioSpec, but just with format/channels/freq fields. 2023-07-30 11:55:52 -04:00
Ryan C. Gordon
e6aaed7d79 include: Audio is not, and has not been, a raw mixing buffer for a long time. 2023-07-30 11:55:52 -04:00
Ryan C. Gordon
56b1bc2198 audio: SDL_AudioStream now has callbacks for Get and Put operations.
This allows code to feed a stream (or feed from a stream) on-demand,
which is to say: it can efficiently simulate the SDL2 audio callback.
2023-07-30 11:55:51 -04:00
Ryan C. Gordon
905c4fff5b audio: First shot at the SDL3 audio subsystem redesign!
This is a work in progress! (and this commit will probably get
force-pushed over at some point).
2023-07-30 11:55:51 -04:00
1vanK
b221b59995 cmake: add SDL_REVISION option
This is useful if one has vendored SDL git and want to avoid rebuilding SDL on every git commit.
2023-07-29 21:16:32 +00:00
Mathieu Eyraud
0500fca00c Add missing break 2023-07-29 10:29:00 -04:00
Ozkan Sezer
d3f2de7f29 fixed typo in prev. patch. 2023-07-28 07:35:04 +03:00
Ozkan Sezer
12b35c6a46 test/testnativecocoa.m: fixed deprecation warnings. 2023-07-28 07:20:50 +03:00
Anonymous Maarten
e24b3e2fa4 cmake: rename SDL_TEST -> SDL_TEST_LIBRARY 2023-07-28 04:41:29 +02:00
Anonymous Maarten
da5016d336 cmake: use pkg-config + test compile instead of Find module for detecting rpi 2023-07-28 04:41:29 +02:00
Anonymous Maarten
deec574ff6 cmake: fix SDL_HIDAPI_LIBUSB 2023-07-28 04:41:29 +02:00
SDL Wiki Bot
f2ae00c1ad Sync SDL3 wiki -> header 2023-07-27 22:43:14 +00:00
Anonymous Maarten
41a96c8133 doc: document building of SDL tests with CMake 2023-07-28 00:41:26 +02:00
Sam Lantinga
3174d0b970 Sorted controller list 2023-07-27 12:48:15 -07:00
Max Maisel
27b8abb056 Add Steam Deck controller mapping to database.
This adds support for the back paddles, and the "..." key
which are not automatically detected.
* "Back" is mapped to the top left "two windows" key.
* "Start" is mapped to the top right "hambuger menu" key.
* "Guide" is mapped to the "Steam" key.
* The "..." key is just a generic button.

When looking at the screen, paddles are number
* P1: Top right
* P2: Top left
* P3: Bottom right
* P4: Botom Left

The new controller mapping was created with the SDL3 gamepadmap tool.
2023-07-27 12:46:47 -07:00
Sam Lantinga
41d436f0fe Use SetWindowPos to show windows when SDL_HINT_WINDOW_ACTIVATE_WHEN_SHOWN is set to avoid activating the parent window when showing a child window 2023-07-27 11:56:53 -07:00
Sam Lantinga
0dc85f3078 Improved the documentation for the gamepad paddle buttons 2023-07-27 11:27:42 -07:00
Frank Praznik
2fff999a41 Try to create the dummy mouse cursor after video backend initialization
The mouse->CreateCursor function pointer will always be null if checked before the video backend is initialized, so a dummy default cursor with null internal structures was being created in all cases, not just for backends lacking cursor functionality. Move the check to after the video subsystem is initialized, when the function pointer check is valid.

Passing this dummy cursor with null internal structures to the Wayland backend would cause a crash, as it requires the internal cursor structures to be valid in order to store cursor backing data, even for default system cursors.
2023-07-27 13:00:50 -04:00
SDL Wiki Bot
d086d9874d Sync SDL3 wiki -> header 2023-07-27 13:36:07 +00:00
Ryan C. Gordon
bce598addd SDL_pixels.c: Fixed compiler warning on Android NDK. 2023-07-26 15:49:24 -04:00
SDL Wiki Bot
ad0c0d3cde Sync SDL3 wiki -> header 2023-07-26 17:17:06 +00:00
Frank Praznik
f8e8dff7ee tests: Fix automated window grab and positioning tests under Wayland/XWayland
When using the Wayland video driver or X11 under XWayland, create a renderer and present a frame as part of window creation, as Wayland requires that a frame be presented for the window to be fully mapped and displayed onscreen. This fixes the grab and expected window size tests.

This also disables the window positioning tests when running under the Wayland driver, as Wayland does not allow application windows to position themselves in the desktop space, which renders the tests unreliable and subject to spurious failure.
2023-07-26 10:08:27 -04:00
Starbuck5
4cffbc3644 Add VS code directory to gitignore 2023-07-25 23:36:14 -07:00
Starbuck5
666f81bace Add more endian-specific aliases for 32 bit pixelformats
Add these for all the RGBX variants, just like all the RGBA variants already have.
2023-07-25 23:35:42 -07:00
Sam Lantinga
4749df0a63 Just disable the 4214 warning instead of trying to change the structure definition 2023-07-25 14:01:46 -07:00
Sam Lantinga
b8d91252c6 Fixed automation tests using the dummy video driver 2023-07-25 11:48:10 -07:00
Sam Lantinga
a16b241b89 Make sure the mouse and keyboard focus is cleared when a window is hidden 2023-07-25 11:47:55 -07:00
Sam Lantinga
21692bc9a8 Cleaned up dummy evdev initialization 2023-07-25 10:44:40 -07:00
Sam Lantinga
3c8f4dca1d Make sure we don't touch the controller effects state when we're in auto mode for PS4/PS5 controllers. 2023-07-24 10:17:02 -07:00
Sam Lantinga
8adab0b88a Removed invalid assert in testatomic 2023-07-22 18:39:39 -07:00
Anonymous Maarten
d5479d7b81 project: build in (at least) c99 mode 2023-07-22 15:55:48 -04:00
Anonymous Maarten
8105f1d5b5 SDL_atomic.h: __ARM_ARCH is not always defined for an arm platform
e.g. riscos toolchain
2023-07-22 15:55:48 -04:00
Anonymous Maarten
b8c8968b69 ci: disable precompiled headers for riscos 2023-07-22 15:55:48 -04:00
Frank Praznik
96720f3350 wayland: Don't clamp the max window size when unbounded 2023-07-22 11:42:23 -04:00
Anonymous Maarten
3823219b28 ci: bump mymindstorm/setup-emsdk to latest tag 2023-07-22 17:36:02 +02:00
Frank Praznik
813e7c3992 wayland: Ensure that the maximum libdecor frame size limit is above the required minimum
Both the minimum and maximum libdecor frame size limits must meet or exceed the required minimum size, or the libdecor plugins can error and/or crash.
2023-07-22 10:26:33 -04:00
Alexander Richards
ec5088cb99 src/SDL.c: add managarm support 2023-07-21 22:45:21 -04:00
Weng Xuetian
d4519aafd3 Remove the unimplemented CloseIC in fcitx module
This call is actually a left-over when porting from fcitx4 service to the new org.freedesktop.portal.Fcitx supported by both fcitx4/fcitx5. CloseIC is actually never a part of the new interface on org.freedesktop.portal.Fcitx. It cause any issue user visible effect.
2023-07-20 13:36:33 -07:00
Frank Praznik
5c2fb6eb61 wayland: Adjust the position of existing popups when resizing a window
When resizing a window, adjust the size of the anchor rect and ensure that existing popups remain in bounds/adjacent to avoid a protocol error.
2023-07-20 15:10:39 -04:00
Frank Praznik
72a489e6be wayland: Always use the requested compositor dimensions for fullscreen windows
In the event that the compositor sends window dimensions of (0,0), use the last requested compositor dimensions for fullscreen windows as opposed to trying to guess the target dimensions from the output, which can be null if no outputs are present, or wrong in the case of multi-display setups.  Fullscreen windows must respect the maximum dimensions reported by the compositor, or a protocol violation can result.

This also prevents possible crashes if the compositor sends a config event with dimensions of (0,0) before a display has been added and/or finalized.
2023-07-20 12:06:59 -04:00
Anonymous Maarten
3ab4665956 cmake: bump minimum required CMake version to 3.16
main features:

- No more sdl-build-options/sdl-shared-build-options/sdl-global-options
- Dependency information is stored on SDL3-collector for sdl3.pc
- Use helper functions to modify the SDL targets;
    - sdl_sources to add sources
    - sdl_glob_sources to add glob soruces
    - sdl_link_dependency to add a link dependency that might also
      appear in sdl3.pc/SDL3Config.cmake
    - sdl_compile_definitions to add macro's
    - sdl_compile_options for compile options
    - sdl_include_directories for include directories
  They avoid repeated checks for existence of the SDL targets
- A nice feature of the previous is the ability to generate
  a sdl3.pc or SDL3Config.cmake that describes its dependencies
  accurately.

various:

- remove duplicate libc symbol list
- add CheckVulkan
- remove unused HAVE_MPROTECT
- add checks for getpagesize
2023-07-20 17:58:06 +02:00
SDL Wiki Bot
a3a9019265 Sync SDL3 wiki -> header 2023-07-20 14:55:15 +00:00
Anonymous Maarten
a4bb4eef73 cmake: create Android jars + apks for tests 2023-07-20 16:54:29 +02:00
Sam Lantinga
58882425fc Use the lower index axis if the controller generates two axes for a single element
The Flydigi Apex and Vader controllers fire both axis 4 and 5 for the right thumbstick Y axis, for example.
2023-07-19 09:48:32 -07:00
Sam Lantinga
255f297439 Fixed crash if SetMappingValue() is passed a NULL key 2023-07-19 09:23:08 -07:00
Sam Lantinga
58e3084477 The Flydigi Vader and Apex series controllers all have the same VID, PID, and name 2023-07-19 09:22:01 -07:00
Sam Lantinga
e413457a7e Fixed clearing the mapping in testcontroller 2023-07-18 22:10:44 -07:00
Sam Lantinga
732218c222 Changed binding order to match Steam 2023-07-18 22:04:55 -07:00
Sam Lantinga
53882a2ed2 Map the buttons in ABXY order 2023-07-18 17:36:40 -07:00
Sam Lantinga
85eb1fa515 Fixed double-comma if the crc is first in the mapping 2023-07-18 17:32:46 -07:00
Sam Lantinga
c0e0f47755 Make sure there are commas in gamepad mapping strings 2023-07-18 17:11:02 -07:00
Anonymous Maarten
b1a0bc3fb0 testlocale: only ininitialize video when needed 2023-07-19 00:14:38 +02:00
Ozkan Sezer
4ca0e937e1 hidapi: remove unwanted files (e.g.: .git*, etc...) 2023-07-19 00:55:04 +03:00
Ozkan Sezer
40ac818bf8 hidapi: sync with mainstream (typo fixes) 2023-07-19 00:40:10 +03:00
Sam Lantinga
2bf05f38ad Increased the timeout when opening /dev/hidraw nodes
We're still seeing it taking longer than 10ms for permissions to become available on Steam Deck.
2023-07-18 14:28:55 -07:00
Anonymous Maarten
e620925728 testlocale: don't pass SDL_INIT_VIDEO to SDL_Init 2023-07-18 22:48:14 +02:00
Frank Praznik
ef4ce8cec5 test: Add flag to suspend drawing when occluded
Add the flag "--suspend-when-occluded" to testgl, testgles2, and testsprite, which, when used, will suspend rendering and throttle the event loop when the occlusion flag is set on the window.
2023-07-18 16:42:05 -04:00
Frank Praznik
44536b7537 Add and event and flag to report when a window has been occluded
Adds the SDL_EVENT_WINDOW_OCCLUDED events and the window flag SDL_WINDOW_OCCLUDED to report when the window occlusion state has changed, so that the application can take appropriate measures, as it may wish to suspend drawing, throttle, or otherwise behave in a more energy efficient manner when the window is not visible. When the window is no longer occluded, the SDL_EVENT_WINDOW_EXPOSED event is sent and the occlusion flag is cleared.

This is handled on macOS via the window occlusion state event (available as of 10.9), and via the xdg-shell protocol on Wayland (version 6, wayland-protocols 1.32, passed through in libdecor 0.1.2).
2023-07-18 16:42:05 -04:00
Sam Lantinga
7aec9ad4a6 Make sure the mapping string doesn't have extraneous whitespace
If that whitespace is extra newlines in the mapping hint, we would create extra empty mapping strings
2023-07-18 13:25:47 -07:00
Sam Lantinga
9db2cb3513 Added SDL_ReloadGamepadMappings() to reset the SDL gamepad mappings 2023-07-18 12:50:10 -07:00
Sam Lantinga
75e7a6fcfa SDL_AddGamepadMappingsFromFile() has been made into a real function 2023-07-18 12:05:04 -07:00
Sam Lantinga
dfc6e8825e Improved reliability of gamepad message ordering
The gamepad vs joystick events always happen in this order:
SDL_EVENT_JOYSTICK_ADDED
SDL_EVENT_GAMEPAD_ADDED
SDL_EVENT_GAMEPAD_REMAPPED
SDL_EVENT_GAMEPAD_REMOVED
SDL_EVENT_JOYSTICK_REMOVED

Whenever a mapping is changed, any controller affected by that mapping will generate a gamepad event. You will only get one SDL_EVENT_GAMEPAD_REMAPPED event per controller per batch of mapping changes, where SDL_AddGamepadMappingsFromFile() and SDL_AddGamepadMapping() are each a batch of changes.
2023-07-18 11:52:56 -07:00
Sam Lantinga
ccefce8321 Send gamepad and joystick removed events when quitting
This helps applications do proper cleanup when reinitializing gamepads, e.g. to reset controller mappings
2023-07-18 09:01:14 -07:00
Sam Lantinga
0a4e6f6d29 Added SDL_strnlen() and SDL_wcsnlen() 2023-07-17 19:37:51 -07:00
rfht
4d63c919f9 simplify OpenBSD D-pad calculation with bitwise operation (#7996) 2023-07-17 19:01:23 -07:00
Sam Lantinga
4a18893c73 Don't fail to create a window if it's too large, just clamp it to the max instead
Some window is better than no window...
2023-07-17 17:48:11 -07:00
Sam Lantinga
eb8b5ed3a4 Fixed crash when the joystick can't be opened 2023-07-17 17:35:38 -07:00
Sam Lantinga
2ebbfe7c5b Added an "auto" mode for PS4 and PS5 controller rumble hints
This allows the controllers to report that they have sensors and enhanced capabilities, but not actually switch into enhanced mode (breaking DirectInput) unless the application tries to use them.
2023-07-17 17:32:57 -07:00
Sam Lantinga
bd4f155bbb Fixed LED pending check failing when the controller timestamp is very large
In this case we know the controller has been on for a while and the Bluetooth connection LED cycle is complete.

Also fixed the timestamp being zero the first time it is checked
2023-07-17 17:08:17 -07:00
Sam Lantinga
16dd5f0da4 Don't send k_EPS5FeatureReportIdCapabilities to Sony PS5 controllers
This report is for third party controllers only.
2023-07-17 16:45:31 -07:00
Sam Lantinga
2fef0be2f6 Don't tickle Bluetooth PS5 controllers in simple mode with an effects packet
That will put the PS5 controller into enhanced mode, which breaks DirectInput games
2023-07-17 16:42:58 -07:00
Sam Lantinga
75d4a91aaa Use SDL_GAMEPAD_TYPE_UNKNOWN, not SDL_GAMEPAD_TYPE_INVALID 2023-07-17 13:54:55 -07:00
SDL Wiki Bot
27556e098e Sync SDL3 wiki -> header 2023-07-17 20:00:18 +00:00
Sam Lantinga
b271e92c6e Added the ability to specify a gamepad type in the mapping
Also renamed most cases of SDL_GAMEPAD_TYPE_UNKNOWN to SDL_GAMEPAD_TYPE_STANDARD, and SDL_GetGamepadType() will return SDL_GAMEPAD_TYPE_UNKNOWN only if the gamepad is invalid.
2023-07-17 12:59:56 -07:00
Sam Lantinga
57820071a4 Added the ability to rename your controller 2023-07-16 15:57:32 -07:00
Sam Lantinga
08db0e8f64 Allow clicking on the gamepad image to bind elements 2023-07-16 15:57:32 -07:00
Sam Lantinga
8f21be87fc Allow using A and B to navigate the controller binding flow 2023-07-16 15:57:32 -07:00
Sam Lantinga
f3fe579cf0 Sort the entries in the controller mapping 2023-07-16 15:57:32 -07:00
Sam Lantinga
787786bdbc testcontroller: memory management cleanup
Also saved the guide button for last in the binding flow, since it may not be present on the controller or available from the OS
2023-07-16 15:57:32 -07:00
Ozkan Sezer
611b3dd1fd remove unused vulkan/*.hpp files. 2023-07-17 00:10:50 +03:00
Anonymous Maarten
87ccb886fe cmake: remove ability to build tests as a standalone project 2023-07-16 20:22:41 +02:00
Anonymous Maarten
80da0cf06d cmake: convert bmp images to c headers using python script
A pure CMake script was too slow
2023-07-16 16:31:06 +02:00
SDL Wiki Bot
74612701bb Sync SDL3 wiki -> header 2023-07-16 11:33:16 +00:00
Sam Lantinga
1a4995371b Use light text for button labels so they show up well over the activity highlight 2023-07-16 04:32:12 -07:00
Sam Lantinga
ae0fce3f01 testcontroller: show face button labels over the activity highlight 2023-07-16 04:32:12 -07:00
Sam Lantinga
505a8dfb15 testcontroller replaces gamepadmap 2023-07-16 04:32:12 -07:00
Sam Lantinga
8296242f2e We don't need to be verbose about gamepad events now that we can visualize them 2023-07-16 04:32:12 -07:00
Sam Lantinga
d90b938f0f Additional work on binding mode for testcontroller 2023-07-16 04:32:12 -07:00
Sam Lantinga
5388edd549 Removed Flydigi Vader 2 mappings
Many of the Flydigi controllers use the same VID/PID and have different mappings, so let's revisit this once we have more data.
2023-07-16 04:32:12 -07:00
Sam Lantinga
57cfd1e106 Removed SDL_GAMEPAD_TYPE_VIRTUAL, SDL_GAMEPAD_TYPE_AMAZON_LUNA, SDL_GAMEPAD_TYPE_GOOGLE_STADIA, and SDL_GAMEPAD_TYPE_NVIDIA_SHIELD
Removing SDL_GAMEPAD_TYPE_VIRTUAL allows a virtual controller to emulate another gamepad type. The other controller types can be treated as generic controllers by applications without special glyph or functionality treatment.
2023-07-16 04:32:12 -07:00
Sam Lantinga
689555a400 Added gamepad BMP files used as sources for the header files 2023-07-16 04:32:12 -07:00
Sam Lantinga
404e030b39 Added binding mode to testcontroller 2023-07-16 04:32:12 -07:00
Sam Lantinga
6c2472d459 Relicensed testutils to match other test code
Permission granted in 76a7b629bf (commitcomment-121408342)
2023-07-16 04:32:12 -07:00
Sam Lantinga
cd99ae47ef Improved button labels, based on controller style 2023-07-16 04:32:12 -07:00
Sam Lantinga
ee34805053 Added ABXY button labels to the gamepad image 2023-07-16 04:32:12 -07:00
Sam Lantinga
e674d81844 Show the gamepad bindings in testcontroller 2023-07-16 04:32:12 -07:00
Sam Lantinga
538292c1da Revert "More than one binding might trigger a gamepad button"
This reverts commit 6251504ac8aeb632cba5c9bb3502ad3628bc1bb3.

This is added CPU cost for a use case that was never supported. testcontroller will explicitly clear any previous binding, so I'm backing this out until there is a good use case.
2023-07-16 04:32:12 -07:00
Sam Lantinga
0bcd9944a3 More than one binding might trigger a gamepad button 2023-07-16 04:32:12 -07:00
Sam Lantinga
b40fb5c51e Fixed getting the CRC of virtual joysticks without a VID/PID 2023-07-16 04:32:12 -07:00
Sam Lantinga
f3d6320bac Added SDL_strndup() 2023-07-16 04:32:12 -07:00
Sam Lantinga
8cc3783e75 Remove extra spaces in stripped tokens 2023-07-16 04:32:12 -07:00
Sam Lantinga
a1615dea85 Added SDL_SetGamepadMapping() to set the mapping for a specific device 2023-07-16 04:32:12 -07:00
Sam Lantinga
eb0955ef89 Removed SDL_GamepadBinding from the API
The text format is more expressive and widely used than the binary structure
2023-07-16 04:32:12 -07:00
Sam Lantinga
ca492dff18 Renamed testgamepad to testcontroller
The program does more than just test gamepads, and will eventually map them as well.
2023-07-16 04:32:12 -07:00
Sam Lantinga
d2d26c7b1e testgamepad replaces testjoystick 2023-07-16 04:32:12 -07:00
Sam Lantinga
34876c390f testgamepad works for joysticks as well as gamepads 2023-07-16 04:32:12 -07:00
Anonymous Maarten
eda2824e6f ci: move 'set -eu' to after source_cmd 2023-07-14 15:00:52 +02:00
Ryan C. Gordon
cf46467a42 pulseaudio: Some fixes that seem to avoid an assertion in libpulse.
- Make sure the hotplug thread has hit its main loop before letting
  DetectDevices continue.
- Don't unref the context subscription operation until it completes
  (or we are shutting down).

I'm not sure which change fixed the problem, but at least one of them
appears to have done so.

Reference Issue #7971.

(cherry picked from commit b9d16dac4e)
2023-07-12 23:35:51 -04:00
Ozkan Sezer
133482a2c0 pulseaudio: eliminate <pulse/simple.h> include.
(cherry picked from commit 776a5e0d25)
2023-07-13 01:55:24 +03:00
Sam Lantinga
c45a0cd9b3 Don't divide by the scale twice
It's already been done in GetUIScreenModeSize(), in the last commit
2023-07-12 15:34:10 -07:00
Ryan C. Gordon
6aef14fb2d pulseaudio: We should be using libpulse, not libpulse-simple.
This probably worked by a quirk of the dynamic loader...?
2023-07-12 16:40:42 -04:00
Ryan C. Gordon
6fd0613ac8 pulseaudio: Require PulseAudio 5.0 or later for SDL3. 2023-07-12 16:34:55 -04:00
Ryan C. Gordon
9ebf0ed781 pulseaudio: fix WaitForPulseOperation blocking longer than necessary.
Now the operation state change we're waiting on will signal the
threaded mainloop, so this doesn't wait longer than necessary.

This requires PulseAudio 4.0 or later, so don't merge this into SDL2,
which requires PulseAudio 0.9.15.

Fixes #7971.
2023-07-12 16:09:33 -04:00
Ryan C. Gordon
956b18f50c pulseaudio: don't wait on pa_context_subscribe in hotplug thread.
This risks blocking the thread if disaster ensues, and we can wait in the
thread's main loop for subscription as well anywhere else.

Reference Issue #7971.
2023-07-12 16:00:13 -04:00
Ozkan Sezer
b3861650d3 need pulseaudio >=0.9.15. call pa_threaded_mainloop_set_name only if available. 2023-07-12 21:39:04 +03:00
Sam Lantinga
1903d7b1bf RAWINPUT_RegisterNotifications() should return int, for consistency 2023-07-11 10:50:43 -07:00
Sam Lantinga
fdff3b16d6 Fixed build 2023-07-11 10:44:57 -07:00
Sam Lantinga
45cd4b8038 Added button background 2023-07-11 10:26:22 -07:00
Sam Lantinga
4feb2f4b1a Added a button to copy the gamepad mapping to the clipboard 2023-07-11 10:20:08 -07:00
Sam Lantinga
4f122c6e39 Removed test binding for space key
This pops up at the most inconvenient times, and space is handy for other functions in various test programs.
2023-07-11 10:20:08 -07:00
Sam Lantinga
41882a1acb Improved RAWINPUT <-> XInput/WGI device correlation
If there is only one controller slot available, assume that's the one matching new RAWINPUt devices. This will be right most of the time, and uncorrelation will fix any bad guesses.
2023-07-11 10:20:08 -07:00
Sam Lantinga
dfc5e6964e Fixed crash if RAWINPUT is not initialized
We shouldn't be doing any of this work in that case
2023-07-11 10:20:08 -07:00
Sam Lantinga
2e3404db01 Added SDL_GetGamepadPowerLevel() to get the power level directly from a gamepad 2023-07-11 10:20:08 -07:00
Sam Lantinga
9885f4d245 Reduced the size of the gamepad front and back images 2023-07-11 10:20:08 -07:00
Sam Lantinga
30a9fffbd4 Fixed array out of bounds access 2023-07-10 22:08:12 -07:00
Sam Lantinga
8ba850bef2 Show battery status on screen in testgamepad 2023-07-10 20:29:09 -07:00
Sam Lantinga
5b9f2d0942 Fixed build 2023-07-10 19:41:45 -07:00
Sam Lantinga
e425fdd416 Added the controller name and info to the testgamepad window
Also added instructions for using the Virtual Controller
2023-07-10 19:13:51 -07:00
Sam Lantinga
3cbf16b944 Added SDL_GetGamepadInstanceID() 2023-07-10 19:13:42 -07:00
Sam Lantinga
50277a0355 Show touchpad and sensor output on screen in testgamepad 2023-07-10 18:05:31 -07:00
Sam Lantinga
d44ada59fb Added joystick and gamepad element display in testgamepad 2023-07-10 17:06:42 -07:00
Sam Lantinga
4a53dc5b8d Added touchpad visualization for testgamepad 2023-07-10 11:36:32 -07:00
Sam Lantinga
33d025d35a Fixed loading 8-bit BMP exported by Gimp with RGB masks 2023-07-10 11:36:31 -07:00
Ozkan Sezer
1e50823a14 fixed linux build. 2023-07-10 20:35:50 +03:00
Sam Lantinga
95d17f9d2c Minor cleanup
(cherry picked from commit 92fd2938e7)
2023-07-10 10:02:57 -07:00
Andre Barata
47fd07bde6 Added support for absolute mice with evdev
(cherry picked from commit 9cd7cbe134)
2023-07-10 10:02:13 -07:00
Sam Lantinga
49b9fd1843 Don't send k_ePS4FeatureReportIdSerialNumber to Bluetooth PS4 controllers
This isn't supported over Bluetooth and might be causing issues with fake PS4 controllers.

Note that this change should NOT be ported to SDL2, as device->is_bluetooth is not set from hidapi there and is only detected by seeing which reports are valid.

Reference https://github.com/libsdl-org/SDL/issues/7960
2023-07-10 09:37:20 -07:00
Sam Lantinga
092a4b780c Don't send k_ePS4FeatureReportIdCapabilities to Sony PS4 controllers
This report is for third party controllers only, and might be causing issues with fake PS4 controllers.

Reference https://github.com/libsdl-org/SDL/issues/7960
2023-07-10 09:37:20 -07:00
Sam Lantinga
5ce967a579 Apply the display content scale to the gamepad test window 2023-07-10 09:37:20 -07:00
Simon McVittie
8b12585e1d testevdev: Add some examples of PDP third-party Switch controllers
Thanks: Ravi Kanodia
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-07-10 08:59:18 -07:00
Sam Lantinga
efd530827a Return from main() instead of calling exit() 2023-07-09 20:42:00 -07:00
Sam Lantinga
8f5ec2f596 Added shared code between testgamepad and gamepadmap
The goal is to eventually create a single program that can do mapping and testing of game controllers.
2023-07-09 19:24:36 -07:00
SDL Wiki Bot
550c84b4df Sync SDL3 wiki -> header 2023-07-09 20:50:16 +00:00
Sam Lantinga
bea99d48f2 Changed 'freesrc' parameter from int to SDL_bool 2023-07-09 13:49:04 -07:00
Sam Lantinga
32d529bf70 Use size_t for the size of memory RWops 2023-07-09 13:36:00 -07:00
Sam Lantinga
80e1c75e1c Re-added mappings for older Xbox One controllers on Linux
The xpad kernel driver doesn't know about these controllers and ends up using BTN_C and BTN_Z and the automatic mapping doesn't work correctly.

It turns out VID 0x045e and PID 0x02e0 is used by the 8BitDo SN30 Pro when connecting via Bluetooth in XInput mode.

Fixes https://github.com/libsdl-org/SDL/issues/7925
2023-07-09 09:50:26 -07:00
Joshua Barnett
a5f387f828 Add kernel32 to SDL_EXTRA_LIBS required for cross-compilation to Win32 native
Linking error experienced while compiling with the following toolchain
due to lack of kernel32.lib

d35e5f8dde/cmake/platforms/WinMsvc.cmake (L317-L321)
2023-07-09 09:18:04 +02:00
Sam Lantinga
ea60da5b94 Fixed mapping BTN_TR2 to right trigger 2023-07-08 18:18:22 -07:00
Alex Maese
0e4165e54b X11: Use XFixes to detect clipboard updates
Currently, SDL_CLIPBOARDUPDATE events are only sent when an SDL window
has its selection cleared.  This change sends the event anytime the
XFixesSelectionNotify event is raised, and when the selection is either
the clipboard or the primary selection.
2023-07-08 16:26:10 -07:00
Sam Lantinga
cd97e3a833 Fixed clang Windows build 2023-07-08 14:10:08 -07:00
Sam Lantinga
a29aac603b Quiet warning when using older buggy WGI headers 2023-07-08 13:28:22 -07:00
Sam Lantinga
7d894dc1c9 Fixed build warnings 2023-07-08 11:16:40 -07:00
Sam Lantinga
f047e178b6 Added WGI gamepad added/removed listeners for RAWINPUT
This fixes WGI correlation on startup when the WGI gamepad list isn't populated yet
2023-07-08 10:24:00 -07:00
Sam Lantinga
cdfc9634e1 Removed patch note for change already in SDL 2.x 2023-07-08 09:35:42 -07:00
Sam Lantinga
3a654b4b1c Added the hint SDL_HINT_JOYSTICK_WGI to control whether to use Windows.Gaming.Input for controllers 2023-07-08 09:32:24 -07:00
Mathieu Eyraud
a4f3905bb6 Fix uninitialised variable 2023-07-08 08:36:36 -07:00
Sam Lantinga
efed24850a Don't tickle Bluetooth PS4 controllers in simple mode with an effects packet
That will put the PS4 controller into enhanced mode, which breaks DirectInput games
2023-07-07 15:56:54 -07:00
Sam Lantinga
785f57eb91 Lazily initialize the WGI gamepad support
Initializing "Windows.Gaming.Input.Gamepad" will put Bluetooth PS4 controllers into enhanced report mode, which breaks any game using DirectInput. Let's wait to do this until absolutely necessary.
2023-07-07 15:56:54 -07:00
Sylvain
aab3cbf207 SDL_thread.h: fix parameter name in comment 2023-07-07 21:55:20 +02:00
Sylvain
6763369f5b gendynapi.py: always check comment formatting of the public api 2023-07-07 21:55:20 +02:00
Frank Praznik
b82d6b8e4e wayland: Set the source surface of the request when raising a window
The xdg_activation token requires specifying the surface that is the source of the activation request, not the surface of the target window. Setting this to the target window was causing raise requests to be blocked by the compositor, as if the surface noted as the origin of the request didn't currently have focus, it appeared to the compositor as though it was trying to 'steal' focus.
2023-07-07 14:30:02 -04:00
Mathieu Eyraud
bcf239e413 Improve sensor detection for Linux gamepad v2
Detecting by name such as "Accelerometer and "Motion Sensor" may be too broad.
Sensors on Dualshock and Switch gamepad are correctly detected by SDL_EVDEV_GuessDeviceClass(). 
Use vendor and product ID for Wii extension controls.
2023-07-07 10:57:45 -07:00
Sam Lantinga
ed6dc1cc05 Prefer using XInput for rumble over WGI, as it allows rumble in the background
(cherry picked from commit e16a83d393)
2023-07-07 09:48:58 -07:00
Sam Lantinga
9f19b2bd97 Continue running XInput detection while RAWINPUT is active
This allows us to re-enable XInput correlation for RAWINPUT devices without reintroducing the controller shutdown bug for controllers using the wireless adapter in https://github.com/libsdl-org/SDL/issues/3468.

Fixes https://github.com/libsdl-org/SDL/issues/7940

(cherry picked from commit a0a3957eb6)
2023-07-07 09:48:58 -07:00
Sylvain
ec90c2e26d Add 'return' comment to SDL_ClearClipboardData 2023-07-07 10:25:06 +02:00
Sam Lantinga
d57249034a Fix Cocoa_RaiseWindow activating the app when SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED is false 2023-07-06 18:14:37 -07:00
Sam Lantinga
c5bd2cba98 Fix passing of child window focus in WIN_ShowWindow/WIN_RaiseWindow
Keyboard focus was being passed to the child window being shown if SDL_HINT_WINDOW_ACTIVATE_WHEN_SHOWN is false and keyboard focus was not being passed to the child window being activated in WIN_RaiseWindow.
2023-07-06 18:14:34 -07:00
Sam Lantinga
565e95ac4e Fix windows created with SDL_WINDOW_MINIMIZED having inconsistent SDL_WINDOW_HIDDEN flag on Windows
- Windows created minimized are shown with SW_SHOWMINNOACTIVE which does not send WM_SHOWWINDOW leaving the window visible (but minimized)
  on desktop but still with the SDL_WINDOW_HIDDEN flag set. Now the hidden flag is cleared in this case but noted that this means it's not currently possible
  to create a window that is initially hidden that then is minimized once shown.
2023-07-06 18:14:27 -07:00
Sam Lantinga
be79f62cb7 Fixed warning C4214: nonstandard extension used: bit field types other than int 2023-07-06 18:14:22 -07:00
Takase
cb55ce70f0 video(wayland): use both --icon and --icon-name for Zenity (#7897)
video(wayland): use both --icon and --icon-name for Zenity

Many distros ship an older version of Zenity that supports GTK3, while some distros ship newer version of Zenity which uses libadwaita.

This command tries to use --icon and fall back to --icon-name when it fails.
2023-07-06 17:53:00 -07:00
Sam Clegg
b42cb1c6f2 emscripten: Add JS library dependencies using EM_JS_DEPS macro
See https://github.com/emscripten-core/emscripten/pull/19780

(cherry picked from commit 042243471f)
2023-07-06 19:32:05 -04:00
Sam Lantinga
95033e87e1 SDL 3.0 video modes are sized in points, with a separate pixel density 2023-07-06 15:19:17 -07:00
Sam Lantinga
dda474504f Fixed prototype definition 2023-07-06 13:00:03 -07:00
Sam Lantinga
1528e7c3c9 Fixed mapping a controller other than the first one 2023-07-06 12:36:26 -07:00
Frank Praznik
1bf7898ddf wayland: Remove leftover debug message 2023-07-06 13:56:22 -04:00
Frank Praznik
d28e9960ce wayland: Use the implicit grab serial for setting the clipboard/primary selection data
Use the implicit grab serial, which includes keyboard key, mouse button, touch, and tablet tool events, for setting the clipboard and primary selection data, as these are all considered valid originating event serials.
2023-07-06 13:52:04 -04:00
Sam Lantinga
badb7f1e8b Added notes about delayed clipboard rendering on Windows 2023-07-06 08:36:49 -07:00
Sam Lantinga
7890985629 Fixed windows debug message formatting 2023-07-06 08:33:12 -07:00
Sam Lantinga
ddb817a1af Only clear the clipboard if setting empty text 2023-07-06 08:32:34 -07:00
Sam Lantinga
f4bd17deee Fixed %p formatting when there is following text 2023-07-06 08:04:20 -07:00
SDL Wiki Bot
17e95345e3 Sync SDL3 wiki -> header 2023-07-06 03:08:15 +00:00
Sam Lantinga
cc254d885d Fixed wayland clipboard not always updating in response to Ctrl-C 2023-07-05 20:06:59 -07:00
Sam Lantinga
c1b11ad54e Expanded automated clipboard tests 2023-07-05 20:06:59 -07:00
Sam Lantinga
c63aa9545e Fixed printf formatting for "%p" and added a unit test to check it 2023-07-05 20:06:59 -07:00
Sam Lantinga
ecbbac7c72 Do a full UCS4 zero termination on iconv converted strings
We don't necessarily know the size of the output characters, so do a full 32-bit zero termination on the output string.

This fixes garbage at the end of Windows clipboard text
2023-07-05 20:06:59 -07:00
Sam Lantinga
ae771d4710 Added test shortcuts Alt-C and Alt-V to test the primary selection functionality 2023-07-05 20:06:59 -07:00
Sam Lantinga
55ff09de38 Reimplement clipboard text in terms of clipboard data
This will simplify the X11 and Wayland implementations, which were doing that under the hood, and makes application interaction between the two APIs consistent.
2023-07-05 20:06:59 -07:00
Sam Lantinga
c980ce2120 Removed SDL_EVENT_CLIPBOARD_CANCELLED in favor of the cleanup callback 2023-07-05 20:06:59 -07:00
Sam Lantinga
443868143c Added support for clipboard data on Windows
The only supported image format is image/bmp
2023-07-05 20:06:59 -07:00
Sam Lantinga
35876da3c4 Clipboard data API revamp
The clipboard data API is now supported on all platforms, at least for internal use.
2023-07-05 20:06:59 -07:00
Sam Lantinga
61ff86617a Added GetClientScreenRect() and fixed build for C89 compilers 2023-07-05 11:05:48 -07:00
expikr
a7326b9396 center cursor to client area (excludes titlebar thickness) 2023-07-05 10:11:57 -07:00
Sam Lantinga
f49f1434b9 Revert "Update SDL_windowswindow.c"
This reverts commit d0fdf6207b.
2023-07-05 09:22:09 -07:00
expikr
d0fdf6207b Update SDL_windowswindow.c 2023-07-04 20:42:01 -07:00
Anonymous Maarten
ffcd1c0c26 cmake: explicitly disable WINDOWS_EXPORT_ALL_SYMBOLS for SDL3-shared
This fixes the following errors when a dll attempts to link to SDL3::SDL3-shared:

m.c.obj : error LNK2019: unresolved external symbol __imp___acrt_iob_func referenced in function printf
m.c.obj : error LNK2019: unresolved external symbol __imp___stdio_common_vfprintf referenced in function _vfprintf_l
MSVCRTD.lib(init.obj) : error LNK2019: unresolved external symbol _CrtDbgReport referenced in function _CRT_RTC_INIT
MSVCRTD.lib(init.obj) : error LNK2019: unresolved external symbol _CrtDbgReportW referenced in function _CRT_RTC_INITW
MSVCRTD.lib(error.obj) : error LNK2019: unresolved external symbol strcpy_s referenced in function "void __cdecl _RTC_StackFailure(void *,char const *)" (?_RTC_StackFailure@@YAXPEAXPEBD@Z)
MSVCRTD.lib(error.obj) : error LNK2019: unresolved external symbol strcat_s referenced in function "void __cdecl _RTC_StackFailure(void *,char const *)" (?_RTC_StackFailure@@YAXPEAXPEBD@Z)
MSVCRTD.lib(error.obj) : error LNK2019: unresolved external symbol __stdio_common_vsprintf_s referenced in function _vsprintf_s_l
MSVCRTD.lib(error.obj) : error LNK2001: unresolved external symbol __C_specific_handler_noexcept
MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol _wmakepath_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned __int64)" (?GetPdbDllPathFromFilePath@@YAHPEB_WPEA_W_K@Z)
MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol _wsplitpath_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned __int64)" (?GetPdbDllPathFromFilePath@@YAHPEB_WPEA_W_K@Z)
MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol wcscpy_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned __int64)" (?GetPdbDllPathFromFilePath@@YAHPEB_WPEA_W_K@Z)
MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol __vcrt_GetModuleFileNameW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPEAUHINSTANCE__@@XZ)
MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol __vcrt_GetModuleHandleW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPEAUHINSTANCE__@@XZ)
MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol __vcrt_LoadLibraryExW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPEAUHINSTANCE__@@XZ)
2023-07-05 00:12:10 +02:00
Sam Lantinga
00fc50557e Make sure logical presentation is complete before destroying the logical render target
Fixes "testautomation --filter render_testLogicalSize"
2023-07-03 18:29:48 -07:00
Sam Lantinga
619f65af0c Fixed resource leak and crash at exit in the D3D11 renderer
Also, for some reason ID3D11DeviceContext_OMGetRenderTargets() was failing in the second read pixels call in the "testautomation --filter render_testViewport" test.

We already know the target view, so just use that.
2023-07-03 17:39:29 -07:00
Sam Lantinga
90262f274a Made error handling more consistent in D3D12_RenderReadPixels() 2023-07-03 17:37:17 -07:00
Sam Lantinga
304d425f99 The clip rect is defined in terms of the current viewport
Don't use the viewport offset when setting the clip rect in the D3D12 renderer.

This fixes "testautomation --filter render_testViewport" on Windows
2023-07-03 17:09:49 -07:00
Sam Lantinga
b6645bb255 Retry to open the clipboard in case another application has it open
This fixes 'testautomation --filter clipboard_testClipboardTextFunctions' on Windows
2023-07-03 16:18:33 -07:00
Sam Lantinga
3bd5e5ca3c Removed spurious casts 2023-07-03 16:18:33 -07:00
luzpaz
37e567994d Fix remaining typos (#7921)
* Fix remaining typos

Found via `codespell -q 3 -S *.hex,*.pdf,./src/libm,./src/hidapi,./src/stdlib/SDL_malloc.c,./src/video/x11/edid.h -L caf,currenty,datas,einstance,fo,hda,lod,mata,parm,parms,pevent,pevents,pixelx,requestor,ser,statics,te,texturers,thid,uscaled,windowz`
2023-07-03 12:46:47 -07:00
luzpaz
65e1d568ef Fix various typos (docs/build scripts/tests) 2023-07-03 08:35:37 -07:00
Ryan C. Gordon
c0bd18f023 khronos: Fixed a typo in a Vulkan header, to match upstream.
Fixes #7916.
2023-07-03 11:03:20 -04:00
Sam Lantinga
f010411492 Rename SDL_strtokr() to SDL_strtok_r()
Fixes https://github.com/libsdl-org/SDL/issues/7914
2023-07-03 06:20:06 -07:00
SDL Wiki Bot
b8d6023a91 Sync SDL3 wiki -> header 2023-07-03 01:49:13 +00:00
Sam Lantinga
3c04be4486 The rectangles passed to SDL_BlitSurfaceUnchecked() and SDL_BlitSurfaceUncheckedScaled() are const.
The destination rectangle passed to SDL_BlitSurface() and SDL_BlitSurfaceScaled() is non-const and filled in with the final destination rectangle after clipping, and now documented as such.

Fixes https://github.com/libsdl-org/SDL/issues/7911
2023-07-02 18:45:11 -07:00
Sam Lantinga
ced153a24a Fixed reference to old function (thanks @tom-seddon!)
Fixes https://github.com/libsdl-org/SDL/issues/7912
2023-07-02 18:24:53 -07:00
Sam Lantinga
4aee17b039 Resorted symbols alphabetically
This can be be done now, before the ABI is frozen
2023-07-02 00:06:55 -07:00
Sam Lantinga
50b6e5eb7e Implemented SDL_LoadBMP() and SDL_SaveBMP() as functions
Fixes https://github.com/libsdl-org/SDL/issues/7902
2023-07-02 00:00:06 -07:00
Sam Lantinga
e264bb5178 Rename SDL_PIXELFORMAT_RGB888 and SDL_PIXELFORMAT_BGR888 to SDL_PIXELFORMAT_XRGB8888 and SDL_PIXELFORMAT_XBGR8888 for clarity
Fixes https://github.com/libsdl-org/SDL/issues/7903
2023-07-01 17:58:34 -07:00
scribam
d85e327c92 cmake: use SDL_CPU_ARM32 instead of CMAKE_GENERATOR_PLATFORM STREQUAL "ARM" 2023-07-01 23:25:49 +02:00
Ryan C. Gordon
9d39e50f29 rwops: Use SetFilePointerEx on Windows for appending writes.
Fixes #7900.

(cherry picked from commit 769bf2ebcc)
2023-07-01 00:37:18 -04:00
Sam Lantinga
5b9fdc9dd1 Revert "Zenity has deprecated --icon-name in favor of --icon"
This reverts commit 55c3c1b05c.

It turns out many Linux distributions are shipping zenity which doesn't support the new --icon option. We'll need a more robust fix for this.
2023-06-29 23:01:36 -07:00
Sam Lantinga
55c3c1b05c Zenity has deprecated --icon-name in favor of --icon
Fixes https://github.com/libsdl-org/SDL/issues/7895
2023-06-29 22:45:59 -07:00
Sam Lantinga
18ff0d1878 Fixed build 2023-06-29 22:40:57 -07:00
Sam Lantinga
69c7a49990 Fixed build warnings 2023-06-29 22:15:23 -07:00
Sam Lantinga
97380dcdab We don't need to reserve window flag bits for sdl2-compat
sdl2-compat does the appropriate bit twiddling to preserve compatibility
2023-06-29 22:02:24 -07:00
Sam Lantinga
8da9b22c17 The SDL_WINDOW_SKIP_TASKBAR flag has been replaced by the SDL_WINDOW_UTILITY flag
The SDL_WINDOW_UTILITY flag has the same functionality, and is now implemented on Windows.
2023-06-29 21:43:17 -07:00
Sam Lantinga
675fc8c38f Added Linux mapping for the Logitech Chillstream
Fixes https://github.com/libsdl-org/SDL/issues/7829
2023-06-29 16:10:55 -07:00
Sam Lantinga
ba9e924e57 Added additional debug logging for Linux joysticks 2023-06-29 16:09:55 -07:00
Sam Lantinga
ffa146f0bc On Windows the mouse speed is affected by the content scale
Fixes https://github.com/libsdl-org/SDL/issues/7802
2023-06-29 14:38:26 -07:00
Anonymous Maarten
4d23eaf81e cmake: only define _FILE_OFFSET_BITS and _TIME_BITS for glibc 2023-06-29 14:55:43 +02:00
Anonymous Maarten
c3be4bc18d cmake: Compile with 64-bit time stamps where possible
On platforms where time_t is a signed 32-bit integer, most notably i386 Linux,
various functions stop working when dealing with a timestamp
beyond January 2038.

glibc has an opt-in mechanism that redefines time_t to be 64-bit,
and correspondingly increases the size of all system data
structures that contain a time_t, such as struct timeval and struct stat.
This is necessary to allow timestamps beyond January 2038 to be represented;
as well as things that obviously deal with timestamps, this affects functions
like stat(), which will fail with EOVERFLOW if asked to inspect a file whose
correct timestamp does not fit in time_t. This in turn can cause unexpected
problems for "filesystem APIs" of the form "if /run/foo exists, then ..."
when accessed by 32-bit code, if the check for existence is done with stat()
rather than access().

Using 64-bit timestamps in glibc is an opt-in and not the default, because
if done carelessly it can change libraries' ABIs. However, SDL mostly doesn't
use system headers or types in its own headers. I

Co-authored-by: Simon McVittie <smcv@collabora.com>
2023-06-28 19:47:52 -07:00
Sam Lantinga
baa9c57581 Added support for the Nintendo Online Famicom controllers 2023-06-28 19:15:43 -07:00
Simon McVittie
10fc3b3db7 evdev: Use time64-friendly accessors for struct input_event
On 32-bit platforms such as i386, if SDL is compiled with -D_TIME_BITS=64
to opt-in to ABIs that will not stop working in 2038, the fields in
this struct change their naming and interpretation.

The Linux header <linux/input.h> defines macros input_event_sec and
input_event_usec which resolve to the right struct field to look at.
The actual field names and types are an implementation detail,
historically signed 32-bit time.tv_sec and time.tv_usec on 32-bit
platforms, but becoming unsigned __sec and __usec when using 64-bit
time (which makes them able to represent times up to 2106).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-28 12:35:12 -07:00
Frank Praznik
e7327b6c73 wayland: Flush cached themes on a theme change
Flush the cached themes when the system cursor theme changes so that the stale cached value won't be used.
2023-06-28 14:53:11 -04:00
capehill
8315a00a01 Fix crash in AudioConvertByteswap 2023-06-28 14:47:10 -04:00
Frank Praznik
fd6cb4dc86 wayland: Add a DBus message handler for the cursor size and theme properties.
Add a DBus message handler to watch and respond to changes to the system cursor size and theme properties. Upon these settings being changed, a cursor refresh will be triggered so the new changes will take effect immediately, without the cursor having to leave and re-enter the window surface.
2023-06-28 13:58:05 -04:00
Sam Lantinga
e643d28d9c Set the hint value before calling hint callbacks
This allows the hint callbacks to perform more complicated logic involving multiple hints without worrying about which hint has been changed.
2023-06-28 08:53:48 -07:00
Sylvain
ad12bb4fd1 Remove hints that weren't used anymore ! 2023-06-28 06:22:20 -07:00
Anonymous Maarten
7751bfdbf3 cmake: create wiki dir before running wikiheaders.pl --copy-to-wiki 2023-06-28 14:41:31 +02:00
Sam Lantinga
0f4679102c Fixed pedantic warning: comma at end of enumerator list
Fixes https://github.com/libsdl-org/SDL/issues/7878
2023-06-27 21:52:33 -07:00
Sam Lantinga
cc5e9ffe70 Don't crash if SDL_MapRGB() and SDL_MapRGBA() are passed a NULL format 2023-06-27 16:08:19 -07:00
Sylvain
600c615529 Fixed bug #7821 - docs/README-migration.md function name typos 2023-06-27 20:10:47 +02:00
Anonymous Maarten
afdd448834 cmake: don't install sdlmanpages.cmake 2023-06-27 19:02:44 +02:00
Sam Lantinga
9ee1200e6f Fixed Nintendo Switch Pro controllers that don't have readable user calibration 2023-06-27 07:48:42 -07:00
Sam Lantinga
c065a9b128 Fix some issues caught by check_stdlib_usage.py 2023-06-27 06:19:06 -07:00
Anonymous Maarten
e8d2ccbc1c ci: reduce amount of files to copy back from freebsd vm
This should reduce the chance on an error during copy back
2023-06-27 13:59:15 +02:00
Anonymous Maarten
1061a978c3 cmake: fix header GLOB used for generating man pages 2023-06-27 13:49:50 +02:00
Sylvain
70ccf34587 Script to detect use of stdlib function 2023-06-27 04:47:08 -07:00
Anonymous Maarten
937f5d0059 cmake: allow man page installation by SDL satellite libraries
This is done by installing the wikiheaders.pl script, and add a wrapping cmake function.
2023-06-27 03:00:19 +02:00
Frank Praznik
9ab2025127 wayland: Don't initialize OpenGL when the window flags didn't specify it
Applications that don't specify a rendering flag are likely handling Vulkan/GL themselves, so SDL loading OpenGL by default in this case is unnecessary overhead, and if a render backend requires it, the window will be recreated with the appropriate flags when the renderer is initialized.
2023-06-26 13:57:48 -04:00
Narr the Reg
425062c123 hidapi: switch: Handle MCU input reports 2023-06-26 10:01:49 -07:00
Ozkan Sezer
02398a8f11 Allow building against old Linux kernels. 2023-06-26 18:01:50 +03:00
Sam Lantinga
fd062657dd Fixed build 2023-06-26 07:43:44 -07:00
meyraud705
6cc21af900 Don't keep sensor file open while sensors are disabled 2023-06-26 07:32:40 -07:00
meyraud705
9cfac88054 Improve sensor detection for Linux gamepad 2023-06-26 07:32:40 -07:00
meyraud705
000277060c Add support for sensor to joystick on Linux (evdev) 2023-06-26 07:32:40 -07:00
Sylvain
95727b5c7d use of SDL functions 2023-06-25 15:50:23 -07:00
Sam Lantinga
87e916dd21 SDL_FindFreePlayerIndex() will always return the next available player index
Fixes https://github.com/libsdl-org/SDL/issues/7868
2023-06-24 15:38:38 -07:00
Sam Lantinga
267fdd7daa Removed Bluetooth connection detection now that we get it from hidapi 2023-06-23 15:50:07 -07:00
Sam Lantinga
44bae1e8a9 Corrected the Victrix FS Pro as a PS4 controller instead of a PS3 controller 2023-06-23 14:27:21 -07:00
Sam Lantinga
6b12fbc6b7 Re-add the simpler SDL_DBus_AppendDictWithKeyValue() function 2023-06-23 07:28:05 -07:00
Sylvain
6f344f29b8 After using SDL_qsort, mark sort_entries() as SDLCALL 2023-06-23 12:52:05 +02:00
Sylvain
1827a0bf62 Remove some use of C runtime functions in testevdev 2023-06-23 11:08:08 +02:00
Sylvain
6cde3835f0 Remove some use of C runtime functions (strlen, qsort) 2023-06-23 10:51:15 +02:00
Sam Lantinga
a807b14957 Greatly improved Xbox One controller initialization sequence 2023-06-22 17:15:35 -07:00
Sylvain
8b86e3073d Revert "Android: also protect Hat/Joy/PadDown,Up so there are not sent without window"
This reverts commit 8f83ccd750.
2023-06-22 23:30:41 +02:00
Sylvain
8f83ccd750 Android: also protect Hat/Joy/PadDown,Up so there are not sent without window 2023-06-22 16:25:22 +02:00
SDL Wiki Bot
a3e0cd5208 Sync SDL3 wiki -> header 2023-06-22 13:45:16 +00:00
Sylvain
627165a2b2 Fix comments 2023-06-22 15:44:48 +02:00
Sylvain
4339113072 SDL_DBus_AppendDictWithKeyValue: allows several key/value for other PRs 2023-06-22 10:50:35 +02:00
Sam Lantinga
8aee6908bb Make sure we send update complete events for delayed guide buttons 2023-06-21 18:42:25 -07:00
Sam Lantinga
4c9fb3e169 Added the events SDL_EVENT_JOYSTICK_UPDATE_COMPLETE and SDL_EVENT_GAMEPAD_UPDATE_COMPLETE
This allows the application to tell when a joystick polling cycle is complete and can process state changes as a single atomic update. It is disabled by default, at least for now.
2023-06-21 13:59:53 -07:00
Sam Lantinga
808d83dd67 Allow specifying APP_PLATFORM and APP_ABI on the command line 2023-06-21 13:49:09 -07:00
Sam Lantinga
214d5daa3c Removed 100 ms hitch when querying third party Nintendo Switch controllers that don't respond to request for info
Also take advantage of the fact that we know whether the device is connected over Bluetooth now.
2023-06-21 12:14:50 -07:00
Sam Lantinga
3694dabe7c Use default sensor calibration if we can't read it from the Nintendo Switch controller
Fixes https://github.com/libsdl-org/SDL/issues/7830
2023-06-21 10:28:45 -07:00
Sam Lantinga
6306ee9f42 List the available haptic devices in testhaptic 2023-06-20 09:33:59 -07:00
Sam Lantinga
8cf5dc9963 Build on Android targeting the arm64-v8a architecture by default
This speeds up iteration time and covers most customer devices
2023-06-20 09:18:19 -07:00
Sam Lantinga
5f3213eb0e Added support for gamepad sensor fusion with the Razer Kishi 2023-06-20 08:41:15 -07:00
Simon McVittie
91198baed4 ibus: Handle error when getting the D-Bus machine ID
It is possible for retrieving the machine ID to fail, either because
dbus was installed incorrectly (machine ID absent or corrupt), or in
32-bit builds, because stat() on the machine ID fails with EOVERFLOW
if it has an out-of-range timestamp or inode number.

dbus has historically treated this as a faulty installation, raising
a warning which by default causes the process to crash. Unfortunately,
dbus_get_local_machine_id() never had a way to report errors, so it has
no alternative for that (bad) error handling.

In dbus >= 1.12.0, we can use dbus_try_get_local_machine_id() to get
the same information, but with the ability to cope gracefully with
errors. ibus won't work in this situation, but that's better than
crashing.

Mitigates: https://github.com/ValveSoftware/steam-for-linux/issues/9605
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-20 06:46:33 -07:00
Sam Lantinga
3ddbeab88f Moved Android sensor event handling to a separate thread
This makes it so you can interact with sensors on multiple threads, as long as only one thread initializes and cleans up the sensor subsystem.

This also has the benefit that sensor data is available as soon as possible.
2023-06-20 01:17:44 -07:00
Sam Lantinga
329e1b8b6a Update the sensors before the joysticks so the gamepad code gets fresh sensor readings 2023-06-19 19:42:01 -07:00
Sam Lantinga
1a9c04e9f1 Don't try to update the gamepad fusion sensors manually, instead rely on the normal update flow 2023-06-19 19:41:20 -07:00
Sam Lantinga
20ea35138f Use a separate sensor watching function for gamepad events to avoid reliance on system sensor events and prevent a potential deadlock 2023-06-19 16:17:34 -07:00
Sam Lantinga
70e43c150e Added support for blitting SDL_PIXELFORMAT_INDEX1LSB
Fixes https://github.com/libsdl-org/SDL/issues/7844

(cherry picked from commit a3d4fd71c3)
2023-06-19 08:38:07 -07:00
Sam Lantinga
c6ee9780df Fixed DualSense controllers not being picked up by the HIDAPI driver
The hidraw device may take additional time to get the correct permissions for us to open it. In my tests on Steam Deck hardware, this ranges between 5-8ms.
2023-06-18 12:19:54 -07:00
Sam Lantinga
4e81b4e8de Added SDL_HINT_VIDEO_X11_SCALING_FACTOR to allow overriding the content scale on X11 (thanks Andres!) 2023-06-18 12:19:43 -07:00
Sam Lantinga
210c135f74 Implement SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED for X11
To match the focus stealing prevention logic from windows/osx.

I didn't implement SDL_HINT_WINDOW_ACTIVATE_WHEN_SHOWN as there is no
standard mechanism for us to do so. In most cases marking a window as OverrideRedirect
will cause to not acquire focus when mapped. And in steam we are doing that when
appropriate.

I still left a note in X11_ShowWindow() regarding this behaviour.
2023-06-18 12:19:38 -07:00
Sam Lantinga
9351bf6dd1 Add handling for SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED and SDL_HINT_WINDOW_ACTIVATE_WHEN_SHOWN on macOS
- Cocoa_ShowWindow will order a window that is not being activated below the key window (if one exists) then set visible

- Cocoa_RaiseWindow calls -[NSWindow orderFront:] without changing the key window
2023-06-18 12:19:22 -07:00
Sam Lantinga
f168f9c813 Added support for the GameSir G4 Pro
We can't read device info or IMU calibration from this controller, and it has no gyro or accelerometer, but is otherwise perfectly functional.
2023-06-17 12:42:55 -07:00
Sam Lantinga
b770644411 Fixed building on older kernel headers 2023-06-17 09:46:46 -07:00
Sam Lantinga
b98494a101 Fixed building on older kernel headers 2023-06-17 09:39:50 -07:00
Sam Lantinga
9fe384b696 Fixed display orientation function names for SDL 3.0 convention 2023-06-17 09:28:27 -07:00
Sam Lantinga
d91e96e7f5 Use SDL_HINT_GAMECONTROLLER_SENSOR_FUSION as a list of controllers to enable sensor fusion
There are too many wraparound style controllers out there to enumerate them all, so instead make this a user option in applications that support it.
2023-06-17 08:59:52 -07:00
Sam Lantinga
610c31c7b7 Generalized the sensor coordinate transform for wraparound gamepads 2023-06-17 08:28:37 -07:00
Sam Lantinga
9eb5eab0ad Use the correct orientation transformation based on whether the device is naturally landscape or portrait 2023-06-17 08:04:34 -07:00
Sam Lantinga
e6d1ba2a17 Added the concept of display natural orientation
Also renamed SDL_GetDisplayOrientation() SDL_GetDisplayCurrentOrientation()

The natural orientation of the primary display is the frame of reference for accelerometer and gyro sensor readings.
2023-06-17 07:42:16 -07:00
Sam Lantinga
8de6ce7e92 Rotate the sensor axes to match gamepad orientation when using the device sensors for game controllers 2023-06-16 17:48:34 -07:00
Sam Lantinga
a9c86e518a Added the Razer Edge controller to the list of wraparound controllers 2023-06-16 17:48:18 -07:00
Sam Lantinga
c207cd3f56 Added the Razer Junglecat to the wraparound controller list 2023-06-16 16:04:12 -07:00
Ozkan Sezer
e4f53e6b21 testevdev.c: comment out two unused data to fix build. 2023-06-17 01:01:10 +03:00
Sam Lantinga
42e4639a5e For gamepads that don't have their own sensors, try to use the system sensors.
This allows using the gyro and accelerometer in handheld devices in conjunction with built-in or wraparound controllers.
2023-06-16 14:44:59 -07:00
Simon McVittie
d584592822 linux: If the kernel specifically tells us the device type, trust it
If a device is positively identified as an accelerometer, pointing stick
or clickpad, then we don't need to second-guess it.

In practice this does not change the result for any device in our
test data, so add some artificial records that exercise this.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-16 08:54:41 -07:00
Simon McVittie
0d5aa70e62 linux: Pass evdev properties when guessing device type
In newer kernels, devices that can be positively identified as a
particular device type (for example accelerometers) get a property
bit set. Plumb this information through into the function, but don't
use it for anything just yet.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-16 08:54:41 -07:00
Simon McVittie
a4ce721d7a testevdev: Allow device properties to be fully populated
The props array was too small for the highest property bits to be set,
although in practice this didn't matter since only the lower-order bits
have a meaning. Make it consistent with all the others.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-16 08:54:41 -07:00
Simon McVittie
fa0ca3d41e linux: Distinguish between "device with keys" and a full keyboard
udev distinguishes between ID_INPUT_KEY, a device with any keyboard keys
at all (including for example USB numeric keypads, Bluetooth headsets
with volume control buttons, and some game controllers; and
ID_INPUT_KEYBOARD, a reasonably fully-featured keyboard that you could
use for general-purpose text entry. If we do the same here, then it's
useful input to our heuristics for identifying devices: for example,
a device with ID_INPUT_KEY could reasonably be a gamepad, but a device
with ID_INPUT_KEYBOARD certainly isn't.

Resolves: https://github.com/libsdl-org/SDL/issues/7827
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-16 08:49:31 -07:00
Simon McVittie
9b7a9ca666 testevdev: Add some more laptop built-in devices
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-16 07:27:48 -07:00
Simon McVittie
00b6db68de testevdev: Add some EVIOCGNAME and USB name strings to test data
We don't currently use these for anything, but we might start using
them as input to our heuristics as part of #7697.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-16 07:27:48 -07:00
Simon McVittie
3772d6cc99 testevdev: Add raw HID report descriptors where available
We don't currently use these in our device-classification heuristic,
but it could be a useful input in future.

Thanks to Sam Lantinga, Ben Fradella, kevenwyld and schlegp for
providing some of these.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-16 07:27:48 -07:00
Simon McVittie
2b7556fea2 testevdev: Correct typo in bus type for Xbox Series S|X via Bluetooth
All Bluetooth devices are bus type 0x0005.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-16 07:27:48 -07:00
Simon McVittie
c13e511844 testevdev: Try to correct Wii devices guessed from kernel source
The comments here disagreed with the actual bytes. According to
https://elixir.bootlin.com/linux/v6.3.7/source/drivers/hid/hid-wiimote-modules.c,
the Balance Board reports BTN_A and ABS_HAT0X, HAT0Y, HAT1X and HAT1Y.
This means the comments here were correct, but the .abs bits shown
were in the wrong byte.

Matching the Wii U Pro Controller against the same kernel source, it
appears to be correct: it's the same representation as a PS3 gamepad,
except that it lacks the Z and RZ axes for analogue triggers.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-16 06:38:12 -07:00
Simon McVittie
ffdafcd880 testevdev: Verify most Wii devices against real hardware
Some of the test data previously seen here was guessed from kernel
source code, and not all of it was correct. The following devices have
now been verified against `evemu-describe` output with Linux 6.3
(thanks to Jeremy Whiting for collecting this):

- basic Wiimote
    - buttons
    - 3-axis accelerometer
    - infra-red sensor for Sensor Bar location (precise aim)
- Motion Plus accessory (3-axis gyroscope)
- Nunchuck accessory (joystick, 2 buttons, second 3-axis accelerometer)
- Classic Controller accessory (a complete traditional gamepad)

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-16 06:38:12 -07:00
SDL Wiki Bot
739f78302b Sync SDL3 wiki -> header 2023-06-16 12:22:18 +00:00
Anonymous Maarten
26df689935 docs: expand CMake documentation + add minimal CMake project for reporting issues 2023-06-16 14:21:38 +02:00
Sylvain
378e33bb2c Android: potential ANR during onKeyDown/Up
SDLActivity may call onNativeKeyDown, while application is quitting
2023-06-16 10:17:01 +02:00
Sam Lantinga
e72935a445 Check for modff in addition to modf 2023-06-15 16:43:35 -07:00
Sam Lantinga
dab4f296b8 Cleanup spacing 2023-06-15 16:43:22 -07:00
Simon McVittie
16b57d2ff1 testevdev: Add details of another driving simulator controller
Thanks to Ben Fradella.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-15 12:21:36 -07:00
Simon McVittie
2b00751206 testevdev: Expand test data for X-Box One Elite 2
This slightly newer device than the one from #7814 is functionally
equivalent when connected via USB. When connected via Bluetooth, it has
a different button mapping.

Thanks to Sam Lantinga.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-15 08:16:28 -07:00
Mathieu Eyraud
62ed6f453f Use SDL_strdup instead of strdup 2023-06-15 06:31:19 -07:00
Sam Lantinga
73927b0948 Removed unused function 2023-06-14 15:16:21 -07:00
Sam Lantinga
2e465ae31b Revert "Added SDL_nextafter() and SDL_nextafterf()"
This reverts commit bc5d074818.

It's not clear that we need these yet, so I'm going to remove them for now.
2023-06-14 11:05:10 -07:00
Sam Lantinga
0c16f4faf0 Fixed third-party Nintendo Switch Pro controllers shutting down when we try to set the home LED.
This fixes the PDP Afterglow Wireless Deluxe Controller.
2023-06-14 10:15:06 -07:00
Sam Lantinga
23e007d3b7 Fixed third party Nintendo Switch Pro Controller resetting when being sent an unsupported command to set the Home LED
Tested with the PowerA Fusion Pro Wireless Controller in Bluetooth mode
2023-06-14 00:02:32 -07:00
Sam Lantinga
8c95bd814b Allow switching licensed Nintendo Switch Pro controllers into gyro input mode 2023-06-13 22:40:51 -07:00
Sam Lantinga
cdfc0c5a33 Added support for the PowerA Fusion Pro Wireless Controller in Bluetooth mode
This controller shows up with a VID/PID of 0, but has full functionality over Bluetooth
2023-06-13 22:20:58 -07:00
Sam Lantinga
0f4b15e16b Removed more Linux Xbox mappings in favor of the automatic mapping
This fixes the Xbox Series X share button on Linux 5.x kernels.
2023-06-13 16:53:10 -07:00
Sam Lantinga
883b0f4071 Cleanup for previous change, fixing typos, etc. 2023-06-13 16:49:33 -07:00
Sam Lantinga
9567989eb3 Use the automatic mapping instead of a hardcoded one for Xbox controllers on Linux
This is much more robust and able to dynamically create a mapping for Xbox One S, Xbox Series X, and Xbox Elite 2 controllers.
2023-06-13 16:41:52 -07:00
Sam Lantinga
db1d4d3d76 Added automatic mapping support for Xbox controllers on the 6.x Linux kernels
This automatically adds support for the share button and paddles when present.
2023-06-13 16:40:30 -07:00
Sylvain
0f24956b0a testautomation_hints.c: free hint memory 2023-06-13 23:12:01 +02:00
Sylvain
2c3717881f testautomation_events.c: initialize "timestamp" to solve "conditional jump or move depends on uninitialised value" 2023-06-13 23:03:32 +02:00
Simon McVittie
56ba7f2ff0 testevdev: Add details of X-Box One Elite 2 via USB
Thanks to iacore for capturing these.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-13 10:33:13 -07:00
Simon McVittie
74484511eb testevdev: Provide a pointer to more information about adding test-cases
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-13 10:33:13 -07:00
Sam Lantinga
bc5d074818 Added SDL_nextafter() and SDL_nextafterf() 2023-06-13 10:32:21 -07:00
Sam Lantinga
b0677f476f Added automatic mapping for Xbox Elite paddles using the xpadneo driver
We can't actually tell yet whether a controller has paddles, so this code isn't effective, but I'll file an upstream issue and see if we can get that resolved.
2023-06-13 10:06:36 -07:00
Sam Lantinga
071d1e29dd Fixed joystick vendor detection in Linux automatic gamepad mapping 2023-06-13 10:05:19 -07:00
Sam Lantinga
5a62a4596e Fixed building with the 16.1.4479499 Android toolchain
(cherry picked from commit b9d1c483b9)
2023-06-13 07:50:00 -07:00
Simon McVittie
cf1dc66e2c linux: Improve gamepad mapping heuristic to accept Android conventions
This heuristic for gamepads without a more specific mapping already
tried two incompatible conventions for handling triggers: the Linux
Gamepad Specification uses hat switch 2 for the triggers (for whatever
reason), but the de facto standard set by the drivers for older Xbox
and Playstation controllers represents each trigger as the Z-axis of
the nearest analog stick.

Android documentation encourages Bluetooth gamepad manufacturers to use
a third incompatible convention where the left and right triggers are
represented as the brake and gas pedals of a driving simulator
controller. The Android convention also changes the representation of
the right stick: instead of using X and Y rotation as a second pair
of axes, Android uses Z position as a second horizontal axis, and
Z rotation as a second vertical axis.

Try to cope gracefully with all of these. This will hopefully resolve
the issue described in #5406 (when using unpatched kernels).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-13 05:38:26 -07:00
Simon McVittie
c4d49fadd4 linux: Reduce magic numbers when mapping gamepad axes
The bitfield `mapped` has two different sets of meanings, depending
whether we're setting up the triggers or the d-pad. Represent them
as symbolic constants rather than opaque integers.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-13 05:38:26 -07:00
Sam Lantinga
dec0dbff13 Fixed enumerating Steam Controllers on iOS 2023-06-12 16:57:41 -07:00
Sam Lantinga
d95dbe78bb Fixed n3ds build 2023-06-12 15:39:57 -07:00
Sam Lantinga
cdc40ee054 Reduce the chance of destroying the joystick mutex while it's in use
Fixes https://github.com/libsdl-org/SDL/issues/7811
2023-06-12 15:27:45 -07:00
Linus Probert
6ab846b688 clipboard: Fixes additional x11 clipboard bugs found in tests 2023-06-12 10:57:06 -07:00
Linus Probert
a2ba5e9052 clipboard: Fixes testautomation fails introduced by clipboard changes 2023-06-12 07:33:39 -07:00
Sylvain
4e0f94ea7d Android: add timeout when waiting the SDL thread to finish
C SDLmain() thread might have started (mSDLThread.start() called)
while the SDL_Init() might not have been called yet,
and so the previous QUIT event will be discarded by SDL_Init() and app is running, not exiting.

This is reprocible by adding instrumentation code in the SDLActivity.

And hopefully, this could fix an ANR, where SDLActivity is in WAITING state (in thread.join()):
  at java.lang.Thread.join (Thread.java:1519)
  at org.libsdl.app.SDLActivity.onDestroy (SDLActivity.java)

while SDLThread seems to be running
2023-06-12 11:53:09 +02:00
Ryan C. Gordon
125e7420ec cocoa: Warp mouse to center of window before enabling relative mouse.
This prevents the case where the mouse might be at the edge of the
window when enabling relative mode, which confuses macOS, at it
might believe the user is attempting to resize the window.

Fixes #6994.

(cherry picked from commit 2afb49ba9a)
2023-06-11 12:54:51 -04:00
Ozkan Sezer
4cfacd5cb7 SDL_dynapi.c: minor cosmetics. 2023-06-10 20:50:02 +03:00
Sam Lantinga
0103ec1126 Fixed accidental commit 2023-06-10 08:44:08 -07:00
SDL Wiki Bot
7f86415146 Sync SDL3 wiki -> header 2023-06-10 15:42:15 +00:00
Sam Lantinga
281018f169 Make it clear that you can't mix 2D rendering and the window surface API
Also added functions to query and destroy the window surface so you can switch between modes if you want.

See https://github.com/pygame-community/pygame-ce/issues/2190 for more details.
2023-06-10 08:39:20 -07:00
Sam Lantinga
5490873daa Fixed querying device info on the MOBAPAD M073
The query packet needs to contain valid rumble data in order to be accepted by the controller.

Fixes https://github.com/libsdl-org/SDL/issues/7788
2023-06-09 18:41:21 -07:00
Sam Lantinga
2042e9c4e3 Only update the serial number if it hasn't already been set
This fixes the serial number for Nintendo Switch Pro, which is queried from the hardware in device initialization, and was later clobbered by the USB string which isn't correct.
2023-06-09 17:34:12 -07:00
Sam Lantinga
c8051b11e8 Fixed reading input from the Razer Atrox Arcade Stick using Windows Gaming Input 2023-06-09 14:35:43 -07:00
Sylvain
aaccf3cd52 X11: common function to wait for the WM before sending SDL Window events 2023-06-09 19:48:59 +02:00
Sylvain
8096f7269b Android: add robustness. check that the native code is run for the first time. 2023-06-09 10:13:58 +02:00
Sylvain
ae9d8acc3b Android: when an EventFilter is binded to SDL_EVENT_DID_ENTER_FOREGROUND event and triggered, GL context is expected to be already restored. 2023-06-09 10:00:01 +02:00
Sam Lantinga
4c0758a234 Fixed crash if display couldn't be found in SDL_UpdateFullscreenMode() 2023-06-08 12:39:32 -07:00
Simon McVittie
d9c17e7055 testevdev: Add details of some more 8BitDo devices
Thanks to Jeremy Whiting.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-08 11:03:10 -07:00
Simon McVittie
a2ed083285 testevdev: Describe several equivalent devices
https://github.com/ValveSoftware/steam-devices/pull/34 lists several
more devices that are functionally equivalent to this one from the
point of view of their evdev metadata. Thanks to apgrc.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-08 11:03:10 -07:00
Simon McVittie
f4a53e78c8 testevdev: Add test data for a DualSense (PS5) gamepad
Also make details of PS4 gamepads (which are very similar from an evdev
point of view) more specific.

Thanks to Sam Lantinga and Jeremy Whiting for recording these.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-08 11:03:10 -07:00
Simon McVittie
2fb1df1551 testevdev: Add test data for Nintendo Switch Joy-Cons via Bluetooth
Thanks to Jeremy Whiting.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-08 11:03:10 -07:00
Simon McVittie
8a82e06075 testevdev: Add test data for Microsoft Xbox Series S|X Controller
Like the Stadia controller, this is unusual because it represents the
Share button as the Record key from a multimedia keyboard (as of Linux
6.2.11 with the xpad driver). Thanks to Jeremy Whiting.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-08 11:03:10 -07:00
Simon McVittie
ff01b43459 testevdev: Add Google Stadia controller
This is a bit unusual because it has a small number of what would
ordinarily be keyboard keys. Thanks to Jeremy Whiting for recording
this.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-08 11:03:10 -07:00
Simon McVittie
9ad0b8b47f testevdev: Add test data for another Switch Pro Controller
A newer evemu-describe transcript has this same controller with its
buttons mapped differently, presumably a result of driver changes in
the Linux kernel. Either way, we should recognise it as a gamepad.
Thanks to Jeremy Whiting.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-08 11:03:10 -07:00
Simon McVittie
7b526d0cad testevdev: Finish incomplete data for Switch Pro Controller via USB
This didn't include any buttons, which I assume was because I
transcribed them incorrectly rather than reflecting reality. Confirmed
against another Switch Pro Controller on a more recent kernel (thanks
to Jeremy Whiting).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-08 11:03:10 -07:00
Simon McVittie
4c33ef94c6 testevdev: Note a functionally-equivalent device
We don't need to re-test the heuristic with the same input data, but
knowing that another device has equivalent evdev metadata is useful
information to record. Thanks to Jeremy Whiting.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-08 11:03:10 -07:00
Simon McVittie
4c035dc1e3 testevdev: Add another laptop touchpad
This was reported by Rémi Bernon as an example of older SDL's non-udev
code path going wrong for touchpads when the invoking user happens to
be in the input group, which I believe was fixed by fdd945f2.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-08 11:03:10 -07:00
Sam Lantinga
32d015a6a0 Fixed PS3 controller initialization over Bluetooth
Now that we have hidapi that knows whether the controller is connected via Bluetooth or USB, this is much easier to fix.
2023-06-08 10:46:56 -07:00
Frank Praznik
e15da1985a video: Apply cleared flag states when restoring hidden windows
Hiding a window and then clearing the minimized, maximized, fullscreen, or grabbed flags wouldn't result in the new state being applied to the window when shown, as the pending flags would always be zero, resulting in the flag application function never being entered. Calling SDL_RestoreWindow() didn't result in the minimized or maximized state being cleared on the hidden window either.

Save the current window flags to the pending flags when hiding a window, and universally apply the pending flags when the window is shown again to ensure that all state that was set or cleared when the window was hidden is applied. Any pending flags that match the existing window flags will be automatically deduplicated by the corresponding functions.
2023-06-08 12:34:56 -04:00
Ryan C. Gordon
49b5cfa6c5 x11: check if window size/position has changed during SDL_ShowWindow.
Fixes #4216.
2023-06-07 15:42:22 -04:00
Sam Lantinga
dc06116c71 Steam sets the device version of the Steam Virtual Gamepad to 0, for the best compatibility with old games 2023-06-06 12:33:48 -07:00
Sam Lantinga
d032492aab Fixed detecting Bluetooth Steam Controllers on Windows 2023-06-05 21:28:12 -07:00
Sam Lantinga
17c397f7ec Save the error code before doing any other operation
SDL_ClearError() resets the Win32 error code to 0
2023-06-05 21:18:49 -07:00
Sam Lantinga
6e7769cde1 Fixed detecting Bluetooth Steam Controllers 2023-06-05 19:52:00 -07:00
Sam Lantinga
6150b5b3cb Don't bother re-encoding Latin1 characters in the ASCII range 2023-06-04 05:37:06 -07:00
Sam Lantinga
491ae20d96 Only convert the result of XLookupString() if it's not already UTF-8
Fixes https://github.com/libsdl-org/SDL/issues/7766
2023-06-04 02:50:03 -07:00
Sam Lantinga
c369b90019 Fixed SDL_iconv_string() truncation when handling SDL_ICONV_E2BIG 2023-06-04 01:01:06 -07:00
Sam Lantinga
d40695115f Cleaned up Alt-Enter/Ctrl-Enter fullscreen toggle logic
Alt-Enter will go from the current state to fullscreen desktop, or if already there, will leave fullscreen mode.
Ctrl-Enter will go from the current state to exclusive fullscreen mode, or if already there, will leave fullscreen mode.
2023-06-03 23:24:21 -07:00
Rusty Moyher
052a9d3284 macOS: Removed the fullscreen blanking window
- Removed the blanking window used in SDL_WINDOW_FULLSCREEN. This allows CMD + Tab to work.
- Changed the fullscreen NSWindow level so this works properly.

Fixes issue #7776
2023-06-03 23:05:09 -07:00
Sam Lantinga
fa41ece65f Allow other applications to open controllers on macOS 2023-06-03 11:53:36 -07:00
Sam Lantinga
6815e75caf Steam uses a different VID/PID for the Steam Virtual Gamepad on Windows 2023-06-03 11:39:03 -07:00
Sam Lantinga
5f00147e61 Revert "Fixed detection of the Steam Virtual Gamepad on macOS"
This reverts commit 5fcd70578b.

Steam has been updated to send a version of 1 to avoid conflicts with controllers that report a version of 0.
2023-06-03 11:35:27 -07:00
Ozkan Sezer
0c862d9a55 added compiler support comment about #pragma push_macro/pop_macro. 2023-06-03 17:23:40 +03:00
Sam Lantinga
5fcd70578b Fixed detection of the Steam Virtual Gamepad on macOS 2023-06-02 18:37:45 -07:00
Sam Lantinga
9837653b9d Allow the application to send commands to Nintendo Switch controllers 2023-06-02 15:52:56 -07:00
Sam Lantinga
7c55845c80 Fixed build if SDL_JOYSTICK_RAWINPUT_MATCHING isn't enabled 2023-06-02 11:20:31 -07:00
Sam Lantinga
767507fcf6 Don't use raw input while Remote Desktop is active
Raw input will not send game controller events while Remote Desktop is active, so dynamically switch between XInput and raw input when Remote Desktop state changes.

Fixes https://github.com/libsdl-org/SDL/issues/7759
2023-06-02 11:16:07 -07:00
Sam Lantinga
a5a1844681 Fixed build error 2023-06-02 10:20:29 -07:00
Sam Lantinga
e8b5b4881c Fixed WGI immediately being correlated with raw input devices with no input
The at rest match state is 0x0000008800000000, not 0
2023-06-02 09:38:18 -07:00
Sam Lantinga
2e27812d39 Fixed event sequence when Remote Desktop connects and disconnects
1. Send display disconnected events for all displays no longer connected
2. Send display connected events for all displays that have been connected
3. Send window display events for any windows that have changed displays
2023-06-02 08:51:47 -07:00
Alibek Omarov
6aaf032320 wayland: reset orientation bitmask before reading values from hint on QtWayland
Signed-off-by: Alibek Omarov <a1ba.omarov@gmail.com>
(cherry picked from commit 68e3e99087)
2023-06-02 08:06:30 -07:00
Alibek Omarov
56520372ca hints: clarify support for comma-separated values for QtWayland orientation that's available since 2.0.22
Signed-off-by: Alibek Omarov <a1ba.omarov@gmail.com>
(cherry picked from commit c395240425)
2023-06-02 07:42:06 -07:00
Ozkan Sezer
8c476ca1b0 hidapi/libusb: need libusb >= 1.0.16 because of libusb_get_port_numbers 2023-06-02 07:26:38 -07:00
Ozkan Sezer
e27c10a5b1 hidapi/libusb: don't try to dlsym libusb_wrap_sys_device
not used in SDL.
2023-06-02 07:26:38 -07:00
Ozkan Sezer
3ecdbf27cc hidapi: silence redefinition warnings 2023-06-02 07:25:02 -07:00
Sam Lantinga
f082c68b2f Updated with upstream suggestions in https://github.com/libusb/hidapi/pull/582 2023-06-01 10:48:15 -07:00
Sam Lantinga
0ad089de21 Backed out local changes to build with libusb on Windows 2023-06-01 08:30:10 -07:00
Sam Lantinga
b36679b90e Updated with upstream suggestions in https://github.com/libusb/hidapi/pull/582 2023-06-01 08:27:56 -07:00
Sam Lantinga
20182eed7c Updated with upstream suggestions in https://github.com/libusb/hidapi/pull/572 2023-06-01 07:47:28 -07:00
Sam Lantinga
0cff44dbd4 Updated with upstream suggestions in https://github.com/libusb/hidapi/pull/577 2023-06-01 07:28:44 -07:00
Sam Lantinga
4f58445f03 Ignore both the mouse and keyboard endpoints of Steam Controllers when enumerating game controllers 2023-05-31 14:28:50 -07:00
Nikita Krapivin
c886e80675 gdk: Virtual keyboard and text input backend 2023-05-31 13:11:39 -07:00
Sam Lantinga
b6a88b0339 Don't try to interpret Xbox controllers as raw HID devices on Windows
These generate fake reports which don't include separate trigger axes, and the HIDAPI joystick driver doesn't understand this report format.
2023-05-31 10:49:46 -07:00
Frank Praznik
adad6514d4 wayland: Add aspect-correct output for scaled modes
Add aspect-correct output of scaled video modes and a hint to control this behavior (aspect, stretch, or none).

The Wayland spec states that fullscreen surfaces that do not cover the entire output shall be centered with the borders masked by the compositor, so no additional work is required aside from calculating the proper window dimensions.

The default is still 'stretch' mode, as some window managers as of this time (KDE and older versions of GNOME still found in LTS distros) don't behave according to the spec and present an unmasked window that is not centered, so it's not yet safe to change the default.
2023-05-31 13:41:49 -04:00
Sam Lantinga
4644ac99fa Remove unneeded property type check 2023-05-31 08:27:54 -07:00
Wohlstand
cddcc4f406 Don't ignore "build-scripts" 2023-05-30 19:56:17 -07:00
Wohlstand
8e0b47331f Also ignore "build-*/" sub-directories
Locally, I do make multiple build directories for various purposes, like "build-debug", "build-release", "build-novideo", etc. Also, Qt Creator (if configure it) may automatically create build directories that always starts with a "build-*" prefix.
2023-05-30 19:56:17 -07:00
Ozkan Sezer
e9e4a9175f testautomation_guid.c: fix integer warning in 32 bit builds. 2023-05-31 04:50:02 +03:00
Sam Lantinga
0b28cbe385 Allow building on really old Linux kernels (thanks @sezero!) 2023-05-30 16:36:40 -07:00
Ozkan Sezer
9b147eb80b SDL_x11window.c: apply missing SDL2-to-SDL3 portage to fix build. 2023-05-31 01:55:50 +03:00
Ozkan Sezer
c521e1286b SDL_dbus.h: define DBUS_TIMEOUT_USE_DEFAULT if not already defined. 2023-05-31 01:55:40 +03:00
Ozkan Sezer
20dfb7df2c hidapi/linux/hid.c: define BUS_SPI if not already defined. 2023-05-31 01:55:40 +03:00
Ryan C. Gordon
19c10b41fd x11: Attempt to wait for SDL_MaximizeWindow to complete before returning.
Fixes #7070.

(cherry picked from commit 379a6f4dab)
2023-05-30 17:10:04 -04:00
Sam Lantinga
1fdcb610ff Fixed build 2023-05-30 05:52:07 -07:00
Sam Lantinga
4c36726a31 macOS child window fixes
- Fix places working with window coordinates that need to call SDL_RelativeToGlobalForWindow or SDL_GlobalToRelativeForWindow

- Remove NSScreen param from ConvertNSRect(). Reflecting the Y coordinate is done relative to the main screen height (which ConvertNSRect
  was already doing) so the explicit screen isn't needed.

- Refactor NSScreen lookups for point/rect and fix getting the screen for Cocoa_SetWindowPosition() to get the screen for the new position and
  not the window's current screen (which may not exist if the window is off-screen).

- Fix re-associating the popup and parent window when the child window is shown. Hiding a child window removes it from the window hierarchy
  and so must be added when the window is shown again.

- Allow popup windows that are not tooltips to gain key focus.
2023-05-29 16:44:17 -07:00
Ryan C. Gordon
ecccf6f9ca windows: Don't allow non-resizable windows to be maximized.
Fixes #6346.

(cherry picked from commit d275851dfb)
2023-05-29 14:49:57 -04:00
David Gow
52b73d4115 pipewire: Set 'application.id' if SDL_HINT_APP_ID set
If SDL_HINT_APP_ID is set, pass it as the application.id to pipewire.
This gives any pipewire-based tools a hint to find an associated
.desktop file for icons, etc.
2023-05-29 11:03:34 -04:00
Sam Lantinga
f74549ef2e Fixed build warning
(cherry picked from commit 5007b96363)
2023-05-28 19:24:17 -07:00
Sam Lantinga
1da5b2e488 Disable SDL_JOYSTICK_RAWINPUT_XINPUT
Apparently when using the Xbox One Wireless Adapter, using XInput at the same time as raw input will cause the controller to turn off immediately after connecting. This appears to be a bug in the Windows 11 driver stack, but since WGI provides all the extended functionality we need, this can be turned off for now.

Fixes https://github.com/libsdl-org/SDL/issues/3468

(cherry picked from commit b2e88ecfeb)
2023-05-28 18:44:02 -07:00
Ryan C. Gordon
95f244598b power: On Linux, compare status strings as case-insensitive.
In case something reports "Device" when we expected "device", etc.

Reference Issue #6835.

(cherry picked from commit df9d0fb332)
2023-05-28 21:36:56 -04:00
Frank Praznik
2f75596d5a Consolidate the X11 WM_CLASS and Wayland app ID envvars
Consolidate the X11_WMCLASS and WAYLAND_WMCLASS envvars into one SDL_HINT_APP_ID hint. This hint serves the same purpose on both windowing systems to allow desktop compositors to identify and group windows together, as well as associate applications with their desktop settings and icons.

The common code for retrieving the value is now consolidated under core/unix/SDL_appid.c as it's common to *nix platforms, and the value is now retrieved at window creation time instead of being cached by the video driver at startup so that changes to the hint after video initialization and before window creation will be seen, as well as to accommodate cases where applications want to use different values for different windows.
2023-05-28 19:15:36 -04:00
Sam Lantinga
85f33fe866 Fixed crash if the X11 display doesn't have a resource manager property 2023-05-27 20:42:22 -07:00
Anonymous Maarten
76a919d458 cmake: don't force enable/disable SDL_HIDAPI_LIBUSB
Use CMakeDependentOption instead to configure SDL_HIDAPI_LIBUSB to a okay-ish variable.
2023-05-28 03:27:20 +02:00
Jeffrey Knockel
e4eab186ec Return xrandr-scaled display modes
XRandR supports applying transformations to an output's picture
including changes to scale. Such scaling is used by some desktop
environments under feature names such as "fractional scaling" to
accomodate HiDPI devices. Alternatively, such scaling can be enabled by
a command such as the following:

xrandr --output DP1 --scale 0.5x0.5 --filter nearest

XRandR scaling has no "HiDPI awareness" or other way for an application
to signal that it wants to work with physical display pixels, and so all
we do is scale SDL's returned display modes so that applications receive
the number of usable pixels that they expect.
2023-05-27 17:20:05 -07:00
SDL Wiki Bot
4d6ed7173e Sync SDL3 wiki -> header 2023-05-27 17:52:16 +00:00
Sam Lantinga
0ffeca8a1c Added SDL_HINT_HIDAPI_ENUMERATE_ONLY_CONTROLLERS to control whether SDL_hid_enumerate() enumerates all HID devices or only controllers.
By default SDL will only enumerate controllers, to reduce risk of hanging or crashing on devices with bad drivers and avoiding macOS keyboard capture permission prompts.
2023-05-27 10:51:52 -07:00
Ozkan Sezer
77e59d4fa9 fixed build error due to -Wunused-function 2023-05-27 18:56:10 +03:00
Ozkan Sezer
8ea76ba116 move diagnostic pragma out of the function for old gcc versions. 2023-05-27 18:40:56 +03:00
Sam Lantinga
211054d9db hidapi: improved error handling 2023-05-27 08:33:48 -07:00
Sam Lantinga
2666e15cf1 hidapi: fixed upstream build 2023-05-27 08:21:59 -07:00
Sam Lantinga
bc28790817 Make sure hidapi error handling is thread-safe
The hidapi method of storing the error on the device is not thread-safe, and not only could it result in a double free if multiple threads were setting the error at the same time, but SDL could be trying to use the error message and have it be freed out from under it by another thread.

Use SDL's error functions since they already use thread-local storage.
2023-05-26 23:50:50 -07:00
Sam Lantinga
d51f84a2e1 Revert "Fixed double-free during multi-threaded hidapi access"
This reverts commit 2b386b6c80.

This isn't the right approach. Even if the string itself isn't double-freed, it can be returned to the application and then freed while the application is trying to use it. This really needs to be in thread-local storage to be completely safe.

In SDL we already have a global thread-local error string, so I'm going to make an SDL-specific change to handle the error strings safely.
2023-05-26 23:50:50 -07:00
Sam Lantinga
1c9aae9a29 hidapi build fixes for the upstream build environment 2023-05-26 22:50:39 -07:00
Sam Lantinga
2b386b6c80 Fixed double-free during multi-threaded hidapi access
The error string is not protected by a mutex, and can be set from multiple threads at the same time. Without this change, it can be double-freed. It can still be double-allocated, leading to a memory leak, but at least it won't crash now.

Signed-off-by: Sam Lantinga <slouken@libsdl.org>
2023-05-26 21:08:39 -07:00
Anonymous Maarten
860e52c99e windows: SDL_Delay expects a 32-bit integer 2023-05-27 02:12:59 +02:00
Anonymous Maarten
13a6a72b88 windows: SDL_GetTicks64 -> SDL_GetTicks 2023-05-27 02:02:46 +02:00
Anonymous Maarten
b4291412a4 tests: build tests with C90 standard
C90 mode is disabled for:
- testautomation: use of isnan/isfinite
- testlock: use of kill
- testvulkan: use of c++ style strings in vulkan.h
2023-05-27 01:49:07 +02:00
Anonymous Maarten
5b5b67df20 wayland: don't use libdecor_frame_get_* functions when header doesn't have it
and we're statically linking to the library.
This fixes building SDL with -DSDL_WAYLAND_SHARED=OFF
2023-05-27 01:25:27 +02:00
Ryan C. Gordon
c6cecb0fb0 wasapi: Deal with HDMI or DisplayPort-based audio devices.
They can vanish for UP TO EIGHT SECONDS...!

This is for devices that connect to HDMI/DisplayPort/etc, where it
presumably has to wait for a display to get up and running before it
can play audio through it, so one can see the audio device fail when
changing display modes, or the system returning from sleep. Since this
can be triggered by a game changing video resolutions at startup (either
before or after opening the audio device!), it's important to deal with.

In normal conditions, it shouldn't take this long to open or recover an
audio device, but this is better than unexpectedly losing the device
in this situation.

Fixes #7044.
Fixes #5571.

(cherry picked from commit 48e71ae87b)
2023-05-26 19:15:56 -04:00
Nikita Krapivin
97a927b44e gdk: Fix the project 2023-05-26 14:53:17 -07:00
Sam Lantinga
128ca70160 Added support for printing wide strings using "%ls" syntax 2023-05-26 13:58:10 -07:00
Ozkan Sezer
a8a72de6fb fix mingw build failures in CI with clang-tidy. 2023-05-26 23:55:04 +03:00
Sam Lantinga
31d0d1b93a Fixed HIDAPI driver build 2023-05-26 10:03:11 -07:00
Sam Lantinga
1ef18c7677 Fixed windows build 2023-05-26 09:50:30 -07:00
Sam Lantinga
cb73bed6eb SDL API renaming: SDL TLS functions
Fixes https://github.com/libsdl-org/SDL/issues/7743
2023-05-26 08:33:15 -07:00
SDL Wiki Bot
2a271aeaf1 Sync SDL3 wiki -> header 2023-05-26 15:20:16 +00:00
Sam Lantinga
381cb41027 Don't export hidapi functions from SDL 2023-05-26 08:19:04 -07:00
Sam Lantinga
007c36e513 Added SDL_HINT_HIDAPI_IGNORE_DEVICES to specify devices that should be ignored in SDL_hid_enumerate() 2023-05-26 08:19:04 -07:00
Sam Lantinga
e6834a1535 hidapi/linux: fixed crash if uevent info isn't available
Signed-off-by: Sam Lantinga <slouken@libsdl.org>
2023-05-26 08:19:04 -07:00
Sam Lantinga
b35d813ebb hidapi/linux: retry hid_send_feature_report() if the ioctl() fails with EPIPE (e.g. the device stalled)
Signed-off-by: Sam Lantinga <slouken@libsdl.org>
2023-05-26 08:19:04 -07:00
Sam Lantinga
7c65c9d411 hidapi/linux: fixed doubled and missing report ID for BLE devices
Signed-off-by: Sam Lantinga <slouken@libsdl.org>
2023-05-26 08:19:04 -07:00
Sam Lantinga
9c2ec04733 hidapi/windows: fixed PS4 controllers over Bluetooth on Windows 7
Signed-off-by: Sam Lantinga <slouken@libsdl.org>
2023-05-26 08:19:04 -07:00
Sam Lantinga
8f60d3ee86 hidapi/windows: do not wait in GetOverlappedResult() in hid_read_timeout()
This is unsafe because the event is auto-reset, therefore the call to
WaitForSingleObject() resets the event which GetOverlappedResult() will
try to wait on.

Even though the overlapped operation is guaranteed to be completed at
the point we call GetOverlappedResult(), it will still wait on the event
handle for a short time to trigger the reset for auto-reset events. This
amounts to roughly a 100 ms sleep each time GetOverlappedResult() is called
for a completed I/O with a non-signalled event.

In the context of HIDAPI, this extra sleep means that callers that loop
on hid_read_timeout() with timeout=0 will loop forever, since the 100 ms
sleep each iteration ensures ReadFile() will always have new data.

Signed-off-by: Cameron Gutman <aicommander@gmail.com>
Signed-off-by: Sam Lantinga <slouken@libsdl.org>
2023-05-26 08:19:04 -07:00
Sam Lantinga
f5c731212e hidapi/windows: fix use-after-free SBH corruption due to overlapped ReadFile in hidapi not being canceled for all threads before device close
- hidapi already called CancelIo on hid_close but that only cancels pending IO for the current thread. Controller read/writes originate from multiple threads (serialized, but on a different thread nonetheless) but device destruction was always done on the main device thread which left any pending overlapped reads still running after hidapi's internal read buffer is deallocated leading to intermittent free list corruption.

Signed-off-by: Sam Lantinga <slouken@libsdl.org>
2023-05-26 08:19:04 -07:00
Sam Lantinga
c09848f7ab hidapi/windows: avoid enumerating devices that may hang when queried
Signed-off-by: Sam Lantinga <slouken@libsdl.org>
2023-05-26 08:19:04 -07:00
Sam Lantinga
b0ba509d87 hidapi/windows: allow building on Windows, using the SDL C runtime
Signed-off-by: Sam Lantinga <slouken@libsdl.org>
2023-05-26 08:19:04 -07:00
Sam Lantinga
57b33aec01 hidapi/libusb: allow building on Windows, using the SDL C runtime
Signed-off-by: Sam Lantinga <slouken@libsdl.org>
2023-05-26 08:19:04 -07:00
Sam Lantinga
feb7178e66 hidapi/mac: Only enumerate IOHIDDevices that are likely to be joysticks
Touching HID devices with keyboard usages will trigger a keyboard capture
permission prompt on macOS 11+. See #4887

Like the IOKit joystick backend, we accept HID devices that have joystick,
gamepad, or multi-axis controller usages. We also allow the Valve VID for
the Steam Controller, just like the Windows HIDAPI implementation does.

Signed-off-by: Cameron Gutman <aicommander@gmail.com>
Signed-off-by: Sam Lantinga <slouken@libsdl.org>
2023-05-26 08:19:04 -07:00
Sam Lantinga
2fa4b2e78f hidapi/mac: fixed crash on macOS when AirPods are connected
Signed-off-by: Sam Lantinga <slouken@libsdl.org>
2023-05-26 08:19:04 -07:00
Sam Lantinga
daccd7289b hidapi/libusb: added quirks for the Sony PS3 controller
Signed-off-by: Sam Lantinga <slouken@libsdl.org>
2023-05-26 08:19:04 -07:00
Sam Lantinga
3b06d64dc3 hidapi/libusb: enable support for Xbox 360 and Xbox One controllers
Signed-off-by: Sam Lantinga <slouken@libsdl.org>
2023-05-26 08:19:04 -07:00
Sam Lantinga
e2ec976735 hidapi/libusb: maintain in-memory cache of vendor/product strings
The get_usb_string call is rather expensive on some USB devices, so we
cache the vendor/product strings for future lookups (e.g. when
hid_enumerate is invoked again later).

This way, we only need to ask libusb for strings for devices we haven't
seen since before we started.

Signed-off-by: Steven Noonan <steven@valvesoftware.com>
Signed-off-by: Sam Lantinga <slouken@libsdl.org>
2023-05-26 08:19:04 -07:00
Sam Lantinga
04e686c52f hidapi/libusb: use LIBUSB_CALL for the read_callback function
Signed-off-by: Sam Lantinga <slouken@libsdl.org>
2023-05-26 08:19:04 -07:00
Sam Lantinga
5de35a1d77 hidapi/libusb: use the same logic to get the config descriptor in hid_open_path() as in hid_enumerate()
Signed-off-by: Sam Lantinga <slouken@libsdl.org>
2023-05-26 08:19:04 -07:00
Sam Lantinga
0487621ec4 Added iOS/tvOS hidapi 0.14.0 support 2023-05-26 08:19:04 -07:00
Sam Lantinga
bb12c6e03e Added Android hidapi 0.14.0 support 2023-05-26 08:19:04 -07:00
Sam Lantinga
92b3969ea3 Fixed parameter documentation mismatch 2023-05-26 08:19:04 -07:00
Sam Lantinga
22f22472a0 Create wrapper headers for platform specific hidapi modules 2023-05-26 08:19:04 -07:00
Sam Lantinga
2a08bf6118 Use the bus in the HIDAPI joystick guid now that it's available 2023-05-26 08:19:04 -07:00
Sam Lantinga
af45ae7296 Update the SDL HIDAPI API to match upstream hidapi 0.14.0 2023-05-26 08:19:04 -07:00
Sam Lantinga
003a9b9666 Added interface_class, interface_subclass, and interface_protocol to USB device info
Currently only filled in for libusb
2023-05-26 08:19:04 -07:00
Sam Lantinga
55ed69fc9a Fixed building SDL_hidapi.c with new hidapi 2023-05-26 08:19:04 -07:00
Sam Lantinga
651d9c4a6e Fixed compiling hidapi in SDL build environment 2023-05-26 08:19:04 -07:00
Sam Lantinga
2004304348 Directly include hidapi.h bundled with the hidapi source code 2023-05-26 08:19:04 -07:00
Sam Lantinga
3b7b8f3c09 Updated hidapi to 0.14.0 release
Upstream: https://github.com/libusb/hidapi/releases/tag/hidapi-0.14.0
2023-05-26 08:19:04 -07:00
Sam Lantinga
6b8b9af88a Disable HIDAPI libusb support on FreeBSD in CI
It looks like we're expecting a newer version of libusb than is installed on our VM image. Disabling pending further investigation.
2023-05-26 08:19:04 -07:00
Sam Lantinga
b252ecec6d Fixed crash if trying to dump a packet larger than USB_PACKET_LENGTH 2023-05-26 08:19:04 -07:00
Sam Lantinga
2bf6a7c6af Fixed build warning on Xcode 14.3 2023-05-26 08:19:04 -07:00
Sam Lantinga
b0d52f11f4 Added udev_device_get_syspath() to udev context 2023-05-26 08:19:04 -07:00
Sam Lantinga
c9d8a04945 Added SDL_swprintf() and SDL_vswprintf() 2023-05-26 08:19:04 -07:00
Sam Lantinga
6c28546828 Added SDL_wcstol() 2023-05-26 08:19:04 -07:00
Sam Lantinga
7602a3181e Allow declarations after statements
The SDL coding standard is C89 plus C++ style comments and mixed code and declarations.
2023-05-26 08:19:04 -07:00
Ryan C. Gordon
35292d7dba pulseaudio: Redesigned to use pa_threaded_mainloop.
We weren't meant to have multiple contexts and mainloops, but we had one
for each opened device and the hotplug detection thread. Instead, use
pa_threaded_mainloop, which can be shared between threads and objects, and
a single context (which, according to the PulseAudio documentation, is
usually meant to be a singleton that represents a global server connection,
possibly with multiple streams hung on it).

Now instead of polling in a loop, threads will block until the
threaded_mainloop runs a callback, and the callback will fire a signal to
unblock the thread.

Prior to this, the code upset ThreadSanitizer, as Pulse has some unprotected
global resource that each mainloop/context would touch.

Reference Issue #7427.
2023-05-26 09:07:33 -04:00
Ryan C. Gordon
81fe505c31 audio: remove is_in_audio_device_thread()
SDL mutexes are always recursive in modern times, so no need to check this,
plus the test triggers a false-positive on ThreadSanitizer.

Reference Issue #7427.
2023-05-26 09:07:33 -04:00
Ryan C. Gordon
d4bc393efe video: Only specify some GL context attributes if not the explicit default.
Just in case it upsets some OpenGL drivers unnecessarily.

Fixes #7730.
2023-05-25 10:04:44 -04:00
David Edmundson
a6bb00f399 x11: Use XResources font DPI as a fallback for X11 content scale
There are many toolkit specific ways to set a font DPI in X11 desktop
environments. The primary approach of reading a Gnome specific setting
from the portal is ok, it will work on Gnome and on Plasma most the
time.

The current fallback GDK_SCALE is less great; it's an internal GTK
setting relating to the mapping of logical pixels to device pixels
within the toolkit, it's a developer setting for GTK devs. We were
instructed within Plasma to not set this as it caused issues.

Xft.dpi in xresources is a good universal fallback, it's very dated to
the point that it works in clients like xterm, Qt on X11 uses it in our
font DPI path.
2023-05-24 13:58:42 -07:00
Sam Lantinga
65180804c4 Disable unused local typedefs warning
This triggers on gcc 4.8.4 for compile time asserts inside of functions

Fixes https://github.com/libsdl-org/SDL/issues/7732
2023-05-23 17:23:30 -07:00
Sam Lantinga
a9c988b2a9 Fixed building on 32-bit Linux 2023-05-23 14:36:25 -07:00
Sam Lantinga
06d5989157 Fixed crash if video isn't initialized in SDL_CreatePopupWindow() 2023-05-23 13:41:34 -07:00
Sam Lantinga
e92e4d8b50 Save waitable timers in thread local storage instead of continuously allocating and freeing them
Fixes https://github.com/libsdl-org/SDL/issues/6597
2023-05-23 11:32:40 -07:00
Sam Lantinga
ddbdd73258 Updated source to match SDL function prototype style 2023-05-23 11:29:41 -07:00
Sam Lantinga
737aa881fa Updated source to match SDL function prototype style 2023-05-23 09:37:07 -07:00
Simon McVittie
a828f5897e testevdev: Add some driving sim controllers from Proton issue reports
Ideally we'd detect these as "joysticks" (or more generally, gaming
controllers), but in most cases their evdev flags are indistinguishable
from an accelerometer or gyro, so the only way to achieve this would be
a table of known devices that doesn't currently exist.

One exception is the one that reports a THROTTLE axis and TRIGGER, THUMB
buttons, which would be reasonable to detect via the joystick heuristic.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-05-23 08:53:19 -07:00
Simon McVittie
c88b1d1ca0 testevdev: Add the ability to mark a device entry as unimplemented
There are some devices for which SDL's device classification heuristic
is known not to give the ideal result. Add a way to incorporate these
into our test data, so that when the heuristic is improved we can
detect them as their intended device type, without making the test fail
before that has been implemented.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-05-23 08:53:19 -07:00
Simon McVittie
22e6319fed testevdev: Add data for some game controllers submitted to steam-devices
This will ensure that detection of these devices doesn't regress.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-05-23 08:52:53 -07:00
Linus Probert
da3fefc65c x11: Adds support for generic clipboard data in X11
Re-writes clipboard data handling in X11 to an on demand approach where
data can be produced on request instead of storing it in X11 properties
on the window.
Primary selection has been changed to mimic this behavior even though
it's only possible to use it for text as of now.
2023-05-23 08:51:56 -07:00
Sam Lantinga
b48b1ce500 Document the Android SDK versions checked in Java code 2023-05-23 08:44:49 -07:00
Sam Lantinga
61ef4efdfa Fixed duplicate Joy-Con controllers on macOS
If both Apple and HIDAPI drivers see the controller, HIDAPI will be preferred.

Fixes https://github.com/libsdl-org/SDL/issues/7479
2023-05-22 13:54:15 -07:00
Sam Lantinga
cf0abf9911 Fixed handling the Saitek P3600, which doesn't use the Xbox 360 controller protocol 2023-05-22 12:41:03 -07:00
Sam Lantinga
c971795954 Fixed reporting backspace key if there is no text in the edit buffer (thanks @312937!)
This workaround isn't necessary at API 30 and above.

Fixes https://github.com/libsdl-org/SDL/issues/7039
2023-05-22 11:54:46 -07:00
Sam Lantinga
3f6b2d1a61 Use numeric codes for Android versions, to avoid SDK dependencies 2023-05-22 11:51:32 -07:00
Frank Praznik
1cadf4bab9 wayland: Validate surfaces and window data before sending touch events
Ensure that incoming touch events originate from valid surfaces owned by SDL and have proper window data before forwarding them to the touch subsystem, or the window focus pointer that is sent with the event may not be a pointer to an SDL window.

Additionally, ensure that allocated touch events are always cleaned up on exit.
2023-05-22 14:40:09 -04:00
Sam Lantinga
4dd9f61bfd Don't map the top keyboard row to numbers when using the one-handed DVORAK layouts (thanks @tormol!)
Fixes https://github.com/libsdl-org/SDL/pull/5127

(cherry picked from commit a2f4783e75)
2023-05-22 11:33:47 -07:00
Caleb Cornett
376a3cd100 Fix Xbox link error from IsRectEmpty 2023-05-21 19:09:28 -07:00
Sam Lantinga
d7a56b93d5 Revert "Popups don't accept first focus clicks"
This reverts commit 9d40d619709ce830372835ca29f516b73a685317.
2023-05-21 08:18:46 -07:00
Sam Lantinga
e1a28bc16f Popups don't accept first focus clicks
I'm not sure if this is is what we want, but it matches Windows behavior
2023-05-21 08:17:42 -07:00
M. P. Halpin
bbf38bbbc3 Stop beep when running iOS apps on ARM-based Macs 2023-05-20 11:20:38 -07:00
Sam Lantinga
a6a222095e Added the hint SDL_HINT_ENABLE_SCREEN_KEYBOARD to control whether the on-screen keyboard should be shown when text input is active
Fixes https://github.com/libsdl-org/SDL/issues/7160
2023-05-20 11:14:34 -07:00
Sam Lantinga
f005106d1b Make sure the sentinel is at the end of the current event pump cycle
If we're waiting, it's possible to not get any events, then add the sentinel, then pump again and then add another sentinel. We want to make sure we only have one sentinel and that it's at the end of the currently pumped events.

Testing:
* Verified test case in https://github.com/libsdl-org/SDL/issues/6539
* Verified test case in https://github.com/libsdl-org/SDL/issues/5350

Fixes https://github.com/libsdl-org/SDL/issues/6539

(cherry picked from commit 00b87f1ded)
2023-05-20 10:37:40 -07:00
Sam Lantinga
1a3b713524 Added support for the PowerA MOGA XP-Ultra Controller 2023-05-19 14:39:30 -07:00
Sam Lantinga
517a2afcbd Added support for the PowerA MOGA XP-Ultra Controller 2023-05-19 14:38:50 -07:00
Sam Lantinga
f60622c510 Undo name change for the controller list 2023-05-19 14:26:37 -07:00
Sam Lantinga
24007b00b2 Moved the controller list out so it can be included elsewhere 2023-05-19 14:22:35 -07:00
Sam Lantinga
4e9cfad558 Cache window manipulation calls while an SDL_Window is hidden and replay them when the window is set visible
- SDL_MaximizeWindow, MinimizeWindow, SetFullScreenWindow, etc are not meant to show the window if it isn't currently visible, but on some platforms
  (e.g. Windows) it isn't possible to set this state without also showing the window so cache the flags in a pending_flags field until SDL_ShowWindow is
  called. Then replay the pending flags through ApplyPendingFlags (hoisted out from SDL_FinishWindowCreation).
2023-05-19 10:23:16 -07:00
Ozkan Sezer
5c019bc97e style fixes for SDL_PROC macros. 2023-05-19 14:10:02 +03:00
Frank Praznik
d5f07730be x11: Dynamically update the scale factor
If the text-scaling-factor setting is available via D-Bus, add a listener and update the content scale values for the displays if the value is changed during runtime.

Factors out the D-Bus message pump from the system theme detection code to the general D-Bus code, as it's now used for more purposes than just the system theme.
2023-05-18 16:16:00 -07:00
Sam Lantinga
068d3da366 Fixed window and backbuffer size on Android 2023-05-18 16:11:57 -07:00
Sam Lantinga
a66cad79c1 SDL_GetClosestFullscreenDisplayMode() now takes a boolean whether to include high density modes
Also changed the match to prioritize resolution over refresh rate
2023-05-18 12:15:23 -07:00
Frank Praznik
32ab1183c7 x11: Expose the text/global scaling factor as the display content scale
Expose the text scaling factor (aka the global scale factor on KDE) as the display content scale value so applications can scale themselves as necessary.

If D-Bus is unavailable or retrieving the setting fails, fall back to trying the legacy GDK_SCALE envvar before reverting to the default 1.0 value.
2023-05-18 14:34:25 -04:00
Sam Lantinga
87186a893c Integrate 8067023 and 8067041 to SDL3:
Change 8067023 by mikela:
	Add SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED to SDL_RaiseWindow

	- When set to false, this allows SDL_RaiseWindow to bring a chosen window to the top of the stack but not force input focus to it

Change 8067041 by mikela:
	Rename SDL_HINT_WINDOW_NO_ACTIVATION_WHEN_SHOWN to SDL_HINT_WINDOW_ACTIVATE_WHEN_SHOWN
2023-05-18 09:21:29 -07:00
Sam Lantinga
e61b5ceefe The SDL_WINDOW_ALLOW_HIGHDPI flag has been renamed SDL_WINDOW_HIGH_PIXEL_DENSITY 2023-05-18 07:34:45 -07:00
Sam Lantinga
d1ee44b65e Add the pixel density to the display mode list in testwm 2023-05-18 07:34:16 -07:00
Sam Lantinga
887a1b5969 Print some newly added window flags 2023-05-18 07:33:49 -07:00
SDL Wiki Bot
f9ecc841ca Sync SDL3 wiki -> header 2023-05-18 00:55:15 +00:00
Sam Lantinga
cc94f600fd Officially added the concept of window pixel density
The SDL_WINDOW_ALLOW_HIGHDPI flag has been renamed SDL_WINDOW_HIGH_PIXEL_DENSITY, and added the function SDL_GetWindowPixelDensity()
2023-05-17 17:54:03 -07:00
Sam Lantinga
e708674416 Always expose the high density video modes in the mode list
The SDL_HINT_VIDEO_ENABLE_HIGH_PIXEL_DENSITY hint is going away, so this matches the macOS logic
2023-05-17 17:40:16 -07:00
Ryan C. Gordon
2e646c7141 audio: Load .WAV files with format->blockalign==0.
In theory this is illegal, but legit wavefiles in the field do it, and
it's easy to bump it to 1 for general purposes.

Formats with more specific alignment requirements already check for them
separately.

Fixes #7714.
2023-05-17 20:06:58 -04:00
Ryan C. Gordon
d05639a626 dynapi: Accept a comma-separated list of libraries to attempt to load.
First one to load and have the necessary symbol is the one we accept,
if any. Once we accept one, we won't try loading others.

Fixes #7613.

(cherry picked from commit 32999798e0)
2023-05-17 20:03:36 -04:00
Frank Praznik
68edc72ae8 wayland: Fixups for new DPI code
Add support for the pixel density hint and fix integer scaling to assume that exclusive fullscreen pixel density values are always 1.
2023-05-17 19:01:14 -04:00
Sam Lantinga
a3ce0d03e3 Fixed building with older macOS SDK 2023-05-17 13:32:21 -07:00
SDL Wiki Bot
5836e057de Sync SDL3 wiki -> header 2023-05-17 19:59:14 +00:00
Sam Lantinga
26e780bc9e Fixed warning "A function declaration without a prototype is deprecated in all versions of C" 2023-05-17 12:58:00 -07:00
Sam Lantinga
c699f3d1d8 Updated SDL high DPI support
We have gotten feedback that abstracting the coordinate system based on the display scale is unexpected and it is difficult to adapt existing applications to the proposed API.

The new approach is to provide the coordinate systems that people expect, but provide additional information that will help applications properly handle high DPI situations.

The concepts needed for high DPI support are documented in README-highdpi.md. An example of automatically adapting the content to display scale changes can be found in SDL_test_common.c, where auto_scale_content is checked.

Also, the SDL_WINDOW_ALLOW_HIGHDPI window flag has been replaced by the SDL_HINT_VIDEO_ENABLE_HIGH_PIXEL_DENSITY hint.

Fixes https://github.com/libsdl-org/SDL/issues/7709
2023-05-17 12:58:00 -07:00
valid-ptr
0fbb9c779c SDL emscripten port: preventDefault should not be called on mousedown. Otherwise mouseup will not be fired outside iframe in Chrome-based browsers
(cherry picked from commit 424bc4bcf7)
2023-05-17 12:35:02 -07:00
Ryan C. Gordon
b5cd0749b2 blit: Add a case for 8-bit blits that sdl12-compat exposed.
sdl12-compat can get into a state where a color-keyed surface is
marked for blending, but wants to blend with full alpha (which
is the same as _not_ blending), so rather than fail to find a
blitter in that case, it just selects the colorkey blitter.

Reference https://github.com/libsdl-org/sdl12-compat/issues/233

(cherry picked from commit 0eea92c8fc)
2023-05-16 14:42:16 -04:00
Vid Tadel
f94aa6208a Implement generic clipboard data on MacOS 2023-05-16 11:02:18 -07:00
Sam Lantinga
642504bc59 Check to make sure the Windows joystick device has buttons and axes
This fixes incorrectly detecting the ROG CHAKRAM X mouse as a game controller on Windows 10
2023-05-15 21:43:55 -07:00
SDL Wiki Bot
e2b7b9b91c Sync SDL3 wiki -> header 2023-05-15 18:21:14 +00:00
Sam Lantinga
4de7433a9e Use the term "points" instead of "screen coordinates"
It turns out that screen coordinates were confusing people, thinking that meant pixels, when instead they are virtual coordinates; device independent units defined as pixels scaled by the display scale. We'll use the term "points" for this going forward, to reduce confusion.
2023-05-15 11:20:38 -07:00
SDL Wiki Bot
78251f973d Sync SDL3 wiki -> header 2023-05-13 16:55:14 +00:00
Frank Praznik
12e1b2546a docs: Add README-wayland
Add a README file for Wayland that lists common issues and limitations.
2023-05-13 12:54:14 -04:00
Ryan C. Gordon
9facc86b6a audio: more AudioStream allocation work.
This was only including the resampling buffer needs if it was larger
the other allocation needs, but it needs to be included unconditionally.

For safety's sake, we also make sure the pre-resample buffer doesn't risk
overflow, too, but this might not be necessary in practice.
2023-05-12 21:35:23 -04:00
Sam Lantinga
e596dd8dad Fixed crash creating a window with the Vivante video driver 2023-05-12 16:24:13 -07:00
SDL Wiki Bot
92a59333ba Sync SDL3 wiki -> header 2023-05-12 14:55:13 +00:00
Linus Probert
19adfa3ad9 wayland: Add support for images in clipboard.
Re-writes the clipboard data handling in wayland to an on demand
solution where callbacks are provided to generate/provide the clipboard
data when requested by the OS.
2023-05-12 07:54:56 -07:00
Sylvain
dfd80f3d76 Android: control activity re-creation 2023-05-12 07:48:33 -07:00
Sam Lantinga
2e6c48dcb4 Added support for the GameSir-G7 Controller for Xbox 2023-05-11 17:44:56 -07:00
Ryan C. Gordon
80a8691098 audio: Fixed buffer overflow in SDL_AudioStream resampling. 2023-05-11 16:25:20 -04:00
Ryan C. Gordon
9bf0934877 audio: SDL_memcpy() params were backwards. :O 2023-05-11 15:13:11 -04:00
Sam Lantinga
d98bd67733 Fixed lockup while waiting for events 2023-05-10 17:35:13 -07:00
Sam Lantinga
fd42a2f994 Changed all variadic macros into fixed (thanks @Wohlstand!) 2023-05-10 06:27:38 -07:00
Sylvain
6d9ccbb3c7 Android: use the headers to have the audio pause/resume definitions
and make SDL_PriveAudioData more private
2023-05-10 09:34:53 +02:00
Sam Lantinga
28f891ad0a Allow the application to send rumble packets to Nintendo Switch controllers 2023-05-09 17:08:47 -07:00
Frank Praznik
785b7c6636 wayland: Implement global mouse coordinate emulation
Wayland doesn't support getting the true global cursor position, but it can be faked well enough for what most applications use it for: querying the global cursor coordinates and transforming them to the window-relative coordinates manually.

The global position is derived by taking the cursor position relative to the toplevel window, and offsetting it by the origin of the output the window is currently considered to be on. The cursor position and button state when the cursor is outside an application window are unknown, but this gives 'correct' coordinates when the window has focus, which is good enough for most applications.
2023-05-09 14:17:18 -07:00
SDL Wiki Bot
9786d8ac40 Sync SDL3 wiki -> header 2023-05-09 18:27:15 +00:00
Ryan C. Gordon
2b6cb7bfb2 include: SDL_ConvertAudioSamples docs now warn about converting in chunks.
Fixes #7154.
2023-05-09 14:24:22 -04:00
Ryan C. Gordon
7b6dabd81f audio: AudioStreams shouldn't overflow output buffers.
Before, as ConvertAudio might have expanded data in-place temporarily during
its work, this could blow up. Now if there's a chance of that, it'll
work out of an internal buffer and copy the final results to the output
buffer.

If the output format can handle the temporary expansion, we write directly
to the output buffer without the extra copy.

Fixes #7668.
2023-05-09 14:19:16 -04:00
Sylvain
04e17d4e46 Remove _THIS in src/audio/ 2023-05-09 11:29:33 -04:00
Sylvain
81ff49f4b5 Remove _THIS in src/video and in src/events (also VideoDevice) 2023-05-09 11:29:33 -04:00
Sylvain
df314ba93e Remove _THIS in src/core: EVDEV UDEV 2023-05-09 11:29:33 -04:00
Ryan C. Gordon
0e1669e296 audio: Fixed audiostreams converting incorrect channel counts. 2023-05-09 10:58:32 -04:00
Ryan C. Gordon
7f219aa369 audio: Make sure AudioStream's internal buffers are large enough.
It needs to deal with ConvertAudio growing buffers in-place, as it might
convert smaller types to float as an intermediate step.
2023-05-09 10:57:23 -04:00
Ryan C. Gordon
c7629704b4 audio: SDL_ConvertAudioSamples shouldn't calculate its output buffer size.
Just use what the AudioStream calculates instead.
2023-05-09 10:56:34 -04:00
Ryan C. Gordon
a88aeb2a8a coreaudio: Flush/stop the AudioQueue before disposing of it.
Otherwise, a CoreAudio thread lingers forever, and coreaudiod eats CPU
until the SDL process terminates.

Fixes #7689.

(cherry picked from commit 86786ed544)
2023-05-08 14:26:34 -04:00
Semphris
7f2ef4d02f Implement SDL_GetPath stub for all OSes 2023-05-08 09:36:39 -07:00
Ozkan Sezer
ef2ad2b0c6 windows/SDL_sysfilesystem.c: fix SHGetKnownFolderPath calling convention 2023-05-08 11:55:32 +03:00
Frank Praznik
b92eaddbbd wayland: Fix the corner case when positioning popups
If the popup is positioned such that it requires correction on both the x and y axes, it will be aligned with parent only at the window corners, which is neither overlapping nor adjacent. In this case, nudge the window plus or minus one screen unit on the x axis so it is properly adjacent to the parent and within spec guidelines.
2023-05-06 12:35:47 -04:00
Sam Lantinga
b6df25c334 Removed redundant __powerpc__ check 2023-05-06 08:44:19 -07:00
Jeremy Rand
9142292f4a SDL_blit_N.c: Move ppc64le swizzle outside of loop
An in-place swizzle mutation was erroneously inside of a loop, which
caused each consecutive 4-pixel vector to alternate between correct and
incorrect endianness.

The bug was introduced in 715e070d29.

Thanks to RobbieAB for reporting the bug.

Fixes https://github.com/libsdl-org/SDL/issues/3428
2023-05-06 11:05:48 -04:00
Ozkan Sezer
26903f237f windows/SDL_sysfilesystem.c: replace KNOWNFOLDERID type usage with GUID 2023-05-06 01:10:02 +03:00
Frank Praznik
1bf5a78b53 wayland: Don't print an error when moving a hidden popup window
Repositioning a hidden popup window is valid behavior, so don't print an error message in this case.
2023-05-05 14:05:34 -04:00
Frank Praznik
27085df50d wayland: Remove redundant window geometry configuration
The window geometry will be updated when in underlying shell surface config handler, before the config is ack-ed, so no need to do it in the popup config handler.
2023-05-05 13:54:10 -04:00
Frank Praznik
eb6837e353 wayland: Validate and trigger the repositioning of popups in more cases
Validate and reposition popups in any case where the position or size may have changed. In particular, this fixes cases where the position parameters were adjusted while the window was hidden, as the new values weren't being applied in all cases.
2023-05-05 13:54:10 -04:00
Frank Praznik
17fba24e21 wayland: Adjust overlap required for popups to be considered adjacent
Popups beyond the right and bottom borders of the window must be width/height minus one in order to be considered adjacent and not be instantly closed or cause a protocol error.
2023-05-05 13:54:10 -04:00
Anonymous Maarten
c810e5f63d video: set error code when SetWindowPosition fails 2023-05-05 17:50:32 +02:00
Ozkan Sezer
52c19bd21b attempt to fix more build failures against older Win32 SDKs. 2023-05-05 03:33:10 +03:00
Ozkan Sezer
d7f1719777 fixed -Wundef warning due to HAVE_MMDEVICEAPI_H 2023-05-05 03:32:56 +03:00
Sam Lantinga
450c947949 Actually define the folder GUIDs 2023-05-04 16:39:16 -07:00
Sam Lantinga
e0e95b1ea9 Fixed coding style and building on older Windows SDKs 2023-05-04 16:28:16 -07:00
Sam Lantinga
9b87de258f Fixed crash in new audio channel conversion code
Each loop needs to be run num_frames times, and the source and destination pointers are incremented by the number of channels during the conversion.
2023-05-04 15:50:38 -07:00
Semphriss
c1dab7745a Add SDL_GetPath() for default OS folders (#7665) 2023-05-04 11:38:11 -07:00
Anonymous Maarten
72e5a52c51 ci: use Haiku cross toolchain
A cross compiler is much faster then an emulated one.
2023-05-04 08:26:54 -04:00
Anonymous Maarten
fe68fd3af9 ci: disable pull_request trigger for haiku 2023-05-04 05:15:10 +02:00
Ryan C. Gordon
e191bc8491 audio: Simplified GetFirstAudioFormat/GetNextAudioFormat.
Now it just returns an iterable array and needs no global state.
2023-05-03 22:37:23 -04:00
Sam Lantinga
b6ca360228 Added support for the Saitek Cyborg V.3 Rumble Pad in PS3 mode 2023-05-03 09:47:16 -07:00
Sam Lantinga
3f0c2a6694 Don't set the display scale if DPI scaling isn't enabled
In this case we want the display mode pixel to screen coordinates to be 1:1 ... but we lose information about the UI scaling of the display - is that okay?
2023-05-03 09:47:13 -07:00
Brick
86b5f40b53 Fixed CalculateAudioStreamWorkBufSize 2023-05-02 11:16:20 -04:00
Brick
079ae065f1 Added SDL prefix AUDIO_* constants 2023-05-02 08:09:06 -07:00
Brick
1ee2832326 Fixed SDL_ConvertMonoToStereo_SSE reading out of bounds 2023-04-30 13:14:20 -04:00
Sam Lantinga
255c3b7c82 By default, OpenBSD uses Linux controller mappings
Fixes https://github.com/libsdl-org/SDL/issues/7609
2023-04-29 17:09:17 -07:00
Sam Lantinga
0d559b7cb3 Fixed parsing SDL_mutex.h 2023-04-29 10:14:03 -07:00
Eric
f7df966b41 SDL_JOYBALLMOTION 2023-04-28 23:35:33 -04:00
Eric
e8c16ce483 Update migration guide with info on trackballs 2023-04-28 23:35:33 -04:00
Frank Praznik
bee6099372 events: Emit an event when a window is destroyed
As child windows can be recursively destroyed when their parents are destroyed, emit an event to notify the application when a window is being or has been implicitly destroyed so that it can appropriately clean up any associated resources.

If the application has registered an event watch, the destroy message will be received when the window handle is still valid, so the application can retrieve and release any userdata associated with the window. If the message is processed at any time after that, the window handle is already invalid and the ID is only useful for application-side bookkeeping purposes.
2023-04-28 15:09:47 -04:00
SDL Wiki Bot
78cfc23993 Sync SDL3 wiki -> header 2023-04-28 19:09:14 +00:00
Sam Lantinga
87ad71f9b2 Rename SDL mutex, semaphore and condition variable types to match SDL 3.0 naming convention 2023-04-28 12:08:33 -07:00
Sam Lantinga
61c0c009ab Rename SDL semaphore and condition variable functions to match SDL 3.0 naming convention
Fixes https://github.com/libsdl-org/SDL/issues/7642
2023-04-28 12:08:33 -07:00
Sam Lantinga
170c410d35 Remove old mutex macros 2023-04-27 19:13:35 -07:00
SDL Wiki Bot
38d22aed67 Sync SDL3 wiki -> header 2023-04-28 01:55:15 +00:00
Ryan C. Gordon
e474047ff8 rwlock: Added SDL_rwlock API for shared locks. 2023-04-27 21:54:02 -04:00
Ryan C. Gordon
776820526b windows: Use InitializeSRWLock explicitly.
The docs say you should, if not statically initializing an SRWLOCK--which
we aren't--but in practice this is probably just being pedantic.

Still, better (thread) safe than sorry!
2023-04-27 21:54:02 -04:00
Ryan C. Gordon
70a501d8ec winrt: Don't reference generic Condition Variables at all.
It always has the SRWLOCK implementation available to it, so let the
linker throw away the generic version if possible.
2023-04-27 21:54:02 -04:00
Ryan C. Gordon
736f9fb9b9 mutex: Fixed typos in documentation 2023-04-27 21:54:02 -04:00
Sam Lantinga
a4b4dff4a2 Added support for the Astro C40 in Xbox 360 mode 2023-04-27 17:10:44 -07:00
SDL Wiki Bot
60c5888423 Sync SDL3 wiki -> header 2023-04-27 22:36:15 +00:00
Ryan C. Gordon
e5a6c24c82 audio: Redesigned audio conversion code for SDL3.
- SDL_AudioCVT is gone, even internally.
- libsamplerate is gone (I suspect our resampler is finally Good Enough).
- Cleanups and improvements to audio conversion interfaces.
- SDL_AudioStream can change its input/output format/rate/channels on the fly!
2023-04-27 18:35:15 -04:00
Sam Lantinga
44bec9c01c Fixed build 2023-04-27 13:06:21 -07:00
Sam Lantinga
c10849b40b Added support for new Xbox Elite 2 firmware 2023-04-27 12:33:33 -07:00
Sam Lantinga
eaf17050b4 Allow popup windows to be raised through SDL_RaiseWindow
- This allows specific child popup windows to be activated explicitly.
2023-04-26 16:31:18 -07:00
Sam Lantinga
b701ac0266 Fixed building with Java 1.7 2023-04-26 14:14:59 -07:00
Sam Lantinga
83554cc307 Fixed outdated symbol renaming hints 2023-04-26 14:11:38 -07:00
Sam Lantinga
c5cdaef6c3 Fixed function documentation references 2023-04-26 14:10:44 -07:00
Linus Probert
43f65a6ef0 wayland: Fixes a memory leak wheere primary selection isn't freed 2023-04-24 11:59:39 -07:00
Ozkan Sezer
ae9119c36b hidapi/mac: replace sprintf uses with snprintf.
Reference issues:
-  https://github.com/libusb/hidapi/pull/509
-  https://github.com/libusb/hidapi/pull/511
2023-04-24 10:46:05 -07:00
Ozkan Sezer
62d1a2c836 hidapi/mac: import mainstream commit c1b9d2ad
c1b9d2ad98
Properly handle the close of run loop on macOS
(https://github.com/libusb/hidapi/pull/522)
- as per documentation `kCFRunLoopRunStopped` should be handled once the runloop is closed via `CFRunLoopStop`;
- if it is not handled - a race condition/crash may happen on the latest macOS when a device gets disconnected while being open;
2023-04-24 10:46:05 -07:00
Mingjie Shen
ac607c1088 SDL_ConvertSurface(): add null pointer check
Check return values of SDL_CreateSurface()
and SDL_ConvertSurface().
2023-04-23 17:43:10 -07:00
Mingjie Shen
bf8c9d2d70 Check return value of VIRTUAL_HWDataForIndex() 2023-04-23 17:40:15 -07:00
Mingjie Shen
a4604cb0d6 Check return value of SDL_malloc() 2023-04-23 08:57:12 -04:00
Frank Praznik
f431037f62 wayland: Insert new displays at the end of the output list
Insert new displays at the end of the list instead of the front so that the initial ordering, as exposed by the compositor, is preserved. This is particularly important when the compositor exposes the xdg-output instance after the wl_output instance, as xdg-output must be attached to the outputs in the same order that wl_output exposed them, or they can be added to the SDL output list in reverse order.
2023-04-21 12:59:36 -04:00
Sam Lantinga
0467301baf Report PS3 accelerometer values in m/s2 instead of Gs 2023-04-19 13:10:39 -07:00
Sylvain
9d18b4b5ed Android: fix crash when AAUDIO isn't used (bug #7620) 2023-04-18 21:34:18 +02:00
Frank Praznik
bad4f4e5ac wayland: Destroy proxy wrappers before and callbacks before event queues
Destroy any proxy wrappers and callbacks before the associated event queues to silence libwayland warnings about destroying the queues while proxies are still attached.
2023-04-18 14:37:16 -04:00
Sylvain
bbdde648d8 Android: let main return normally for testautomation 2023-04-14 12:26:12 +02:00
Sylvain
7afe735b5f SDL_test: add more color when success/fail/skip 2023-04-14 12:12:45 +02:00
Sylvain
117169d610 Android AAUDIO: handle multiple devices 2023-04-14 11:31:47 +02:00
Sylvain
f38cb0d06f Android: don't add telephony device, as it cannot be opened 2023-04-14 11:31:27 +02:00
Simon McVittie
c335e3db82 test/template.test.in: Pass SDL_NONINTERACTIVE_ARGUMENTS to installed-tests
Otherwise they'll try to run with no arguments, and fail, when run by
ginsttest-runner.

Fixes: 81ca9d61 "cmake+test: add more automated tests + use properties"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-04-12 15:04:11 +00:00
Ozkan Sezer
dfff017fc6 testaudiocapture.c: added missing return statement to main() 2023-04-12 12:56:10 +03:00
Ozkan Sezer
c41a76657e SDL_timer.c: silence a minor warning. 2023-04-12 12:55:40 +03:00
Sylvain
0a33ed7a2b testaudiocapture: let main exit normally 2023-04-12 11:43:20 +02:00
Sylvain
c101e719fd testprogram: let main() return normally, don't exit for platform (eg Android) where there is some cleanup afterward. 2023-04-12 11:37:26 +02:00
Sylvain
ec053ec4f8 Android: need to save/restore the swap interval / vsync
otherwise, there is a difference of framerate, either with gles2 or SDL_renderer (testspriteminimal, testgles2).
2023-04-12 11:09:59 +02:00
Frank Praznik
8162d6659a wayland: Use the integer buffer scale event when applicable
wl_compositor v6 introduces the preferred buffer scale event, which serves a similar function to the fractional scale protocol, but deals in integer scale factors. Listen to this event when the wl_compositor version is >= 6 and the fractional scale protocol is not present to set the scale factor for surfaces.
2023-04-10 10:16:33 -04:00
Sam Lantinga
05b701f12e Fix win32 windows with WS_EX_COMPOSITED style continuing to receive WM_PAINT messages after ValidateRect
- Composited windows seem to need to actually paint (or appear to paint) through calls to Begin/EndPaint to properly validate
  their update region. If not done they will continue to receive WM_PAINT messages for the same region.
2023-04-07 06:20:28 -07:00
Sam Lantinga
17bdea7a91 Fix pop-up windows changing position for each HideWindow()/ShowWindow() cycle
When X11_UpdateWindowPosition() was called and the position didn't update
we would fire an SDL_EVENT_WINDOW_MOVED event with the global x,y for
the pop-up instead of the relative position for the pop-up.

This change ensures we always have a relative position for pop-ups before sending
the SDL_EVENT_WINDOW_MOVED event.
2023-04-06 15:12:09 -07:00
Sam Lantinga
92821f7a82 Fixed Visual Studio warning 4389: '==': signed/unsigned mismatch 2023-04-06 15:11:56 -07:00
Sam Lantinga
acadb6f873 More defensive coding against dangling device pointers 2023-04-06 11:33:27 -07:00
Sam Lantinga
1a20ccb289 Clarified the expected sensor value when a game controller is at rest 2023-04-06 09:55:01 -07:00
Sam Lantinga
558bbbb07a The latest Armor-X Pro firmware update fixes the sign on the Z axis of the sensors 2023-04-06 09:55:01 -07:00
Sylvain
3c703f2061 Android: message to indicate that main() is called for the 1 or n'th time 2023-04-06 10:08:07 +02:00
Cyril Dubet
60dcaff7eb Fix key code names for ISO keyboard layouts 2023-04-05 17:03:05 -07:00
Sam Lantinga
73b2faea4e The macOS minimum deployment target is now 10.11
Xcode 14.3 does not allow targeting 10.9, the minimum recommended version is 10.13 and the minimum possible version is 10.11.
2023-04-05 11:37:27 -07:00
Sam Lantinga
e13b74ccf0 Fixed crash if joystick->hwdata != NULL && device->driver == NULL
This should never happen, but we're seeing it in the wild, so make sure that we can never call into a NULL device driver.
2023-04-05 11:24:27 -07:00
Frank Praznik
a21ee02095 wayland: Use the output description from wl_output as of v4
xdg-output names and descriptions are deprecated in favor of those provided by the core wl_output protocol as of v4. Bump wl_output support to v4 and ignore the xdg-output description in favor of the wl_output description when appropriate.
2023-04-05 10:24:23 -04:00
Frank Praznik
5c27bc81d8 wayland: Use release for display and seat objects, if available
wl_seat and wl_output gained release methods, which should be preferred over destroy methods if they are available.

Bumps wl_output to version 3.
2023-04-05 10:24:23 -04:00
Frank Praznik
9084b6c666 wayland: Remove some unused variables 2023-04-05 10:24:23 -04:00
Ethan Lee
3ac48053bc wayland: Minor whitespace cleanup
Co-authored-by: Frank Praznik <frank.praznik@gmail.com>
2023-04-05 08:58:12 -04:00
Anonymous Maarten
c721155b89 cmake: prepend generated wayland protocol include path 2023-04-05 08:58:12 -04:00
David Edmundson
0c551e7069 wayland: Support axis relative direction
This allows clients to be aware of "natural scrolling" settings in the
compostior and adjust accordingly to optionally keep the same wheel and
trackpad behaviour accross platforms.

Testing using the "testmouse" example, behaviour in the demo is now the
same regardless of the compositor setting for scrolling.
2023-04-05 08:58:12 -04:00
Anonymous Maarten
ac72cdcf79 Fix -Wmissing-prototypes warning
./src/video/SDL_video.c:1734:13: warning: no previous prototype for function 'SDL_CreateWindowInternal' [-Wmissing-prototypes]
SDL_Window *SDL_CreateWindowInternal(const char *title, int x, int y, int w, int h, SDL_Window *parent, Uint32 flags)
            ^
./src/video/SDL_video.c:1734:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
SDL_Window *SDL_CreateWindowInternal(const char *title, int x, int y, int w, int h, SDL_Window *parent, Uint32 flags)
^
static
2023-04-05 05:39:48 +02:00
Anonymous Maarten
029e61a07e cmake: split SDL_NEON into SDL_NEON and SDL_NEON_BLITTERS 2023-04-04 15:55:02 -07:00
Sam Lantinga
cf2c6fa58d Fixed crash if dbus can't be initialized 2023-04-04 12:34:00 -07:00
Sylvain
407b85c506 Android: audio change audio assert when try to open concurrent device to a real error 2023-04-04 09:43:01 +02:00
Frank Praznik
a874f6c993 wayland: Send system timestamps for relative pointer events 2023-04-02 10:51:37 -04:00
Frank Praznik
1869e1247d wayland: Track the serial numbers for implicit grab events and use them when raising windows
Track the serial numbers of key events, mouse button presses, touch down events, tablet tool down events, and tablet button presses, and pass the serial, along with the seat, to the xdg-activation protocol when raising windows to increase the chances of it succeeding.
2023-04-02 10:51:37 -04:00
Frank Praznik
6119ac8bb4 wayland: Don't round trip when setting the initial minimized and maximized states during window creation
Don't perform a round trip when setting the minimized and maximized window states during initial window creation, as it will be done later in the window creation process.
2023-04-02 10:51:37 -04:00
Frank Praznik
ab948123c2 wayland: Avoid recursive calls into fullscreen setting functions
When changing the fullscreen state and performing a roundtrip, more than one configure event can be sent before getting the event that changes the fullscreen state. Don't change the higher-level window state and avoid recursive calls back into the video system during these events.
2023-04-02 10:51:37 -04:00
Frank Praznik
1f177cf93e wayland: Refactor constraint handling
According to the xdg-shell spec, xdg-toplevel min/max values are just hints, which compositors are free to ignore, and they often do so in several cases (usually when tiling, maximizing, or entering fullscreen). Even with the hints set, manually constraining the surface dimensions for non-maximized, non-fullscreen surfaces is required for consistent behavior.

In the case of maximized windows, the dimensions as specified in the configure event are non-negotiable and must be respected by the client, as not doing so is a protocol violation.

This also eliminates some redundant calls to set the libdecor resizable state, which can cause unnecessary commits internally.
2023-04-02 10:51:37 -04:00
Sam Lantinga
2aa2fa5449 Added SDL_CreateWindowWithPosition()
It turns out there's a race condition on X11 where the window could be placed by the window manager while being placed by the application, so we need to have the initial position available at window creation.
2023-03-31 17:21:44 -07:00
Anonymous Maarten
b6ae281e97 Use #ifdef/#ifndef instead of #if defined/#if \!defined 2023-03-30 21:35:01 +00:00
Sam Lantinga
308bcbbe76 Fixed Visual Studio warning 4244 2023-03-30 14:04:32 -07:00
Sam Lantinga
85ee1498a5 Fixed Visual Studio warning 4245 2023-03-30 14:02:06 -07:00
Sam Lantinga
f341c06552 Fixed Visual Studio warning 4310 2023-03-30 14:02:05 -07:00
Sam Lantinga
0bd77a5b93 Fixed Visual Studio warning 4389 2023-03-30 14:02:04 -07:00
Sam Lantinga
d135daad5b Fixed Visual Studio warning 4459 2023-03-30 14:02:03 -07:00
Sam Lantinga
b078122c53 Fixed Visual Studio warning 4701 2023-03-30 14:02:02 -07:00
Sam Lantinga
28d687aae0 Fixed Visual Studio warning 4702 2023-03-30 10:48:50 -07:00
Sam Lantinga
e2f560d4bb Fixed build error
'__inline__' is not at beginning of declaration [-Werror=old-style-declaration]
2023-03-30 10:48:48 -07:00
Frank Praznik
1fd15c9b4e x11: Don't allow the changing of certain scancodes
The X11 driver uses scancodes derived from keysyms to map the scancodes for extended keys to the physical keyboard, however, this can be incorrect when using certain XKB options (e.g. caps:swapescape), which changes the keysyms emitted by certain keys, but does not imply that their scancodes or positions should be altered. Mark selected scancodes as being non-remappable so that their scancodes aren't changed by toggling XKB mapping options.
2023-03-30 11:25:23 -04:00
Sam Lantinga
655a07bdd8 Don't probe for PlayStation controllers when we already know the controller type
Fixes https://github.com/libsdl-org/SDL/issues/7556
2023-03-30 07:36:40 -07:00
Sam Lantinga
a67d410501 Fixed analog triggers on the DualSense controller 2023-03-30 07:25:49 -07:00
Jérôme Duval
2d64f419c5 Haiku: use a BLooper for events, only create a BApplication when it doesn't already exist. (#7555) 2023-03-30 07:12:10 -07:00
Sylvain
cae6b4489d - simplication and factorization around CalculateSize and Pitch, RGB/YUV
- update SDL_CalculateYUVSize pitch to size_t
2023-03-30 12:05:35 +02:00
Anonymous Maarten
c82cca0494 ci: use loongson official cross toolchains 2023-03-30 05:15:28 +02:00
Anonymous Maarten
eed266d266 SDL_syshaptic.c and SDL_sysjoystick.c need string.h for strerror 2023-03-30 04:19:43 +02:00
Anonymous Maarten
cf8899ec94 cmake: allow HAVE_LINUX_INPUT_H with !defined(HAVE_LIBC) 2023-03-30 04:19:36 +02:00
Anonymous Maarten
b99f380498 intrinsics: add lsx/lasx intrinsic headers when not disabled
__attribute__((target(xx))) is not supported by LoongArch64.
The following warning is emitted:
target attribute is not supported on this machine [-Wattributes]
2023-03-30 04:00:48 +02:00
Anonymous Maarten
94bca5a2a3 ci: add loongarch64 workflow 2023-03-30 03:24:52 +02:00
Sam Lantinga
c07e966690 Fixed build 2023-03-29 16:36:13 -07:00
Anonymous Maarten
3472dc11d6 Fix uses of undefined macro identifiers (-Wundef)
* Fix -Wundef warnings due to use of unguarded SDL_LOADSO_DISABLED

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_WINDOWS

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_ANDROID

* Fix -Wundef warnings due to use of unguarded SDL_LOADSO_DUMMY

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_COCOA

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_UIKIT

* Fix -Wundef warnings due to use of unguarded SDL_TIMERS_DISABLED

* Fix -Wundef warnings due to use of unguarded SDL_EVENTS_DISABLED

* Fix -Wundef warnings due to use of unguarded SDL_TIMER_DUMMY

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DISABLED

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DISABLED

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_DISABLED

* Fix -Wundef warnings due to use of unguarded SDL_HAPTIC_DISABLED

* Fix -Wundef warnings due to use of unguarded SDL_SENSOR_DISABLED

* Fix -Wundef warnings due to use of unguarded __ANDROID__

* Fix -Wundef warnings due to use of unguarded __IOS__

* Fix -Wundef warnings due to use of unguarded EMULATE_CAS

* Fix -Wundef warnings due to use of unguarded SDL_ATOMIC_DISABLED

* Fix -Wundef warnings due to use of unguarded SDL_THREADS_DISABLED

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_SNDIO

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_NETBSD

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_WASAPI

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_DSOUND

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_HAIKU

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_COREAUDIO

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_AAUDIO

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_OPENSLES

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_ANDROID

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_PS2

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_PSP

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_VITA

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_N3DS

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_EMSCRIPTEN

* Fix -Wundef warnings due to use of unguarded SDL_NEON_INTRINSICS

* Fix -Wundef warnings due to use of unguarded SDL_ALTIVEC_BLITTERS

* Fix -Wundef warnings due to use of unguarded __VITA__

* Fix -Wundef warnings due to use of unguarded __3DS__

* Fix -Wundef warnings due to use of unguarded SDL_DYNAPI_PROC_NO_VARARGS

* Fix -Wundef warnings due to use of unguarded __APPLE__

* Fix -Wundef warnings due to use of unguarded __WINRT__

* Fix -Wundef warnings due to use of unguarded SDL_HIDAPI_DISABLED

* Fix -Wundef warnings due to use of unguarded __TVOS__

* Fix -Wundef warnings due to use of unguarded HAVE_DRIVER_BACKEND

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_XINPUT

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_WGI

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_DINPUT

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_MFI

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_EMSCRIPTEN

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_PS2

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_PSP

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_VITA

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_N3DS

* Fix -Wundef warnings due to use of unguarded __MACOS__

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_D3D

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_WINRT

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_RPI

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_VITA_PVR_OGL

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_VIVANTE

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_D3D11

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_D3D12

* Fix -Wundef warnings due to use of unguarded SDL_RENDER_DISABLED

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_METAL

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_PS2

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_PSP

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_VITA_GXM

* Fix -Wundef warnings due to use of unguarded SDL_ARM_SIMD_BLITTERS

* Fix -Wundef warnings due to use of unguarded SDL_ARM_NEON_BLITTERS

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_HAIKU

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_PS2

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_PSP

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_VITA

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_N3DS

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_KMSDRM

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_RISCOS

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_EMSCRIPTEN

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_NGAGE

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_METAL

* Fix -Wundef warnings due to use of unguarded SDL_LSX_INTRINSICS

* Fix -Wundef warnings due to use of unguarded HAVE_PTHREAD_NP_H

* Fix -Wundef warnings due to use of unguarded __RISCOS__

* Fix -Wundef warnings due to use of unguarded FAKE_RECURSIVE_MUTEX

* Fix -Wundef warnings due to use of unguarded USE_POSIX_SPAWN

* textureData is only needed when SDL is built with YUV support

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_ALSA

* Fix -Wundef warnings due to use of unguarded SDL_SSE3_INTRINSICS

* Fix -Wundef warnings due to use of unguarded SDL_SSE4_2_INTRINSICS

* Fix -Wundef warnings due to use of unguarded SDL_SSE4_1_INTRINSICS

* Fix -Wundef warnings due to use of unguarded SDL_AVX512F_INTRINSICS

* Fix -Wundef warnings due to use of unguarded SDL_SSE2_INTRINSICS

* Fix -Wundef warnings due to use of unguarded SDL_AVX_INTRINSICS

* Fix -Wundef warnings due to use of unguarded SDL_AVX2_INTRINSICS

* Fix -Wundef warnings due to use of unguarded SDL_SSE_INTRINSICS

* Fix -Wundef warnings due to use of unguarded SDL_MMX_INTRINSICS

* Fix -Wundef warnings due to use of unguarded HAVE_CLOCK_GETTIME

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_DISK

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_DUMMY

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_DUMMY

* Fix -Wundef warnings due to use of unguarded HAVE_GCC_ATOMICS

* Fix -Wundef warnings due to use of unguarded HAVE_GCC_SYNC_LOCK_TEST_AND_SET

* Fix -Wundef warnings due to use of unguarded SDL_USE_LIBDBUS

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_JACK

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_VIRTUAL

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_LINUX

* Fix -Wundef warnings due to use of unguarded HAVE_LIBC

* Fix -Wundef warnings due to disabling SDL_LIBC

* Fix -Wundef warnings due to use of unguarded HAVE_PLATFORM_BACKEND

* Fix -Wundef warnings due to use of unguarded DEBUG

* Fix -Wundef warnings due to use of unguarded HAVE_LINUX_INPUT_H

* Fix -Werror=unused-variable when building with SDL_LIBC=OFF

* Fix -Wundef warnings due to use of unguqrded SDL_USE_LIBUDEV

* Use SDL alloc functions in libusb/hid.c

* Fix -Wundef warnings due to use of unguarded HAVE_LIBUDEV_H

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_VULKAN

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_OFFSCREEN

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_OGL

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL_GLX

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL_ES

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL_ES2

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_RENDER_OGL_ES2

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_OSS

* Remove SDL_AUDIO_DRIVER_SUNAUDIO reference since it is never set

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_PIPEWIRE

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_PULSEAUDIO

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_X11_XCURSOR

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_X11_XDBE

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_X11_XFIXES

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_X11_XINPUT2

* Fix -Wundef warnings due to use of unguarded #if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH

* Fix -Wundef warnings due to use of unguarded #if SDL_VIDEO_DRIVER_X11_XRANDR

* Fix -Wundef warnings due to use of unguarded #if SDL_VIDEO_DRIVER_X11_XSCRNSAVER

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_X11_XSHAPE

* Don't call XShape functions when XShape is diabled

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_WAYLAND

* Fix -Wundef warnings due to use of unuarded SDL_VIDEO_DRIVER_X11

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_RISCOS

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL_EGL

* Disable array when compiled with SDL_EVENTS=OFF

* Fix -Wundef warnings due to use of unguarded SDL_INPUT_LINUXEV

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_PTHREAD

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_WINDOWS

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_PS2

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_PSP

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_VITA

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_N3DS

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_STDCPP

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_NGAGE

* Fix -Wundef warnings due to use of unguarded __WINDOWS__

* Fix -Wundef warnings due to use of unguarded __WINGDK__

* Fix -Wundef warnings due to use of unguarded __ANDROID__

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_GENERIC_COND_SUFFIX

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_VITA_PIB

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_VITA_PVR

* Fix -Wundef warnings due to use of unguarded SDL_FILE_DISABLED

* Fix -Wundef warnings due to use of unguarded __XBOXONE__

* Fix -Wundef warnings due to use of unguarded __XBOXSERIES__

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL_WGL

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_QNX

* Fix -Wundef warnings due to use of unguarded SDL_AUDIO_DRIVER_DISK

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_QNX

* Fix -Wundef warnings due to use of unguarded DEBUG_RAZOR

* Fix -Wundef warnings due to use of unguarded WINAPI_FAMILY_PHONE_APP

* Fix -Wundef warnings due to use of unguarded SDL_MAC_NO_SANDBOX

* Fix -Wundef warnings due to use of unguarded __(IPHONE|APPLETV|MAC)_OS_VERSION_MAX_ALLOWED

* Fix C4090 warning ('function': different 'const' qualifiers)

* ci: use -isystem for include dirs of pspdev toolchain

* cmake: add -Wundef option

* Fix remaining -Wundef warnings due to use of unguarded SDL_VIDEO_VULKAN and SDL_VIDEO_METAL

* Fix -Wundef warnings due to use of unguarded __MACOS__

* DEBUG_CONVERT is guaranteed to be defined in src/audio/SDL_audiocvt.c

* Fix -Wundef warnings due to use of unguarded HAVE_NANOSLEEP

* Fix -Wundef warnings due to use of unguarded HAVE_DXGI_H

* Fix -Wundef warnings due to use of unguarded HAVE_LINUX_INPUT_H

* fix SDL_VIDEO_DRIVER_WAYLAND

* fix SDL_VIDEO_DRIVER_X11

* Fix -Wundef warnings due to use of unguarded HAVE_MMDEVICEAPI_H

* Fix -Wundef warnings due to use of unguarded HAVE_PTHREAD_SETNAME_NP

* Fix -Wundef warnings due to use of unguarded HAVE_PTHREAD_SET_NAME_NP

* Fix -Wundef warnings due to use of unguarded HAVE_SETJMP

* Fix -Wundef warnings due to use of unguarded HAVE_SIGNAL_H

* Fix -Wundef warnings due to use of unguarded HAVE_TPCSHRD_H

* Fix -Wundef warnings due to use of unguarded MACOSX_COREAUDIO

* Fix -Wundef warnings due to use of unguarded SDL_HAPTIC_DINPUT

* Fix -Wundef warnings due to use of unguarded SDL_HAPTIC_IOKIT

* Fix -Wundef warnings due to use of unguarded SDL_HAPTIC_XINPUT

* Fix -Wundef warnings due to use of unguarded SDL_IPHONE_KEYBOARD

* Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_RAWINPUT

* Fix -Wundef warnings due to use of unguarded SDL_POWER_ANDROID

* Fix -Wundef warnings due to use of unguarded SDL_POWER_EMSCRIPTEN

* Fix -Wundef warnings due to use of unguarded SDL_POWER_HAIKU

* Fix -Wundef warnings due to use of unguarded SDL_POWER_LINUX

* Fix -Wundef warnings due to use of unguarded SDL_POWER_MACOSX

* Fix -Wundef warnings due to use of unguarded SDL_POWER_PSP

* Fix -Wundef warnings due to use of unguarded SDL_POWER_UIKIT

* Fix -Wundef warnings due to use of unguarded SDL_POWER_VITA

* Fix -Wundef warnings due to use of unguarded SDL_POWER_WINDOWS

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_PTHREAD_RECURSIVE_MUTEX

* Fix -Wundef warnings due to use of unguarded SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_VIVANTE_VDK

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_WAYLAND

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL_CGL

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL_EGL

* Fix -Wundef warnings due to use of unguarded __MACOS__

* Fix -Wundef warnings due to use of unguarded __OpenBSD__

* Fix -Wundef warnings due to use of unguarded __FreeBSD__

* Fix -Wundef warnings due to use of unguarded __MWERKS__

* Fix -Wundef warnings due to use of unguarded __WIN32__

* Fix -Wundef warnings due to use of unguarded SDL_IPHONE_LAUNCHSCREEN

* Fix -Wundef warnings due to use of unguarded SDL_VIDEO_OPENGL_ES2

* Remove unused HAVE_CONST, HAVE_INLINE and HAVE_VOLATILE

* Revert "Use SDL alloc functions in libusb/hid.c"

This reverts commit 847c64b00d.

* Handle FAKE_RECURSIVE_MUTEX in similar way as SDL2

* Don't use defined in macro
2023-03-29 21:49:01 +00:00
Sam Lantinga
c3d3c2c672 Fixed crash if SDL_GetDisplays() is called before video is initialized 2023-03-29 14:44:03 -07:00
Sam Lantinga
aec0cfe5ee Added !SDL_CPUINFO_DISABLED to #endif 2023-03-29 08:24:04 -07:00
Emily Banerjee
8973d20f39 Fixed audiotypecvt assertion when without CPUInfo (#7464) 2023-03-29 08:22:57 -07:00
Sam Lantinga
f1099f8e70 The Xinmotek Controller is used in multiple products with different mappings
The mapping included here is for the Ultimate Atari Fight Stick
2023-03-28 15:14:00 -07:00
Sam Lantinga
8df7b4d853 Fixed gyro values for the Armor-X Pro controller 2023-03-28 14:44:28 -07:00
Sam Lantinga
37517557ae Fixed the accelerometer and gyro axes for the Armor-X Pro controller 2023-03-28 12:28:15 -07:00
Anonymous Maarten
0c3777d566 video: fix warnings about unused variables when building without duff's loop 2023-03-28 16:59:27 +00:00
Anonymous Maarten
11c70406c3 testautomation_audio: fix -Wimplicit-fallthrough warning 2023-03-28 16:59:27 +00:00
Anonymous Maarten
f7961b7c9a video/blit: fix -Wimplicit-fallthrough warnings 2023-03-28 16:59:27 +00:00
Anonymous Maarten
e1b8a03239 testsurround: fix channel names
Used table in include/SDL3/SDL_audio.h as reference.
2023-03-28 16:59:27 +00:00
Sylvain
c838ccf0e3 Safety fix: clear "_this->wakeup_window" when destroying the window 2023-03-28 08:28:31 -07:00
Sylvain
0c048d98af Safety fix: clear "_this->current_glwin" when destroying the window 2023-03-28 08:28:31 -07:00
Sylvain
e494844e9a Fixed bug #7515 - Window still grabbed after destroying 2023-03-28 09:42:19 +02:00
Sylvain
1fe2110755 Don't clear checked_texture_framebuffer 2023-03-28 09:40:17 +02:00
Anonymous Maarten
cb076b83ff cmake: fix testnative for Macos 2023-03-28 04:01:50 +02:00
Anonymous Maarten
1259a60731 cmake: build tests as library on Android 2023-03-28 01:30:55 +02:00
Anonymous Maarten
b8b852a55b cmake: testnative can also be built on non-Linux 2023-03-28 00:43:54 +02:00
Elad Lahav
2a03ad2cbf AUDIO_U16 support was removed from SDL3 2023-03-27 15:33:08 -07:00
Elad Lahav
254f03388f Detect QCC as the compiler 2023-03-27 15:33:08 -07:00
Elad Lahav
5fee62d774 Rename files under src/video/qnx 2023-03-27 15:33:08 -07:00
Elad Lahav
b4f28fb532 Define _LARGEFILE64_SOURCE as 1 for all platforms 2023-03-27 15:33:08 -07:00
Elad Lahav
60d95e2a77 Use posix_spawn() on QNX 2023-03-27 15:33:08 -07:00
Elad Lahav
f352eeb90c Use the built-in version of vsnprintf() to support printing NULLs 2023-03-27 15:33:08 -07:00
Elad Lahav
b98a501e0d glGetProcAddress() should return SDL_FunctionPointer 2023-03-27 15:33:08 -07:00
Elad Lahav
bc9e0bb7ad Switch from EXTRA_LIBS to SDL_EXTRA_LIBS 2023-03-27 15:33:08 -07:00
Elad Lahav
eca7b8e4a1 Do not look at local headers when determining features
Avoids the detection of X11 on the build machine
2023-03-27 15:33:08 -07:00
Elad Lahav
c611c6ee6b Do not enable SYSWM_X11 for QNX 2023-03-27 15:33:08 -07:00
Elad Lahav
b026f588d6 Update to use SDL_GetFirstAudioFormat() and SDL_GetNextAudioFormat() 2023-03-27 15:33:08 -07:00
Elad Lahav
4b17cc3a46 Add CMake toolchain files 2023-03-27 15:33:08 -07:00
Elad Lahav
49a8b16ffd Fix use of _LARGEFILE64_SOURCE 2023-03-27 15:33:08 -07:00
Elad Lahav
4374645738 Add QNX video and audio modules 2023-03-27 15:33:08 -07:00
Elad Lahav
292b80a13a Treat the QNX compiler as GCC for using atomics 2023-03-27 15:33:08 -07:00
Elad Lahav
b47eeb8488 Add QNX as a platform to the cmake build files 2023-03-27 15:33:08 -07:00
Sam Lantinga
8029a767ee Fixed the accelerometer sensitivity for the Armor-X Pro controller 2023-03-27 14:27:22 -07:00
Sam Lantinga
3340864786 Increased precision for PS4 sensor data conversion 2023-03-27 14:21:05 -07:00
Pierre Wendling
975039ce0d SDL_hidapi_steam.c: Fix compilation under c2x.
When N2935 is implemented, the enum breaks compilation. Use a #define of
the SDL booleans instead.
2023-03-27 09:02:14 -07:00
Pierre Wendling
ea093378a2 Fix clang-tidy error on LLVM 16.
Starting LLVM 16, clang-diagnostic-implicit-function-declaration is
treated as an error.
2023-03-27 12:50:00 +03:00
Sylvain
d3faec0b6e testcommon/automation: add [--audio driver] option
allow to use --audio --video --renderer for testautomation
2023-03-27 10:23:18 +02:00
Anonymous Maarten
9ada9daf51 SDL_blit_copy: Don't call potentially FPU using SDL_memcpy in SDL_memcpyMMX 2023-03-27 06:12:49 +00:00
Anonymous Maarten
37c9329db2 cmake: rename SDL_AVX512 -> SDL_AVX512F cmake option 2023-03-27 06:12:49 +00:00
Anonymous Maarten
8789729b4a cpuinfo: update \sa's of SDL_HasXXX functions 2023-03-27 06:12:49 +00:00
Anonymous Maarten
b0a5182e84 Sunset SDL_HasRDTSC 2023-03-27 06:12:49 +00:00
Anonymous Maarten
513025b182 Implement _intel_fast_(memcpy|memset)
The classic Intel compiler generates calls to these functions when
building the SDL library with SDL_LIBC=OFF.
2023-03-27 06:12:49 +00:00
Anonymous Maarten
99a799ad8b cmake: add /Q_no-use-libirc flag when building a no-libc library
The new Intel LLVM compiler needs this when building SDL3
in release mode.
2023-03-27 06:12:49 +00:00
Anonymous Maarten
46f5c1fe6a Move and rename SDL_rdtsc macro to testautomation 2023-03-27 06:12:49 +00:00
Anonymous Maarten
a06046c55c memset and memcpy are not intrinsic functions in new LLVM-based Intel compiler 2023-03-27 06:12:49 +00:00
Anonymous Maarten
4be82202de cmake: new LLVM based Intel compiler does not recognize MSVC's /MP 2023-03-27 06:12:49 +00:00
Anonymous Maarten
51d96a1680 cmake: increase threshold for stack probes
The /Gs argument controls the number of bytes that local variables
can occupy before a stack probe is initiated.
By setting it to a huge value, no calls to __chkstk are inserted.

This change is needed for the classic Intel C compiler to build SDL
with -DSDL_LIBC=OFF.
2023-03-27 06:12:49 +00:00
Anonymous Maarten
095d4b1ffc byteswap: Don't use intrinsic byteswap functions with Intel C compiler
It reroutes intrinsic _byteswap_u(short|long|int64) call to libc function.
2023-03-27 06:12:49 +00:00
Anonymous Maarten
09832c701c cpuinfo: use __cpuidex instead of __cpuid
The classic Intel Compiler does not clear the ecx register prior
to executing the cpuid opcode.
2023-03-27 06:12:49 +00:00
Anonymous Maarten
904e4a6e7c ci: reduce amount of data copied back from VM in FreeBSD action
By reducing the amount of data to be copied back from the VM to the host,
we hope that the chance on failure is reduced.
2023-03-27 06:12:49 +00:00
Anonymous Maarten
e66f4fa71c ci: test with (old) Intel compiler + (new) oneAPI compiler 2023-03-27 06:12:49 +00:00
Anonymous Maarten
d392ce516a testautomation_math: avoid equality tests with INFINITY
Fixes this warning:
 warning: comparison with infinity always evaluates to false in fast floating point modes [-Wtautological-constant-compare]
2023-03-27 06:12:49 +00:00
Anonymous Maarten
29e19bf829 cmake: disable warnings in libm + warning about EMMS instruction
SDL_BlitCopyMMX ends with _mm_empty(), so the MMX state should be emptied.

(_mm_empty is the intrinsic function for emms)
2023-03-27 06:12:49 +00:00
Anonymous Maarten
345d1cd355 cmake: add support for building with Intel C compiler 2023-03-27 06:12:49 +00:00
Anonymous Maarten
97c3077678 cmake: detect rdtsc in CMake 2023-03-27 06:12:49 +00:00
Anonymous Maarten
e2f51bf38e SDL_intrin.h: add SDL_rdtsc macro 2023-03-27 06:12:49 +00:00
capehill
b8c88cc584 testgles2_sdf: Call correct function to get shader info log 2023-03-26 22:29:49 +02:00
capehill
d5fac067cd testdisplayinfo: use correct index variable 2023-03-26 21:14:18 +02:00
Frank Praznik
203a2a76fc events: Increase the size of the name buffer when logging events
Event names have grown in length and are occasionally truncated when being logged (e.g. SDL_EVENT_WINDOW_PIXEL_SIZE_CHA). Increase the event name buffer size to handle the longer names.
2023-03-26 13:01:26 -04:00
Frank Praznik
5a0095d373 video: Try to match the requested video mode when moving fullscreen windows
Try to match the requested video mode when a fullscreen window is moved to a new display, or it may not be returned to the requested mode if it is moved to a display with no matching mode, then back to the original display.
2023-03-26 12:50:32 -04:00
SDL Wiki Bot
8c852f4dcf Sync SDL3 wiki -> header 2023-03-25 22:11:16 +00:00
Karl Hedberg
11142ec256 Made the Android documentation more clear and understandable (#7535) 2023-03-25 15:10:04 -07:00
Sam Lantinga
1f095b9ce6 Fixed wikiheaders.pl with perl-5.10.1 (thanks @sezero!) 2023-03-24 13:57:24 -07:00
Sylvain
f5dc1c0176 Add some color in testautomation logs! 2023-03-24 13:55:20 -07:00
Frank Praznik
11323abf57 wayland: Set the minimized flag on windows until cleared by a focus event
The behavior when minimizing a window on Wayland is compositor dependent and clients are not informed when windows enter or leave the minimized state, however we can assume that, when receiving a minimize request from the application, the minimized window should set and keep the minimized status flag until the window regains focus.

This is required when attaching a renderer context to a minimized window, as the renderer creation process destroys and recreates the target window, and without retaining the minimized flag, the recreated window will lose the minimized state.
2023-03-24 16:17:16 -04:00
Frank Praznik
6bb48b4fe9 wayland: Unref the libdecor window when hiding
Hiding the decorations while not unreferencing the frame was a workaround for an internal libdecor use-after-free bug that was fixed some time ago. Revert to unreferencing the window when hiding to ensure that it is properly destroyed.

Reverts dd2e318
2023-03-24 16:17:16 -04:00
Sam Lantinga
26f511a8f4 Add SWP_NOACTIVATE to SetWindowPos flags passed in WIN_SetWindowAlwaysOnTop 2023-03-24 10:39:56 -07:00
Sylvain
693558a894 testautomation_video: fix memory leak 2023-03-24 09:52:05 +01:00
Sylvain
8d3d4e523e Fix sdltest_randomAsciiStringWithMaximumLength() where it requests a string a size 0
seen with: ./testautomation --seed MILAFAP2AKVP3V4G --filter sdltest_randomAsciiStringWithMaximumLength
2023-03-24 09:52:05 +01:00
Sylvain
3ccfd361cb Fix video_getSetWindowPosition() that fail when checking events,
because testautomation_events.c() didn't finish to poll all events before
2023-03-24 09:52:05 +01:00
Sylvain
5976b79c1c testautomation: create no window, so that testautomation_mouse.c::mouse_getMouseFocus() pass
(more precisely, the last test,  when the window is destroyed, focus window should report null)
2023-03-24 09:52:05 +01:00
Sylvain
f30a182de2 Fix video_getSetWindowGrab(): need to raise the window, and wait for focus gained 2023-03-24 09:52:05 +01:00
Sylvain
d4d26e0ddb testautomation_video: if SDL_SetWindowSize/Position isn't honored, we should check there is an event
x11: send the events if various occasions
2023-03-24 09:52:05 +01:00
Sylvain
4b1378fe8e X11: fix size/position (test video_setWindowCenteredOnDisplay)
this fix x11 backend to correctly pass video_setWindowCenteredOnDisplay()
- get border values early  (eg status bar)
- wait for size/position change to get valid values

Fix set topleft is client rendering area
2023-03-24 09:52:05 +01:00
Anonymous Maarten
749f3ebd14 Fix arguments of SDL_BlitCopyMMX 2023-03-24 02:18:06 +01:00
Ryan C. Gordon
586004e52a wikiheaders.pl: Manpages shouldn't use .BI sections, it looks bad.
Reference Issue #7514.
2023-03-21 22:23:06 -07:00
Ryan C. Gordon
1b81ececd3 wikiheaders.pl: Fixed uninitialized value warning when run without arguments. 2023-03-21 21:57:12 -07:00
Ozkan Sezer
0ef85873a2 fixed uninitialized warnings from gcc7, gcc8, and gcc9. 2023-03-22 01:56:20 +03:00
SDL Wiki Bot
6760d54737 Sync SDL3 wiki -> header 2023-03-21 20:04:18 +00:00
Ozkan Sezer
f5a92092e1 SDL_intrin.h: workaround clang-cl failures when avx isn't enabled. 2023-03-21 23:03:02 +03:00
Ozkan Sezer
5d4d11f92f SDL_intrin.h: fixed typo in AVX2 checks. 2023-03-21 23:03:02 +03:00
Anonymous Maarten
c30903882b cmake+tests: include SDL_build_config.h in select tests + add include paths 2023-03-21 23:03:02 +03:00
Anonymous Maarten
0bd5ce13db cmake: add underscore in SSE4_1 and SSE4_2 options 2023-03-21 23:03:02 +03:00
Ozkan Sezer
8eb673d43d cmake: fix typo from previous commit. 2023-03-21 23:03:02 +03:00
Ozkan Sezer
262b13431d testautomation_intrinsics.c (sse2): change _mm_store_pd to _mm_storeu_pd
fixes segmentation faults
2023-03-21 23:03:02 +03:00
Ozkan Sezer
7a54d363cf testautomation_intrinsics.c: correct call to check SSE4.1 presence. 2023-03-21 23:03:02 +03:00
Ozkan Sezer
6c9780720b cmake: added configuration options for AVX2, AVX512F, SSE4.1, and SSE4.2
adjusted SDL_intrin.h and testautomation_intrinsics.c accordingly.
2023-03-21 23:03:02 +03:00
Ozkan Sezer
feec1305c6 cmake: remove duplicate setting of HAVE_ASSEMBLY to TRUE 2023-03-21 23:03:02 +03:00
Ozkan Sezer
260bb1c661 SDL_intrin.h: fixed disabler macro name for SSE4.1 2023-03-21 23:03:02 +03:00
Anonymous Maarten
5775d5e112 Add intrinsics test automation 2023-03-21 23:03:02 +03:00
Anonymous Maarten
cb46cbe684 include: include intrinsics headers for RDTSC SSE4.1 and SSE4.2 2023-03-21 23:03:02 +03:00
Anonymous Maarten
905b892314 cmake: simplify mmx/sse/sse2/avx compiler support detection 2023-03-21 23:03:02 +03:00
Ozkan Sezer
2e4ce78b33 tidy-up SDL_yuv.c 2023-03-21 23:03:02 +03:00
Ozkan Sezer
1dbe6447ee SDL_intrin.h: simplified MSVC preprocessor conditions.
Also removed definings of gcc-specific macros for MSVC.
2023-03-21 23:03:02 +03:00
Anonymous Maarten
6a9e2495f0 docs: add general information on how to build optimized binaries 2023-03-21 23:03:02 +03:00
Anonymous Maarten
b5b9ddb205 SDL_intrin.h: define SDL_<simd>_INTRINSICS in user-visible header 2023-03-21 23:03:02 +03:00
Ozkan Sezer
41c693dc25 build fix for non-x86 targets. 2023-03-21 23:03:02 +03:00
Ozkan Sezer
79513afc19 build fixes to SDL_yuv.c 2023-03-21 23:03:02 +03:00
Ozkan Sezer
69de6964e5 use target attributes of gcc / clang for SIMD code. 2023-03-21 23:03:02 +03:00
Anonymous Maarten
cd7a3f8af5 cmake: generate and install man pages 2023-03-21 02:19:19 +01:00
Anonymous Maarten
70edd54835 sdlwiki: SDL3 advises users to include through 'SDL3/SDL.h' 2023-03-21 02:19:19 +01:00
Anonymous Maarten
77b8edb5ad wikiheaders.pl: add --manpath argument 2023-03-21 02:19:19 +01:00
Anonymous Maarten
81ca9d61d6 cmake+test: add more automated tests + use properties 2023-03-21 02:19:19 +01:00
Anonymous Maarten
115460a930 torturethread: sleep a bit in SubThreadFunc to avoid starvation
testtorture, built by MinGW from msys2, got blocked indefinitely.
2023-03-21 02:19:19 +01:00
Anonymous Maarten
6a9c692bb9 testsem: don't re-parse positional argument twice 2023-03-21 02:19:19 +01:00
Anonymous Maarten
abfc2a01ca ci: disable parallel building for ps2
The ps2 builds were flaky.

https://github.com/ps2dev/ps2dev/issues/67
2023-03-21 02:19:19 +01:00
Anonymous Maarten
38219e08d9 ci: increase memory size of vmactions workflow
By default, the VM gets 1024MiB. https://github.com/vmactions/freebsd-vm/issues/28 suggests to increase it.
2023-03-21 02:19:19 +01:00
Anonymous Maarten
773aad14f8 cmake: Fix building without libsamplerate library
On Fedora, the headers for 32-bit and 64-bit are shared.
When building a 32-bit library, CMake found the header (that was installed
for the 64-bit libsamplerate development package). Because no 32-bit libsamplerate
library was installed, linking failed. (SDL_LIBSAMPLERATE_DYNAMIC was set to FALSE
because CMake could not find a library)
2023-03-20 05:34:41 +01:00
Ivan Mogilko
f360965db6 Fixed SDL_RenderSetVSync does not update flags if simulated vsync is on
This lets the user to correctly detect current vsync state by reading SDL_RendererInfo.
Also fixes SetVSync's return value check (it may be positive for error too).

(cherry picked from commit d78072fcd4)
2023-03-18 11:44:45 -07:00
Sam Lantinga
08d5c1386e Fixed always on top windows on Windows
Also cleaned up some SetWindowPos() calls and made it explicit when we change the topmost flag
2023-03-17 10:37:21 -07:00
Anonymous Maarten
4a6528e3f0 testprograms: parse arguments using SDLTest_CommonState 2023-03-17 17:54:16 +01:00
Anonymous Maarten
8bea41f737 testthread: parse arguments using SDLTest_CommonState + add arguments 2023-03-17 17:54:16 +01:00
Anonymous Maarten
64b739bc1e testlock: parse arguments using SDLTest_CommonState + extra arguments 2023-03-17 17:54:16 +01:00
Anonymous Maarten
4d86a83fa9 testver: don't allow any arguments 2023-03-17 17:54:16 +01:00
Anonymous Maarten
0268881e30 testspriteminimal: don't allow any arguments 2023-03-17 17:54:16 +01:00
Anonymous Maarten
08d5235da0 testintersections: check integer argument + no global done + get final tick before SDL shutdown 2023-03-17 17:54:16 +01:00
Anonymous Maarten
6e2851878f testhittesting: use SDLTest_Common for creating window(s) and renderer(s) 2023-03-17 17:54:16 +01:00
Anonymous Maarten
75da730a88 testfile: fix reference values 2023-03-17 17:54:16 +01:00
Anonymous Maarten
ee13b74d59 testyuv: fix buffer overflow write 2023-03-17 17:54:16 +01:00
Anonymous Maarten
774e51627e SDL_test: fix infinite loop when passing invalid argument 2023-03-17 17:54:16 +01:00
Anonymous Maarten
c52ad54b05 SDL_test: don't parse audio/video arguments when its subsystem is not enabled 2023-03-17 17:54:16 +01:00
Anonymous Maarten
c8d4ca35ad SDL_test: always print common log usage, even without audio/video backend 2023-03-17 17:54:16 +01:00
Anonymous Maarten
08c85ebae0 SDL_test: introduce SDLTest_CommonDestroyState to only destroy SDLTest_CommonState 2023-03-17 17:54:16 +01:00
Anonymous Maarten
5109e19935 SDL_test: remove unused BuildCommonUsageString 2023-03-17 17:54:16 +01:00
Anonymous Maarten
9451d3079d dynapi: SDL_DYNAPI_entry must be in version script
For SDL dynapi to work, the SDL_DYNAPI_entry symbol must be externally visible.
Adding __attribute__((visibility(default))) would not work
since version scripts override these.
2023-03-17 08:53:14 -07:00
Sylvain
4286f463a8 testautomation_pixels: calling SDL_DestroyPixelFormat or SDL_DestroyPalette with NULL parameter doesn't generate an error 2023-03-17 10:28:54 +01:00
Sam Lantinga
e4be1247d0 Added a hint to retain window content during state changes
In my testing window content is always retained, but this makes our intent explicit.
2023-03-16 20:43:07 -07:00
Sam Lantinga
ed0937598e Added gamepad mapping for Flydigi Vader 2 with the latest firmware (6.0.4.9) 2023-03-16 20:01:45 -07:00
Sam Lantinga
a776188d77 Don't change the Z order when moving or resizing windows 2023-03-16 17:19:38 -07:00
Sam Lantinga
9ee71f0ddf Added --skip-taskbar and --always-on-top command line options 2023-03-16 16:58:01 -07:00
Sam Lantinga
3f67f02d0e Fixed SDL_WINDOW_SKIP_TASKBAR on Windows
The WS_EX_APPWINDOW forces a window onto the taskbar, which is not what we want. Set the style to 0 to use the default behavior.
2023-03-16 16:56:46 -07:00
Sam Lantinga
c7ab378c61 We don't need to track whether we were hidden by parent focus change 2023-03-16 14:11:41 -07:00
Sam Lantinga
76176c9845 Conversely, we shouldn't automatically show children when we get focus 2023-03-16 14:09:46 -07:00
Sam Lantinga
0cb7c4ba58 Don't hide popups when losing focus
This isn't the behavior on Windows, and this should probably be an application defined behavior.

If we decide we want this globally, it should probably be implemented at a higher level in SDL_OnWindowFocusLost(), and properly handle the transition of focus to a child window.
2023-03-16 14:04:12 -07:00
Sylvain
5da9e99da0 Fixed bug #7462 - 8888 as default GL backbuffer red/green/blue/alpha bit sizes 2023-03-16 13:54:11 -07:00
Sylvain
f9ac7b4044 Fixed bug #7467 - testautomation_audio currently fails because of invalid src/dst rate 2023-03-16 20:49:22 +01:00
Sylvain
899ee8f75a Change SDL_BLENDMODE_MUL for gl renderers
Add FIXME for PSP
2023-03-16 20:25:59 +01:00
Sylvain
b95b203116 Refresh generation of SDL_blit_auto.c after simplifying sdlgenblit.pl 2023-03-16 20:25:59 +01:00
Sylvain
41b8fee833 Simplify SDL_BLENDMODE_MUL in sdlgenblit.pl 2023-03-16 20:25:59 +01:00
Sylvain
99668c286b Simplify SDL_BLENDMODE_MUL 2023-03-16 20:25:59 +01:00
Sylvain
ad1a216d65 Refresh generation of SDL_blit_auto.c 2023-03-16 20:25:59 +01:00
Sam Lantinga
66eff69d2b Don't update hidden child windows, their relative position doesn't change
This improves performance when moving a top level window that has many hidden child windows
2023-03-16 11:24:21 -07:00
Sam Lantinga
e6fe7273a5 Toggle menu visibility with the space bar 2023-03-16 11:24:21 -07:00
Frank Praznik
a8ea8db6d7 wayland: Update the popup window geometry on configure events 2023-03-16 14:01:42 -04:00
Frank Praznik
be70d9a9c7 wayland: Clarify the popup position restriction purpose
Child popups don't necessarily need to be within, but must intersect or be partially adjacent to the parent, per the xdg-positioner spec.
2023-03-16 14:01:42 -04:00
Frank Praznik
c270d151b0 wayland: Handle cases where the compositor does not scale the monitor viewport in its compositing space
The xdg-output spec was updated to clarify its usage rules, and what was previously thought to be a bug is actually valid behavior. Gnome, when not using 'scale-monitor-framebuffer', does not scale the viewport of the display in the global compositor space, and thus the physical and logical sizes of the display will match. This value still needs to be divided by the integer scale value to get the logical output dimensions in screen units though.
2023-03-16 14:01:42 -04:00
Sam Lantinga
5dd317b869 Fixed position when setting WM hints on X11 popup windows 2023-03-15 20:23:03 -07:00
Sam Lantinga
422517c036 Allow passing 0 to SDL_SetWindowMinimumSize() and SDL_SetWindowMaximumSize() to indicate no limit 2023-03-15 16:13:56 -07:00
Sam Lantinga
d95b04feaf Fixed display ID check in video_setWindowCenteredOnDisplay 2023-03-15 16:12:54 -07:00
Sylvain
4312abab69 testprogram: add option to use SDL_BLENDMODE_MUL 2023-03-15 22:00:13 +01:00
Sam Lantinga
b07a049923 Fixed window positioning in testpopup 2023-03-15 10:35:26 -07:00
Sam Lantinga
e794057d9f Move the popup windows to follow the mouse 2023-03-15 10:19:55 -07:00
Anonymous Maarten
7ea6ef4076 ci: add workflow for building SDL on ppc64le 2023-03-15 14:54:20 +01:00
Anonymous Maarten
e77132b8aa ci: only store cache vita reqs when restore-cache didn't find anything 2023-03-15 14:54:20 +01:00
Anonymous Maarten
65178df717 ci: test ARM neon and simd on ci using vita toolchain 2023-03-15 14:54:20 +01:00
Anonymous Maarten
d27db3defa cmake+video: always use altivec.h header for detection + introduce SDL_ENABLE_ALTIVEC 2023-03-15 14:54:20 +01:00
Anonymous Maarten
684709a5b6 cmake: fix building testautomation without X11 support 2023-03-15 14:54:20 +01:00
Anonymous Maarten
9cb5f0bfc6 video: fix ARM neon and simd 2023-03-15 14:54:20 +01:00
Anonymous Maarten
64e242fd77 cmake: Add test resources to list of files to clean 2023-03-15 14:54:20 +01:00
Anonymous Maarten
ba5b1f2fd2 Fix build with -DX11MODES_DEBUG in CPPFLAGS 2023-03-15 14:54:20 +01:00
Anonymous Maarten
d24ef0213b SDL_threadprio.c uses SCHED_RR and SCHED_FIFO from sched.h 2023-03-15 14:54:20 +01:00
Anonymous Maarten
3db3424b4e cmake: Detect powerpc architecture 2023-03-15 14:54:20 +01:00
Anonymous Maarten
fc4085b54e cmake: Allow build system to disable arm neon intrinsics 2023-03-15 14:54:20 +01:00
Anonymous Maarten
46de6241d7 cmake: Allow build system to disable loongarch intrinsics 2023-03-15 14:54:20 +01:00
Anonymous Maarten
99b8313eb1 add SDL_DISABLE_MMX to SDL_build_config.h.cmake 2023-03-15 14:54:20 +01:00
Anonymous Maarten
4681240241 cmake: Detect AVX + allow build system to disable Intel intrinsics 2023-03-15 14:54:20 +01:00
Anonymous Maarten
683411e96f cmake: only use precompile headers for C and CXX 2023-03-15 14:38:26 +01:00
Anonymous Maarten
7d55bbc0da cmake: get_filename_component(EXT) returns extension including leading dot 2023-03-15 14:38:26 +01:00
Sam Lantinga
a17ad65f2b Revert "Popup window parent defaults to the first toplevel window"
This reverts commit e8e2c8175c.

Conceptually tooltips and context menus always have parent windows
2023-03-14 14:53:54 -07:00
Frank Praznik
969e0842e6 video: Preserve the flag to restore popup windows with the parent when recreating the window during renderer initialization 2023-03-14 16:37:09 -04:00
Sam Lantinga
e8e2c8175c Popup window parent defaults to the first toplevel window 2023-03-14 11:42:58 -07:00
Sam Lantinga
3951cae4a5 Ignore the PS4 packet CRC if it's not being set correctly
This fixes handling the 8BitDo SN30 Pro with the 2.00 firmware in PS4 mode

Fixes https://github.com/libsdl-org/SDL/issues/7270
2023-03-13 19:58:35 -07:00
Sylvain
f1d9c36136 testshape: now uses SDL_WINDOW_TRANSPARENT instead of the shaped window API 2023-03-13 21:23:04 +01:00
Sylvain
2cafa52598 - Added SDL_WINDOW_TRANSPARENT to request a window with transparent framebuffer
- Remove SDL_VIDEO_EGL_ALLOW_TRANSPARENCY hint, EGL now checks 'window->flags & SDL_WINDOW_TRANSPARENT'
2023-03-13 21:23:04 +01:00
Frank Praznik
4dededd345 wayland: Don't throttle presentation until the first swap has occurred
Don't throttle window updates until the first swap has occurred, as the window won't actually be shown or receive the frame callback until that point and this causes new window creation to have a full 1 second delay.
2023-03-13 15:36:55 -04:00
SDL Wiki Bot
1010254a28 Sync SDL3 wiki -> header 2023-03-13 18:22:16 +00:00
Sam Lantinga
4dd26698fc Added SDL_GetWindowParent() to get the parent of popup windows 2023-03-13 11:21:02 -07:00
Sam Lantinga
ebe3a9dc44 Spacing cleanup 2023-03-13 11:21:02 -07:00
SDL Wiki Bot
689ea5361e Sync SDL3 wiki -> header 2023-03-13 17:57:18 +00:00
Frank Praznik
1f35fd6939 video: Update the popup window creation documentation and disallowed flags
Update the popup window creation documentation with additional info, remove the SDL_WINDOW_MOUSE_GRABBED flag check since it isn't a valid window creation flag and will be removed automatically elsewhere, and check for and remove the explicit skip taskbar and borderless flags since they are implicit for popup windows.
2023-03-13 13:56:01 -04:00
Frank Praznik
f97b469184 video: Disallow additional operations on popups where appropriate
Disallow additional window operations on popups where they have no functionality or otherwise don't make sense:

- Popups cannot be set as modal to other windows (they're already child windows of a parent)
- Other windows cannot be set as modal of popups
- Popups cannot explicitly grab the mouse/keyboard (the topmost popup menu takes the keyboard focus implicitly)
- Popups cannot flash or be raised
2023-03-13 13:56:01 -04:00
Frank Praznik
d5b5e524af wayland: Set the EGL swap timeout to one second from the current time
Set the timeout max to one second from the current time or presentation time will always be greater than the timeout and the application will run unthrottled.
2023-03-12 17:07:32 -04:00
David Carlier
3990c71726 SDL_GetBasePath simplification for Haiku.
when solely looking for the path for the current binary
in the current team, find_path is sufficient.
2023-03-12 08:29:42 -04:00
Sam Lantinga
67e2558310 Check tooltip and popup window flags during parameter validation 2023-03-11 12:44:57 -08:00
Rudolf Polzer
de3909a190 Android: indicate gamepaddb entries where axis order changed.
Axis order was changed in 6f1f586086 to improve
default mappings.
2023-03-11 12:43:48 -08:00
Frank Praznik
3e28588bb6 wayland: Never use the cached size for maximized or tiled windows
Don't use the cached floating window size for maximized or tiled windows. Fixes the initial window size when creating a window with the maximized flag set.
2023-03-11 11:40:57 -05:00
Sam Lantinga
f4c1260120 More changes to fix building with older macOS SDKs 2023-03-10 16:38:45 -08:00
Sam Lantinga
c044cff4c7 Rewrite WIN_GetSystemTheme() so we don't need to bump Windows SDK versions 2023-03-10 16:29:42 -08:00
Sam Lantinga
edc8f0b841 Fixed building on older macOS SDKs 2023-03-10 16:15:46 -08:00
Sam Lantinga
ffe6e58c85 Fixed compiling with older Windows SDKs 2023-03-10 16:12:18 -08:00
SDL Wiki Bot
1550fb69e4 Sync SDL3 wiki -> header 2023-03-10 23:52:18 +00:00
Frank Praznik
cfeb663c87 tests: Add popup window test program
Right click to create new popup menus. Clicking over an existing popup menu will create a child menu. Left click to close all menus. Hover to display a tooltip that is the child of the window below it. Closing the application closes the root window, which should automatically destroy any open popup windows and exit gracefully.
2023-03-10 15:51:13 -08:00
Frank Praznik
5a0f50e1c3 docs: Update the migration document with changes to the tooltips and popup menu flags. 2023-03-10 15:51:13 -08:00
Frank Praznik
98e864f286 win32: Implement popup windows 2023-03-10 15:51:13 -08:00
Frank Praznik
77dc1a929a cocoa: Implement popup windows 2023-03-10 15:51:13 -08:00
Frank Praznik
f41d3933e6 X11: Implement popup windows 2023-03-10 15:51:13 -08:00
Frank Praznik
68d2d9f76d wayland: Implement popup windows 2023-03-10 15:51:13 -08:00
Frank Praznik
e987c4a463 video: Add the concept of child popup windows
Add the CreatePopupWindow function to allow the creation of child tooltip and menu popup windows. Popup windows must be created as either a tooltip or popup menu and cannot be minimized, maximized, made fullscreen, or grab the mouse.

Child popup windows are tracked and will be recursively hidden, shown, or destroyed in tandem with the parent window.
2023-03-10 15:51:13 -08:00
Sam Lantinga
fc1af1dfde Added support for the trigger buttons on the Victrix Pro FS for PS5 2023-03-10 15:40:09 -08:00
Sam Lantinga
06183989e1 Removed space between sizeof and parentheses 2023-03-10 08:12:58 -08:00
Sam Lantinga
dfa832c5de Make sure our pixel size is up to date at window creation
This guarantees that the application will always get SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED when a window is created.

Fixes https://github.com/libsdl-org/SDL/issues/7441
2023-03-10 08:11:16 -08:00
Sam Lantinga
2af6f4a3e4 Fixed build warning on Android 2023-03-10 08:11:16 -08:00
Stephen Kitt
bbfd5b3fb2 Specify bash for androidbuildlibs.sh
This script relies on string indexes in parameter expansions, which
aren't suppored by /bin/sh (e.g. dash).

Based on a patch by Roflcopter4:
https://github.com/joncampbell123/dosbox-x/pull/3850

Signed-off-by: Stephen Kitt <steve@sk2.org>
2023-03-10 07:26:37 -08:00
Qrox
71c80c478a Uses integer arithmetics in SDL_ResampleAudio
- Revert resampler workaround
- Avoids precision loss caused by large floating point numbers
- Adds unit test to test the signal-to-noise ratio and maximum error of resampler
- Code cleanup
2023-03-09 22:12:03 -08:00
Sam Lantinga
926db1bd54 Removed a duplicate delay accidentally added during code refactor 2023-03-09 16:12:49 -08:00
Sam Lantinga
645823fc90 Wait for the GCController framework to see IOKit devices
It occasionally takes a few millseconds for the GCController framework to handle the device notification and set up the device

Fixes the duplicate controller issue in https://github.com/libsdl-org/SDL/issues/6686
2023-03-09 16:12:49 -08:00
Sam Lantinga
21e444b2e7 Fixed a few additional sizeof locations 2023-03-09 15:25:48 -08:00
Sam Lantinga
c6443d86c9 Code style: changed "sizeof foo" to "sizeof(foo)" (thanks @sezero!) 2023-03-09 15:10:44 -08:00
Guldoman
ad95c93bf4 Add portal interface to support SDL_GetSystemTheme in linux 2023-03-09 15:05:16 -08:00
Anonymous Maarten
c304fbded6 cmake: disable ccache by default 2023-03-09 20:24:03 +01:00
Sam Lantinga
2ca727aec6 If the client rect is empty, use the last known window size
This happens on Windows 11 with fullscreen desktop windows when the desktop is brought up with the Windows+D shortcut.

Fixes https://github.com/libsdl-org/SDL/issues/7419
2023-03-09 10:31:39 -08:00
Ozkan Sezer
bb59f46cbe Removed guard around the enabled assertions support code
Otherwise, SDL_assert_always() wouldn't work.

Fixes https://github.com/libsdl-org/SDL/issues/7433
2023-03-09 20:51:50 +03:00
Ozkan Sezer
34d13cd0a9 made IsModifierKeyPressed() helper static 2023-03-09 20:28:05 +03:00
Deve
4de6ddd07f Fixed incorrect modifier keys handling on macOS 2023-03-09 09:00:53 -08:00
David Demelier
d0c4849d0b Rename SDL_atomic_t to SDL_AtomicInt 2023-03-09 09:00:09 -08:00
Sam Lantinga
8994878767 Added SDL_GetSystemTheme() to return whether the system is using a dark or light color theme, and SDL_EVENT_SYSTEM_THEME_CHANGED is sent when this changes
Fixes https://github.com/libsdl-org/SDL/issues/5334
Fixes https://github.com/libsdl-org/SDL/issues/6958
Closes https://github.com/libsdl-org/SDL/pull/6440
2023-03-09 03:25:20 -08:00
Sam Lantinga
fb0c3197e0 Fixed the documentation for SDL_SetRelativeMouseMode() 2023-03-08 22:32:54 -08:00
Sam Lantinga
cabedee4a1 Fixed constraining the mouse to the window in relative mode 2023-03-08 22:29:45 -08:00
Ryan C. Gordon
d898dbfe50 render: Make sure logical_target is bound when presenting.
Fixes black screen on macOS.

Fixes #7320.
2023-03-08 22:57:29 -05:00
Lokathor
b8bc4a234b Make mappings for "Retrolink SNES Controller" with SDL_GAMECONTROLLER_USE_BUTTON_LABELS both on and off
I've only tested this on windows, but I went ahead and made the same changes for linux and mac because I assumed it's the same there and that we'd want to keep the three platforms in sync.
2023-03-08 16:43:12 -08:00
Sylvain
4053876bf6 Fix warning drop const qualifier 2023-03-08 22:22:34 +01:00
Sam Lantinga
ba87b96cea Fixed signed/unsigned warnings
Fixes https://github.com/libsdl-org/SDL/issues/7424
2023-03-08 12:36:44 -08:00
Ozkan Sezer
53bde3abee fix SDL_FindFreePlayerIndex so it can really return -1. 2023-03-08 20:00:00 +03:00
Sam Lantinga
91b328c2c6 Fixed emscripten build 2023-03-08 08:58:26 -08:00
Sam Lantinga
dd7cf12206 Fixed instances of SDL_joystick_players being set to -1 (thanks @AntTheAlchemist!)
Fixes https://github.com/libsdl-org/SDL/issues/7426
2023-03-08 08:38:59 -08:00
Sylvain
d78817703e Fix build 2023-03-08 16:42:10 +01:00
Sylvain
c963f02571 More fix warnings about static function and prototype 2023-03-08 16:14:09 +01:00
Sylvain
16bb6a0b3d Fix warnings about static function and prototype 2023-03-08 11:41:18 +01:00
Sam Lantinga
61309b4382 Disassociate the SDLOpenGLContext from the view before deleting it
If we don't do this, the view will be blanked even if another context is current and rendering from that context won't be visible.

Fixes https://github.com/libsdl-org/SDL/issues/4986
2023-03-08 01:35:21 -08:00
Sam Lantinga
04a03a3eec Use SDL_GL_DeleteContext instead of Cocoa_GL_DeleteContext for context cleanup
That will make the current context NULL before deleting the context.
2023-03-08 01:33:28 -08:00
Sam Lantinga
d08338ddc5 Added mapping for the Xbox Elite Core controller connected via Bluetooth on Android 2023-03-06 15:36:49 -08:00
divVerent
6f1f586086 Fix Xbox One gamepad axis assignment on SDL_JOYSTICK_ANDROID API (#7405) 2023-03-06 15:33:18 -08:00
Sam Lantinga
f8106d4f30 Fixed build warning
format '%x' expects argument of type 'unsigned int', but argument 2 has type 'Uint32' {aka 'long unsigned int'}
2023-03-06 13:33:52 -08:00
Sam Lantinga
c0e7845874 Be more clear about what flags conflicted 2023-03-06 11:43:28 -08:00
Sam Lantinga
c69aea887a Fixed permissions for src/video/x11/SDL_x11modes.c 2023-03-06 11:39:21 -08:00
Sam Lantinga
698dbd8464 SDL_CreateWindow() has been simplified and no longer takes a window position. 2023-03-06 09:50:12 -08:00
Sam Lantinga
7905254087 Updated debug print with new SDL_DisplayMode fields 2023-03-06 09:50:12 -08:00
Sylvain
a946a34452 Add Drag and drop position, for x11, wayland and MACOSX 2023-03-06 08:44:05 -08:00
Sylvain
813c586edb Change local (void*) to SDL_FunctionPointer 2023-03-06 12:38:38 +01:00
Sylvain
9b065bf54b Fix various warnings: static /void / comma 2023-03-06 12:37:37 +01:00
Sam Lantinga
c9aec268fa SDL_GetJoystickIDForPlayerIndex() should return 0 for invalid ID (thanks @AntTheAlchemist!) 2023-03-03 16:15:28 -08:00
Anonymous Maarten
103fbcfc05 cmake: use compatible interface properties to disallow linking to a different version of SDL 2023-03-03 23:40:57 +01:00
Michal Suchanek
987b748067 evdev_kbd: Use current keymap
keymap can change over time, caching the keymap causes wrong keys
returned when user changes keymap during runtime

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
(cherry picked from commit 96a2a6b945)
2023-03-03 14:31:20 -08:00
Sam Lantinga
6b87d1938f Added SDL_EVENT_DISPLAY_SCALE_CHANGED 2023-03-03 11:16:31 -08:00
Sam Lantinga
16f4e37bb5 Fixed build 2023-03-03 09:49:48 -08:00
Sam Lantinga
e3d90c694c Make sure the window is valid in SDL_SetKeyboardFocus() 2023-03-03 09:09:11 -08:00
Sam Lantinga
f1c3d3be97 Default to using newer D3D renderers in SDL 3.0 2023-03-02 15:09:57 -08:00
Ryan C. Gordon
8b9a938413 dataqueue: Make thread safe.
Each data queue gets its own mutex and each function obtains it.

Fixes #7390.
2023-03-02 16:35:16 -05:00
Eddy Jansson
91b9ba8c54 Correct typo GetSlectionText -> GetSelectionText 2023-03-02 16:29:18 -05:00
Ryan C. Gordon
f833e005e1 dataqueue: Removed non-public SDL_ReserveSpaceInDataQueue function
This wasn't used, and it was just asking for trouble.
2023-03-02 16:09:23 -05:00
Ozkan Sezer
ea824c6d20 hidapi/windows tidy-up. 2023-03-02 21:40:02 +03:00
Sam Lantinga
3bba33932f Fixed testshape on high DPI displays
Since the shape is set based on the pixels in the image, we want the window to have the same number of pixels.
2023-03-02 10:15:14 -08:00
Sam Lantinga
59ca0c8b22 Simplified the testshape example 2023-03-02 10:00:15 -08:00
Sam Lantinga
bd2e2ee7aa SDL_RenderTexture() and SDL_RenderTextureRotated() take floating point source coordinates
See the discussion at https://discourse.libsdl.org/t/sdl-rendercopyf-uses-ints/36732/8
2023-03-02 09:42:32 -08:00
Ozkan Sezer
199a7af296 hidapi/windows: fix build using older toolchains. 2023-03-02 20:21:20 +03:00
Sam Lantinga
c887b55964 Fixed mingw build 2023-03-02 08:58:52 -08:00
Sam Lantinga
a5fba759b3 Get the name, manufacturer and serial number for Bluetooth devices on Windows
Adapted from upstream hidapi code
2023-03-02 08:20:38 -08:00
Sam Lantinga
727c7d4e2f Don't clobber an existing entry with a different version when adding a gamepad mapping 2023-03-01 16:38:48 -08:00
Sam Lantinga
9e14559e80 Print the mapping used for a gamepad in testgamepad 2023-03-01 16:37:56 -08:00
Anonymous Maarten
790612f4f8 cmake: make sdltests_utils static library 2023-03-01 23:41:22 +01:00
Sylvain
ac3fd00018 testautomation_pixels/audio: use SDL_arraysize and fix warnings 2023-03-01 22:15:45 +01:00
Ozkan Sezer
6fc32491c7 testautomation_audio.c: use SDL_arraysize for g_numAudioFormats. 2023-03-01 22:56:56 +03:00
Sam Lantinga
add980efb7 Unfixed spacing
From @ozkan: Except for line 2537, all those trailing whitespace are from original code which had left in as-is in case we want to upgrade to a newer version more easily.
2023-03-01 11:19:52 -08:00
Sam Lantinga
2f14b36709 Fixed spacing 2023-03-01 10:02:14 -08:00
Sam Lantinga
cfb96e260b Fixed spacing 2023-03-01 09:51:27 -08:00
David Carlier
8d24381e7e SDL_GetSystemRAM completion for Haiku system.
using native system_info's api.
2023-03-01 09:50:03 -08:00
Sam Lantinga
d5775f6708 The gamepad event structures caxis, cbutton, cdevice, ctouchpad, and csensor have been renamed gaxis, gbutton, gdevice, gtouchpad, and gsensor.
Fixes https://github.com/libsdl-org/SDL/issues/7375
2023-03-01 09:48:28 -08:00
Ozkan Sezer
8d8b3d3a9a fix testautomation_audio.c after commit f48d0cc 2023-03-01 18:37:56 +03:00
Ryan C. Gordon
f48d0cc164 audio: Remove AUDIO_U16* support.
It wasn't heavily used, and you can't use memset to silence a U16 buffer.

Fixes #7380.
2023-03-01 10:26:01 -05:00
Sam Lantinga
941a603665 Document that SDL_IsScreenSaverEnabled() was renamed SDL_ScreenSaverEnabled() 2023-02-28 15:56:49 -08:00
Sam Lantinga
ebdb320651 Follow the same pattern for releasing the window data in the UIKit driver
Possible fix for https://github.com/libsdl-org/SDL/issues/7361
2023-02-28 15:56:49 -08:00
Ryan C. Gordon
5d3234d8ae docs: Removed bogus file from wiki bridge.
That was fixed to not do that again by 7e429a13d3
2023-02-28 13:39:43 -05:00
SDL Wiki Bot
c3d2f5368b Sync SDL3 wiki -> header 2023-02-28 17:50:11 +00:00
SDL Wiki Bot
3f49e370c8 Sync SDL3 wiki -> header 2023-02-28 17:39:22 +00:00
Ryan C. Gordon
5585a4ac72 Renamed CONTRIBUTING.md to README-contributing.md
This lets the wiki bridge pick it up.
2023-02-28 12:38:31 -05:00
Ryan C. Gordon
7b9b20e684 docs: Deleting a bogus file to see if wiki bridge rebuilds it. 2023-02-28 12:31:11 -05:00
SDL Wiki Bot
60127460b0 Sync SDL3 wiki -> header 2023-02-28 17:30:22 +00:00
Ryan C. Gordon
99c38268cd wikiheaders: Sort pages before listing them in README/FrontPage.md. 2023-02-28 12:28:10 -05:00
Ryan C. Gordon
7745c9b3ae wikiheaders: Use Windows endlines in the source, Unix in the wiki. 2023-02-28 12:28:10 -05:00
SDL Wiki Bot
260dcb856e Sync SDL3 wiki -> header 2023-02-28 17:27:14 +00:00
Eddy Jansson
5f5abb6805 Always allocate zt in output of SDL_iconv_string()
Before this, the function could not be used on buffers,
as it would not account for the zero-termination unless
it was included in the input.
2023-02-28 09:26:01 -08:00
SDL Wiki Bot
5fb5586233 Sync SDL3 wiki -> header 2023-02-28 17:18:06 +00:00
Sam Lantinga
6aeb07d4c2 Fixed SDL windows getting the maximized state after leaving fullscreen on macOS 2023-02-28 09:03:28 -08:00
Ryan C. Gordon
6d1e14b792 wikiheaders: ignore wiki's README/FrontPage.md 2023-02-28 11:55:19 -05:00
SDL Wiki Bot
90a911b31f Sync SDL3 wiki -> header 2023-02-28 16:52:06 +00:00
SDL Wiki Bot
af9a2237e3 Sync SDL3 wiki -> header 2023-02-28 16:48:26 +00:00
Ryan C. Gordon
2506676f34 wikiheaders: Bridge README files in the docs directory to wiki.
Fixes #6026.
2023-02-28 11:45:47 -05:00
Sam Lantinga
da134a3039 Fixed locking up the Logitech F310 with the PlayStation controller detection 2023-02-28 08:36:31 -08:00
Sam Lantinga
c824060503 Fixed missing line 2023-02-27 21:08:50 -08:00
Sam Lantinga
a6d8cdf186 Setting a window to non-fullscreen when it's not fullscreen is a no-op
Also explicitly reset fullscreen mode when destroying a window, eliminating the need for doing that in SDL_HideWindow(), as that's already taken care of in SDL_OnWindowHidden() normally.
2023-02-27 21:06:05 -08:00
Ryan C. Gordon
a479633455 wikiheaders: fixed wikilinks in Markdown code sections. 2023-02-27 23:08:19 -05:00
Anonymous Maarten
02fede7c8c cmake: initialize SDL_SHARED and SDL_STATIC from BUILD_SHARED_LIBS 2023-02-28 02:15:39 +01:00
Sam Lantinga
fcc9deb365 Only restore desktop mode when hiding a window if that window was fullscreen 2023-02-27 15:38:48 -08:00
Sam Lantinga
206fa4dafb Added mapping for DualSense Edge Wireless Controller on Linux
This is a mapping when using evdev, not the more advanced HIDAPI support.
2023-02-27 15:19:34 -08:00
Ryan C. Gordon
9f8425a7a9 include: Fixed wiki formatting that got mangled into the headers. 2023-02-26 21:47:17 -05:00
David Carlier
a5a53c12bf USE_DEV_RANDOM close the file descriptor even in the rare case it can't read it 2023-02-26 14:00:00 +03:00
Torge Matthies
f18b5656f6 x11: Fix duplicate Xinput2 event reception
Passing True for owner_events in the XGrabPointer call makes all
XI_RawMotion events appear in the queue twice, with the only difference
between them being the value of XGenericEventCookie::cookie. These have
always been filtered out by a check in the XI_RawMotion handler,
however with a mouse that polls at more than 1 kHz frequency, there
also exist legitimate events that appear indistinguishable from these
duplicated events. These must not be filtered out, otherwise the
pointer may move at an inconsistent speed, appearing like a bad pointer
acceleration implementation.

Change owner_events to False in the XGrabPointer and remove the
duplicate event detection code to fix this.

Signed-off-by: Torge Matthies <openglfreak@googlemail.com>
2023-02-25 10:04:46 -08:00
David Carlier
d73f2d76a0 Haiku modernizing a bit the C++ code with C++11 heuristics
with BApplication
2023-02-24 20:54:41 -08:00
Sam Lantinga
2897de9efc Clear the undefined position state when the window is placed
This allows the window to be recreated in the same location if needed, for example if recreated because of switching to OpenGL rendering.
2023-02-24 18:04:54 -08:00
Sam Lantinga
4d9d343662 Added handling for undefined window position on X11 2023-02-24 17:49:45 -08:00
Sam Lantinga
3bfd596608 Added handling for undefined window position on Windows 2023-02-24 17:06:47 -08:00
Ryan C. Gordon
5b0351a672 wikiheaders: Fix wikilinks inside code sections a little. Not perfect yet. 2023-02-24 14:29:36 -05:00
Sam Lantinga
daffe02b11 Fixed relative mouse motion over remote desktop
Setting the cursor clip area to a single pixel prevents the relative mouse motion remote desktop warping from working, so the mouse is never recentered.
2023-02-24 09:20:38 -08:00
Ryan C. Gordon
0598ecc150 Sync wiki -> headers. 2023-02-24 11:49:41 -05:00
Ryan C. Gordon
d748a454a8 wikiheaders: fixed see-also conversion 2023-02-24 11:45:43 -05:00
Ryan C. Gordon
5ff49955ab wikibridge: Fixes for manpage generation from Markdown format. 2023-02-24 10:21:54 -05:00
Anonymous Maarten
f2a277414f raspberry: SDL_DisplayMode's w/h members have been renamed to screen_w/screen_h
Found by running the coccinelle script on SDL's source tree.
2023-02-24 06:55:28 -08:00
Ryan C. Gordon
936a51d5cc wikiheaders: Work to make the wiki exist primarily in Markdown format.
This adds a means to mass-convert the whole wiki to Markdown as a one-time
operation, and then some fixes to make --copy-to-headers correctly deal with
Markdown-formatted wiki pages.
2023-02-24 09:07:09 -05:00
Ozkan Sezer
2eb4ab5bb0 SDL_revision.h: added missing newline at end of file. 2023-02-23 23:55:56 +03:00
Sam Lantinga
516e48515e Changed the VID/PID used for the Backbone One controller on iOS 2023-02-23 12:24:15 -08:00
Sam Lantinga
05ac1f8d5a Print the full information for all joysticks that are connected 2023-02-23 11:58:14 -08:00
Sam Lantinga
59bf1c2853 Added support for the Backbone One PlayStation Edition 2023-02-23 11:57:48 -08:00
Sam Lantinga
b2d913883c Fixed view frame from flipping back and forth between landscape and portrait on iOS 2023-02-23 09:14:53 -08:00
Frank Praznik
e8fd7f74bd windows: Track the window display ID locally
Track the current window display ID locally so as not to depend on specific behavior of the video layer, which may change the value at times when it isn't expected.
2023-02-23 07:39:16 -08:00
Frank Praznik
9f1a7bb94c wayland: Track the window display ID locally
Track the current window display ID locally so as not to depend on specific behavior of the video layer, which may change the value at times when it isn't expected.
2023-02-23 07:39:16 -08:00
Frank Praznik
d9fadb8b47 video: Update the current display when moving a window programmatically
When moving a window programmatically, the move event will be deduplicated due to the window x and y coordinates already being updated, so the window's current display ID needs to be explicitly updated.
2023-02-23 07:39:16 -08:00
Frank Praznik
e8076b78ef video: Move fullscreen windows via SDL_UpdateFullscreenMode()
Update the target display ID and use SDL_UpdateFullscreenMode() when moving a fullscreen window to handle the case where the target display has an existing fullscreen window.
2023-02-23 07:39:16 -08:00
Sam Lantinga
c2f8a478d8 Don't set a logical presentation mode by default
SDL3 applications are DPI aware by default, and can set the logical presentation mode as appropriate.
2023-02-22 22:27:01 -08:00
Sam Lantinga
bff307c4b2 Fixed warning building on iOS 2023-02-22 22:03:25 -08:00
Sam Lantinga
6c9e199f73 Use bridged pointers to Objective C objects in C structures
Fixes https://github.com/libsdl-org/SDL/issues/7244
2023-02-22 22:03:25 -08:00
Sam Lantinga
0fe1e9f3a7 Cleaned up SDL_migration.cocci, removing old SDL3 names 2023-02-22 16:44:06 -08:00
Sam Lantinga
9eb19d2bf2 SDL_CheckWindowDisplayChanged() is a static function 2023-02-22 15:34:44 -08:00
Sam Lantinga
756921a049 Fixed float conversion warning 2023-02-22 15:33:47 -08:00
Sam Lantinga
a758f87f6f Fixed compile error on Android when assert is defined as SDL_assert 2023-02-22 15:32:49 -08:00
Ozkan Sezer
a2f8cf8fc0 fix MSVC build failures in CI after commit 1e5e8e2f 2023-02-22 10:30:56 +03:00
Sam Lantinga
87a83787a3 De-duplicate Google Stadia controllers on macOS 2023-02-21 15:31:32 -08:00
Sam Lantinga
4aeec9d8c2 Rumbling the Google Stadia Controller over Bluetooth works on Linux and macOS 2023-02-21 15:05:57 -08:00
Sam Lantinga
021a7cfa13 Fixed the packet size for Xbox One controllers 2023-02-21 12:47:48 -08:00
Ryan C. Gordon
1e5e8e2fda resampler: Work at double precision on x86-64 machines.
We get audio artifacts if we don't work at the higher precision, but
this is painful on CPUs that have to use a software fallback for this,
so for now (that is, until we have a better solution), get better output
on amd64 chips, where the cost is less painful.
2023-02-21 13:00:20 -05:00
Ryan C. Gordon
357bc8ca5c resampler: correctly save off left padding.
I don't know if we ever actually hit this in practice, but if this isn't
replacing the whole buffer, it needs to slide the end of the existing padding
over to the start before adding in the new data.
2023-02-21 13:00:19 -05:00
Sam Lantinga
1a15d506a6 Removed duplicated conditional 2023-02-20 18:24:52 -08:00
Sam Lantinga
02cea5fca1 Fixed rumble caps for the Nintendo Joy-Con controllers 2023-02-20 17:14:18 -08:00
Sam Lantinga
4994654d4f Added support for the Razer Wolverine V2 controllers 2023-02-20 15:14:20 -08:00
Sam Lantinga
e8091b8983 cocoa/gles: do not unload EGL when context is destroyed 2023-02-20 10:40:54 -08:00
Marc-André Lureau
93861e1de0 windows/gles: do not unload EGL when context is destroyed
It's legitimate to have multiple contexts.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-02-20 10:40:19 -08:00
Marc-André Lureau
654965a628 windows/gles: correct indentation
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-02-20 10:40:19 -08:00
Sam Lantinga
5d3cf61e8b Don't call SDL_GetDisplayIndex(0) when creating or positioning a window
Fixes https://github.com/libsdl-org/SDL/issues/7354
2023-02-20 10:38:13 -08:00
Anonymous Maarten
f1202fccdc cmake: create SDL3::SDL3-shared for VC and Xcode devel package 2023-02-20 00:43:53 +01:00
Anonymous Maarten
213fbd01c5 SDL_endian.h: improve doxygen documentation 2023-02-19 10:01:33 -08:00
Anonymous Maarten
549cedfa88 include: add \brief to includes 2023-02-19 10:01:33 -08:00
Anonymous Maarten
0625695898 docs: Fix doxyfile 2023-02-19 10:01:33 -08:00
Anonymous Maarten
efdc92802f Fix -Wunused-function warning when configuring with -DSDL_X11_XINPUT2=OFF 2023-02-19 09:59:12 -08:00
Anonymous Maarten
0e2866f846 Fix -Wunused-variable warning when configuring with -DSDL_X11_XRANDR=OFF 2023-02-19 09:59:12 -08:00
Anonymous Maarten
cfadb4c106 Fix -Wunused-variable warning when configuring with -DSDL_X11_XSHAPE=OFF 2023-02-19 09:59:12 -08:00
Sam Lantinga
ced02319a6 Fixed typo (thanks @Iniquitatis!) 2023-02-19 09:57:35 -08:00
Lauri Kasanen
0123d6311d Fix GetGlobalMouseState when xi2 is not available at runtime 2023-02-19 09:56:08 -08:00
Sam Lantinga
24d419c09f Updated documentation for SDL3_DYNAMIC_API
Fixes https://github.com/libsdl-org/SDL/issues/7347
2023-02-19 09:54:47 -08:00
Ozkan Sezer
964a877eb3 SDL_x11dyn.h: include XInput2.h also for Xfixes
Fixes https://github.com/libsdl-org/SDL/issues/7343
2023-02-11 23:51:28 +03:00
Anonymous Maarten
18f38bef03 Remove include/SDL3/SDL_name.h 2023-02-18 12:33:54 -08:00
Le Philousophe
a67ae8eed5 Fix window size in X11 when window manager refuses to resize 2023-02-18 12:31:46 -08:00
Ozkan Sezer
b5a7bd72df minor tidy-up. 2023-02-18 11:29:10 +03:00
Sylvain
c88becc87a Fix kmsdrm build 2023-02-18 08:12:52 +01:00
Alexandros Koutroulis
a2251d1093 SDL_SetWindowIcon now reports errors. (#7081) 2023-02-17 16:17:27 -08:00
Anonymous Maarten
dc138ee3d4 cmake: SDL3-shared target will always be a shared target 2023-02-17 23:42:03 +01:00
Anonymous Maarten
6ae1578691 ci: cache PVR_PSP2 and gl4es4vita 2023-02-17 21:29:22 +01:00
Sam Lantinga
eede2066fb Added other names for the DragonRise Inc. Wired Wheel (thanks @felimwhiteley!) 2023-02-17 11:29:27 -08:00
Frank Praznik
39e6d4a891 Set the window width and height when moving 2023-02-17 09:25:01 -05:00
Sam Lantinga
630c23ce17 You can move fullscreen desktop windows between displays using SDL_SetWindowPosition() 2023-02-16 17:28:56 -08:00
Sam Lantinga
64b88115ec SDL_SetWindowFullscreen() now takes a boolean value 2023-02-16 17:28:35 -08:00
Sam Lantinga
6c04c6f090 Fixed SDL_SetWindowSize() and SDL_SetWindowPosition()
The backend code expected window->x,y,w,h to be set when updating size and position
2023-02-16 16:59:15 -08:00
Anonymous Maarten
d3b7308ee7 ci: install pkg-config on Macos runner 2023-02-16 13:59:23 -08:00
Anonymous Maarten
4d8a50912b cmake: no shared SDL libraries for riscos 2023-02-16 13:59:23 -08:00
Anonymous Maarten
e203046a5c cmake+ci: build shared and static libraries on ci 2023-02-16 13:59:23 -08:00
Sam Lantinga
bde4c738bb Don't build SDL as a static library by default
Linking with SDL dynamically allows end users to update SDL with bug fixes and new controller support and is recommended. This change makes it so SDL is dynamic by default and developers can build SDL themselves with a static option if that's something they need.
2023-02-16 13:59:23 -08:00
Sam Lantinga
ece8a7bb8e Hold the joystick lock while opening the HID device on non-Android platforms
On Windows the main thread can be enumerating DirectInput devices while the Windows.Gaming.Input thread is calling back with a new controller available, and in this case HIDAPI_IsDevicePresent() returned false since the controller initialization hadn't completed yet, creating a duplicate controller.

Fixes https://github.com/libsdl-org/SDL/issues/7304
2023-02-16 09:50:04 -08:00
Sam Lantinga
96722a5809 Ubuntu 18.04 doesn't have a new enough version of Wayland for SDL, so update documentation appropriately
Reference https://github.com/libsdl-org/SDL/issues/7271
2023-02-16 08:57:53 -08:00
Sylvain
03e69fbc0c Fix potential de-referencing null pointer in SDL_EVDEV_kbd_keycode() 2023-02-16 08:22:37 +01:00
Sylvain
b44d3699b1 Fixed most small problems reported by cppcheck for src/core PR #7307 (from @kevin2kevin2) 2023-02-16 08:22:37 +01:00
Sam Lantinga
bcd97b36d2 Fixed Steam Runtime sandbox detection
Fixes hotplug issues on Steam Deck for Proton and native games
2023-02-15 13:53:57 -08:00
Frank Praznik
4187c6c08c video: Select the closest mode for the target refresh rate accounting for small variations
Use the delta of the target refresh rate and the refresh rate of the mode to select the closest matching display mode, as the actual closest mode may have a slightly lower rate than the target by a small fraction of a hz (e.g 59.98 vs 60.0).
2023-02-15 10:07:46 -05:00
Frank Praznik
3f5ef7dd42 video: Handle moving exclusive fullscreen windows between displays
Desktops can move windows, even exclusive fullscreen windows, from one display to another. To handle this, windows now hold two fullscreen modes: the desired mode, which is considered mutable only to the application, and the current mode. When a fullscreen request is made, the current mode is initially set to the desired mode for the initial fullscreen transition. If an exclusive fullscreen window is moved to a new display, the new display is checked to see if it has a mode compatible with the desired mode. If it does, the compatible mode is used so the windows will have the same properties on the new display. If no compatible mode is found, the window becomes desktop fullscreen. This occurs whenever the window is moved to ensure that an attempt will always be made to use the application's requested mode, if possible.

Exiting and reentering fullscreen results in the desired mode being restored on the display specified by it.
2023-02-15 10:07:46 -05:00
Eric Wasylishen
1f46986d33 testwm.c: show all modes of all displays in the on-screen list (#7323)
* testwm.c: show all modes of all displays in the on-screen list

To allow testing https://github.com/libsdl-org/SDL/pull/7317
2023-02-14 21:05:00 -08:00
Sam Lantinga
beb6a2afdc Map the Android MENU button back to the SDL MENU key
Thanks to @AntTheAlchemist for the investigation!

Fixes https://github.com/libsdl-org/SDL/issues/7318
2023-02-14 18:02:12 -08:00
Sam Lantinga
5925cd4ef3 Fixed handling simple mode PS4 reports
Fixes https://github.com/libsdl-org/SDL/issues/7270
2023-02-14 17:51:16 -08:00
Sam Lantinga
284ae91734 Include SDL_events.h for SDL_ConvertEventToRenderCoordinates() 2023-02-13 17:50:29 -08:00
Sam Lantinga
b39b7025fd SDL_GL_GetDrawableSize, SDL_Metal_GetDrawableSize, and SDL_Vulkan_GetDrawableSize can be replaced with SDL_GetWindowSizeInPixels 2023-02-13 13:11:43 -08:00
Ozkan Sezer
c6792f78df look for clock_gettime() in libc first, then in librt if not found. 2023-02-13 11:23:12 -08:00
Frank Praznik
9370f9ca85 wayland: Deduplicate calls to position fullscreen windows already on the correct output 2023-02-13 13:25:16 -05:00
Ozkan Sezer
272010b612 cmake: really fix detection of pthread_setname_np() on Apple platforms. 2023-02-13 11:56:10 +03:00
Ozkan Sezer
f7f61af12b cmake: fix detection of pthread_setname_np() on Apple platforms. 2023-02-13 11:55:40 +03:00
Sylvain
93ed3148ba Fixed bug #7302 - Memory 'leak' in SDL_SetMouseSystemScale() 2023-02-13 09:42:12 +01:00
Anonymous Maarten
236d26b480 cmake: add -F <SDL3-framework-parent-folder> compile option in CMakeLists.txt 2023-02-13 05:26:57 +01:00
Anonymous Maarten
d0b39890d2 cmake: include_guard() is not needed 2023-02-13 04:55:46 +01:00
Sylvain
eea4711110 gendynapi.py: add option to check doc formating (eg \param \returns \since) 2023-02-12 20:43:30 +01:00
Sylvain
81c94a165c Add \since docs where missing and resets some to 3.0.0
- remove a \returns
2023-02-12 20:43:11 +01:00
Sylvain
3d93b07d5b Documentation \param fixes 2023-02-12 08:21:36 -08:00
Sylvain
49e47b523a Update \returns to the generic form 2023-02-12 08:21:02 -08:00
Sylvain
612584277c Fix build documentation 2023-02-12 09:54:36 +01:00
Sylvain
e9af964cf4 More \param added for SDL function in stdinc.h 2023-02-12 09:50:38 +01:00
Sylvain
43c08170af Add missing '\param' documentation 2023-02-12 09:42:13 +01:00
Sylvain
ce366facaa Add missing \returns, change "return" to "returns" to have same naming 2023-02-12 09:22:25 +01:00
Francisco Javier Trujillo Mata
b728de788e Fixed audio 2023-02-11 13:23:08 -08:00
Frank Praznik
4a6f3cf47e x11: Set the window position when entering fullscreen
Set the window position when entering fullscreen as both real Xorg and XWayland need this in order for the window to be on the correct display.
2023-02-11 14:44:02 -05:00
Frank Praznik
d6a19c8cc6 video: Use the explicit fullscreen display for a window unless the window was moved
When an exclusive fullscreen display is specified, it overrides any positioning, including from driver specific functions. Allows for the proper placement of fullscreen windows on macOS and Windows when the floating window is on a display that differs from the one specified by the exclusive fullscreen mode.

 A specific position-only function has been split out for use when a window has been moved.
2023-02-11 14:44:02 -05:00
Sam Lantinga
68e2f23066 Sorted controller list 2023-02-10 17:18:02 -08:00
Alfredo Escobar
76552e4780 Add Hori Pokken Tournament DX Pro Pad 2023-02-10 17:16:26 -08:00
Sam Lantinga
e4face7c1d Fixed the share button on the ThrustMaster eSwap PRO Controller Xbox 2023-02-10 16:46:21 -08:00
Sam Lantinga
b55bb02723 Constrain the mouse position before it's used to generate mouse deltas
Also clamp the mouse position to the maximum of *max and the last mouse position

Fixes https://github.com/libsdl-org/SDL/issues/7221#issuecomment-1426054481
2023-02-10 09:08:12 -08:00
Sam Lantinga
144390f8fc Fixed renaming suggestion for SDL_WINDOWEVENT_CLOSE 2023-02-10 06:48:54 -08:00
Sam Lantinga
13d9e41c3f SDL_WINDOWEVENT_SIZE_CHANGED was renamed SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED 2023-02-10 06:38:14 -08:00
Sam Lantinga
69a6796476 Note that the coordinates in SDL_GetDisplayForPoint() and SDL_GetDisplayForRect() are screen coordinates 2023-02-10 06:31:10 -08:00
Sam Lantinga
449b2289c8 Remove renaming for SDL_GetDisplayDPI() 2023-02-10 06:31:09 -08:00
Sylvain
7c4ec1867b Remove some vim config lines 2023-02-10 11:00:48 +01:00
Sylvain
26f27a9e5a Update README-migration 2023-02-10 09:30:31 +01:00
Sylvain
32d30944a1 SDL_GetNumTouchFingers(): 0 is a valid value. negative is automatically an error 2023-02-10 09:30:31 +01:00
Sylvain
a2f3711c80 SDL_AndroidGetExternalStorageState(): return 0 on success, and fills *state with flags 2023-02-10 09:30:31 +01:00
Bruce Mitchener
a8e89f2567 emscripten: Update deprecated calls to EM_ASM*.
`EM_ASM_` and `EM_ASM_INT_V` are calls that have been deprecated
for a long time.

Since the return value isn't used for the call to `EM_ASM_`, it
can be replaced with `EM_ASM`.

`EM_ASM_INT_V` is now (for the last few years) `EM_ASM_INT`.
2023-02-09 23:10:17 -08:00
Sam Lantinga
b9773be3b3 Don't clamp mouse coordinates until they're fully outside the containing area
A window 1920x1080 pixels wide at 125% scaling will have a width and height of 1536x864, but at pixel (1919,1079) the mouse coordinate will be (1535.2,863.2), which is within the bounds of 1536x864, but larger than (1535,863).
2023-02-09 18:29:47 -08:00
Sam Lantinga
5b77ad54c4 Fixed order and constness of parameters to SDL_ConvertAudioSamples() 2023-02-09 17:49:35 -08:00
Sam Lantinga
fa599c7548 Fixed SDL_GetRendererOutputSize renaming 2023-02-09 17:31:44 -08:00
Sam Lantinga
e65e2c8ed7 SDL_CloseJoystick() should return void, not int 2023-02-09 17:26:16 -08:00
Sam Lantinga
9ff15e5382 Don't change M_PI in application code, that's not an SDL symbol 2023-02-09 17:26:15 -08:00
Anonymous Maarten
ff82341ce9 cmake: allow find_package from build directory (requires CMake 3.26) 2023-02-09 17:20:28 -08:00
Anonymous Maarten
b8adf90aa3 cmake: check again for unknown documentation commands 2023-02-09 17:20:28 -08:00
Anonymous Maarten
cc0fa00049 cmake: include directories of (generated) dependencies as SYSTEM 2023-02-09 17:20:28 -08:00
Sam Lantinga
a9650d440a Fixed MFI controller being opened while HIDAPI controller was being opened
This was the callstack:
    frame #3: 0x00000001004e1930 libSDL3.1.0.0.dylib`IOS_AddJoystickDevice(controller=0x0000600003b0c000, accelerometer=SDL_FALSE) at SDL_mfijoystick.m:528:14
    frame #4: 0x00000001004e1a54 libSDL3.1.0.0.dylib`__IOS_JoystickInit_block_invoke(.block_descriptor=0x0000000100547760, note=@"GCControllerDidConnectNotification") at SDL_mfijoystick.m:673:45
    frame #5: 0x000000018601e578 CoreFoundation`__CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 128
    frame #6: 0x00000001860bc074 CoreFoundation`___CFXRegistrationPost_block_invoke + 88
    frame #7: 0x00000001860bbfbc CoreFoundation`_CFXRegistrationPost + 440
    frame #8: 0x0000000185fefbac CoreFoundation`_CFXNotificationPost + 708
    frame #9: 0x0000000186edc72c Foundation`-[NSNotificationCenter postNotificationName:object:userInfo:] + 88
    frame #10: 0x000000019b054a18 GameController`__60-[_GCControllerManagerAppClient _onqueue_publishController:]_block_invoke + 156
    frame #11: 0x0000000185dc19dc libdispatch.dylib`_dispatch_call_block_and_release + 32
    frame #12: 0x0000000185dc3504 libdispatch.dylib`_dispatch_client_callout + 20
    frame #13: 0x0000000185dd1d1c libdispatch.dylib`_dispatch_main_queue_drain + 928
    frame #14: 0x0000000185dd196c libdispatch.dylib`_dispatch_main_queue_callback_4CF + 44
    frame #15: 0x000000018606ad6c CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
    frame #16: 0x00000001860287ec CoreFoundation`__CFRunLoopRun + 2036
    frame #17: 0x00000001860278a4 CoreFoundation`CFRunLoopRunSpecific + 612
    frame #18: 0x00000001003b1194 libSDL3.1.0.0.dylib`process_pending_events at hid.c:509:9
    frame #19: 0x00000001003aebe8 libSDL3.1.0.0.dylib`PLATFORM_hid_open_path(path="USB_054c_05c4_0x11a104290", bExclusive=0) at hid.c:823:2
    frame #20: 0x00000001003b051c libSDL3.1.0.0.dylib`SDL_hid_open_path_REAL(path="USB_054c_05c4_0x11a104290", bExclusive=0) at SDL_hidapi.c:1419:19
    frame #21: 0x00000001004dabdc libSDL3.1.0.0.dylib`HIDAPI_SetupDeviceDriver(device=0x0000600003518000, removed=0x000000016fdfee3c) at SDL_hidapijoystick.c:399:19
    frame #22: 0x00000001004da890 libSDL3.1.0.0.dylib`HIDAPI_AddDevice(info=0x000060000212c2d0, num_children=0, children=0x0000000000000000) at SDL_hidapijoystick.c:843:5
    frame #23: 0x00000001004d9148 libSDL3.1.0.0.dylib`HIDAPI_UpdateDeviceList at SDL_hidapijoystick.c:1000:21
    frame #24: 0x00000001004d9940 libSDL3.1.0.0.dylib`HIDAPI_JoystickDetect at SDL_hidapijoystick.c:1205:13
    frame #25: 0x00000001003bc6d8 libSDL3.1.0.0.dylib`SDL_UpdateJoysticks_REAL at SDL_joystick.c:1703:9
    frame #26: 0x00000001003a13a8 libSDL3.1.0.0.dylib`SDL_PumpEventsInternal(push_sentinel=SDL_FALSE) at SDL_events.c:855:9
    frame #27: 0x00000001003a1340 libSDL3.1.0.0.dylib`SDL_PumpEvents_REAL at SDL_events.c:879:5
    frame #28: 0x000000010038b380 libSDL3.1.0.0.dylib`SDL_PumpEvents at SDL_dynapi_procs.h:572:1
    frame #29: 0x0000000100004524 testgamepad`loop + 40
    frame #30: 0x00000001000063d8 testgamepad`main + 2140
2023-02-09 12:07:11 -08:00
Ozkan Sezer
ae91dcbcf4 fix dynapi after commit dc74a67a 2023-02-09 22:50:00 +03:00
Sylvain
dc74a67a57 SDL_UnlockTexture: change from 'int' to 'void' 2023-02-09 20:17:27 +01:00
Sylvain
cee245b6a9 SDL_*SceenSaver(): change return value to int. // add SDL_Unsupported() errors 2023-02-09 08:16:46 -08:00
Sylvain
e2e5e670bf Remove returns int from Destroy/Close/Unlock functions 2023-02-09 07:57:14 -08:00
Linus Probert
3bd737d44c Add error returns to void functions that can fail/set errors.
This takes care of the last set of void functions that could
potentially be shifted to instead return an int indicating success and
setting an error in case of an error.
2023-02-09 07:23:21 -08:00
Sylvain
b305d9e3c0 Change return type from void to int for audio function. Eventually set invalid parameter error. 2023-02-08 17:43:44 -08:00
Sam Lantinga
824b9b0a58 Removed SDL_GetDisplayDPI()
This function wasn't consistently correct across platforms and devices.

If you want the UI scale factor, you can use display_scale in the structure returned by SDL_GetDesktopDisplayMode(). If you need an approximate DPI, you can multiply this value times 160 on iPhone and Android, and 96 on other platforms.
2023-02-08 17:35:54 -08:00
Sam Lantinga
b7c6fec10a Make sure we synchronously re-enable USB reporting mode for Switch controllers (thanks @SortaCore!)
Fixes https://github.com/libsdl-org/SDL/issues/3450
2023-02-08 14:22:39 -08:00
Sam Lantinga
50575ed223 Note the Google Stadia controller doesn't support rumble over Bluetooth 2023-02-08 14:16:24 -08:00
Sam Lantinga
00e02de77b Fixed mis-detecting the share button on the Xbox controller over NDIS 2023-02-08 14:16:21 -08:00
Sam Lantinga
d1c72bb0bc Dynamically update the serial number if it isn't available at first
This happens for Xbox One controllers using newer firmware connected over NDIS
2023-02-08 14:16:17 -08:00
Sylvain
c5c94a6be6 Change return type from void to int, for functions that set an error
(SDL_SetError(), SDL_OutOfMemory(), SDL_Unsupported(), SDL_InvalidParam())

Update prototype to forward errors to generic layer, for the functions:
MoveCursor, WarpMouse, GL_DeleteContext, GetDisplayModes.

Check invalid parameter in SDL_SetTextInputRect() generic layer.
2023-02-07 13:51:45 -08:00
Frank Praznik
6c37d5b57f x11: Cast the dot clock value to 64-bit when calculating the refresh rate
The Xrandr dot clock value is declared as an unsigned long and the result when multiplying by 100 can overflow on a 32-bit system. Explicitly cast it to Sint64 to ensure that no overflow will occur.
2023-02-07 13:39:38 -05:00
Sam Lantinga
20a4e31a12 Re-added the internal hint SDL_BORDERLESS_WINDOWED_STYLE
sdl2-compat should set this to "0"
2023-02-07 09:47:17 -08:00
Pierre Wendling
fa8fba3812 Add clang-tidy config and CMake/CI support. 2023-02-06 21:02:25 -08:00
Sam Lantinga
5fded632d6 Added support for the Turtle Beach REACT-R and Recon Xbox controllers 2023-02-06 20:14:12 -08:00
Frank Praznik
d603371848 video: Try to get the display for fullscreen windows via the window position
Attempt to retrieve the display for fullscreen windows using the window position so that the correct display ID is returned if an exclusive fullscreen window is moved to another display.
2023-02-06 17:18:35 -08:00
Sam Lantinga
a357021800 Use GNU sed if available
Fixes update-copyright.sh on macOS, which doesn't support the -b option.
2023-02-06 15:47:16 -08:00
Sam Lantinga
0208a0eeb3 Added support for the Logitech ChillStream 2023-02-06 13:28:59 -08:00
Ozkan Sezer
7f3036c353 make sure to not enable SDL_PASSED_BEGINTHREAD_ENDTHREAD for WinRT 2023-02-07 00:22:37 +03:00
Ozkan Sezer
b82a8b76b1 windows/SDL_systhread.c: remove some dead code. 2023-02-07 00:22:20 +03:00
Sam Lantinga
22bafe8729 Removed debug code accidentally committed 2023-02-06 11:23:53 -08:00
Sam Lantinga
f8b41919da Fixed warning running a command queue without any vertex operations 2023-02-06 11:22:00 -08:00
Linus Probert
375bde8a4f [SDL3] Cleanup void functions (#7253)
Some functions that do call SDL_SetError but return void changed to instead return non-zero in case of errors.
2023-02-06 08:53:52 -08:00
Sam Lantinga
9d8f98c735 Don't change presentation modes when resizing the logical target
Fixes https://github.com/libsdl-org/SDL/issues/7251
2023-02-06 08:51:58 -08:00
Sylvain
6f0acca8bd Return the SDL_SetError value 2023-02-06 11:42:38 +01:00
Sean Ridenour
a077cc8e4d [SDL3] macOS SetCursor performance fix (fixes #7151) (#7249)
* Setting the same mouse cursor twice is a no-op

* Cocoa: Call [NSCursor set] to change mouse cursor

The previous way, changing the mouse cursor was handled by invalidating
the mouse cursor rectangles and then recreating them (with the new
cursor) the next event loop. This is extremely slow; sometimes it can
take over a millisecond! With [NSCursor set] it happens instantly and
very quick performance-wise.

The downside is that it sets the cursor for the whole screen, so we
have some guards in place to change it to the system cursor if
the mouse moves outside the window or the window loses focus.

* Cocoa: Remove unneeded resetCursorRects: function
2023-02-05 17:58:33 -08:00
Sylvain
fbe0352764 SDL_DestroyRenderer: drop all commands first
and don't queue new command from SDL_DestroyTexture() (memory leak)
2023-02-05 13:35:08 -08:00
Ozkan Sezer
e1d79b418c fix build error due to -Wshadow 2023-02-05 20:45:02 +03:00
Sam Lantinga
653f2c4ba3 Made the render tests less verbose in the successful case 2023-02-05 09:11:00 -08:00
Sam Lantinga
ec1b42557f Fixed memory leak at shutdown (thanks @1bsyl!)
Clean up the textures first, as destroying the current render target will queue viewport and clip rectangle commands
2023-02-05 09:10:21 -08:00
Sylvain
5d1006657a SDL_migration.cocci: remove metavariable warning 2023-02-05 17:48:18 +01:00
Leonardo Brondani Schenkel
6f06e4bc80 Add Linux mapping for 8BitDo Pro 2 Wired Controller for Xbox
Without these mappings, this controller "kinda" works out of the box:
- `SDL_GameControllerMapping()` works because it will notice "Xbox" in
  the name and use the default XInput mappings
- `SDL_GameControllerMappingForGUID()` will not find any mapping

lsusb:
```
ID 2dc8:2000 8BitDo 8BitDo Pro 2 Wired Controller for Xbox
```

In Linux this controller is supported by two drivers:
- `xpad` (built-in to the kernel), exposes the controller name from the
  USB descriptor and the GUID starts with 03 (0x03 = BUS_USB)
- `xone` (https://github.com/medusalix/xone), exposes a virtual
  controller which is always named "Microsoft X-Box One pad" and the
  GUID starts with 06 (0x06 = BUS_VIRTUAL)

This commit adds the 2 GUIDs from both drivers so mappings will always
be found and the real controller name will always be reported.

(cherry picked from commit 4266cf8504)
2023-02-05 08:45:24 -08:00
Sam Lantinga
1c03ddefc3 Sorted controller list 2023-02-05 08:43:26 -08:00
Sam Lantinga
d563f38a0d Note that the renderer will by default scale from window coordinates to pixels 2023-02-05 08:41:35 -08:00
Antonis Geralis
52cd9fcbb0 Added Elecom 8button gamepad 2023-02-05 08:41:07 -08:00
Sylvain
85143c28b5 SDL_migration.cocci: fix syntax 2023-02-05 09:37:37 +01:00
Frank Praznik
4a16d8d00e Merge pull request #7238 from Kontrabant/wayland_fix_portrait
wayland: Transform mode values for native portrait displays
2023-02-04 11:42:43 -05:00
Frank Praznik
b2d8a1a58c wayland: Transform mode values for native portrait displays
Portrait displays may have native, physical resolutions that are taller than wide. Reverse the mode dimensions when dealing with these displays as well as those rotated via software means.
2023-02-04 11:40:55 -05:00
Ozkan Sezer
02fbf2cf99 replaced line comments in public header. 2023-02-04 10:02:10 +03:00
Sam Lantinga
2a83093b36 Use a reasonable upper bound on the number of pixels we'll try to draw when traversing a line
Fixes https://github.com/libsdl-org/SDL/issues/6116
2023-02-03 20:53:30 -08:00
Anonymous Maarten
d6fdb842b0 include: add comment documenting the change(s) to SDL_opengl_glext.h 2023-02-04 02:44:10 +01:00
Alynne
4dea13e02f Adds Stadia BT mapping 2023-02-03 15:01:49 -08:00
Sam Lantinga
a34a84ba98 Rename int versions of the SDL2 render functions (#7235)
This makes it clear what the new versions are, and in the case of SDL_RenderDrawPoint() and SDL_RenderDrawLine(), the coccinelle script actually does the (float) casts for you.
2023-02-03 14:55:32 -08:00
Sam Lantinga
14a4ce8b59 Fixed SDL_ScaleMode values for consistency 2023-02-03 14:20:51 -08:00
Sam Lantinga
e5edce8e75 Fixed permissions on src/render/SDL_render.c (#7232) 2023-02-03 13:14:48 -08:00
Sylvain Becker
cb6b8b0132 Simplify flags testing (#7220) 2023-02-03 13:08:42 -08:00
Sam Lantinga
dcd17f5473 Renderer logical size is now implemented as a render target
This fixes rounding errors with coordinate scaling and gives more flexibility in the presentation, as well as making it easy to maintain device independent resolution as windows move between different pixel density displays.

By default when a renderer is created, it will match the window size so window coordinates and render coordinates are 1-1.

Mouse and touch events are no longer filtered to change their coordinates, instead you can call SDL_ConvertEventToRenderCoordinates() to explicitly map event coordinates into the rendering viewport.

SDL_RenderWindowToLogical() and SDL_RenderLogicalToWindow() have been renamed SDL_RenderCoordinatesFromWindow() and SDL_RenderCoordinatesToWindow() and take floating point coordinates in both directions.

The viewport, clipping state, and scale for render targets are now persistent and will remain set whenever they are active.
2023-02-03 12:57:37 -08:00
Anonymous Maarten
93fc72a405 opengl: make SDL_opengl_glext.h's include compatible with macos
- Mesa defines __gl_glext_h_
- Apple defines __glext_h_
2023-02-03 20:58:05 +01:00
Frank Praznik
0bf91e16b7 wayland: Fix non-floating libdecor window sizing 2023-02-03 11:07:31 -05:00
Ozkan Sezer
9f21bed729 dynapi: cast GetProcAddress() result to void* 2023-02-03 17:40:40 +03:00
Ozkan Sezer
e7ea47a1b4 add version check to SDL_MALLOC macro (for correctness) 2023-02-03 17:40:40 +03:00
Frank Praznik
7d439b87b0 video: Don't switch display modes when emulating mode changes
SDL uses window minimization to determine fullscreen window visibility and hide windows before changing the video mode back to the desktop. Wayland, however, does not have the concept of a minimized window and doesn't set the minimized flag (minimization can be requested, but what actually happens to the window is implementation dependent, and if a window is minimized via a desktop shortcut or decoration control, the application is not notified of any state changes). Make the video core mode setting a no-op so that the Wayland backend can handle reporting the display dimensions using its own internal logic.
2023-02-02 18:25:18 -08:00
Frank Praznik
7def1438c3 wayland: Refactor for video core changes
Accommodate the new video core changes.

The new video core changes allow for some window geometry calculation refactoring that simplify the system:

- Removal of helper functions
- Eliminate some discrepancies between the libdecor and xdg-toplevel paths
- No need to short-circuit the video core window size event deduplication check
- Exclusive fullscreen windows will always end up on the correct output, even when fullscreen is initiated from the compositor
- Better handling of cases where the desktop is scaled, but does not expose the viewport protocol
- Return the display bounds for the emulated mode if an exclusive fullscreen window has focus
- Fixed cases where changing display properties during runtime wouldn't update the display mode lists
- General cleanup
2023-02-02 18:25:18 -08:00
Frank Praznik
47cdb532f1 video: Don't rely on memcpy undefined behavior
The C specification states that passing a size of 0 to functions like memcpy is valid, but even if the size is 0 and the function is essentially a no-op, the result when passing any invalid pointers is considered undefined behavior. Don't rely on undefined behavior when copying the display or mode lists.
2023-02-02 15:11:36 -08:00
Frank Praznik
166afebcad video: Update self-referential pointers when reallocating the display list
The display list can contain self-referential pointers if the current mode pointer points to the desktop mode or a fullscreen mode array element, and reallocating the display or fullscreen mode lists without updating the current mode pointer in these cases can leave them pointing to freed memory or garbage data. Manually copy the list items and update the self-referential pointers if necessary.
2023-02-02 09:46:01 -08:00
Sam Lantinga
673bc57649 Don't accept official mappings for controllers that aren't unique
For example, the DragonRise Inc. Generic USB Joystick
See https://github.com/gabomdq/SDL_GameControllerDB/issues/202 for details
2023-02-02 08:39:54 -08:00
Sam Lantinga
917607c335 Fixed sort_controllers.py and resorted game controller database 2023-02-02 08:38:22 -08:00
Sam Lantinga
d29e1f3632 Added gamepad mappings for the Xin-Mo Dual Arcade Fightstick 2023-02-01 23:09:53 -08:00
Sasha Szpakowski
baca26d727 macOS: fix initial Metal drawable size in certain multi-display setups 2023-02-01 22:38:55 -08:00
Frank Praznik
98ae54ccc0 video: Set the ID of fullscreen modes when adding a display
When adding a display, traverse the list of added fullscreen modes and ensure the display ID is set to its final, valid value, or the modes added before calling SDL_AddVideoDisplay() will have an invalid display ID.
2023-02-01 16:37:57 -08:00
Anonymous Maarten
d8f0715385 Revert "Remove unused SDL_GetCPUName"
This reverts commit 4e6ab13d6f.
2023-02-02 00:49:09 +01:00
Anonymous Maarten
78be9eaf38 Revert "Add testcpuinfo.c"
This reverts commit 5888b008b1.
2023-02-02 00:49:09 +01:00
Anonymous Maarten
69aede6c9e Add missing _ in SDL_EVENT_LOCALECHANGED and SSDL_EVENT_TEXTEDITING_EXT 2023-02-02 00:49:09 +01:00
Anonymous Maarten
08bcee8570 test: don't use wiki urls for documentation comments
Also make consistent use of \ as documentation escape character.
2023-02-02 00:49:09 +01:00
Anonymous Maarten
bff449eb24 testcpuinfo.c needs SDL3/SDL_main.h 2023-02-01 23:49:27 +01:00
Anonymous Maarten
5888b008b1 Add testcpuinfo.c 2023-02-01 23:34:37 +01:00
Anonymous Maarten
4e6ab13d6f Remove unused SDL_GetCPUName 2023-02-01 23:17:15 +01:00
Sam Lantinga
177a6f38e0 Only minimize the window for an assert if it's in exclusive fullscreen mode 2023-02-01 12:05:25 -08:00
Sam Lantinga
ac75fe9324 Folded SDL_WINDOW_FULLSCREEN_EXCLUSIVE and SDL_WINDOW_FULLSCREEN_DESKTOP into a single SDL_WINDOW_FULLSCREEN flag
The fullscreen video mode used by the window can be used to determine whether it's in exclusive fullscreen or fullscreen desktop mode.
2023-02-01 12:05:25 -08:00
Sam Lantinga
14338ab459 Removed display mode flags
They weren't really adding any value and added complexity to the API
2023-02-01 12:05:25 -08:00
Sam Lantinga
9ff1055489 Workaround for Visual Studio 2019 const warning
Visual Studio 2022, gcc, and clang all agree that "const SDL_DisplayMode **" is a non-const pointer to const data, but Visual Studio 2019 warns about this, so we'll just add a cast to the SDL_free() call for now.

Apparently this was a legitimate bug that has been recently fixed:
https://stackoverflow.com/questions/10403713/why-does-visual-c-warn-on-implicit-cast-from-const-void-to-void-in-c-but
2023-02-01 12:05:25 -08:00
Sam Lantinga
6b137579ea Windows default to fullscreen desktop mode if they don't pick an explicit video mode
Rather than iterating over display modes using an index, there is a new function SDL_GetFullscreenDisplayModes() to get the list of available fullscreen modes on a display.
{
    SDL_DisplayID display = SDL_GetPrimaryDisplay();
    int num_modes = 0;
    SDL_DisplayMode **modes = SDL_GetFullscreenDisplayModes(display, &num_modes);
    if (modes) {
        for (i = 0; i < num_modes; ++i) {
            SDL_DisplayMode *mode = modes[i];
            SDL_Log("Display %" SDL_PRIu32 " mode %d:  %dx%d@%gHz, %d%% scale\n",
                    display, i, mode->pixel_w, mode->pixel_h, mode->refresh_rate, (int)(mode->display_scale * 100.0f));
        }
        SDL_free(modes);
    }
}

SDL_GetDesktopDisplayMode() and SDL_GetCurrentDisplayMode() return pointers to display modes rather than filling in application memory.

Windows now have an explicit fullscreen mode that is set, using SDL_SetWindowFullscreenMode(). The fullscreen mode for a window can be queried with SDL_GetWindowFullscreenMode(), which returns a pointer to the mode, or NULL if the window will be fullscreen desktop. SDL_SetWindowFullscreen() just takes a boolean value, setting the correct fullscreen state based on the selected mode.
2023-02-01 12:05:25 -08:00
Anonymous Maarten
048df6260c Remove disabled self test main functions in src/SDL_error.c 2023-02-01 20:14:48 +01:00
Anonymous Maarten
4af93990a9 Remove disabled self test main functions 2023-02-01 20:13:34 +01:00
Anonymous Maarten
e73151f544 ci: don't upload test directory for ps2 workflow separately 2023-02-01 20:04:47 +01:00
Anonymous Maarten
2afee88c81 ci+haiku: ignore return code of sv force-restart 2023-02-01 19:43:11 +01:00
Frank Praznik
d58693928d video: Return the display ID when the window is fully enclosed
If the window was fully enclosed, GetDisplayForRect() would return the index of the display ID in the array instead of the display ID itself. Return the display ID itself.
2023-01-31 20:23:52 +01:00
Sam Lantinga
c5f570b30b Make sure count is 0 in out of memory conditions
This prevents a crash if the caller assumes that they can always dereference the returned pointer if there is a non-zero count.
2023-01-31 10:04:51 -08:00
Vladyslav Serhiienko
47deebe23f Fixes for Android builds 2023-01-31 08:39:51 -08:00
Anonymous Maarten
0a3d038ff7 cmake: fix installed SDL3::SDL3_test + test on ci 2023-01-31 05:29:38 +01:00
Anonymous Maarten
72f40cb1f5 ci: restart VM after installing haiku dependencies 2023-01-31 01:59:21 +01:00
Anonymous Maarten
25b723cc82 cmake: detect Emscripten architecture as emscripten 2023-01-31 01:59:21 +01:00
Anonymous Maarten
53d434fd24 cmake: add CPack support for creating binary archives 2023-01-31 01:59:21 +01:00
Anonymous Maarten
64c97906c9 ci: fail CMake configuration on warning 2023-01-31 01:59:21 +01:00
Anonymous Maarten
23c2c15a70 cmake: capitalize SDL3::Headers target 2023-01-31 01:59:21 +01:00
Anonymous Maarten
d45f0a0566 ci: upload artifacts for main workflow 2023-01-31 01:59:21 +01:00
Anonymous Maarten
32e7921f98 cmake: by default, link tests to SDL3.dll on Windows 2023-01-31 01:59:21 +01:00
Anonymous Maarten
13c294eec3 cmake: add support for creating Apple frameworks with CMake 2023-01-31 01:59:21 +01:00
Anonymous Maarten
93c25e650c cmake: create SDL3::headers for include path + no exported CMake variables 2023-01-31 01:59:21 +01:00
Anonymous Maarten
5690dfb65b cmake: don't install Android.mk files for Android 2023-01-31 01:59:21 +01:00
Anonymous Maarten
09e2f83e17 cmake: no more SDL3_* cache variables 2023-01-31 01:59:21 +01:00
Anonymous Maarten
19d162281c cmake: detect cpu architecture in SDL_DetectCPUArchitecture
Stop looking for arch, when one is found
2023-01-31 01:59:21 +01:00
Anonymous Maarten
9cf34908a1 cmake: pass VERSION to project() + don't use SDL_VERSION 2023-01-31 01:59:21 +01:00
Anonymous Maarten
3aa456dead cmake: remove MSCOS_RPATH related FIXME
The Macos CI does not show any warnings, so assume it's fixed
2023-01-31 01:59:21 +01:00
Bruno Sanches
7c085862e1 SDL_Video.h - audio driver
I believe you intend to say "video driver", not audio driver
2023-01-30 08:13:16 -08:00
Sylvain
d66f27376e Prevent setting an error "invalid display" when the parameter displayID hasn't been set. 2023-01-30 10:57:51 +01:00
Sam Lantinga
b07f8e987b Fixed checking the return values of SDL_AddBasicVideoDisplay() and SDL_AddVideoDisplay()
Also fixed Wayland and Windows usage of SDL_DelVideoDisplay()

https://github.com/libsdl-org/SDL/issues/7192
2023-01-29 21:58:15 -08:00
Sam Lantinga
1ffc09c6e6 Changed SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED to be the same value as SDL_EVENT_WINDOW_SIZE_CHANGED so SDL2 applications continue to work as expected. 2023-01-29 21:37:51 -08:00
Sam Lantinga
de766fdcd7 Fixed Haiku build 2023-01-29 21:35:45 -08:00
SDL Wiki Bot
87af6c0019 Sync SDL3 wiki -> header 2023-01-30 03:26:14 +00:00
Sam Lantinga
22c69bccdf Displays are now referenced by instance ID instead of index 2023-01-29 19:25:15 -08:00
Anonymous Maarten
758c0dd6d8 Rename mouse BUTTON(DOWN|UP) event to BUTTON_(DOWN|UP) 2023-01-29 19:24:48 -08:00
Sylvain
413376cdb3 migration: replace SDL_DisplayMode w and h by screen_w and screen_h 2023-01-29 12:19:09 -08:00
Frank Praznik
e22f5ed7d3 wayland: Check that all required dynamic symbols have been successfully resolved at init time
Ensure that all hard dependencies are resolved when dynamically loading the libraries required for the Wayland backend and fail gracefully if a required module was not initialized successfully.
2023-01-29 11:23:08 -08:00
Sasha Szpakowski
90795291e4 Remove SDL_GL/Metal/Vulkan_GetDrawableSize().
SDL_GetWindowSizeInPixels supersedes those functions.
2023-01-29 11:20:33 -08:00
Sasha Szpakowski
0d0a34f79f iOS: fix the desktop display mode's display scale property. 2023-01-29 11:11:46 -08:00
Frank Praznik
a67b441a10 wayland: Send a pixel sized change event when the drawable size changes 2023-01-28 18:37:15 -08:00
Aaron Barany
4667d65f77 Fixes for building on Mac with OpenGL disabled. 2023-01-28 17:24:25 -08:00
Sam Lantinga
df7639f100 Call SDL_OnWindow* handlers after the event has been delivered
This guarantees that events which trigger other events will happen in dependency order, instead of being reversed.
2023-01-28 15:56:02 -08:00
Sam Lantinga
432af82a88 Don't deliver window events while it's being destroyed 2023-01-28 15:56:02 -08:00
Sam Lantinga
bf4095359c Removed duplicated window size events, and added SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED 2023-01-28 15:56:02 -08:00
Sasha Szpakowski
af0ec13fc3 iOS: fix display modes to have accurate pixel sizes and screen scales. 2023-01-28 15:48:08 -08:00
SDL Wiki Bot
8814bedc3b Sync SDL3 wiki -> header 2023-01-28 18:57:14 +00:00
Sam Lantinga
31f464153d SDL_WINDOW_INPUT_GRABBED has been renamed SDL_WINDOW_MOUSE_GRABBED 2023-01-28 10:56:38 -08:00
Sam Lantinga
e83c54f271 SDL_WINDOW_FULLSCREEN and SDL_WINDOW_FULLSCREEN_DESKTOP are now distinct flags 2023-01-28 10:56:38 -08:00
Sasha Szpakowski
67037f064b macOS: remove obsolete 10.7 and 10.8-specific code. 2023-01-27 20:46:38 -08:00
Sasha Szpakowski
d293145ec9 macOS: include @1x display modes with the same point-size as @2x modes
Previously they were discarded because SDL didn't expose enough information for apps to differentiate between a low-dpi and high-dpi mode which had the same size in DPI-scaled points. Now the information is available in SDL_DisplayMode.

Fixes #3025.
2023-01-27 20:43:13 -08:00
Frank Praznik
ba74e76e56 wayland: Correct mode values to use pixels instead of screen units
Fixes the Wayland backend to report the desktop mode dimensions in pixels instead of screen units, adjusts enumerated fullscreen resolutions to use the correct pixel values and scaling, and changes some nomenclature to reflect the terminology used in the new DPI system.
2023-01-27 14:51:08 -08:00
Sam Lantinga
0229091f37 Fixed build 2023-01-27 14:24:06 -08:00
Sam Lantinga
24fec13ac1 Add full high DPI information to SDL_DisplayMode
SDL_DisplayMode now includes the pixel size, the screen size and the relationship between the two. For example, a 4K display at 200% scale could have a pixel size of 3840x2160, a screen size of 1920x1080, and a display scale of 2.0.
2023-01-27 12:38:46 -08:00
Sylvain
b23d20cd4d Android: display_mode scale: cast to do a float division 2023-01-27 08:17:20 -08:00
Frank Praznik
fc5f363ff7 video: Send the new fullscreen size in screen coordinates
After successfully entering fullscreen, send the new fullscreen window dimensions in screen coordinates, not pixels, to avoid a unit mismatch.
2023-01-27 08:16:27 -08:00
Sam Lantinga
c2d79cb411 Verify that clear ignores the viewport and test a logical size that isn't the same aspect ratio as the window 2023-01-26 16:10:13 -08:00
Sam Lantinga
d9b53399fe Added an SDL render logical size test 2023-01-26 14:49:23 -08:00
Sam Lantinga
c708ddd66f Added a SDL render viewport test 2023-01-26 13:58:59 -08:00
Sam Lantinga
1c83c1fadd Fixed build warnings in Xcode 2023-01-26 13:58:59 -08:00
Sam Lantinga
b5e6d0eba9 Added testautomation to the Xcode project 2023-01-26 13:58:59 -08:00
Frank Praznik
56120a132d wayland: Remove duplicate code
Remove some duplicate code that was left behind when rearranging things during the new high-DPI support work.
2023-01-26 13:16:57 -08:00
Ryan C. Gordon
077725d0e3 wikiheaders: Fixed SDL2 wiki link. 2023-01-26 14:50:52 -05:00
Ryan C. Gordon
5f8b53820a wikiheaders: Link to the SDL2 wiki in the preamble.
Fixes #6568.
2023-01-26 14:45:58 -05:00
Ryan C. Gordon
726d6f9422 wikiheaders: Allow markdown in the wikipreamble string.
Reference Issue #6568.
2023-01-26 14:45:57 -05:00
Frank Praznik
b2cfcbdb64 wayland: Support new high-DPI system
- Adds support for scaled fullscreen modes
- General cleanup of scale factor setting and usage
2023-01-26 11:11:30 -08:00
Ozkan Sezer
b462027c53 SDL_test_common.c: minor warning fix (SDL_AudioDeviceID is unsigned) 2023-01-26 22:05:47 +03:00
Sam Lantinga
364db52ca3 Moved testautomation data out of SDL_test library 2023-01-26 10:25:44 -08:00
Ozkan Sezer
742e356180 test/loopwavequeue.c: minor warning fix (SDL_AudioDeviceID is unsigned) 2023-01-26 18:15:20 +03:00
Ozkan Sezer
be2afeec84 SDL_loadso.h: add missing SDLCALL to SDL_LoadFunction() 2023-01-26 18:01:10 +03:00
Jiří Malák
54540a82a0 SDL_atomic.h: Update SDL_CPUPauseInstruction for Watcom. (#7157)
Appropriate CPU directive can be used in #pragma aux so that it is not
necessary to hardcode instruction bytes.

(cherry picked from commit 507fc462db)
2023-01-26 17:01:56 +03:00
Frank Praznik
6895e1700f video: Ensure that the closest returned video mode match always has a valid scale value 2023-01-25 20:18:45 -08:00
Sam Lantinga
5970311353 Fixed build using clang-cl on Windows 2023-01-25 14:46:09 -08:00
Ozkan Sezer
3bf86c0eca cmake: addititonal check for visibility attributes.
makes sure to detect unsupported configurations especially with new gcc
versions.
2023-01-26 01:32:32 +03:00
Sam Lantinga
13087405e0 Fixed clang documentation warnings
Don't warn about \threadsafety, which was added as custom documentation for SDL functions

Also removed -Wdocumentation-unknown-command, since that triggers on the e-mail addresses in the generated wayland protocol headers.
2023-01-25 14:25:13 -08:00
Anonymous Maarten
4ec3a5ac27 cmake: only add <LANG>_VISIBILITY_PRESET properties when compiler supports -fvisibility= 2023-01-25 22:27:47 +01:00
Sam Lantinga
a37f2aed7e Hook up Android_ScreenDensity to convert pixels to screen coordinates on Android
Fixes https://github.com/libsdl-org/SDL/issues/7149
2023-01-25 13:06:42 -08:00
Sam Lantinga
9bbc402b81 Take the display scale into account in SDL_GetWindowSizeInPixels() 2023-01-25 13:06:42 -08:00
Sam Lantinga
162e40c982 Use densityDpi instead of density to more closely match what the UI scale is 2023-01-25 13:06:42 -08:00
Sam Lantinga
6dc135413a Create a static SDL_test library on Android 2023-01-25 13:06:42 -08:00
Anonymous Maarten
330ad80014 cocci: fix game pad event types 2023-01-25 22:02:31 +01:00
Ryan C. Gordon
79cca812cb include: make SDL_RenderPresent thread safety notes less verbose.
Reference Issue #7140.
2023-01-25 13:15:34 -05:00
SDL Wiki Bot
43e3daace3 Sync SDL3 wiki -> header 2023-01-25 18:02:19 +00:00
Ryan C. Gordon
197340ea1c Sync wiki -> headers. 2023-01-25 13:01:40 -05:00
Ryan C. Gordon
01cba48d18 wikiheaders: Add a \threadsafety tag to document threading details.
Reference Issue #7140.
2023-01-25 12:59:25 -05:00
Sylvain
73dc327c84 Android get the display Density 2023-01-25 09:28:21 -08:00
Sam Lantinga
6a27188023 SDL_DisplayMode now represents physical pixels and has added a display scaling factor
Work in progress on https://github.com/libsdl-org/SDL/issues/7134
2023-01-25 09:26:59 -08:00
Sam Lantinga
a1e101e898 Fixed formatting for Haiku cc files 2023-01-25 03:03:41 -08:00
Sam Lantinga
6240252736 Updated documentation with the SDL_WINDOW_ALLOW_HIGHDPI flag removal 2023-01-25 01:28:37 -08:00
Sam Lantinga
4696c9556b SDL 3.0 is going to be high DPI aware and officially separates screen… (#7145)
* SDL 3.0 is going to be high DPI aware and officially separates screen coordinates from client pixel area

The public APIs to disable high DPI support have been removed

Work in progress on https://github.com/libsdl-org/SDL/issues/7134
2023-01-25 01:23:17 -08:00
Sylvain
78cc95e34e Rename internal GetDisplayDPI to GetDisplayPhysicalDPI 2023-01-25 00:04:00 -08:00
Sylvain
724d92fd65 Rename SDL_GetDisplayDPI to SDL_GetDisplayPhysicalDPI
to avoid confusion with logical DPI
2023-01-25 00:04:00 -08:00
Sam Lantinga
d496d187c5 Document that the pitch value may be zero for surfaces that will be filled in by the application later.
Also verify that the pitch isn't zero for surfaces with valid pixels

Fixes https://github.com/libsdl-org/SDL/issues/7143
2023-01-24 22:51:16 -08:00
Ryan C. Gordon
e3bada6fbd wikiheaders: We never updated the config when we moved to include/SDL3. :O 2023-01-24 19:42:36 -05:00
Anonymous Maarten
ecffa93f39 ci: test vita piglet/pvr gles support
ci: configure gl4es4vita

ci: test gles on pib AND pvr
2023-01-25 00:23:05 +01:00
Anonymous Maarten
edf8db0466 cmake: removed unused code 2023-01-25 00:23:05 +01:00
Anonymous Maarten
5f995579e9 vita: add missing static libraries for using gles with pib 2023-01-25 00:23:05 +01:00
Anonymous Maarten
bb3a60bce5 cmake: move include(sdlfind.cmake) to main cmake script 2023-01-25 00:23:05 +01:00
Anonymous Maarten
3e3debf9de vita: allow GLES support without GL support 2023-01-25 00:23:05 +01:00
Anonymous Maarten
3cb819ac48 vita: fix PVR_PSP2 (GLES) + gl4es4fita (GL) 2023-01-25 00:23:05 +01:00
Anonymous Maarten
ec3234ea21 editorconfig: trim trailing spaces from yml's 2023-01-25 00:23:05 +01:00
Sam Lantinga
14eb8db152 Fixed build 2023-01-24 14:01:01 -08:00
Sam Lantinga
a06a593aa6 Renamed SDL_GetGamepadNumTouchpads and SDL_GetGamepadNumTouchpadFingers to match the new convention 2023-01-24 13:47:30 -08:00
Jesse Chounard
fcf5b99068 Update vsproj search paths (libsdl-org/SDL#7139) 2023-01-24 13:08:12 -08:00
Ozkan Sezer
58e8cf599c README-migration.md: fix SDL_WINDOWEVENT_CLOSE renamed name.
SDL_EVENT_WINDOW_CLOSE_REQUESTED, not SDL_EVENT_WINDOW_CLOSE.
2023-01-24 20:05:50 +03:00
Sylvain
052b14eb65 Add SDL_ConvertAudioSamples() helper function 2023-01-24 08:26:09 -08:00
Sam Lantinga
7b50bae524 Renamed SDL events for clarity
Fixes https://github.com/libsdl-org/SDL/issues/6877
2023-01-24 07:26:48 -08:00
Lokathor
74697bc351 group init flag defines into an enum (#7137) 2023-01-24 06:04:43 +00:00
ds-sloth
d020dd89ba Support MIN/MAX blend on opengles2 2023-01-23 06:11:36 -08:00
Sam Lantinga
b6646f4de5 Use nanosecond timestamp for sensors (thanks @1bsyl!) 2023-01-23 05:34:24 -08:00
Frank Praznik
34bb0735d8 video: Don't resize moved fullscreen windows if the display mode switch failed
If an exclusive fullscreen window is moved between displays, SDL_UpdateFullscrrenMode can kick the window out of fullscreen if the display onto which it was moved doesn't have a matching video mode. Check the return code and clear the fullscreen flag and skip the resize if the window is no longer fullscreen.
2023-01-22 14:00:54 -08:00
Frank Praznik
8f8746cc1b video: Return an error on failure to set the video mode
If SDL_UpdateFullscreenMode() fails to find a matching mode for the window, it will restore the window to its previous state, but still returns a success code of 0. Return an error code of -1 if no matching display mode can be found.
2023-01-22 14:00:54 -08:00
David Carlier
b379c910d4 SDL_CPUPauseInstruction RISCV-64 version proposal. 2023-01-22 13:58:59 -08:00
ds-sloth
38697e832a Support MIN/MAX blend on OpenGL + ES 2023-01-22 13:49:44 -08:00
Sylvain
b1f365374b Add code snipped to migrate from AudioCVT interface 2023-01-22 22:22:50 +01:00
Sylvain
cb01b35c4e testresample.c: use SDL_DestroyAudioStream() 2023-01-22 22:22:50 +01:00
Anonymous Maarten
0770c55e8d cocci: remove SDL_INIT_NOPARACHUTE 2023-01-22 20:14:35 +01:00
Anonymous Maarten
967ebd78e6 cocci: also fix up SDL_CreateRenderer calls with non-default render indices 2023-01-22 20:04:40 +01:00
Sam Lantinga
9c8642ded9 Removed SDL_INIT_NOPARACHUTE
Fixes https://github.com/libsdl-org/SDL/issues/7121
2023-01-22 09:14:12 -08:00
Sylvain
e4fdf42097 Update README-migration.md 2023-01-22 11:31:30 -05:00
Sylvain
bd793b6d75 Update testresample.c 2023-01-22 11:31:30 -05:00
Sylvain
6ad51558d4 Update testaudiostream_audio.c 2023-01-22 11:31:30 -05:00
Sylvain
64bc0a1612 Remove AudioCVT interface in favor of SDL_AudioStream 2023-01-22 11:31:30 -05:00
raphasamp
9211c0b639 Update SDL_vitagles_pvr.c
This was broken unintentionally during #6545.
2023-01-22 17:32:00 +03:00
PARTY MAN X
fb11918758 Blacklist Konami Amusement Controllers From HIDAPI.
Fixes issue #7118 by adding all Konami Amusement controllers to the
blacklist.  Additionally, the blacklist is changed to exclude a whole
vendor when the PID 0x0000 is used.

(cherry picked from commit a44b646105)
2023-01-21 22:05:21 -08:00
Sam Lantinga
bd1115fa33 Make sure subsystems are noted as initialized during initialization
This fixes issues with SDL_WasInit(X) returning false if called from an event filter during initialization
2023-01-20 17:06:49 -08:00
Sam Lantinga
c4db0725e4 Enable paddles on the Xbox Elite controller when connected over USB 2023-01-20 09:31:22 -08:00
Frank Praznik
5d5d39b190 video: Don't resize moved, fullscreen windows when mode switching is being emulated
When a driver is emulating mode changes, the display bounds are always the native desktop size, not those of the video mode being emulated. This can result in incorrectly setting the size of fullscreen Wayland windows. Don't resize fullscreen windows to the display dimensions when mode switching is emulated.

Renames the quirk flag from VIDEO_DEVICE_QUIRK_DISABLE_DISPLAY_MODE_SWITCHING to VIDEO_DEVICE_QUIRK_MODE_SWITCHING_EMULATED to better reflect its purpose.
2023-01-19 15:07:29 -08:00
Frank Praznik
5ba9e07366 wayland: Remove fullscreen window moving code
SDL now handles moving fullscreen windows on move events in the video core, so Wayland doesn't have to do it manually anymore.
2023-01-19 15:07:29 -08:00
Guldoman
6c06f5ce93 wayland: Set APPLICATION scancode name to Menu
This mimics the behavior of the other platforms.
2023-01-19 15:05:41 -08:00
Sam Lantinga
14695a714f Set the default priority level of SDL_LOG_CATEGORY_ERROR to SDL_LOG_PRIORITY_ERROR
This way SDL_LogError() will show errors by default.

Fixes https://github.com/libsdl-org/SDL/issues/7105
2023-01-19 08:04:40 -08:00
Sam Lantinga
4becca4fc9 Clarify that SDL_GetJoystickFromInstanceID() and SDL_GetGamepadFromInstanceID() return NULL if the associated device hasn't been opened yet.
Fixes https://github.com/libsdl-org/SDL/issues/7100
2023-01-19 07:42:04 -08:00
Sam Lantinga
c8dfc6b475 Fixing window being incorrect size when using win+shift+arrow to move new big picture mode between displays
*When changing the display of a window, if it's a fullscreen window, resize it to the size of the new display

CR: @saml
2023-01-19 07:43:01 -08:00
Frank Praznik
423a82cd4b wayland: Enforce or override libdecor minimum window size
libdecor plugins can change the min/max window size values internally to enforce a minimum window size, and errors and crashes can result if the window size is below the internal limit.

On versions of libdecor >= 0.1.1, the minimum width and height can be queried and the minimum required window size will be enforced. The application requested window size is still respected, however, the actual window may be slightly larger than the drawable area to accommodate the required libdecor minimum size.

On version 0.1.0 of libdecor, which lacks the function to retrieve the minimum size, the internal limits are overridden before committing a frame, so that the internal limits always match the window size as a workaround, even if the window is technically smaller than the plugin would normally allow.
2023-01-18 10:28:01 -08:00
Fabian Greffrath
9b861d2ea4 add support for libsamplerate's "linear" resampling mode
Fixes #6998

(cherry picked from commit 8efa1f8fc6)
2023-01-16 23:49:26 -05:00
Sylvain
80f51eeb1f testautomation: add an option to list all test suites and tests 2023-01-16 11:07:09 +01:00
Sylvain
69253c542a SDL_test_harness: fix memory leak when generated seed 2023-01-16 10:41:43 +01:00
Sylvain
1a47cf5448 Revert "gen_audio_resampler_filter: Use SDL_PI_F"
This reverts commit 41221777ba.
2023-01-16 10:04:22 +01:00
Sylvain
41221777ba gen_audio_resampler_filter: Use SDL_PI_F 2023-01-16 09:24:27 +01:00
Sylvain
4156e6f52e SDL_CreateAudioStream: check for invalid parameters 2023-01-16 09:24:27 +01:00
Eric Wasylishen
08963dc183 testdrawchessboard.c: draw a diagonal line for visually checking highdpi functionality
Also enable dpi awareness
2023-01-15 12:57:42 -08:00
Eric Wasylishen
67c91353e0 Handle DPI scaling in SDL_GetWindowSurface
Fixes DPI awareness of testdrawchessboard (previously, the surface was
being created in points instead of pixels, resulting in the demo app
only drawing in a corner of the screen on High-DPI displays)

*_CreateWindowFramebuffer()/*_UpdateWindowFramebuffer(): are updated
to use SDL_GetWindowSizeInPixels instead of SDL_GetWindowSize() or
window->w/window->h.

Most of the _CreateWindowFramebuffer backends are untested except
for Windows.

Fixes #7047
2023-01-15 12:57:42 -08:00
Anonymous Maarten
6d11515873 cmake: make sdl3.pc relocatable 2023-01-15 12:37:51 -08:00
Anonymous Maarten
0a1479d58c cmake: fix sdl3.pc for Nintendo 3DS + add to test matrix 2023-01-15 17:46:36 +01:00
Anonymous Maarten
fc72ee5775 haiku: cast pointer to SDL_FunctionPointer 2023-01-14 15:25:22 +01:00
Sam Lantinga
8238a128c3 Fixed build on Steam Link hardware 2023-01-13 16:37:56 -08:00
Sam Lantinga
decbbb0499 Updated API for SDL_JoystickID sign change 2023-01-13 14:20:59 -08:00
Sam Lantinga
bf53183c8b Fixed building on Raspberry Pi 2023-01-13 14:20:57 -08:00
Sam Lantinga
0ed4589ed2 Merge commit '0785f272fd9eb9c2cb366b074b09417aeea3f3c6' into main 2023-01-13 14:20:17 -08:00
Sam Lantinga
3db5ea6b80 Merge commit 'a3ae26ddd0a34ee3f5f39311dbdf420b24d95939' into main 2023-01-13 14:20:15 -08:00
Sam Lantinga
e9406686ee Merge commit '67ddb4c5a21564edb228c51fc3c8d77aafdca618' into main 2023-01-13 14:20:12 -08:00
Sam Lantinga
0475d65635 Merge commit '40f0744b73603630d78a50c3c0026aa0aed64069' into main 2023-01-13 14:20:10 -08:00
Sam Lantinga
9a7d6b0e40 Merge commit '3d67b8d026f396af72dc0ac0d59e61449a8198c9' into main 2023-01-13 14:20:08 -08:00
Sam Lantinga
f6d1fe9d0e Merge commit 'b60084eb0b8ca4e96d2c927e4667801236f14c74' into main 2023-01-13 14:20:06 -08:00
Sam Lantinga
bfa3c0e972 Merge commit '180afcdf3998e5175b744d3f2d87147802809450' into main 2023-01-13 14:20:04 -08:00
Sam Lantinga
27059107c5 Merge commit 'c9647b4ad00ad01ba3262b74548d7e8be934ed15' into main 2023-01-13 14:20:02 -08:00
Anonymous Maarten
0785f272fd Add type argument to non-dynamic LOAD_LIBUSB_SYMBOL macro
It should not need a cast.
2023-01-13 19:31:18 +01:00
Anonymous Maarten
a3ae26ddd0 cmake: convert spaces in PTHREAD_CFLAGS to ';' 2023-01-13 19:02:54 +01:00
Sam Lantinga
67ddb4c5a2 Fixed PS2 build 2023-01-13 10:00:16 -08:00
Francisco Javier Trujillo Mata
40f0744b73 Use filesystem drivers 2023-01-13 09:59:46 -08:00
Anonymous Maarten
3d67b8d026 cmake: convert spaces in USB_CFLAGS to ';' 2023-01-13 18:40:49 +01:00
Anonymous Maarten
b60084eb0b cmake: don't quote INOTIFY_INCLUDE_DIRS 2023-01-13 18:33:51 +01:00
Frank Praznik
180afcdf39 Revert "wayland: Don't try to restore non-resizable windows"
This reverts commit e35c3872dc.
2023-01-12 17:59:50 -08:00
Sam Lantinga
c9647b4ad0 Use the symbolic names of the audio and video driver hints 2023-01-12 17:25:15 -08:00
Sam Lantinga
76e0d6a577 Merge commit '23beef4fc7e0d218e02ebbcd363adae63254c54d' into main 2023-01-12 16:21:58 -08:00
Sam Lantinga
ef9a2593ee Merge commit 'cfe2050c042ca9bd1cdb76092dabcbe5f2cc44df' into main 2023-01-12 16:21:56 -08:00
Sam Lantinga
7d454a4420 Merge commit '7c16fe6d69c487c1148dd0dab6c4fd820bc69ec7' into main 2023-01-12 16:21:54 -08:00
Sam Lantinga
4fc01c7a66 Merge commit '7516bd349c81fc113d6474dee3271dfe8439e27c' into main 2023-01-12 16:21:52 -08:00
Sam Lantinga
d3d14ff61d Merge commit '0da24479da05f5410a8583efce7194c074f0522d' into main 2023-01-12 16:21:49 -08:00
Sam Lantinga
c9ea823345 Merge commit '99ec05e2b8c517fa23adb657a66609890f335dc2' into main 2023-01-12 16:21:47 -08:00
Sam Lantinga
72408ebc2a Merge commit 'e35c3872dc6a8f7741baba8b786b202cef7503ac' into main 2023-01-12 16:21:45 -08:00
Sam Lantinga
d11fb83680 Merge commit '50f2eb7d41fbba7c82630e55ead4ecf9c32f4c69' into main 2023-01-12 16:21:43 -08:00
Sam Lantinga
746efe4597 Merge commit '8e4a39b41cf6ca9da29977a17b975f106e257593' into main 2023-01-12 16:21:41 -08:00
Sam Lantinga
c02056a0b6 Merge commit '5f39dd8a2f5418c47354f5a46c2106a16c8875c4' into main 2023-01-12 16:21:39 -08:00
Sam Lantinga
23beef4fc7 We no longer need explicit SDL_ENABLE_SYSWM_* while building SDL 2023-01-12 16:17:00 -08:00
Sam Lantinga
cfe2050c04 Default to enable/disable SDL_syswm subsystems based on enabled video drivers while building SDL 2023-01-12 16:17:00 -08:00
Sam Lantinga
7c16fe6d69 Default to use the built-in EGL definitions 2023-01-12 16:17:00 -08:00
Sam Lantinga
7516bd349c Move SDL_internal.h to be first in the file, after the copyright 2023-01-12 16:17:00 -08:00
Sam Lantinga
0da24479da Fixed building Vivante video driver 2023-01-12 16:17:00 -08:00
Sam Lantinga
99ec05e2b8 Cast the return value of SDL_LoadFunction() to the type of the function being loaded 2023-01-12 16:17:00 -08:00
Frank Praznik
e35c3872dc wayland: Don't try to restore non-resizable windows
Libdecor can crash if attempting to un-maximize a window that was not set as resizable.
2023-01-12 13:34:36 -08:00
Frank Praznik
50f2eb7d41 wayland: Perform a round trip when maximizing and restoring windows
Perform a round trip when maximizing and restoring windows so the changes have already taken effect when the associated functions return.
2023-01-12 13:34:36 -08:00
Sam Lantinga
8e4a39b41c Rename the xcFramework target to SDL.xcframework so it's clear when being embedded in other projects 2023-01-12 13:23:49 -08:00
Sam Lantinga
5f39dd8a2f Always run xcFramework and disk image creation builds when requested 2023-01-12 13:08:33 -08:00
Sam Lantinga
d1694472e2 Merge commit '6dc50a78fc4cd53b68892135c61cb130c1253277' into main 2023-01-12 12:50:41 -08:00
Sam Lantinga
986ecec436 Merge commit '1e8443f54e4ec729ce4a003e1636219702fb1de5' into main 2023-01-12 12:50:39 -08:00
Sam Lantinga
31b73d822f Merge commit '9eaea7d6614c00c865c8059a161631a2668adf12' into main 2023-01-12 12:50:37 -08:00
Sam Lantinga
fb7d8c5493 Merge commit '57e78f4cf53b0fc84900a047120263c3c71e721c' into main 2023-01-12 12:50:35 -08:00
Sam Lantinga
b71c3b7f67 Merge commit '1bf1c866fe60adba0a78e2ee24d464ede9d0369d' into main 2023-01-12 12:50:32 -08:00
Sam Lantinga
d120fd3607 Merge commit '3b2e9d98dfee969e10553648f57a9adfe7dc297d' into main 2023-01-12 12:50:30 -08:00
Sam Lantinga
da2c0242cc Merge commit '2ec9a20204ef9b1c590e64d865b31f9f213cbd8a' into main 2023-01-12 12:50:28 -08:00
Sam Lantinga
8f4ab749ec Merge commit '8bdc25f4e4529c1faf92f9586a62956501e75300' into main 2023-01-12 12:50:26 -08:00
Sam Lantinga
fdd1a7f970 Merge commit 'ed1bdf32ee5ad5f0ca503718d4b4563e7889a1a0' into main 2023-01-12 12:50:24 -08:00
Sam Lantinga
65aacde711 Merge commit '9b0c660a033cce0d14ee4efc647ec1d01b60b6e1' into main 2023-01-12 12:50:22 -08:00
Sam Lantinga
e9ce6bb546 Merge commit '21e4be5a275bdfe629982313de7f3cca08a425a8' into main 2023-01-12 12:50:20 -08:00
Sam Lantinga
74d0935e58 Merge commit 'efa2945502abb069ab8b1ba8a6ba253fa32b80cd' into main 2023-01-12 12:50:18 -08:00
Sam Lantinga
38f8b7ff87 Merge commit '439c0b023680a1cf18661336471ff405131de661' into main 2023-01-12 12:50:15 -08:00
Sam Lantinga
6dc50a78fc Fixed window never being shown on iOS 2023-01-12 12:45:55 -08:00
Anonymous Maarten
1e8443f54e cmake: only use $<COMPILE_LANGUAGE:OBJC> when CMAKE_OBJC_COMPILER is defined 2023-01-12 21:12:54 +01:00
Sylvain
9eaea7d661 SDL_migration.cocci: simplify multiplicaction / division by 1 2023-01-12 20:52:37 +01:00
happyharryh
57e78f4cf5 Fixed the hat_map to avoid segmentation fault 2023-01-12 06:55:35 -08:00
Sam Lantinga
1bf1c866fe Handle new SDL_rwops error codes in SDL_LoadFile_RW()
Thanks @BeWorld2018!
2023-01-12 06:53:07 -08:00
Sylvain
3b2e9d98df SDL_migration.cocci: migrate audio api 1.2 2023-01-12 15:01:31 +01:00
Ozkan Sezer
2ec9a20204 SDL_dynapi.c: add extern "C" guards, just in case.. 2023-01-12 14:01:32 +03:00
Sylvain
8bdc25f4e4 SDL_migration.cocci: set events 2023-01-12 11:56:49 +01:00
Sylvain
ed1bdf32ee SDL_migration.cocci: more gamepad migration 2023-01-12 11:39:48 +01:00
Sylvain
9b0c660a03 SDL_migration: various name changes, and function removed 2023-01-12 11:08:15 +01:00
Sylvain
21e4be5a27 SDL_migration: add RW read/write 2023-01-12 10:43:08 +01:00
Sylvain
efa2945502 SDL_migration.cocci: add SIMD Alloc / Free 2023-01-12 09:58:37 +01:00
Sylvain
439c0b0236 Add vulkan migration 2023-01-12 09:45:14 +01:00
Sam Lantinga
ad5c4d415d Merge commit '050507c333b0dfecb3e08604ec7ff12d5c410935' into main 2023-01-11 22:16:25 -08:00
Sam Lantinga
b963ab56a8 Merge commit '67d517907bf8662395edf88c2137b8b0bc74d9e8' into main 2023-01-11 22:16:23 -08:00
Sam Lantinga
b7c73b67a2 Merge commit '0ad22cfe37955727272333844bb80294e307007a' into main 2023-01-11 22:16:21 -08:00
Sam Lantinga
126f4a9994 Merge commit '7f610cd96946f39c89ab9f46e505944c1ced769b' into main 2023-01-11 22:16:17 -08:00
Sam Lantinga
a43f0180b3 Merge commit '555183257db81b59be532cbe3252adbbd823d1d6' into main 2023-01-11 22:16:15 -08:00
Sam Lantinga
ab977a5696 Merge commit 'd0aaf74ec0e413cc51e32febd14d59c0c4dc5b39' into main 2023-01-11 22:16:13 -08:00
Sam Lantinga
653c65cd29 Merge commit '84cd7214bdc766beffbbef79ff9df3127fb95a8d' into main 2023-01-11 22:16:11 -08:00
Sam Lantinga
80a9542405 Merge commit '30516fd3a69a508e883afa59ef7a88e13b93a24c' into main 2023-01-11 22:16:09 -08:00
Sam Lantinga
1ea973d5d2 Merge commit 'f046788a5a76302da79e921222dfb544bc6c9bee' into main 2023-01-11 22:16:07 -08:00
Sam Lantinga
21b121b6df Merge commit '85924687fd5d53a58f5e3cf7bf3479b0c0587674' into main 2023-01-11 22:16:04 -08:00
Sam Lantinga
ff36830ead Merge commit '0621a673502e56a24caa129051270b4a55363ad9' into main 2023-01-11 22:16:02 -08:00
Sam Lantinga
050507c333 Fail the xcFramework build if the archive didn't succeed 2023-01-11 16:48:55 -08:00
Anonymous Maarten
67d517907b log: fix unused-variable warning when configuring SDL with -DSDL_LIBC=OFF 2023-01-11 16:31:27 -08:00
Sam Lantinga
0ad22cfe37 Fixed version validation 2023-01-11 15:11:41 -08:00
Francisco Javier Trujillo Mata
7f610cd969 Using UV instead of STQ 2023-01-11 15:10:51 -08:00
Francisco Javier Trujillo Mata
555183257d Remove dummy flag 2023-01-11 15:10:51 -08:00
Sam Lantinga
d0aaf74ec0 Added an xcframework target to cover all supported Apple platforms
This is also used to create the release disk image
2023-01-11 14:41:30 -08:00
Sylvain
84cd7214bd SDL_migration.cocci / rename_api.py: handle migration of enum/structure
and fix previous one in SDL_migration.cocci.
2023-01-11 23:33:14 +01:00
Ozkan Sezer
30516fd3a6 joystick/vita: add some sanity check to SDL_GetJoystickInstanceID result
Reference issue: https://github.com/libsdl-org/SDL/issues/7051
2023-01-11 21:56:50 +03:00
Ozkan Sezer
f046788a5a joystick/vita: fix index value use returned by SDL_GetJoystickInstanceID
Reference issue: https://github.com/libsdl-org/SDL/issues/7051
2023-01-11 21:56:50 +03:00
Ozkan Sezer
85924687fd fix SDL_GetSensorInstanceID() return code upon failure.
Reference issue: https://github.com/libsdl-org/SDL/issues/7051
2023-01-11 21:56:50 +03:00
Ozkan Sezer
0621a67350 fix SDL_GetJoystickInstanceID() return code upon failure
Reference issue: https://github.com/libsdl-org/SDL/issues/7051
2023-01-11 21:56:50 +03:00
Sam Lantinga
2597dc0157 Merge commit '21a1508cebe897d141be13711c580fcb9e082ef2' into main 2023-01-10 21:26:13 -08:00
Sam Lantinga
d7e9e5b3b1 Merge commit '0ead89747ade602c8162e1bef7087dac6c04ad82' into main 2023-01-10 21:26:11 -08:00
Sam Lantinga
429ac88266 Merge commit '9c7aed74ba70e73b429316c4ace7bc9e99103c08' into main 2023-01-10 21:26:09 -08:00
Sam Lantinga
fa494fbf5f Merge commit '95faeab96c803d5e18a1864326916c051273e003' into main 2023-01-10 21:26:07 -08:00
Sam Lantinga
21a1508ceb Re-add JNI_OnLoad to the symbols list so Android symbols are resolved properly 2023-01-10 21:15:21 -08:00
Sam Lantinga
0ead89747a Fixed filename comment in SDL_intrin.h 2023-01-10 21:05:38 -08:00
Wohlstand
9c7aed74ba SDLAudioManager.java: Fixed the support for Android older than API 23
(cherry picked from commit b425036808)
2023-01-10 20:15:59 -08:00
Sam Lantinga
95faeab96c SDL_GetNumJoysticks() and SDL_GetNumSensors() are no longer in the API 2023-01-10 18:07:40 -08:00
Sam Lantinga
a73e5d8f8d Merge commit '237086c91702e77d3b2882f4baf0c75f6a1b711e' into main 2023-01-10 16:27:02 -08:00
Sam Lantinga
aaa8cd02a1 Merge commit 'dc280c17a03d9acf0ff0e850662351c822c2eda6' into main 2023-01-10 16:26:59 -08:00
Sam Lantinga
4efad40157 Merge commit '9f721d492a19ed92f099602c450576935eb00b46' into main 2023-01-10 16:26:57 -08:00
Sam Lantinga
237086c917 Fixed Xcode 14.2 warnings 2023-01-10 15:51:14 -08:00
Sam Lantinga
dc280c17a0 Moved SDL_intrin.h back into the public headers for application use 2023-01-10 15:50:35 -08:00
Sam Lantinga
9f721d492a Catch SDL_opengles2.h in rename_headers.py 2023-01-10 15:25:48 -08:00
Sam Lantinga
769985a9e1 Merge commit '69b94145d32e67c9c2187caab183f6ee8680064c' into main 2023-01-10 10:19:08 -08:00
Sam Lantinga
dcb283dce1 Merge commit 'c4b471bd1314933fd726ef987d96c92c68033f99' into main 2023-01-10 10:19:05 -08:00
Sam Lantinga
b4fac46b8a Merge commit 'ecc48b882df9b819fb4079184bbf2b0c11a0523f' into main 2023-01-10 10:19:03 -08:00
Sam Lantinga
41ef6ef810 Merge commit '5066fcde69919926e3f178fb1a01e0cc66aa8b14' into main 2023-01-10 10:19:01 -08:00
Sam Lantinga
1a18e9b7c2 Merge commit '413af2f5f166649a4f12419c9125837381f3547c' into main 2023-01-10 10:18:59 -08:00
Sam Lantinga
d401e1ed2f Merge commit '38b35a3414910df342a9aa0050002ebbc6ffcc5b' into main 2023-01-10 10:18:57 -08:00
Sam Lantinga
5ac57b20cb Merge commit '56522034db321676fd2d665d27e5aeac0c2383f9' into main 2023-01-10 10:18:55 -08:00
Sam Lantinga
3cf76e2581 Merge commit '9fa55d9cabc93532cd5cf44105ec589a4db1d097' into main 2023-01-10 10:18:53 -08:00
Sam Lantinga
a26f810dd8 Merge commit '2aa9569b3e3dacce9338fb6964c953217d02ff65' into main 2023-01-10 10:18:51 -08:00
Sam Lantinga
45950b476d Merge commit '9597c482facce811f1f96eee346c12e8f41b2abd' into main 2023-01-10 10:18:49 -08:00
Sam Lantinga
89d8b0372d Merge commit 'a486d0e2b2985141bb1e1e9945cfc32890bfa6cd' into main 2023-01-10 10:18:46 -08:00
Sam Lantinga
d44c86e443 Merge commit '049e6ff4085cdfbb311d08afc8699e1dcffffab0' into main 2023-01-10 10:18:44 -08:00
Sam Lantinga
f890f97286 Merge commit '837416ef8508c2abda02da8b8c2fe4d1a877e78a' into main 2023-01-10 10:18:42 -08:00
Sam Lantinga
def4d03c3f Merge commit 'aa7fdd6624645d152c498372b600d5a309293be4' into main 2023-01-10 10:18:40 -08:00
Sam Lantinga
bec108a254 Merge commit '0ab99ffb2a9a887a2db30d29e917638d90a96747' into main 2023-01-10 10:18:38 -08:00
Sam Lantinga
db1ff457d0 Merge commit 'f85ef6fc3cc51e641231db478783725e0ea86937' into main 2023-01-10 10:18:36 -08:00
Sam Lantinga
4354174865 Merge commit '5ed00d34aa248c3af60ba26a0a74866a15bdb704' into main 2023-01-10 10:18:34 -08:00
Sam Lantinga
053c377893 Merge commit 'e9b86eebf3018dd3653af53fc47cb772ab85059f' into main 2023-01-10 10:18:32 -08:00
Sam Lantinga
40b45970ef Merge commit '7275b2b3522cde90841b239bc61e4494f142d514' into main 2023-01-10 10:18:29 -08:00
Sam Lantinga
7da95766b5 Merge commit '5feebcdce0252f6af7c21c2aa7525134c09b5002' into main 2023-01-10 10:18:27 -08:00
Sam Lantinga
bd98f8fef4 Merge commit 'fde78d12f247a776b52b007479e5274d4bd4e3fe' into main 2023-01-10 10:18:23 -08:00
Sam Lantinga
f092f5982c Merge commit '78ccadd5a22bd60c015598fa0abad92705d5ea0f' into main 2023-01-10 10:18:21 -08:00
Sam Lantinga
f393f65104 Merge commit '504bce5187830c082cb8803fe9447b4fb45fcccc' into main 2023-01-10 10:18:19 -08:00
Sam Lantinga
b61a819e0c Merge commit 'c663e6d568a1bcb096df3ff072f1b9306980ab73' into main 2023-01-10 10:18:17 -08:00
Sam Lantinga
56ad16fb7b Merge commit 'dbd4b88abce852bb11d850333f28c66681cb5530' into main 2023-01-10 10:18:15 -08:00
Sam Lantinga
81c3343d04 Merge commit '40833d25262552fe96dec5acd3870d79f08f1456' into main 2023-01-10 10:18:12 -08:00
Sam Lantinga
8cd08097d9 Merge commit '59308cb3e99c104692b55156883cd89c2aa84699' into main 2023-01-10 10:18:10 -08:00
Sam Lantinga
60cff229c8 Merge commit '62297e7da506e767de678c8aab4efdfd2fc38c89' into main 2023-01-10 10:18:08 -08:00
Sam Lantinga
2c5b384dce Merge commit '607ddd0e101d6b0867036e5c48b0f854d553edce' into main 2023-01-10 10:18:06 -08:00
Sam Lantinga
85d6fb280a Merge commit '4798c36197d403fbb97cd4853fa109d1b0b77d62' into main 2023-01-10 10:18:04 -08:00
Sam Lantinga
69b94145d3 Updated documentation for SDL_migration.cocci
Especially note that this can be installed and run in WSL on Windows
2023-01-10 07:54:18 -08:00
Anonymous Maarten
c4b471bd13 Ensure training new line in cocci files 2023-01-10 16:43:15 +01:00
Anonymous Maarten
ecc48b882d migration: change 2nd arg of SDL_CreateRenderer to NULL if it was -1 2023-01-10 16:11:22 +01:00
Sylvain Becker
5066fcde69 Add SDL_migration.cocci for SDL2 to 3 migration (#7042)
* Add SDL_migration.cocci for SDL2 to 3 migration
2023-01-10 15:25:00 +01:00
Elad Lahav
413af2f5f1 Addressed comments 2023-01-10 06:19:40 -08:00
Elad Lahav
38b35a3414 Allow the use of posix_spawn() instead of vfork/execlp() 2023-01-10 06:19:40 -08:00
Sam Lantinga
56522034db Fixed building with Visual Studio 2010 2023-01-09 18:30:23 -08:00
Narr the Reg
9fa55d9cab hidapi: switch: Add user calibration support 2023-01-09 18:07:54 -08:00
Sam Lantinga
2aa9569b3e Replaced SDL_SIMDAlloc(), SDL_SIMDRealloc(), and SDL_SIMDFree() with SDL_aligned_alloc() and SDL_aligned_free()
Fixes https://github.com/libsdl-org/SDL/issues/5641
2023-01-09 18:01:59 -08:00
Anonymous Maarten
9597c482fa ci: add haiku to ci matrix 2023-01-10 02:39:09 +01:00
Anonymous Maarten
a486d0e2b2 ci: rename *.yaml -> *.yaml 2023-01-10 02:39:09 +01:00
Anonymous Maarten
049e6ff408 cmake: haiku uses CXX code, so enable it in C-only project 2023-01-10 02:39:09 +01:00
Anonymous Maarten
837416ef85 cmake: command-line option ‘-Wdeclaration-after-statement’ is valid for C/ObjC but not for C++ 2023-01-10 02:39:09 +01:00
Anonymous Maarten
aa7fdd6624 haiku: remove unused variable in SDL_BApp.h 2023-01-10 02:39:09 +01:00
Anonymous Maarten
0ab99ffb2a cmake: add SDL_TESTS_TIMEOUT_MULTIPLIER to account for slower machines 2023-01-10 02:39:09 +01:00
Anonymous Maarten
f85ef6fc3c haiku: fix use of SDL_ConvertSurfaceFormat 2023-01-10 02:39:09 +01:00
Sam Lantinga
5ed00d34aa Document that condition variable mutexes can't be locked recursively.
Fixes https://github.com/libsdl-org/SDL/issues/5497
2023-01-09 15:59:39 -08:00
Sam Lantinga
e9b86eebf3 Functions which return function pointers now return SDL_FunctionPointer instead of void*
This fixes the clang warning "Cast between pointer-to-function and pointer-to-object is an extension"

You can define SDL_FUNCTION_POINTER_IS_VOID_POINTER in your project to restore the previous behavior.

Fixes https://github.com/libsdl-org/SDL/issues/2866
2023-01-09 15:46:21 -08:00
Sylvain
7275b2b352 SDL_GetTicks64: entry added in SDL_ENABLE_OLD_NAMES 2023-01-09 21:59:50 +01:00
Sam Lantinga
5feebcdce0 SDL_AddHintCallback() now returns a standard int result instead of void
Fixes https://github.com/libsdl-org/SDL/issues/7035
2023-01-09 12:09:30 -08:00
Sam Lantinga
fde78d12f2 Updated copyright for 2023 2023-01-09 09:41:41 -08:00
Sam Lantinga
78ccadd5a2 Speed up processing of update-copyright.sh 2023-01-09 09:38:36 -08:00
Sam Lantinga
504bce5187 Set SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS for the virtual joystick test 2023-01-09 09:16:10 -08:00
Sam Lantinga
c663e6d568 Revert "Always allow controller events for virtual joysticks regardless of focus state"
This reverts commit d94f2a9ee5.

Rather than changing behavior, we'll set SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS in the joystick tests
2023-01-09 09:05:40 -08:00
Sam Lantinga
dbd4b88abc Generally removed generally 2023-01-09 09:04:05 -08:00
Sam Lantinga
40833d2526 Documented thread starvation issue raised in https://github.com/libsdl-org/SDL/pull/7023 2023-01-09 09:01:41 -08:00
Sam Lantinga
59308cb3e9 SDL_platform_defines.h is already included in SDL_platform.h 2023-01-09 08:40:11 -08:00
Anonymous Maarten
62297e7da5 cmake: avoid string(SUBSTRING) on short strings
CMake 3.1 and older throws an error when the input string is too short
2023-01-09 15:44:50 +01:00
Sylvain Becker
607ddd0e10 Merge pull request #7033 from 1bsyl/br_oldname_gettick64
Add oldname entry: GetTicks64() is renamed GetTicks()
2023-01-09 13:44:53 +01:00
Sylvain
4798c36197 Add oldname entry: GetTicks64() is renamed GetTicks() 2023-01-09 13:43:39 +01:00
yuanhecai
50af65a7dd Fix loongarch64 support
HAS_LSX/LASX is modified as HAVE_LSX/LASX.
2023-01-09 09:11:50 +01:00
Ozkan Sezer
0d8c22acd2 cmake (CheckPTHREAD): remove _GNU_SOURCE define after bug #7026 fix 2023-01-09 01:30:37 +03:00
Sylvain
a486eeccf4 Remove one test that contains call of SDL_Quit() / SDL_Init() because it
conficts with the initializaion of test common.
(before it used SDL_VideoInit SDL_VideoQuit which weren't perturbated by SDL_Quit())
2023-01-08 12:39:23 -08:00
Anonymous Maarten
f91a747549 include: SDL_dynapi.h depends on platform defines 2023-01-08 21:37:54 +01:00
Sam Lantinga
d94f2a9ee5 Always allow controller events for virtual joysticks regardless of focus state
Refrence https://github.com/libsdl-org/SDL/pull/7024
2023-01-08 10:48:46 -08:00
Anonymous Maarten
61f76efb85 cmake: do all compile tests with -D_GNU_SOURCE=1 2023-01-08 19:07:58 +01:00
Sam Lantinga
ac99db9fc8 Fixed infinite loop shutting down WGI controllers
We are guaranteed that the lock will be held during shutdown, so if we are in InvokeRemoved(), it's because we're shutting down controllers and need to remove them from our internal list.

Fixes https://github.com/libsdl-org/SDL/issues/7016
2023-01-08 09:35:17 -08:00
Anonymous Maarten
f53d797cca cmake: generate git hash using GetRevisionDescription CMake module
This allows the build system (ninja/make/VS) to detect whether the current
checkout git commit has changed. If so, SDL_revision.h will be updated.
2023-01-08 18:20:56 +01:00
Ozkan Sezer
d4f7b0aa0e cmake: added missing INTERFACE to target_compile_definitions 2023-01-08 19:41:32 +03:00
Sam Lantinga
9ffeae7b58 Added a migration note for SDL_Vulkan_GetInstanceExtensions() 2023-01-08 07:59:14 -08:00
Hunter Kvalevog
a2b2464b46 SDL_Vulkan_GetInstanceExtensions: Require Vulkan
Document that this function will fail if the user doesn't call
SDL_Vulkan_LoadLibrary (either explicitly or via SDL_CreateWindow)
beforehand.
2023-01-08 07:55:34 -08:00
Hunter Kvalevog
0953367967 SDL_Vulkan_GetInstanceExtensions: Remove window
Remove the unused `window` parameter from
SDL_Vulkan_GetInstanceExtensions, which is never used by any of the
backends.
2023-01-08 07:55:34 -08:00
Anonymous Maarten
c8286fc9a2 testevdev: cannot test evdev capabilities without linux input
Configure with "-DSDL_LIBC=OFF" to get this configuration.
2023-01-08 07:29:40 -08:00
Anonymous Maarten
1d60030e84 cmake: add -Wformat when checking -Wformat-extra-args
The need for -Wformat when using -Wformat-extra-args was observed for
the msys2 mingw64 gcc toolchain.
2023-01-08 15:57:51 +01:00
Anonymous Maarten
e85e11b211 cmake: avoid adding full path to SDL_EXTRA_LIBS
This avoids placing e.g. -l/path/to/libX11.so in sdl3.pc when configuring with -DSDL_X11_SHARED=OFF
2023-01-08 15:57:51 +01:00
Anonymous Maarten
dfcd8d5835 cmake: remove unused function 'listtostrrev' 2023-01-08 15:57:51 +01:00
Anonymous Maarten
77025417dd cmake: add SDL_ prefix to EXTRA_LIBS/EXTRA_LDFLAGS 2023-01-08 15:57:51 +01:00
Anonymous Maarten
bffbfa572c cmake: rename SDL_STATIC_LIBS -> SDL_PC_STATIC_LIBS 2023-01-08 15:57:51 +01:00
Anonymous Maarten
2f1860cfc6 cmake: add sdl-shared-build-options target to collect SDL shared library flags 2023-01-08 15:57:51 +01:00
Anonymous Maarten
0003559adf cmake: handle macos current and compatibility version through VERSION/SOVERSION properties 2023-01-08 15:57:51 +01:00
Anonymous Maarten
053c37583c cmake: avoid modifying CMAKE_C_FLAGS 2023-01-08 15:57:51 +01:00
Anonymous Maarten
8fc445c730 cmake: SDL3 does not need -lmingw32 anymore because SDL_main has gone 2023-01-08 15:57:51 +01:00
Anonymous Maarten
562a8209d8 cmake: HAVE_LINUX_VERSION_H is unused 2023-01-08 15:57:51 +01:00
Anonymous Maarten
5555284a70 cmake: use target_compile_options to use -idirafter for khronos headers 2023-01-08 15:57:51 +01:00
Anonymous Maarten
4d9ee735fd cmake: SIZEOF_VOIDP, LIBNAME and LIBTYPE are not used 2023-01-08 15:57:51 +01:00
Anonymous Maarten
0a4420e02f cmake: rename cmake variables to include _PC_ as they are meant for pkgconfig file 2023-01-08 15:57:51 +01:00
Anonymous Maarten
373a6464c8 cmake: collect cflags in sdl-build-options and sdl-global-options 2023-01-08 15:57:51 +01:00
Anonymous Maarten
fb80608fff cmake: use cmake <LANG>_VISIBILITY_PRESET property to pass -fvisibility=hidden 2023-01-08 15:57:51 +01:00
Anonymous Maarten
87af5cfc9f cmake: HAVE_GCC_PREFERRED_STACK_BOUNDARY is not used anymore 2023-01-08 15:57:51 +01:00
Anonymous Maarten
d73b9fec1e cmake: target_compile_definitions does not need -D prefix 2023-01-08 15:57:51 +01:00
Sylvain Becker
1277c7784d Merge pull request #7022 from 1bsyl/br_test_mouse
Fix testautomation_mouse:
2023-01-08 13:44:49 +01:00
Sylvain
51ae7cc35c Fix testautomation_mouse:
FLT_MIN is positive and very small. we want -FLT_MAX here.
2023-01-08 13:28:10 +01:00
Anonymous Maarten
ec14487e1d unix/SDL_systimer.c: add ';' to statement 2023-01-08 01:04:06 +01:00
Sylvain
cbe01319e0 Fix testautomation_pixels using really invalid pixel format 2023-01-07 10:11:02 -08:00
Sylvain
76e1c7c509 Fix testautomation_pixels:
we can create all pixel format, including SDL_PIXELFORMAT_UNKNOWN (as before).
2023-01-07 09:46:41 -08:00
Sam Lantinga
7f0801377b Separate wmain() and main() implementations
Fixes https://github.com/libsdl-org/SDL/issues/7010
2023-01-07 08:28:07 -08:00
Ozkan Sezer
ca541789ea cmake: check for math library functions even in the absence of libm
(Reference issue: https://github.com/libsdl-org/SDL/issues/7011)
2023-01-07 14:25:04 +03:00
Ozkan Sezer
5ea06f487d cmake: fix detection of library functions when -Werror is enabled.
(Reference issue: https://github.com/libsdl-org/SDL/issues/7011)
2023-01-07 14:25:04 +03:00
Ozkan Sezer
0f9b923ff4 cmake: fix detection of math library functions.
Fixes https://github.com/libsdl-org/SDL/issues/7011
2023-01-07 14:25:04 +03:00
Sam Lantinga
5a2a91cb05 Fixed compile warnings with unused parameters 2023-01-06 16:24:20 -08:00
Sylvain
13ab100317 Fixed bug #6990: fix computation of alpha in BlitRGBtoRGBPixelAlphaMMX
backport from SDL2 branch
2023-01-06 21:29:01 +01:00
Sam Lantinga
5dd07a5773 The alloc_size attribute isn't supported in clang 3.x 2023-01-06 12:10:21 -08:00
Sam Lantinga
6b5855e990 Removed SDL_REVISION_NUMBER 2023-01-06 09:53:18 -08:00
Sylvain
93e2903ac5 Add SDL_PlayAudioDevice() to play audio. Remove pause_on param from SDL_PauseAudioDevice() 2023-01-06 09:15:39 -08:00
Sam Lantinga
26be384801 SDL_syswm.h provides the platform specific types by default again
You can enable and disable subsystems with SDL_ENABLE_SYSWM_*/SDL_DISABLE_SYSWM_* and you can disable the type forward declarations with SDL_DISABLE_SYSWM_*_TYPES
2023-01-05 23:50:37 -08:00
Frank Praznik
230ad2a201 wayland: Handle modifier keys internally
Modifier keys on Wayland can be remapped, latched/locked, and defer the system modifier state changes to key release events instead of key press events, which the default SDL modifier handling code doesn't deal with correctly. Track and set the modifier keys internally to deal with the plethora of various combinations that the system key modifiers can be in and correctly reflect the actual system state to SDL applications.
2023-01-05 10:39:19 -08:00
Frank Praznik
d2917918c0 events: Add function to send keystrokes and not update the modifier state
Add SDL_SendKeyboardKeyIgnoreModifiers() function and repurpose the source parameter for the SDL_SendKeyboardKeyInternal() function to use as a generic set of keyboard flags.
2023-01-05 10:39:19 -08:00
Matt Durgavich
59ad6793b9 Fix For issue #6948 (#6991)
MessageBoxes attached to a window in macOS should use modal APIs and not
use a poll/sleep pattern on the main thread. Sleeping the main thread
makes the NSWindow message loop sluggish and interferes with external
applications that need to send messages to that window, such as
VoiceOver.
2023-01-05 08:54:27 -08:00
Sylvain
2d7f8d7d51 Remove legacy SDL_Audio functions that acts on device id == 1 2023-01-05 09:40:06 -05:00
Sam Lantinga
bb34441474 Provide a better real-world example of the SDL_RWread() API change 2023-01-05 00:48:44 -08:00
Sam Lantinga
228d9ae791 rename_headers.py covers begin_code.h/close_code.h 2023-01-04 23:50:08 -08:00
Sam Lantinga
c93f2f06c9 Updated release_checklist.md for SDL 3.0 2023-01-04 23:47:01 -08:00
Sam Lantinga
51a80d03ce Be really explicit about needing to check for negative error codes with SDL_RWread() 2023-01-04 22:29:45 -08:00
Guldoman
5a42831345 wayland: Fallback to default cursor if chosen one wasn't found 2023-01-04 21:28:26 -08:00
Sam Lantinga
0bbf6cc379 Test text rendering APIs take floating point coordinates 2023-01-04 16:45:02 -08:00
Sam Lantinga
0901657278 Document renamed API functions in SDL_keyboard.h 2023-01-04 15:41:35 -08:00
Sam Lantinga
1dc119c316 Removed functions from SDL_oldnames.h that are no longer in the API 2023-01-04 14:53:29 -08:00
Sam Lantinga
4f978456a8 Renamed SDL_GAMEPADDEVICEREMAPPED to SDL_GAMEPADREMAPPED 2023-01-04 14:32:37 -08:00
Sam Lantinga
28b22e3f9b Removed functions from SDL_oldnames.h that are no longer in the API 2023-01-04 14:03:33 -08:00
Deve
eddaf870f5 Avoid textinput events when pasting from clipboard on iOS.
I handle command+C and command+V shortcuts for copy/paste from clipboard using
SDL_GetClipboardText/SDL_SetClipboardText. But on iOS command+V shortcut is
also handled by system, so that I also get textinput event with that clipboard
text. And thus the application gets this clipboard text twice (from
SDL_GetClipboardText and from textinput event).

I assume that intended behavior is that command+V shouldn't generate textinput
events. At least as far as I know ctrl+V on other platforms does nothing. This
commit disables paste action for UITextField, so that textinput event isn't
generated anymore.
2023-01-04 13:52:15 -08:00
Sam Lantinga
c823f26f18 Revert "Removed public joystick locking API"
This reverts commit a515f51ac0.

We still need joystick locking to protect the gamepad mappings
2023-01-04 13:51:40 -08:00
Sam Lantinga
566a559beb Fixed parsing symbols from SDL_oldnames.h 2023-01-04 13:51:00 -08:00
Sam Lantinga
e76c1d74bc Added a python script to rename SDL2 headers to SDL3 headers 2023-01-04 11:20:38 -08:00
Sam Lantinga
6084d60c66 Removed QtCreator entries from .gitignore
We don't use QtCreator in the SDL project, and it matches the build-scripts directory
2023-01-04 11:18:18 -08:00
Sam Lantinga
406c8b79fe rename_symbols: only write new file if contents have changed
Also don't stop for other exceptions, just print them and keep going
2023-01-04 10:40:30 -08:00
Sylvain
6863f0b2d8 Add SDL_WindowID type for SDL_Window id 2023-01-04 09:21:52 -08:00
Sam Lantinga
86c6376140 Fixed integral constant overflow 2023-01-04 08:54:46 -08:00
Sam Lantinga
5fab64f862 Fixed documentation errors in testautomation_render.c 2023-01-03 16:44:00 -08:00
Sam Lantinga
6cfe4f2ba8 Fixed documentation errors in testautomation_math.c 2023-01-03 16:44:00 -08:00
Sam Lantinga
aaaf7423ac Fixed build 2023-01-03 16:17:10 -08:00
Sam Lantinga
39852241ef Added -Wdocumentation to CMake clang build 2023-01-03 15:58:48 -08:00
Sam Lantinga
32c077216c Fixed warnings 2023-01-03 15:59:35 -08:00
Sam Lantinga
95e5417d2e Fixed documentation warnings 2023-01-03 15:39:11 -08:00
Sam Lantinga
49af0d1b89 Fixed build 2023-01-03 15:35:18 -08:00
Sam Lantinga
0357390fc2 Added support for the ThrustMaster eSwap PRO Controller Xbox 2023-01-03 15:23:38 -08:00
Sam Lantinga
e85839cd56 Fixed line wrapping for HID packet dump 2023-01-03 15:12:47 -08:00
Sam Lantinga
dacdb1c310 Added support for the ThrustMaster eSwap PRO Controller Xbox 2023-01-03 15:12:18 -08:00
Sam Lantinga
71f3bf90ed Improved handling of binding buttons and axes 2023-01-03 12:47:40 -08:00
Sam Lantinga
1d956c2817 Rename SDL2 tests for SDL3 2023-01-03 11:54:35 -08:00
Sylvain
86658f2ca7 Wayland / Drag and Drop: find the current window 2023-01-03 08:18:08 -08:00
Sam Lantinga
9c1a9ecb4b Removed non-float versions of SDL render API drawing functions
This simplifies the API and removes a level of API translation between the int variants of the functions and the float implementation

Fixes https://github.com/libsdl-org/SDL/issues/6656
2023-01-03 08:16:58 -08:00
Sylvain
bf76fc6b05 Fixed bug #6816 - SDL_RenderSetVSync doesn't disable vsync for software renderer 2023-01-03 06:38:11 -08:00
Sam Lantinga
38b138cd0a Fixed rounding of floating point values in snprintf 2023-01-03 06:35:25 -08:00
Sam Lantinga
72f0056961 Simulate NTSC timings for Windows desktop display modes 2023-01-03 06:35:25 -08:00
Sam Lantinga
b06e310c08 Fixed spinning rendering too fast 2023-01-03 06:35:25 -08:00
Sam Lantinga
e3c1749f5b The refresh rate in SDL_DisplayMode is now a float 2023-01-03 06:35:25 -08:00
Sylvain Becker
851b0e16be Add SDL_GetRenderVSync (see #6495) (#6965) 2023-01-02 11:21:02 -08:00
Sylvain Becker
023f067903 Update GL_GetSwapInterval for backends (#6963) 2023-01-02 10:15:05 -08:00
Sam Lantinga
d764de77d4 Include SDL_audio.h for SDL_AudioDeviceID definition
Fixes https://github.com/libsdl-org/SDL/issues/6971
2023-01-02 09:08:44 -08:00
Mathieu Eyraud
fa5475ba9f Fix joystick instance id check 2023-01-02 09:04:18 -08:00
Mathieu Eyraud
ea6f0ae683 Fix use after free in SDL_GetGamepads 2023-01-02 09:03:49 -08:00
Sylvain Becker
5cf55c4f28 Merge pull request #6969 from meyraud705/meyraud705-yuv_leak
Fix memory leak in SDL_SW_CreateYUVTexture
2023-01-02 17:46:12 +01:00
Mathieu Eyraud
721ece7ba0 Fix memory leak in SDL_SW_CreateYUVTexture 2023-01-02 10:22:44 +01:00
Sylvain Becker
9148c89d23 Merge pull request #6964 from 1bsyl/br_android_orientation_bug
Br android orientation bug
2023-01-02 09:44:42 +01:00
Sylvain
4408e9f957 Android: orientation, check for exact match to "Portrait". (see #6959)
(Portrait is also contained in PortraitUpsideDown)
2023-01-01 18:47:13 +01:00
Sylvain
c4982955b2 Android: inverse LandscapeLeft and LandscapeRight (see #6959)
LandscapeLeft has now been set to ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE and LandscapeRight to ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE in order to reflect the docs: https://wiki.libsdl.org/SDL2/SDL_HINT_ORIENTATIONS
2023-01-01 18:41:55 +01:00
Sylvain Becker
8a13533949 Handle error return value for SDL_GetSwapInterval 2023-01-01 08:20:41 -08:00
Sam Lantinga
a515f51ac0 Removed public joystick locking API
All joystick functions are thread-safe and you can now get an atomic list of joysticks with SDL_GetJoysticks()

Fixes https://github.com/libsdl-org/SDL/issues/6956
2022-12-31 09:24:14 -08:00
Ryan C. Gordon
87c8e2b942 README-migration: Added backticks to avoid markdown highlighting. 2022-12-31 01:12:10 -05:00
Ozkan Sezer
321c30db57 windows: more HANDLE -> HMODULE changes. 2022-12-31 08:00:00 +03:00
Ozkan Sezer
929da2c28e SDL_dynapi.c: LoadLibraryA() returns HMODULE. 2022-12-30 11:11:10 +03:00
Sam Lantinga
324c0b76a0 Removed SDL_HasGamepads(), SDL_HasJoysticks(), and SDL_HasSensors()
Also cleaned up logic for whether we need to poll for events:
- We need to periodically poll for joysticks to handle hotplug.
- We need to frequently poll for joysticks and sensors when they're open so their state can be updated
2022-12-29 23:20:26 -08:00
Sam Lantinga
7f23d71b6a Added SDL_modf() and SDL_modff()
This function is useful for accumulating relative mouse motion if you want to only handle whole pixel movement.
e.g.
static float dx_frac, dy_frac;
float dx, dy;

/* Accumulate new motion with previous sub-pixel motion */
dx = event.motion.xrel + dx_frac;
dy = event.motion.yrel + dy_frac;

/* Split the integral and fractional motion, dx and dy will contain whole pixel deltas */
dx_frac = SDL_modff(dx, &dx);
dy_frac = SDL_modff(dy, &dy);
if (dx != 0.0f || dy != 0.0f) {
    ...
}
2022-12-29 23:12:19 -08:00
Sam Lantinga
ead4f122e4 Added basic support for %g snprintf format specifier 2022-12-29 23:12:19 -08:00
Sam Lantinga
cefbeb582f Mouse coordinates are floating point
You can get sub-pixel mouse coordinates and motion depending on the platform and display scaling.

Fixes https://github.com/libsdl-org/SDL/issues/2999
2022-12-29 23:12:19 -08:00
Sam Lantinga
8c3239dee5 Fixed documentation warning 2022-12-29 22:10:35 -08:00
Daniel Gibson
ac8a041541 SDL_main for Win32: Get rid of console_*main, add wWinMain()
I don't think there's any point in console_*main() for non-MSVC - I think
it can't be called anyway now that SDL_main is header-only.
So I renamed those functions to main() and wmain() and made them MSVC-only

For reference, MinGW (at least the version I tested) supports both main()
and WinMain(), no matter if compiled with -mconsole or -mwindows (it seems
to prefer main() over WinMain() if both are available, in both cases).
But when building with -municode, it needs wmain() or wWinMain(), so
that case is now handled with wWinMain()
2022-12-29 21:50:58 -08:00
Sam Lantinga
98678b5d8d SDL API renaming: SDL_Alloc*/SDL_Free* -> SDL_Create*/SDL_Destroy*
Fixes https://github.com/libsdl-org/SDL/issues/6945
2022-12-29 15:07:15 -08:00
Sam Lantinga
e1bd5bd071 Fixed keyboard scancode mapping for parenthesis
(thanks to @meyraud705 for tracking down the root cause!)

Fixes https://github.com/libsdl-org/SDL/issues/6787
Closes https://github.com/libsdl-org/SDL/pull/6937
2022-12-29 14:55:18 -08:00
Sam Lantinga
1b90107fdb Spell out "Float" in function names 2022-12-29 14:50:31 -08:00
Sylvain Becker
d7d3c22dbf Remove more reserved identifiers (#6925) 2022-12-29 13:58:16 -08:00
Sam Lantinga
ce412c2c71 Consistency cleanup for README-migration.md 2022-12-29 10:44:54 -08:00
Ryan C. Gordon
138f632b59 include: Add a comment about reserving a bit for sdl2-compat. 2022-12-29 13:34:53 -05:00
Anonymous Maarten
7150d6b05a cmake: add SDL3 to include path
This reverts parts of 9f2ca87
2022-12-29 09:01:56 -08:00
Sylvain
88630b85f5 SDL_GL_SwapWindow() returns an error code 2022-12-29 08:40:51 -08:00
Sam Lantinga
abd051f89e Re-sorted SDL 3.0 API list 2022-12-28 19:55:19 -08:00
Sam Lantinga
80890f3aae SDL API renaming: SDL_render.h
Fixes https://github.com/libsdl-org/SDL/issues/6883
2022-12-28 19:40:25 -08:00
Sam Lantinga
ea0c2f55be SDL API renaming: *Is* functions
Feedback from @icculus:
"IsTablet" uses "is" as a form of "to be" ...like, the actual question is of its nature.

The rest is just a superfluous word in the question and it flows as better English with if (RectEmpty) than if (IsRectEmpty)

Fixes https://github.com/libsdl-org/SDL/issues/6932
2022-12-28 19:40:25 -08:00
Sam Lantinga
66351fd4ba Replace tri-state functions SDL_EventState(), SDL_GetJoystickEventState(), SDL_GetGamepadEventState(), SDL_ShowCursor()
`SDL_QUERY`, `SDL_IGNORE`, `SDL_ENABLE`, and `SDL_DISABLE` have been removed.

SDL_EventState() has been replaced with SDL_SetEventEnabled()
SDL_GetEventState() has been replaced with SDL_EventEnabled()
SDL_GameControllerEventState has been replaced with SDL_SetGamepadEventsEnabled() and SDL_GamepadEventsEnabled()
SDL_JoystickEventState has been replaced with SDL_SetJoystickEventsEnabled() and SDL_JoystickEventsEnabled()

SDL_ShowCursor() has been split into three functions: SDL_ShowCursor(), SDL_HideCursor(), and SDL_CursorVisible()

Fixes https://github.com/libsdl-org/SDL/issues/6929
2022-12-28 17:49:34 -08:00
Sam Lantinga
9b8208c195 Updated add_symbol_to_oldnames 2022-12-28 17:49:34 -08:00
Sam Lantinga
61232de1ab Sort the initial SDL 3.0 symbols 2022-12-28 14:29:03 -08:00
Sylvain
71eb78e790 X11: fix removing SDL_WINDOW_HIDDEN flags (thanks @zturtleman) 2022-12-28 23:18:00 +01:00
Sam Lantinga
e4e7a8baff Reset the dynamic API for SDL 3.0 2022-12-28 13:53:06 -08:00
Sam Lantinga
58763b608b Cancel current CI actions when a PR is updated 2022-12-28 13:10:27 -08:00
Sam Lantinga
16092f58bb Updated gamepad, joystick, sensor APIs, removing device indices
Instead of indexing into an internal list of devices which requires locking, we return a list of device IDs which can then be queried individually.

Reference: https://github.com/libsdl-org/SDL/issues/6889
2022-12-28 13:10:27 -08:00
Sam Lantinga
e40a96155f Fixed getting the VID/PID of a virtual joystick 2022-12-28 12:51:54 -08:00
Sylvain
639a744ac4 Update README-migration 2022-12-28 12:16:57 -08:00
Sylvain
aa46ff8f4b Remove SDL_WINDOW_SHOW flag, as redundant with SDL_WINDOW_HIDDEN 2022-12-28 12:16:57 -08:00
Zack Middleton
59a70d568d Rename SDL_main_impl.h include guard to match the filename 2022-12-28 05:57:10 -08:00
Zack Middleton
e512809246 Fixup PS2/PSP SDL_RunApp()
Make PS2/PSP use the mainFunction argument for SDL_RunApp().

Make PSP SDL_RunApp() return the value from mainFunction().

Make PS2 SDL_RunApp() call SDL_SetMainReady() like all other
SDL_RunApp() functions. (It doesn't affect anything for PS2 as
SDL_MAIN_NEEDED isn't defined.)
2022-12-28 05:57:10 -08:00
Sam Lantinga
87a24ba765 The minimal Makefile doesn't really build for any platform 2022-12-27 16:50:18 -08:00
Sam Lantinga
1d80082e8e Removed old iOS demos 2022-12-27 16:48:55 -08:00
Sam Lantinga
36d4395c97 SDL API renaming: internal functions 2022-12-27 15:05:51 -08:00
Sylvain
25336d053a Remove underscore for _SDL_iconv_t
And change the name, not to have the same for pointer and data
2022-12-27 12:41:09 -08:00
Sylvain Becker
07808d6a03 Remove underscore in guard header defines (#6922) 2022-12-27 12:31:12 -08:00
Sam Lantinga
cdbd1be8c6 Allow SDL_oldnames.h to be completely disabled 2022-12-27 12:30:37 -08:00
Sam Lantinga
3db9112ef4 Make sure we match the same way when adding a mapping and looking up a mapping
Fixes https://github.com/libsdl-org/SDL/issues/6898
2022-12-27 12:16:46 -08:00
Sylvain
04f2820e07 Remove underscore for some SDL_ builtin function/macros 2022-12-27 11:34:58 -08:00
Sylvain
81cd84f456 Remove reserved underscore SDL_joystick 2022-12-27 11:34:13 -08:00
Sam Lantinga
ab2d007982 More gamepad renaming 2022-12-27 11:31:54 -08:00
Sam Lantinga
58aecf0a54 SDL API renaming: SDL_rect.h
Fixes https://github.com/libsdl-org/SDL/issues/6887
2022-12-27 11:01:11 -08:00
Sam Lantinga
a28d1d59be More gamepad renaming 2022-12-27 10:42:45 -08:00
Sam Lantinga
701e965235 Removed leading underscore in structure names
Fixes https://github.com/libsdl-org/SDL/issues/6856
Closes https://github.com/libsdl-org/SDL/pull/6914
Closes https://github.com/libsdl-org/SDL/pull/6915
Closes https://github.com/libsdl-org/SDL/pull/6916
Closes https://github.com/libsdl-org/SDL/pull/6917
Closes https://github.com/libsdl-org/SDL/pull/6918
Closes https://github.com/libsdl-org/SDL/pull/6919
2022-12-27 10:35:53 -08:00
Sam Lantinga
960e9044b3 Fixed test code after gamepad event rename 2022-12-27 10:28:43 -08:00
Sam Lantinga
ad8a6d2b05 Split SDL gamepad internal functions into SDL_gamepad_c.h 2022-12-27 10:23:28 -08:00
Sam Lantinga
15b464747f WhatsNew.txt should be new features in SDL 3.0
docs/README-migration.md will cover API changes and removals since SDL 2.0
2022-12-27 10:06:45 -08:00
Sam Lantinga
5baed331f1 Don't add symbol renaming to WhatsNew.txt 2022-12-27 10:00:10 -08:00
Sam Lantinga
84725c00d8 Make sure we update the cmake test programs as well 2022-12-27 09:56:16 -08:00
Sam Lantinga
659abc721a SDL API renaming: SDL_gamecontroller.h
SDL_gamecontroller.h has been renamed SDL_gamepad.h, and all APIs have been renamed to match.

Fixes https://github.com/libsdl-org/SDL/issues/6885
2022-12-27 09:47:24 -08:00
Sylvain
ab0c5cf07d Fix compilation 2022-12-27 17:25:31 +01:00
Sam Lantinga
59467ff063 Make it easier to mass rename symbols in the SDL API 2022-12-27 07:31:27 -08:00
Sam Lantinga
c6969df4d7 SDL API renaming: SDL_video.h
Fixes https://github.com/libsdl-org/SDL/issues/6880
2022-12-27 06:38:34 -08:00
Sam Lantinga
cc0296c934 SDL API renaming: SDL_surface.h
Fixes https://github.com/libsdl-org/SDL/issues/6884
2022-12-27 06:36:39 -08:00
Sam Lantinga
2db699f48e SDL API renaming: SDL_sensor.h
Fixes https://github.com/libsdl-org/SDL/issues/6888
2022-12-27 06:23:39 -08:00
Sam Lantinga
0d54115235 SDL API renaming: SDL_render.h
Fixes https://github.com/libsdl-org/SDL/issues/6883
2022-12-27 06:21:13 -08:00
Sam Lantinga
083e436a1a SDL API renaming: SDL_pixels.h
Fixes https://github.com/libsdl-org/SDL/issues/6886
2022-12-27 06:08:31 -08:00
Sylvain
3d063d7295 More renaming SDL_FreeWAV() to SDL_Free() 2022-12-27 14:53:10 +01:00
Sam Lantinga
fc478c1bc0 SDL API renaming: SDL_joystick.h
Fixes https://github.com/libsdl-org/SDL/issues/6881
2022-12-27 05:50:46 -08:00
Sylvain Becker
aa0053141b Remove SDL_VideoInit / Quit. Prefer SDL_SubSytemInit / Quit (#6913) 2022-12-27 05:42:48 -08:00
Sam Lantinga
713ba2e31a SDL API renaming: SDL_audio.h
Fixes https://github.com/libsdl-org/SDL/issues/6879
2022-12-27 05:32:55 -08:00
Sam Lantinga
9625fb2832 Documentation cleanup 2022-12-27 05:28:18 -08:00
Sylvain Becker
47170d288e Don't export SDL_AudioInit/Quit, use SDL_InitSubsystem instead (#6912)
* Don't export SDL_AudioInit/Quit, use SDL_InitSubsystem instead

* Update README

Co-authored-by: Sam Lantinga <slouken@libsdl.org>
2022-12-27 05:22:22 -08:00
Sylvain
3fb0c8b54a Remove/Rename SDL_FreeWAV() to SDL_free() 2022-12-27 05:14:52 -08:00
Ozkan Sezer
29ba5f5d64 SDL_thread.h: fix beginthread param of SDL_CreateThreadWithStackSize for win32 2022-12-27 00:10:00 +03:00
Vincent Hamm
5410d361f7 Fix SDL_CreateThreadWithStackSize not passing staacksize with win32 static api
(cherry picked from commit 68073c6276)
2022-12-26 11:24:17 -08:00
Sam Lantinga
63724c113b Removed the vi format comments from the source
Vim users can use the [editorconfig plugin](https://github.com/editorconfig/editorconfig-vim) to automatically set tab spacing for the SDL coding style.

Fixes https://github.com/libsdl-org/SDL/issues/6903
2022-12-26 11:17:23 -08:00
Sam Lantinga
7c67213cef editorconfig: remove trailing whitespace in source code 2022-12-26 10:34:07 -08:00
Sam Lantinga
00f05dcf49 render: only enable clipping when the rectangle is valid
Fixes https://github.com/libsdl-org/SDL/issues/6896
2022-12-26 10:24:25 -08:00
Sam Lantinga
cc49f1e279 Fixed crash if mutex functions are used before any mutex has been created 2022-12-26 09:49:36 -08:00
Sam Lantinga
d31776b17a Also rename the internal function symbol when renaming API functions 2022-12-26 08:57:57 -08:00
avafinger
12e0e6d130 SDL3 with Hardware Acceleration for ROCKCHIP platform (mali blob) 2022-12-26 08:50:51 -08:00
Sam Lantinga
074a2b0f30 Cleaned up .gitignore, removing autotools files
This also removes various names for build directories. We're not going to add everyone's random build directory name, if you want git to appear clean you can build in the build subdirectory or out of tree.
2022-12-24 08:39:29 -08:00
Sam Lantinga
a2dab02a31 Only define platform compatibility symbols on the platform they represent
Fixes https://github.com/libsdl-org/SDL/issues/6892
2022-12-24 08:27:26 -08:00
Frank Praznik
abdfa809db Prepend key modifier enum values with 'SDL_' 2022-12-23 20:35:49 -08:00
Sam Lantinga
b7ac14f2bd Ignore __pycache__ directory 2022-12-23 20:33:09 -08:00
Sam Lantinga
32fad06a93 Catch the iOS demos when renaming API functions 2022-12-23 20:32:12 -08:00
Sam Lantinga
fd0631fd35 Added documentation for rename_symbols.py 2022-12-23 15:58:15 -08:00
Sam Lantinga
759f98085a Used rename_api.py to add previously renamed symbols to SDL_oldnames.h 2022-12-23 15:08:30 -08:00
Sam Lantinga
c309a92034 Added rename_symbols.py to mass rename symbols in an SDL2 codebase 2022-12-23 15:07:21 -08:00
Sam Lantinga
0967a32fc6 Added a --code-only option to rename.py
Also added support for renaming macros and structures
2022-12-23 13:15:19 -08:00
Sam Lantinga
b5a92406eb Added infrastructure for renaming API functions
You can rename APIs using rename.py and all the code and documentation will be updated, and entries will be added to WhatsNew.txt and docs/README-migration.md.
e.g.
rename.py SDL_foo.h function SDL_CreateFoo SDL_FooCreate

SDL_oldnames.h is included in the SDL header, and if you define SDL_ENABLE_OLD_NAMES, will redefine the old API functions to call the new ones, and if not, will define them as a symbol letting you what the new API function is.
2022-12-23 11:00:11 -08:00
Sam Lantinga
08c45eb37e Added placeholder in the patch notes for renamed functions 2022-12-23 11:00:11 -08:00
Ryan C. Gordon
1cf2b566af cpu: Removed 3DNow! support and SDL_Has3DNow().
Reference Issue #6636.
2022-12-23 09:30:56 -08:00
João Henrique
0187209f46 kmsdrm: Fix wrong check on KMSDRM_CreateWindow.
A previous cleanup commit inverted a statement that checked the return value of
a KMSDRM_CreateSurfaces call during KMSDRM_CreateWindow, which causes the video
backend to always fail despite success.

This commit restores the intended behavior.

Fixes: 3c501b963d ("Clang-Tidy fixes (#6725)").
2022-12-23 09:27:51 -08:00
meyraud705
126c60cb45 Add "SDL_" prefix to RW_SEEK macros 2022-12-23 09:25:37 -08:00
Sam Lantinga
1a80fbaae4 Moved the header sections into alphabetical order in README-migration.md 2022-12-22 17:06:46 -08:00
Sam Lantinga
6649309c83 Converted default_cursor.h from ANSI to UTF-8 2022-12-22 17:06:46 -08:00
Rudolf-Walter Kiss-Szakacs
cc7b6f9e49 Add SDL_HINT_WINDOWS_ENABLE_MENU_MNEMONICS.
(cherry picked from commit 232ed540db)
2022-12-22 10:06:02 -08:00
Shawn Hoffman
927c4d4aa4 fix string literal constness warnings
# Conflicts:
#	src/video/winrt/SDL_winrtvideo.cpp
2022-12-22 10:03:40 -08:00
Ryan C. Gordon
7a5a1b16ce events: Make sure new display events don't overlap with sdl2-compat.
Reference PR #6867.
2022-12-22 11:47:54 -05:00
Ryan C. Gordon
3197632347 include: Renamed begin_code.h and close_code.h to have SDL_ prefixes.
Fixes #6864.
2022-12-22 11:39:26 -05:00
Sam Lantinga
909b513c33 Made SDL_WINDOWEVENT_* and SDL_DISPLAYEVENT_* first class event types
Fixes https://github.com/libsdl-org/SDL/issues/6772
2022-12-22 07:38:13 -08:00
Anonymous Maarten
4676d1d31e android: register all methods using JNI_OnLoad 2022-12-21 23:00:58 -08:00
Ryan C. Gordon
c9887c5c72 include: Split out functions in SDL.h to SDL_init.h.
SDL.h now exists solely as a header that includes everything else, instead
of one that forces you to include everything else when you just want the
declaration for SDL_Init().

Fixes #6840.
2022-12-22 01:05:10 -05:00
Ryan C. Gordon
182806e39f docs: Updated migration notes for SDL_RWops. 2022-12-22 00:55:54 -05:00
Anonymous Maarten
3b8548cdcf android: fix java fingerprint fo nativeAddJoystick 2022-12-21 09:39:22 -08:00
Anonymous Maarten
9e6952ed8c android: fix android-prefab.sh for SDL3 2022-12-21 09:39:22 -08:00
Anonymous Maarten
19d4d64cfe cmake: disable precompiled header for SDL_spinlock.c when targeting Android
This fixes the following error:
error: PCH file was compiled for the target 'thumbv7-none-linux-android16' but the current translation unit is being compiled for target 'armv7-none-linux-android16'
2022-12-21 09:39:22 -08:00
Anonymous Maarten
9421828e7e gendynapi.py: add android native symbols to SDL_dynapi.sym 2022-12-21 09:39:22 -08:00
Anonymous Maarten
063cb60659 gendynapi.py: use pathlib + uppercase global variables 2022-12-21 09:39:22 -08:00
Caleb Cornett
19039b6ca4 Fix GDK OpenGL build error 2022-12-20 23:18:04 -05:00
Caleb Cornett
3ebfb15469 gdk: Add support for building with OpenGL on Xbox 2022-12-19 17:57:06 -05:00
Sam Lantinga
de871dc5f7 Sorted headers in Xcode project
This lets us more easily see when one is missing
2022-12-19 09:55:53 -08:00
Sam Lantinga
0d172ccb40 Fixed marking SDL headers as public in the Xcode project
Fixes https://github.com/libsdl-org/SDL/issues/6851
2022-12-19 09:45:43 -08:00
Anonymous Maarten
8f9227e4be cmake: use CMakePushCheckState to handle check states 2022-12-19 09:19:45 -08:00
Anonymous Maarten
fab33545fa cmake: remove outdated fixme 2022-12-19 09:19:45 -08:00
Anonymous Maarten
fe8291e09a cmake: only install SDL_test*.h headers when building SDL_test library 2022-12-19 09:19:45 -08:00
Anonymous Maarten
d53cd7161a sdlwiki: SDL_version.h moved to include/SDL3 2022-12-19 09:19:45 -08:00
Anonymous Maarten
653893f188 cmake: declutter root + remove obsolete variables 2022-12-19 09:19:45 -08:00
Anonymous Maarten
39a7abad7a cmake: lowercase all macros 2022-12-19 09:19:45 -08:00
Anonymous Maarten
289b024715 cmake: add function to print dict list 2022-12-19 09:19:45 -08:00
Anonymous Maarten
a787b1c0b7 cmake: LINKER_LANGUAGE is a target property, not a cmake variable
LINKER_LANGUAGE needs to be used as following:
Usage

  cmake [options] <path-to-source>
  cmake [options] <path-to-existing-build>
  cmake [options] -S <path-to-source> -B <path-to-build>

Specify a source directory to (re-)generate a build system for it in the
current working directory.  Specify an existing build directory to
re-generate its build system.

Run 'cmake --help' for more information.

Haiku does not not this property explicitly set because CMake knows .cc files are c++
2022-12-19 09:19:45 -08:00
Anonymous Maarten
69812678cf cmake: cache cmake config installation folder in SDL_INSTALL_CMAKEDIR_ROOT
Make sure SDLx is not part of the cached variable such that it can be re-used by SDL2 and SDL3
2022-12-19 09:19:45 -08:00
Anonymous Maarten
88784ba547 .editorconfig: remove autotools files + trim whitespace from cmake files 2022-12-19 09:19:45 -08:00
Sam Lantinga
83b29f9ce1 Don't send Razer devices the Sony third-party query feature report
Some of them lock up or reset, and the vast majority of devices are not actually game controllers.

Fixes https://github.com/libsdl-org/SDL/issues/6733
2022-12-19 09:14:55 -08:00
Maido
94a0e5ea8d Android active driver check (#6850)
Check if a driver is active before attempting to handle the devices.
Otherwise an assertion will fail.
2022-12-19 16:02:10 +01:00
Sylvain Becker
5bf8bc2241 Android JAVA DetectDevices: 'is_capture' is inverted (#6845)
* Android JAVA DetectDevices: 'is_capture' is inversed
* Android Audio: adding audio device. also inverted capture, from jni side
2022-12-18 16:55:59 +01:00
Yevhen Babiichuk (DustDFG)
7fc8533b62 Use alias types for which members of event structs instead of plain types (#6841)
Signed-off-by: Yevhen Babiichuk (DustDFG) <dfgdust@gmail.com>

Signed-off-by: Yevhen Babiichuk (DustDFG) <dfgdust@gmail.com>
2022-12-18 12:10:15 +01:00
Sylvain Becker
186687bda9 Android: make Detect devices common between aaudio and android driver. (#6828)
remove VLA, dynamic alloc, check max length get using GetIntArrayRegion
2022-12-18 12:07:38 +01:00
Ryan C. Gordon
78725dc0cd include: Fixed a C++-style single line comment.
Reference Issue #6838.
2022-12-17 23:52:33 -05:00
Ryan C. Gordon
d927befcd7 docs: Just adjusting some link text. 2022-12-17 13:06:44 -05:00
Ryan C. Gordon
7b25f04476 README-migration.md: Point to the SDL_gesture repository. 2022-12-17 13:05:00 -05:00
Ryan C. Gordon
3b5780ba0a README-migration.md: Updated stdio RWops example code for new API. 2022-12-17 13:05:00 -05:00
Sam Lantinga
d305bc6d55 Fixed order of operations problem when tearing down the window
Make sure the window framebuffer is cleaned up before shutting down OpenGL, as it might be implemented using an OpenGL texture.

Fixes this call stack:
```
(gdb) p _this
$1 = (SDL_VideoDevice *) 0x42e360
(gdb) p _this->egl_data
$2 = (struct SDL_EGL_VideoData *) 0x0
```
2022-12-17 07:09:24 -08:00
Sam Lantinga
b678a98024 Fixed compiler warning
```
 ./src/thread/pthread/SDL_syssem.c:140:12: warning: variable 'retval' is used uninitialized whenever 'while' loop exits because its condition is false [-Wsometimes-uninitialized]
    while (sem_trywait(&sem->sem) != 0) {
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
./src/thread/pthread/SDL_syssem.c:149:12: note: uninitialized use occurs here
    return retval;
           ^~~~~~
./src/thread/pthread/SDL_syssem.c:140:12: note: remove the condition if it is always true
    while (sem_trywait(&sem->sem) != 0) {
```

This was a legitimate bug, thank you clang!

Fixes https://github.com/libsdl-org/SDL/issues/6830
2022-12-17 06:58:02 -08:00
Sam Lantinga
9c9e6e3aa3 Fixed compiler warning
```
 ./src/joystick/SDL_joystick.c:105:12: warning: no previous extern declaration for non-static variable 'SDL_joystick_lock' [-Wmissing-variable-declarations]
SDL_mutex *SDL_joystick_lock = NULL; /* This needs to support recursive locks */
           ^
./src/joystick/SDL_joystick.c:105:1: note: declare 'static' if the variable is not intended to be used outside of this translation unit
SDL_mutex *SDL_joystick_lock = NULL; /* This needs to support recursive locks */
^
```
1 warning generated.

(cherry picked from commit 3b0cd44158)
2022-12-17 06:54:33 -08:00
Sylvain
dce2546534 Revert wrong comment in SDL_surface.h for SDL3 (see #6824) 2022-12-16 16:42:06 +01:00
Maido
abf5cc5203 Android audio device selection (#6824)
Make it possible to select a specific audio device for Android
2022-12-16 16:40:02 +01:00
Sylvain
b461d9e183 testautomation_rwops: update test because of change in SDL_RWwrite.
when it's not possible to write to memory ( mem_writeconst ), error code is -1 (see #6818)
2022-12-16 10:24:19 +01:00
Sam Lantinga
6570febd47 Sorted PS4 controllers, note that the NACON Wireless Controller for PS4 actually reports as an XInput device
(cherry picked from commit a53382e460)
2022-12-15 18:02:24 -08:00
Sam Lantinga
0da118ce45 Note that the NACON Daija Arcade Stick is an arcade stick
(cherry picked from commit e99b9ca9c0)
2022-12-15 18:02:15 -08:00
Sam Lantinga
5a45d2e58b Updated Xcode project for SDL_main as a header-only library 2022-12-15 10:53:44 -08:00
Daniel Gibson
ab554c8392 Update doc/README-* for header-only SDL_main 2022-12-15 08:01:01 -08:00
Daniel Gibson
c3bf253b09 Remove SDL3_main from build systems, remove most of src/main/*
XCode is still missing, and src/main/winrt/SDL3-WinRTResource*
still need to find a new home
2022-12-15 08:01:01 -08:00
Daniel Gibson
63d3fb469d Move src/main/haiku/ to src/core/
turns out that this wasn't even built as a static libSDLmain,
but as part of the (possibly dynamic) libSDL3
2022-12-15 08:01:01 -08:00
Daniel Gibson
989a8ca90e Port PSP SDL_main to header-only + SDL_RunApp() 2022-12-15 08:01:01 -08:00
Daniel Gibson
b1b3bd654d Port PS2 SDL_main to header-only + SDL_RunApp() 2022-12-15 08:01:01 -08:00
Daniel Gibson
544f2c7982 Port ngage to header-only SDL_main + SDL_RunApp()
For some reason, ngage doesn't seem to be handled in any of the
build systems, so I couldn't add SDL_ngage_runapp.cpp to any buildscript
2022-12-15 08:01:01 -08:00
Daniel Gibson
7bfc41db3c Unify all the SDL_*RunApp() functions into just SDL_RunApp()
makes the SDL_main code shorter

Also added a generic SDL_RunApp() implementation for platforms that
don't really need it.

Some platforms (that use SDL_main but haven't been ported yet) are
still missing, but are added in the following commits.
2022-12-15 08:01:01 -08:00
Daniel Gibson
1de559248e PortNintendo 3DS SDL_main to header-only + SDL_N3DSRunApp()
and move the #undef main and #define main SDL_main to the start/end of
SDL_main_impl.h instead of repeating it in every platform implementation

Thanks to SDL_N3DSRunApp we don't need the #include <3ds.h> in
SDL_main_impl.h - that caused conflicts with testthread.c, because both
have (different) ThreadFunc typedefs.
2022-12-15 08:01:01 -08:00
Daniel Gibson
2aee3e654d Remove SDL_main from VS Solutions in VisualC/ and VisualC-GDK/
and update README-visualc.md and README-gdk.md accordingly

Also moved src/main/windows/version.rc to src/core/windows/
and adjusted VS solutions, CMakeLists.txt and versioning scripts
in build-scripts/ accordingly.

This will eventually allow us to remove all of src/main/

# Conflicts:
#	VisualC/tests/testgesture/testgesture.vcxproj
2022-12-15 08:01:01 -08:00
Daniel Gibson
28b93451dc Make WinRT's SDL_main header-only
As the implementation requires C++, the user will have to include
SDL_main.h in a C++ source file (that needs to be compiled with /ZW).
It's ok to keep the standard main() implementation in plain C and use
an otherwise empty C++ source file for the SDL_main implementation part,
if both source files #include <SDL3/SDL_main.h>

Including SDL_main.h in a C source file will print a message at
compilation (when building for WinRT or possibly other not yet implemented
platforms that require C++ for main), to remind the user of also
including it in a .cpp source file. This message/warning can be disabled
with #define SDL_MAIN_NOIMPL before including SDL_main.h in the C file.
When including it in a .cpp file, there will be a compiler error with
helpful message if it's not compiled with /ZW

For this I renamend _SDL_MAIN_NOIMPL to SDL_MAIN_NOIMPL, because now it's
not for internal use only anymore, but also useful for users (that want
their main() function in a different file than the SDL_main implementation)

Add a project for the testdraw2.c test to the WinRT solution to at least
get some minimal testing on WinRT.
I won't add all tests because it's a lot of manual clicking per test,
but this should be better than nothing :)
2022-12-15 08:01:01 -08:00
Daniel Gibson
8e0693c982 Make iOS/tvOS (uikit) SDL_main header-only
Also adjusted iOS demo's includes to <SDL3/..> and explicit SDL_main.h

untested, I don't have Xcode (or a Mac, for that matter)

The xcode projects (for both Xcode-iOS/ and Xcode/) will probably
have to be adjusted for the SDL_main changes to work, but now at least
the iOS demo source should work as is :)
2022-12-15 08:01:01 -08:00
Daniel Gibson
28ecbbf0b5 Make GDK's SDL_main header-only 2022-12-15 08:01:01 -08:00
Daniel Gibson
2d0eaea1cc Add missing SDL_main.h includes to remaining libSDLmain implementations
this should hopefully make the automated builds work again

(this commit can probably be removed once all affected platforms are
converted to header-only SDL_main)
2022-12-15 08:01:01 -08:00
Daniel Gibson
22e22ba196 Add SDL_main.h includes to tests
.. including cmake/test/*.c, whatever that does

(this is needed now because SDL.h doesn't include SDL_main.h anymore)
2022-12-15 08:01:01 -08:00
Daniel Gibson
ca2fe7be1a Implement SDL_main as header-only lib for Win32
(remaining platforms will follow)

SDL_main.h is *not* included by SDL.h anymore, users are supposed to
include it directly now, usually only in the file they implement main() in.
If they need the header elsewhere or don't want SDL_main to implement
main() (but only call SDL_SetMainReady() or whatever), they
can #define SDL_MAIN_HANDLED first, same as before.
For SDL-internal usage, I added _SDL_MAIN_NOIMPL, which *also* skips the
implementation and `#define main SDL_main`, but still defines
SDL_MAIN_AVAILABLE and SDL_MAIN_NEEDED in SDL_main.h, as before.

To make the implementaion in the header shorter and avoid including windows.h,
I moved most of the Win32 SDL_main code into SDL3.dll via SDL_Win32RunApp(),
so the header-only part is just the different main functions calling
SDL_Win32RunApp(SDL_main, NULL)

Note that I changed changed the return value and type of OutOfMemory()
to return -1 instead of FALSE, so main() (or WinMain() or whatever)
returns -1 instead of 0 in case of an out-of-memory error

Compared to original Win32 SDL_main, I tweaked the part of the
implementation in SDL_main_impl.h a bit to avoid linker warnings
and conflicts with stuff from windows.h:

- replaced windows.h with own define of WINAPI
  and typedef-ing HINSTANCE and LPSTR.
  This prevents conflicts between all the generically-named #defines and
  types in windows.h and user code (like DrawState in some SDL tests)
- only using one of main() or wmain() gets rid of a MSVC linker error
  ("warning LNK4067: ambiguous entry point")
  If this still causes problems, we might try getting rid of wmain(),
  seemed to me like MSVC can use regular main() in UNICODE mode as well
- simplified the UNICODE logic for that - while this is not exactly
  equivalent to the old, it should make sense and Works For Me
2022-12-15 08:01:01 -08:00
Sylvain
ffaf451558 testime.c: fix wrong {} in switch 2022-12-15 14:26:18 +01:00
Sylvain
ff3f4236f2 testime.c: add valid cast, since the variable as been tested non negative before 2022-12-15 14:22:11 +01:00
Sylvain
48955cce0e test/testime.c: put back size_t 2022-12-15 14:19:02 +01:00
Sylvain
deba9f4b8b testime.c: fix various warnings + test error code from SDL_RWread, changing bytesRead to Sint64 (thanks Ozkan) see #6818 2022-12-15 14:11:08 +01:00
Sylvain Becker
1e6d4649c0 fixed build rwops (#6818)
* Fixed build
2022-12-15 10:06:15 +01:00
Ryan C. Gordon
c637031294 rwops: Fixed another Windows build failure. 2022-12-15 00:16:02 -05:00
Ryan C. Gordon
4075748e41 rwops: Removed unused variable in Windows-specific code. 2022-12-15 00:09:32 -05:00
Brian Kirkpatrick
e35730ac54 fixed const error when compiling for mutated total_need value in SDL_rwops.c 2022-12-14 20:25:40 -08:00
Ryan C. Gordon
83559503c4 test: patched to compile. 2022-12-14 23:25:09 -05:00
Sam Lantinga
980208b814 Fixed crash in SDL_PrivateGameControllerRefreshMapping()
(cherry picked from commit 7a9966af9d)
2022-12-14 20:24:14 -08:00
Ryan C. Gordon
72c1f73bc5 rwops: Make read and write work like POSIX, not stdio.
This simplifies some things, clarifies some things, and also allows
for the possibility of RWops that offer non-blocking i/o (although
none of the current built-in ones do, intentionally, we could add this
later if we choose, or people could provide things like network socket
RWops implementations now, etc.

Fixes #6729.
2022-12-14 15:47:13 -05:00
Frank Praznik
e9a9afaded wayland: Look up pressed keys via keycodes instead of scancodes on keyboard entry
On window focus, look up the pressed modifier keys via keycodes instead of scancodes to handle the case of remapped keys, as xkb remapping changes the associated keycode, not the scancode.
2022-12-14 11:31:40 -08:00
Sam Lantinga
3a940ba8ee Updated gendynapi.py to handle thread-safety annotations 2022-12-14 09:59:56 -08:00
Sam Lantinga
5c29b58e95 Added support for clang thread-safety analysis
The annotations have been added to SDL_mutex.h and have been made public so applications can enable this for their own code.

Clang assumes that locking and unlocking can't fail, but SDL has the concept of a NULL mutex, so the mutex functions have been changed not to report errors if a mutex hasn't been initialized. We do have mutexes that might be accessed when they are NULL, notably in the event system, so this is an important change.

This commit cleans up a bunch of rare race conditions in the joystick and game controller code so now everything should be completely protected by the joystick lock.

To test this, change the compiler to "clang -Wthread-safety -Werror=thread-safety -DSDL_THREAD_SAFETY_ANALYSIS"
2022-12-14 09:53:39 -08:00
Sylvain Becker
02493579b5 DBus: add a reference to the connection
Fixed bug #6712
2022-12-14 11:41:35 -05:00
Sylvain Becker
e0ee9fa80c Fix build (#6808) 2022-12-14 09:47:15 +01:00
Ryan C. Gordon
5a2d0b69c8 render: Remove SDL_GetRenderDriverInfo and change SDL_CreateRenderer.
Fixes #6625.
2022-12-13 23:27:35 -05:00
Ozkan Sezer
1230a8fde8 fix (hopefully) MSVC builds after gesture removal. 2022-12-14 00:50:20 +03:00
Ryan C. Gordon
a76053352c gesture: Removed the gesture API from SDL3.
Fixes #6758.
2022-12-13 14:54:37 -05:00
Simon McVittie
07fa2769b8 cmake: Fix detection of ALSA::ALSA for static linking
This was still conditional on whether SDL2::SDL2-static exists, but
it's now SDL3 that matters.

Resolves: https://github.com/libsdl-org/SDL/issues/6801
Fixes: 9eb4d1f "cmake: use FindALSA.cmake to find ALSA libraries"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-12-13 09:03:48 -05:00
Simon McVittie
45ebdfb1dc emscripten: Replace a stray reference to SDL2 with SDL3
Entirely untested, but I'm fairly sure this is what was intended.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-12-13 09:03:11 -05:00
Simon McVittie
4a46a9e372 .gitignore: Replace all SDL2 with SDL3
Some of these are probably unnecessary now that Autotools (with its
optional in-tree builds) has been deleted in favour of CMake (with
mandatory out-of-tree builds), but let's be consistent.

Spotted while doing a `git grep` for other bugs of the same form as #6801.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-12-13 09:02:28 -05:00
Sam Lantinga
650e16a824 Detect display change when fullscreen desktop windows move displays
This happens when using Win+Alt+Left/Right on a resizable fullscreen desktop window on Windows
2022-12-12 20:26:17 -08:00
Sam Lantinga
a506d798d8 Don't try to open the Razer Huntsman Elite keyboard as a controller
(cherry picked from commit 817454cfe6)
2022-12-12 18:01:32 -08:00
Ryan C. Gordon
12486e144b wasapi: Fixed incorrect assertions.
Fixes #6795.
2022-12-12 16:07:48 -05:00
Frank Praznik
90a964f132 wayland: Set xdg surface geometry
It was previously thought that these function calls were unnecessary as the initial bug and reproduction case that necessitated their addition seemed to be fixed, but apparently there are still cases where this needs to be set explicitly. Set the xdg surface geometry at creation time and when the window size changes.

Partially reverts #6361.  This is not needed in the libdecor path, as libdecor calls this for the content surface internally.
2022-12-12 11:21:20 -08:00
Sam Lantinga
618340bf99 Added support for the STRIKEPAD PS4 Grip Add-on to the HIDAPI driver 2022-12-12 10:55:38 -08:00
Anonymous Maarten
9eb4d1f020 cmake: use FindALSA.cmake to find ALSA libraries
Co-authored-by: nfarid <54642193+nfarid@users.noreply.github.com>
2022-12-12 01:37:01 +01:00
Pierre Wendling
053ce39d67 N3DS: Semaphore fixes. (#6776)
* N3DS: Make Sem waits cooperative friendly.

The 3DS has a cooperative threading model. Sleeping after TryWait and
WaitTimeout avoid starving other threads. It inccurs a runtime penalty,
but it's better than having to hard reset your console to recover from
a deadlock.
2022-12-11 11:27:16 -08:00
Kelly Gravelyn
bb6abd7b03 Remove OutDir and IntDir from GDK projects 2022-12-10 09:50:47 -08:00
Sylvain
e5a470d0d3 Update DYNAPI SDL_WinRTRunApp() prototype which was wrong (see #6783) 2022-12-10 17:54:16 +01:00
Sylvain
3d190ebcb4 SDL_dynapi_procs: fixed SDL_UIKitRunApp prototype (see #6783) 2022-12-10 17:45:56 +01:00
Sylvain
a38ea6bad2 SDL_assert: remove old define for obsolete naming 2022-12-10 17:21:51 +01:00
Sylvain
f906c52ee6 SDL_assert: remove old naming convention (see #6783) 2022-12-10 17:19:00 +01:00
Sylvain
2905b6d65a SDL_dynapi_procs: update wrong naming conventions with SDL_AssertState/Data (see #6783) 2022-12-10 17:15:14 +01:00
Ryan C. Gordon
16f8dfcef9 docs: Note that you don't need to free SDL_GetDefaultCursor's results.
Reference Issue #6777.
2022-12-09 22:08:40 -05:00
Sylvain
99baebf5eb SDL_dynapi_procs.h: one more space (for diff purpose) 2022-12-09 20:42:01 +01:00
Sylvain
b7008e4614 SDL_dynapi_procs: remove extra ' ' 2022-12-09 20:36:34 +01:00
Sylvain
cce1341b5b gendynapi.py: don't generate parameter for '...' - corrected 2022-12-09 20:34:13 +01:00
Sylvain
f442d0a0ef Revert "gendynapi.py: don't generate parameter for '...'"
This reverts commit ea8c7df91b.
2022-12-09 20:33:14 +01:00
Sylvain
ea8c7df91b gendynapi.py: don't generate parameter for '...' 2022-12-09 20:22:44 +01:00
Sylvain
5f89987d7f Fixed extra 'space' (see #6783 Thanks @sezero !) 2022-12-09 20:09:17 +01:00
Sam Lantinga
3736005fc4 Added test event logging for SDL_WINDOWEVENT_ICCPROF_CHANGED and SDL_WINDOWEVENT_DISPLAY_CHANGED 2022-12-09 10:23:00 -08:00
Sylvain
b116dd8eb8 gendynapi.py: add comment for OS-specific API (Thanks @DanielGibson!) 2022-12-09 09:27:19 +01:00
Sam Lantinga
cfa493c97f Use the current timestamp for keyboard hook events
Fixes https://github.com/libsdl-org/SDL/issues/6771
2022-12-08 23:13:13 -08:00
Sam Lantinga
5bc80abe0d Added logging for SDL_DISPLAYEVENT_MOVED
(cherry picked from commit be3b1cff0b)
2022-12-08 17:04:27 -08:00
Sam Lantinga
7d1bf0a9fe Make sure the display list is up to date for window placement
(cherry picked from commit ab479b4961)
2022-12-08 17:04:11 -08:00
Sam Lantinga
a4a80360f5 Added SDL_DISPLAYEVENT_MOVED to detect when display positioning changes
(cherry picked from commit 264da8c127)
2022-12-08 12:47:56 -08:00
Sam Lantinga
98fa97de91 Fixed memory leak when removing existing displays
(cherry picked from commit cfc7cac3c9)
2022-12-08 12:46:50 -08:00
Frank Praznik
653e484da1 wayland: Handle the Num Lock and Caps Lock modifiers via modifier events
Num Lock and Caps Lock always need to be explicitly handled by the modifier handler function, or they won't be correctly set if active at application startup, or if the lock state is changed while the application lacks focus since a key press for these keys will never be received.  In these cases, the internal SDL modifier state can end up the inverse of the actual modifier state.
2022-12-08 09:29:37 -08:00
Sylvain
e93769d2c9 Extract the name of a callback paramter 2022-12-08 08:55:27 -08:00
Sylvain
67a4094eea Rewrite + gendynapi into python 2022-12-08 08:55:27 -08:00
Sylvain
c265fb74b0 Renamed AUDIODRIVER and VIDEODRIVER hint/env to AUDIO_DRIVER and VIDEO_DRIVER 2022-12-08 09:50:09 -05:00
Ryan C. Gordon
7ca0d15d64 events: Changed SDL_GetEventState from a macro to a function.
Fixes #6773.
2022-12-08 00:08:51 -05:00
Sam Lantinga
9a6bcca6b8 Use the correct name for the DualSense controllers 2022-12-07 14:53:33 -08:00
Sam Lantinga
9339085593 Added support for the DualSense Edge paddles 2022-12-07 14:25:53 -08:00
Sam Lantinga
ea714956b6 Clarified where the paddle locations are 2022-12-07 14:17:58 -08:00
Sam Lantinga
a71ac0eb06 Revert "Add window title to app_ids for different"
This reverts commit 39eab4bf44.

From @Kontrabant:
Making windows use the window title as the app ID by default doesn't seem like the right direction. The app ID is used by window managers to group windows from the same application together for switching between with alt-tilde and such functionality, and giving each window it's own app ID would break this.
2022-12-07 07:39:40 -08:00
Frank Praznik
30bb8f616d wayland: Pass through event timestamps of 0
Always pass through event timestamps of 0 so the current time will be used for the event.
2022-12-06 09:17:00 -08:00
Lei.Huang
39eab4bf44 Add window title to app_ids for different
"app_ids" can be used for multiple windows

Signed-off-by: Lei.Huang <leihuang@amd.com>
2022-12-05 21:30:03 -05:00
Sam Lantinga
e8b1dfef9b Fixed centering the D-pad on some joysticks
Fixes https://github.com/libsdl-org/SDL/issues/6767
2022-12-05 13:33:04 -08:00
Sam Lantinga
fcafe40948 Removed balls from the joystick API
They were only used by one joystick decades ago, so removing them for SDL3

Fixes https://github.com/libsdl-org/SDL/issues/6766
2022-12-05 13:17:18 -08:00
Sam Lantinga
75f1eb9216 Don't assume evdev events and SDL_GetTicks() use the same time source
The evdev events are in the same time base as gettimeofday(), but SDL_GetTicks() might be using clock_gettime()
2022-12-05 10:40:16 -08:00
Sam Lantinga
57d34f2e10 Make sure we never get a zero tick_start value 2022-12-05 10:17:38 -08:00
Sam Lantinga
c468d93760 Removed unnecessary conversion from nanoseconds to milliseconds in SDL_GetTicks() 2022-12-05 10:11:22 -08:00
Sam Lantinga
82b01035d1 Reduce the chance of overflow when calculating nanosecond time
Fixes https://github.com/libsdl-org/SDL/issues/6762
2022-12-05 09:43:30 -08:00
Ozkan Sezer
ed6d401616 gendynapi.pl: fix "Use of uninitialized value $7" after commit 0f9482e.
Reference issue: https://github.com/libsdl-org/SDL/issues/6740.
2022-12-05 20:29:56 +03:00
Sylvain
af5bda5ef3 Fix warnings 'macro argument should be enclosed in parentheses' 2022-12-05 09:06:44 -08:00
Frank Praznik
8cafde5ecc wayland: Add high-resolution event timestamp support
Add the protocol for high-resolution timestamp events and subscribe to them if available.

Event timestamps are now handled natively in nanoseconds as much as possible to avoid error-prone conversions.

Variables have been appended with _ms or _ns where appropriate, to avoid ambiguity.
2022-12-04 16:56:26 -08:00
Ozkan Sezer
4a22ee7277 tests: avoid redefinition warnings for MSVC _CRT_???_NO_DEPRECATE macros 2022-12-05 00:35:20 +03:00
Sam Lantinga
38de07d9e4 Cancel current CI actions when a PR is updated 2022-12-04 10:05:54 -08:00
Sam Lantinga
39e39f335e Only cancel previous builds when iterating on pull requests 2022-12-04 09:50:51 -08:00
Ozkan Sezer
d6327a00fb re-applied the SDL_NewAudioStream deconstification, including to its definition
we should keep this to SDL3 only.
2022-12-04 20:50:20 +03:00
Sam Lantinga
d3ba6529e6 Fixed windows build 2022-12-04 09:39:55 -08:00
Cameron Cawley
ee0e9e979c Move intrinsic includes into a private header 2022-12-04 09:34:10 -08:00
Sam Lantinga
b4da4ed95a Removed SDL_SensorGetDataWithTimestamp() and SDL_GameControllerGetSensorDataWithTimestamp()
If you care about timestamps you'll also want to catch all of the sensor events instead of just polling the current state. For example, Nintendo Switch controllers generate 3 sensor events with distinct values for each polling interval.
2022-12-04 09:29:28 -08:00
Sam Lantinga
b8760a3ffe The timestamp_us member of the sensor events has been renamed sensor_timestamp and now represents nanoseconds. 2022-12-04 09:29:28 -08:00
Sam Lantinga
73f4aeee6a Pass the event timestamp for joystick events
This allows the application to get more fine grained information about controller event timing, and group events that happened together.
2022-12-04 09:29:28 -08:00
Sam Lantinga
f32cdfa096 Fixed presentation reset calculation (thanks @zturtleman!) 2022-12-04 09:28:03 -08:00
Sam Lantinga
f9ad84fd5d Cancel current CI actions when a PR is updated
This should help get build feedback more quickly when someone is iterating on a PR
2022-12-04 09:11:38 -08:00
Ozkan Sezer
25e62193f4 just revert the const removal from SDL_NewAudioStream in commit d0bbfdb 2022-12-04 12:56:50 +03:00
Ozkan Sezer
202eaeea11 replace windows timeapi.h with mmsystem.h for better compatibility. 2022-12-04 12:50:04 +03:00
Ozkan Sezer
36a43eac00 apply const removal changes from SDL_NewAudioStream to dynapi side too. 2022-12-04 12:47:20 +03:00
Frank Praznik
1f40b9de96 wayland: Pass event timestamps to SDL
SDL events support system timestamps now, so pass them through.
2022-12-03 21:17:35 -08:00
Sylvain Becker
4ffa7f868d Fixed bug libsdl-org#6745 - Check for overflow in SDL_CalculateYUVSize (#6747)
Fixed bug #6745 - Check for overflow in SDL_CalculateYUVSize
2022-12-03 21:22:14 +01:00
Max Bachmann
5650046f93 Detect Logitech PRO Racing Wheel as wheel 2022-12-03 08:21:18 -08:00
Sylvain
021d0b7300 Fix wrong clang-tidy modification. This is an integer division. Thanks @meyraud705 (see PR #6725) 2022-12-03 13:36:09 +01:00
Ozkan Sezer
0f9482ebc3 reran gendynapi.pl to add SDL_GetTicksNS / SDL_DelayNS to SDL_dynapi.sym 2022-12-03 00:33:50 +03:00
Sam Lantinga
1a890808a4 Fixed build 2022-12-02 13:11:04 -08:00
Jan Engelhardt
1878674477 build: add symbol versioning for SDL
If a program built against one version of SDL is run in an
environment where there is an earlier version of the SDL .so library
installed, the result varies depending on platform configuration; in
the best case, it won't start at all, at worst it aborts in the
middle of the user doing "something important" (systems implementing
lazy symbol resolution). verdefs on the other hand are always checked
on startup.

The dependency information present in programs and shared libraries
is not only of value to the dynamic linker, but also to a
distribution's package management. If the dynamic linker is able to
tell that a program is not runnable per the above, a package manager
is able to come to the same conclusion — and block the installation
of a nonfunctional program+library ensemble.

Because there are a lot more symbols than there are libraries (I am
going to throw in "10^4 to 1 or worse"), package managers generally
do not evaluate symbols, but only e.g. the SONAME, NEEDED and VERNEED
fields/blocks. Because the SONAME is the same between two SDL
versions like 2.0.24, and 2.0.26, everything rests on having verdefs.

This patch proposes the addition of verdefs.
2022-12-02 13:05:37 -08:00
Sylvain Becker
92cd2c0a74 Enable creation of yuv SDL_Surfaces (#6735) 2022-12-02 12:53:48 -08:00
Sam Lantinga
0a3262e819 Pass the OS event timestamp for keyboard, mouse, and touch events where possible
Currently implemented for Windows and Apple platforms
2022-12-02 12:37:41 -08:00
Sam Lantinga
1f4cc733a1 Removed the nanosecond versions of event and thread primitive waits from the public API
It's not clear applications need this level of precision yet, so let's leave these private for now.
2022-12-02 12:37:41 -08:00
Sam Lantinga
e2432bbd3b How did PS2 build without a condition variable implementation? 2022-12-02 12:37:41 -08:00
Sam Lantinga
8121bbd083 Convert ticks to 64-bit, added nanosecond precision to the API
Fixes https://github.com/libsdl-org/SDL/issues/5512
Fixes https://github.com/libsdl-org/SDL/issues/6731
2022-12-02 12:37:41 -08:00
Sylvain
764b899a13 Fix Conditional jump or move depends on uninitialised value(s)
eg ./testsprite2 --trackmem
2022-12-02 21:11:33 +01:00
Sam Lantinga
4713db1484 Commented out syntax that causes Visual Studio 2019 to complain on every edit 2022-12-02 00:43:01 -08:00
Ozkan Sezer
a3d7dd2464 SDL_sysfilesystem.c (SDL_GetBasePath): fixed the solaris code path.
Reference issue: https://github.com/libsdl-org/SDL/pull/6681
2022-12-02 06:23:30 +03:00
Ozkan Sezer
ab916e8a61 fixed corrupted (zero-sized) SDL3-WinRTResource_BlankCursor.cur.
(copied from SDL2 branch with renaming.)
2022-12-02 03:32:00 +03:00
Ozkan Sezer
bb8adf74e0 cmake/sdlchecks.cmake: make it diff smaller against SDL2 2022-12-02 03:01:02 +03:00
Frank Praznik
378b1c286a Fix formatting on Wayland and Pipewire function signatures
Fixes the formatting on some function signatures that clang-format missed.
2022-12-01 15:13:28 -08:00
Sylvain Becker
ab1f4172e3 Remove SDL_GL_CONTEXT_EGL #6657 (#6683) 2022-12-01 14:53:37 -08:00
Sam Lantinga
7237c56499 Detect the G923 (Xbox style) and PXN V900 (PS3 mode) as wheels 2022-12-01 14:43:34 -08:00
Pierre Wendling
3c501b963d Clang-Tidy fixes (#6725) 2022-12-01 13:07:03 -08:00
Sam Lantinga
c2ce44bead More cleanup for #6619 2022-12-01 12:53:11 -08:00
Anonymous Maarten
11ef4df207 cmake: rely on targets from the main cmake script 2022-12-01 20:32:47 +01:00
Anonymous Maarten
14ffaba399 cmake: build with rpath's, they are removed on install
This allows to build and run tests (on Linux) linked against the shared library
2022-12-01 20:32:47 +01:00
Anonymous Maarten
1dce3f9265 ci: RISCOS is a bool 2022-12-01 20:32:47 +01:00
Anonymous Maarten
88b41c47fa ci: do verbose PSP build 2022-12-01 20:32:47 +01:00
Sam Lantinga
a463aca0d1 Simplified SDL_CreateRGBSurface* functions 2022-12-01 08:53:14 -08:00
Sam Lantinga
1e7e25626b Use SDL_PIXELFORMAT_RGB565, which is the most common 16-bit format 2022-12-01 08:34:41 -08:00
Sam Lantinga
a01759f8f0 Fixed 16-bit RGBA masks 2022-12-01 08:32:57 -08:00
Sam Lantinga
c30b2063e0 Clarified the migration path for SDL_CreateSurface() 2022-12-01 08:26:32 -08:00
Sylvain Becker
932f61348d Remove mask versions of SDL_CreateRGBSurface* #6701 (#6711)
* Rename SDL_CreateRGBSurface{,From} to SDL_CreateSurface{,From}, which now takes a format parameter
2022-12-01 08:04:02 -08:00
Sylvain
778b8926b4 Small format changed (using clang-format 15.0.2-1) 2022-12-01 09:39:08 +01:00
Ozkan Sezer
45025799b7 restore SDL_malloc.c original formatting. 2022-11-30 17:28:26 -08:00
Sasha Szpakowski
b3b94cf36b Fix xcode project after opengles renderer removal 2022-11-30 17:25:43 -08:00
Sam Lantinga
36c5d5cc65 Added support for the Logitech Cordless Precision PS3 controller 2022-11-30 17:18:00 -08:00
Sam Lantinga
4f9c2b3e2e Added support for the HORIPAD Pro for Xbox Series X 2022-11-30 17:17:44 -08:00
Sam Lantinga
e2df0a9d5a Re-enabled support for third party PS3 controllers 2022-11-30 17:17:15 -08:00
Sam Lantinga
27e8eb4ca8 Fixed Victrix FS Pro V2 controller hang on reboot
(cherry picked from commit 9e997cc787)
2022-11-30 15:39:48 -08:00
Sam Lantinga
f8c3528c55 Fixed crash if GetRectDisplayIndex() is called before SDL_VideoInit()
(cherry picked from commit d87048fd5a)
2022-11-30 14:38:25 -08:00
Sam Lantinga
1e2dfdb019 Removed the OpenGL ES 1.0 2D render implementation
In SDL3 we plan to make more use of shaders in the 2D render API, and this minimizes the number of platforms we have to consider for new features. OpenGL ES 2.0 or newer is supported on all modern iOS and Android devices.
2022-11-30 13:39:37 -08:00
Sam Lantinga
5750bcb174 Update for SDL3 coding style (#6717)
I updated .clang-format and ran clang-format 14 over the src and test directories to standardize the code base.

In general I let clang-format have it's way, and added markup to prevent formatting of code that would break or be completely unreadable if formatted.

The script I ran for the src directory is added as build-scripts/clang-format-src.sh

This fixes:
#6592
#6593
#6594
2022-11-30 12:51:59 -08:00
Ozkan Sezer
14b902faca begin_code.h: add gcc version checks to the alloc_size attributes. 2022-11-30 11:33:32 +03:00
Ozkan Sezer
4b6390261b begin_code.h: remove obsolete __SYMBIAN32__ handling for DECLSPEC. 2022-11-30 11:33:32 +03:00
Sam Lantinga
c5790359fd Added precompiled header support for Visual Studio and Xcode (#6710)
Fixes https://github.com/libsdl-org/SDL/issues/6704
2022-11-29 18:34:15 -08:00
Sam Lantinga
6ca7212b75 Fixed unreachable code warning 2022-11-29 18:03:58 -08:00
Anonymous Maarten
a52327f6b8 cmake: add support for precompiled headers 2022-11-29 14:23:42 -08:00
Anonymous Maarten
e26e893daf test: build + fix test/testgles2_sdf.c 2022-11-29 22:43:46 +01:00
Ethan Lee
f9f7db4e08 video: Prefer Wayland over X11 (take 2!) 2022-11-29 16:35:36 -05:00
David Edmundson
6d2b74db66 Support wayland fractional scale protocol
The new protocol adds support for more native communication of
fractional scaling.

Everything in the wayland backend already existed only our fractional
scale was calculated implicitly through a combination of output size
guesswork for fullscreen windows.

This new protocol makes that explicit, providing a more robust solution
and a solution for non-fullscreen surfaces. The fallback code is still
left in place for now whilst compositors gain support.
2022-11-29 16:35:12 -05:00
Sam Lantinga
71d5f510c6 Fixed dylib generation on macOS
We just build libSDL3.dylib instead of libSDL3.0.0.0.dylib with symlinks

Fixed the compatiblity vs current version, e.g.

SDL 3.20.87
    @rpath/libSDL3.0.dylib (compatibility version 2001.0.0, current version 2001.87.0)

SDL 3.21.5
    @rpath/libSDL3.dylib (compatibility version 2106.0.0, current version 2106.0.0)
2022-11-29 11:57:19 -08:00
Anonymous Maarten
6f20d990ad cmake: swap VERSION and SOVERSION 2022-11-29 20:36:46 +01:00
Anonymous Maarten
ba19d3c048 cmake: remove SDL_CMAKE_DEBUG_POSTFIX option
Use CMAKE_DEBUG_POSTFIX instead
2022-11-29 11:29:03 -08:00
Anonymous Maarten
2d89c4680f cmake: simplify .so and .dylib versioning 2022-11-29 11:29:03 -08:00
Ryan C. Gordon
a3225ae6de dynapi: Abstract out the environment variable name. 2022-11-29 14:13:07 -05:00
pionere
cf0cb44df8 video: fix error messages
- do not overwrite error message set by SDL_InitFormat (SDL_AllocFormat)
- set proper error message (Cocoa_Metal_CreateView)
- protect against allocation failure (UIKit_Metal_CreateView)
2022-11-29 10:59:40 -08:00
Anonymous Maarten
7e7a8e76a5 cmake: move platform detection to cmake/sdl/paltform.cmake for re-use by SDL2-compat 2022-11-29 21:10:56 +03:00
Anonymous Maarten
e2060de714 cmake: use target_link_libraries to pass -Wl,--undefined=WinMain 2022-11-29 21:10:56 +03:00
Sylvain Becker
fc4fc5295f Remove depth field from SDL_CreateRGBSurfaceWithFormat and SDL_Create… (#6685)
* Remove depth field from SDL_CreateRGBSurfaceWithFormat and SDL_CreateRGBSurfaceWithFormatFrom
* Removed unused 'flags' parameter from SDL_CreateRGBSurface and SDL_CreateRGBSurfaceWithFormat
* Removed unused 'flags' parameter from SDL_ConvertSurface and SDL_ConvertSurfaceFormat
2022-11-29 09:40:09 -08:00
Sam Lantinga
6873082c34 Fixed building on Windows with SDL_VIDEO=OFF
Fixes https://github.com/libsdl-org/SDL/issues/6562
2022-11-29 09:29:42 -08:00
Ozkan Sezer
8901297437 SDL_test_md5.h: fix MD5UINT4 type to be really 32 bits. 2022-11-29 08:53:56 -08:00
Sam Lantinga
f077c69193 Fixed bug #6698 - VISA: wrong check sceKernelPollSema 2022-11-29 08:50:51 -08:00
pionere
461a38ff1a thread: code style 2022-11-29 08:44:10 -08:00
Sylvain
38c281fbc0 Fixed bug #6698 - VISA: wrong check sceKernelPollSema 2022-11-29 16:14:23 +01:00
pionere
f6db1aba66 thread: return -1 from SDL_SemWaitTimeout if semaphore is NULL 2022-11-29 09:40:32 -05:00
pionere
6875e1c262 thread: fix inconsistent return values
- SDL_CreateMutex returns NULL when the creation fails (ngage)
- SDL_SemValue returns 0 when the semaphore is NULL (n3ds)
2022-11-29 09:26:12 -05:00
Sam Lantinga
b5076ef5e3 Added support for the Xbox Elite controller paddles with firmware version 5.13+ 2022-11-28 23:15:23 -08:00
Vasily Khoruzhick
dbaeb2b9e9 Add support for the 8BitDo Ultimate Wireless 2.4GHz Controller in DirectInput mode
Generated using controller map
2022-11-28 17:47:09 -08:00
Sam Lantinga
04399e1fc2 Added support for the 8BitDo Ultimate Wired Controller in DirectInput mode, including the misc button and paddles 2022-11-28 14:54:56 -08:00
Sam Lantinga
5efca283d3 Add 8BitDo to the list of Xbox 360 third party vendors
Allows detection of the 8BitDo Ultimate Wired Controller
2022-11-28 14:54:36 -08:00
Sam Lantinga
9593c8b29d Added a note to direct people to README-migration.md 2022-11-28 11:03:22 -08:00
Sam Lantinga
c2432f8d0d Rename SDLmain to SDL_main and SDLtest to SDL_test for consistency with other SDL libraries 2022-11-28 10:57:59 -08:00
Sam Lantinga
b4ebb3b568 Windows borderless windows interact better with the window manager
This behavior more closely matches other platform where the window is borderless but still interacts with the window manager (e.g. task bar shows above it, it can be resized to fit within usable desktop area, etc.)

If you want a borderless window the size of the desktop that looks like a fullscreen window, then you should use the SDL_WINDOW_FULLSCREEN_DESKTOP flag.

Fixes https://github.com/libsdl-org/SDL/issues/6659
2022-11-28 09:32:39 -08:00
Sam Lantinga
a08f517069 Removed unused SDL_ArrayOrder enumeration values
Fixes https://github.com/libsdl-org/SDL/issues/6658
2022-11-28 09:08:16 -08:00
Sam Lantinga
62f4fc6f35 Be explicit that we support the MSB variants of the 1bpp and 4bpp surface formats
Fixes https://github.com/libsdl-org/SDL/issues/6242
2022-11-28 09:06:44 -08:00
Samuel Venable
4f5e9fd5bd [skip ci] Solaris getexecname() returns argv[0]
`argv[0]`/`getexexname()` are not always absolute paths by default and can be modified to anything the developer wants them to be.

Consider using `readSymLink("/proc/self/path/a.out")` instead and `getexecname()` as the fallback, since the symlink will always be the correct absolute path (unless /proc is ot mounted, but it is by default on Solaris and Illumos platforms).
2022-11-27 21:29:07 -05:00
Markus Mittendrein
f3c466ec1e SDL_ResampleAudio: Fix float accumulation error
While 78f97108f9 reduced the accumulation error, it was still big enough to cause distortions.
Fixes #6196.

(cherry picked from commit 8145212103)
2022-11-27 21:15:44 -05:00
Anonymous Maarten
3acd1ad25f cmake: only MSVC understands -nodefaultlib:MSVCRT 2022-11-28 00:20:22 +01:00
Anonymous Maarten
5151cbf4d1 cmake: check essential headers even when building with SDL_LIBC=OFF 2022-11-28 00:20:22 +01:00
Anonymous Maarten
9d7e4a7d6e cmake: don't cache HAVE_xxx variables for checking libc features 2022-11-28 00:20:22 +01:00
Anonymous Maarten
b2e428626b cmake: disable system iconv by default on Windows
This is a different default then current CMake and autotools, but matches the released SDLx.dll's.
2022-11-28 00:20:22 +01:00
Anonymous Maarten
27707755c1 cmake: use SDL_LIBC_DEFAULT for default SDL_LIBC value 2022-11-28 00:20:22 +01:00
Anonymous Maarten
3fad16cc2b cmake: use SDL_CPU_X86 to enable MMX/SSE on x86 2022-11-28 00:20:01 +01:00
Anonymous Maarten
21f8e3ce04 cmake: use CMakePushCheckState while testing ARM NEON support 2022-11-28 00:20:01 +01:00
Anonymous Maarten
46d85fd5a4 cmake: don't cache HAVE_3DNOW value 2022-11-28 00:20:01 +01:00
Anonymous Maarten
82360b3175 cmake: don't cache HAVE_SSE value 2022-11-28 00:20:01 +01:00
Anonymous Maarten
375456a3a0 cmake: use SDL_ASSEMBLY_DEFAULT for default SDL_ASSEMBLY value 2022-11-28 00:20:01 +01:00
Anonymous Maarten
9f2ca87504 build: don't add SDL3 subfolder to include path for external projects 2022-11-27 14:33:13 -08:00
Sam Lantinga
2af4f74e1c Remove sdl3.m4 and sdl3-config, and document pkg-config as the recommended replacement
Fixes https://github.com/libsdl-org/SDL/issues/6639
2022-11-27 14:11:06 -08:00
Sasha Szpakowski
0fdabf9595 Update WhatsNew.txt with removed hints. 2022-11-27 10:06:52 -08:00
Sylvain Becker
6a2200823c Cleanup add brace (#6545)
* Add braces after if conditions

* More add braces after if conditions

* Add braces after while() conditions

* Fix compilation because of macro being modified

* Add braces to for loop

* Add braces after if/goto

* Move comments up

* Remove extra () in the 'return ...;' statements

* More remove extra () in the 'return ...;' statements

* More remove extra () in the 'return ...;' statements after merge

* Fix inconsistent patterns are xxx == NULL vs !xxx

* More "{}" for "if() break;"  and "if() continue;"

* More "{}" after if() short statement

* More "{}" after "if () return;" statement

* More fix inconsistent patterns are xxx == NULL vs !xxx

* Revert some modificaion on SDL_RLEaccel.c

* SDL_RLEaccel: no short statement

* Cleanup 'if' where the bracket is in a new line

* Cleanup 'while' where the bracket is in a new line

* Cleanup 'for' where the bracket is in a new line

* Cleanup 'else' where the bracket is in a new line
2022-11-27 08:38:43 -08:00
Sam Lantinga
4958dafdc3 Update comments to refer SDL_GetWindowSizeInPixels (thanks @NoelFB!)
Many SDL Window comments referenced SDL_GL_GetDrawableSize but not the new SDL_GetWindowSizeInPixels.

Closes https://github.com/libsdl-org/SDL/pull/6666
2022-11-27 08:27:00 -08:00
Sasha Szpakowski
80a9397459 Remove SDL_HINT_IDLE_TIMER_DISABLED.
SDL_DisableScreenSaver can be used instead. Fixes #6660.
2022-11-27 08:23:02 -08:00
Sam Lantinga
0a48abc860 Switch header convention from #include "SDL.h" to #include <SDL3/SDLh>
I ran this script in the include directory:
```sh
sed -i '' -e 's,#include "\(SDL.*\)",#include <SDL3/\1>,' *.h
```

I ran this script in the src directory:
```sh
for i in ../include/SDL3/SDL*.h
do hdr=$(basename $i)
   if [ x"$(echo $hdr | egrep 'SDL_main|SDL_name|SDL_test|SDL_syswm|SDL_opengl|SDL_egl|SDL_vulkan')" != x ]; then
        find . -type f -exec sed -i '' -e 's,#include "\('$hdr'\)",#include <SDL3/\1>,' {} \;
    else
        find . -type f -exec sed -i '' -e '/#include "'$hdr'"/d' {} \;
    fi
done
```

Fixes https://github.com/libsdl-org/SDL/issues/6575
2022-11-26 22:15:18 -08:00
Joshua Root
9a64aa6f95 Fix build with Xcode < 7
The _Nullable attribute is not available in older versions.
2022-11-26 20:35:57 -08:00
Anonymous Maarten
1fa80ca529 cmake: testevdev needs build include headers 2022-11-26 15:37:08 -08:00
Sam Lantinga
e4b97c42b3 cmake: avoid copy of headers by moving generated headers to include/build_config (thanks @madebr!)
Shove all build system generated headers in include/build_config.
Doing this, cmake does not need to copy the headers anymore.
This was done for external projects vendoring SDL.

See https://github.com/libsdl-org/SDL/issues/6641#issuecomment-1328092535
2022-11-26 15:37:08 -08:00
Sam Lantinga
9c8369e097 Temporary hack to address performance issues in https://github.com/libsdl-org/SDL/issues/6581#issuecomment-1327987916 (thanks @icculus!) 2022-11-26 13:09:50 -08:00
Sam Lantinga
bb5568ac4f Fixed HAVE_SIGNAL_SUPPORT typo in commit 63f307fe1f (thanks @sezero!) 2022-11-26 12:52:23 -08:00
Sam Lantinga
a268c841e3 Remove references to STDC_HEADERS (thanks @sezero!) 2022-11-26 12:51:20 -08:00
Sam Lantinga
581f1ca5c8 We should only mark functions as inline if necessary for performance 2022-11-26 11:18:24 -08:00
Ryan C. Gordon
fa5adcafd5 cocoa: Patched to compile on macOS SDK < 10.10.
Fixes #6586.
2022-11-26 13:57:45 -05:00
Ozkan Sezer
141bc25198 SDL_rwops.c: reduce ifdefs, and mark SDL_RWFromFP() as SDL_INLINE. 2022-11-26 20:11:20 +03:00
Ryan C. Gordon
80c1ddbe97 dynapi: Bumped dynapi version to 2, so SDL2 libs don't conflict. 2022-11-26 09:49:18 -05:00
Sam Lantinga
ce9f3173cd Only use memset_pattern4() if we have string.h on Apple platforms 2022-11-26 05:25:57 -08:00
Sam Lantinga
bde808cd87 Fixed some warnings when building on Linux with -DSDL_LIBC=OFF 2022-11-26 05:18:26 -08:00
Sam Lantinga
e9014ee769 Fixed evdev using standard C functions instead of SDL functions 2022-11-26 05:01:03 -08:00
Sam Lantinga
45cbee81df Fixed kmsdrm using standard C functions instead of SDL functions 2022-11-26 04:58:55 -08:00
Sam Lantinga
63f307fe1f Remove SDL_config.h from the public headers
The SDL headers are no longer dependent on the build configuration.

Fixes https://github.com/libsdl-org/SDL/issues/6643 and https://github.com/libsdl-org/SDL/issues/6641
2022-11-26 04:48:36 -08:00
Sam Lantinga
bc5677db95 Fixed tvOS build, which is both __IOS__ and __TVOS__ 2022-11-25 17:28:51 -08:00
Sam Lantinga
6786dc481d Xcode expects SUPPORTED_PLATFORMS to be "macosx" (thanks @MaddTheSane!) 2022-11-25 17:16:34 -08:00
Sam Lantinga
8b5a7ccc76 HAVE_OPENGL is defined by CMake on macOS 2022-11-25 17:12:51 -08:00
Sam Lantinga
b6b29fd071 Updated Metal shaders 2022-11-25 16:07:09 -08:00
Sam Lantinga
d9e62f37fb Fixed build 2022-11-25 16:05:03 -08:00
Sam Lantinga
5cfd26d0b9 Removed obsolete android-project-ant 2022-11-25 16:03:29 -08:00
SDL Wiki Bot
4be6b7c047 Sync SDL3 wiki -> header 2022-11-26 00:01:17 +00:00
Sam Lantinga
cc1f9eb983 Use Apple's nomenclature for macOS and iOS
Fixes https://github.com/libsdl-org/SDL/issues/6621
2022-11-25 16:00:06 -08:00
Sam Lantinga
5fb3eb9475 Update docs/README-porting.md
Co-authored-by: Cameron Cawley <ccawley2011@gmail.com>
2022-11-25 15:37:30 -08:00
Sam Lantinga
597e6a685b Update docs/README-macos.md
Co-authored-by: Cameron Cawley <ccawley2011@gmail.com>
2022-11-25 15:37:30 -08:00
Sam Lantinga
7661725b48 Update docs/README-riscos.md
Co-authored-by: Cameron Cawley <ccawley2011@gmail.com>
2022-11-25 15:37:30 -08:00
Anonymous Maarten
c7b5ff81e6 ci: no more need for autoconf and make 2022-11-25 15:37:30 -08:00
Ozkan Sezer
cc0a31d09b INSTALL.txt: s/mingw64/mingw-w64/ 2022-11-25 15:37:30 -08:00
Sam Lantinga
aa2107a698 Fixed install instructions 2022-11-25 15:37:30 -08:00
Sam Lantinga
9c49c57241 Updated INSTALL.txt with instructions for building with mingw64 2022-11-25 15:37:30 -08:00
Sam Lantinga
6d103303e7 Added toolchain files for cross-compiling to Windows 2022-11-25 15:37:30 -08:00
Anonymous Maarten
bdb416e4f3 docs: remove references to configure build systems from documentation 2022-11-25 15:37:30 -08:00
Anonymous Maarten
1c0d26e55c Remove autotools-specific sdl3-config-*.cmake files 2022-11-25 15:37:30 -08:00
Anonymous Maarten
716821ca67 autotools: remove SDL3.spec.in 2022-11-25 15:37:30 -08:00
Ozkan Sezer
7b21eaddce remove autotools build system
- TODO: update INSTALL.txt to replace the autotools configure
        instructions with cmake.
- TODO: update make build system to provide an equivalent to
        autotools' `make dist` ?
- TODO: update / revise github actions, replace autotools-only
        ones with cmake (e.g.: vmactions.yml for FreeBSD.)

Reference issue: https://github.com/libsdl-org/SDL/issues/6571
2022-11-25 15:37:30 -08:00
Frank Praznik
873ec097ea x11: Remove deprecated/defunct X11 hints
SDL_HINT_VIDEO_X11_FORCE_EGL was deprecated in favor of the more general SDL_HINT_VIDEO_FORCE_EGL, and Xinerama and Xvidmode support was previously removed from SDL, rendering their associated hints nonfunctional.
2022-11-25 13:46:47 -08:00
Sam Lantinga
346eeba210 Removed SDL_GetRevisionNumber()
Fixes https://github.com/libsdl-org/SDL/issues/6620
2022-11-25 13:36:14 -08:00
slime
ac8fbb7040 Remove SDL_CalculateGammaRamp. 2022-11-25 13:28:56 -08:00
slime
52f4cc843d Remove SDL_SetWindowBrightness and SDL_SetWindowGammaRamp. 2022-11-25 13:28:56 -08:00
Sam Lantinga
d14530ea82 Removed check for _HAVE_STDINT_H
Fixes https://github.com/libsdl-org/SDL/issues/6619
2022-11-25 13:12:58 -08:00
Anonymous Maarten
95b0712033 cmake: don't create libSDL3.so symbolic link at install time 2022-11-25 12:57:32 -08:00
Simon McVittie
7ef38beb7e build: Simplify library name
We want the library to come out as libSDL3.so.0 on Unix, or something
similar on other platforms. There's no need to have libSDL3-3.0.so.0,
because next time we intentionally break the API it should become libSDL4
anyway.

Partially implements #5626.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-11-25 12:57:32 -08:00
Anonymous Maarten
4574c16178 cmake: test for lsx and lasx intrinsics for loongarch 2022-11-25 21:50:08 +01:00
Anonymous Maarten
d1f423d9db cmake: make all assembly options depend on SDL_ASSEMBLY and architecture 2022-11-25 21:50:08 +01:00
Anonymous Maarten
d0e14008b5 cmake: find libudev library so it gets priority 2022-11-25 21:36:53 +01:00
Anonymous Maarten
1bbff6596c cmake: add support for some BSD's wscons input 2022-11-25 21:36:53 +01:00
Ozkan Sezer
ab8df9096c fix copy/paste typo in previous commit. 2022-11-25 23:20:00 +03:00
Ozkan Sezer
f3fe8ea7ad fix CI windows errors again (because of unused stdio reader callbacks.) 2022-11-25 23:15:02 +03:00
Ozkan Sezer
a8faac1b8b fixed SDL_config_windows.h (was broken by 1e4cd682) 2022-11-25 23:04:04 +03:00
Ozkan Sezer
de0cca91d4 fix CI windows errors because of SDL_RWFromFP() 2022-11-25 22:55:30 +03:00
Ozkan Sezer
25e9449a41 fix SDL_PI_D (L suffix is for long double, not double.) 2022-11-25 22:40:37 +03:00
Ozkan Sezer
1e4cd682b3 removed M_PI detection from cmake, removed HAVE_M_PI from config files.
(didn't touch autofoo side for it so as not to break PR/6605)
2022-11-25 22:35:40 +03:00
Ozkan Sezer
0b8309da0c renamed SDL PI constants to SDL_PI_D and SDL_PI_F. 2022-11-25 22:35:24 +03:00
Sam Lantinga
199423612c Updated test programs with SDL_M_PI* 2022-11-25 10:57:12 -08:00
Sam Lantinga
05139f4a2e Removed SDL_RWFromFP from the public API
This will blow up if the SDL library and the application have a different C runtime, which can easily happen on Windows.
2022-11-25 10:46:26 -08:00
Sam Lantinga
670f1df469 Removed SDL_stdinc.h dependency on HAVE_M_PI, added SDL_M_PIl (double) and SDL_M_PIf (float) instead 2022-11-25 10:33:37 -08:00
Sam Lantinga
8733927e35 Remove SDL_stdinc.h dependency on HAVE_ALLOCA
Assume alloca() is available on all modern systems
2022-11-25 10:06:36 -08:00
Sam Lantinga
fa3814ddf1 Removed SDL_rwops.h dependency on stdio.h 2022-11-25 09:55:42 -08:00
Anonymous Maarten
34d538bd13 ci: fix typo in arguments of cmake
(aargh, sorry)
2022-11-25 05:07:32 +01:00
Anonymous Maarten
18ef9dcf61 ci: fix arguments for FreeBSD CMake
(sorry)
2022-11-25 04:52:52 +01:00
Anonymous Maarten
ecd36c8f07 cmake: fix typo's in last commit 2022-11-25 04:31:25 +01:00
Anonymous Maarten
c9b8559af5 cmake: use option to pass extra check options instead of hardcoding them 2022-11-25 03:15:30 +01:00
Anonymous Maarten
b4fc66525c ci: use CMake for building SDL on FreeBSD 2022-11-24 23:34:04 +01:00
Anonymous Maarten
c069ff1586 cmake: add /usr/local/include to check include directories 2022-11-24 23:33:59 +01:00
Anonymous Maarten
cd13600944 cmake: don't reset check state after pushing state 2022-11-24 23:33:54 +01:00
Michael Fitzmayer
67f31a19a8 Add bitdraw.h, remove non-working stub class 2022-11-24 13:12:36 -08:00
Anonymous Maarten
622f64dff2 cmake: add X11 include dir to check dirs 2022-11-24 20:59:02 +01:00
Sylvain Becker
4f780c7319 SDL_mfijoystick.m: remove VLA, so that projects can be built with error on vla 2022-11-24 16:07:03 +01:00
Ozkan Sezer
f73f23a35c added missing FGREP to Makefile.in. fixed syntax. regenerated configure. 2022-11-24 17:00:32 +03:00
Frank Praznik
836eb22442 wayland: Fix build when not using the shared Wayland libraries
Explicitly include the Wayland protocol headers when statically linking against the Wayland libraries or older system headers might be used instead of the local versions.
2022-11-24 03:00:56 -08:00
Sam James
3e7952ce8a Avoid use of deprecated egrep/fgrep
GNU grep 3.8 emits a deprecation warning on use of egrep/fgrep.

Signed-off-by: Sam James <sam@gentoo.org>
2022-11-24 02:58:20 -08:00
Joshua Root
239423e205 vulkan_metal.h: Make compatible with ObjC ARC
Fixes #6598
2022-11-23 17:37:38 -08:00
Frank Praznik
f47169fcba wayland: Fix libdecor_dispatch signature
The function returns an int, not a bool.
2022-11-23 15:16:37 -08:00
Sam Lantinga
003fd11de8 Regenerated dynamic API after SDL_syswm.h update 2022-11-23 14:34:21 -08:00
SDL Wiki Bot
d9efb7e3de Sync SDL3 wiki -> header 2022-11-23 22:07:15 +00:00
Sam Lantinga
b0840eb32e Updated SDL_syswm.h for SDL 3.0
* The header is no longer dependent on SDL build configuration
* The structures are versioned separately from the rest of SDL
* SDL_GetWindowWMInfo() now returns a standard result code and is passed the version expected by the application
* Updated WhatsNew.txt and docs/README-migration.md with the first API changes in SDL 3.0
2022-11-23 14:05:59 -08:00
Joshua Root
53ca1f7702 SDL_mfijoystick.m: fix build with Xcode < 9
Fixes #6601.
2022-11-23 12:47:46 -08:00
Joshua Root
f8cebeea59 Check build-time SDK in LoadMainMenuNibIfAvailable
Fixes building against OS X 10.7 SDK.
2022-11-23 12:27:50 -08:00
Joshua Root
d2910904fb SDL_cocoaopengl.h: ensure CVDisplayLinkRef is defined
The typedef seems to be pulled in coincidentally with newer SDKs, but
older ones need to import the header explicitly.
2022-11-23 12:21:31 -08:00
Ozkan Sezer
dcad446066 fix dynapi after SDL_GDKSuspendComplete addition. 2022-11-23 23:04:25 +03:00
SDL Wiki Bot
459be25ef9 Sync SDL3 wiki -> header 2022-11-23 19:59:15 +00:00
Sam Lantinga
d5ff71d685 Updated dynamic API after 040a17a50f 2022-11-23 11:55:02 -08:00
Ciro Mondueri
896e200d94 adds GDK suspend/resume basic handling (#6596)
(cherry picked from commit f6144dfe03)
2022-11-23 11:54:16 -08:00
ZX_Huang
a5b0583b7c Add mouse test cases (#6563)
* Add mouse test cases

* fix SDL_GetGlobalMouseState result type

* fix other platforms compile error
2022-11-23 14:28:34 -05:00
pionere
13ea5f7a79 autotools: Detect SDL_JOYSTICK_MFI for macOS + Weak link with CoreHaptics
Only enable MFI if we also have CoreHaptics to ensure rumble works. See:
 - cmake: Detect SDL_JOYSTICK_MFI for macOS (bc409163a8)
 - cmake: Weak link with CoreHaptics (401f485490)
2022-11-23 11:27:48 -08:00
pionere
450f184f7d use SDL_InvalidParamError in the thread 'classes' 2022-11-23 14:27:26 -05:00
Joshua T. Fisher
61188d4972 Allow Foreign Windows to call SDL_Vulkan_CreateSurface on MacOS (#6436) 2022-11-23 11:13:33 -08:00
Cameron Cawley
4ee4e49e49 Select the best pixel formats for use in the software renderer 2022-11-23 11:08:40 -08:00
Ryan C. Gordon
712457ec28 Merge pull request #6321 from Daft-Freak/no-ie
Delete emscripten CanvasPixelArray (IE10/11) support
2022-11-23 14:03:35 -05:00
SDL Wiki Bot
675f77718c Sync SDL3 wiki -> header 2022-11-23 19:03:15 +00:00
Ryan C. Gordon
040a17a50f Merge pull request #6317 from tycho/wip/angle-egl
EGL: fixes for better ANGLE support
2022-11-23 14:02:15 -05:00
Ryan C. Gordon
dcd9e21966 Merge branch 'main' into wip/angle-egl 2022-11-23 14:01:17 -05:00
Cameron Cawley
84781a7b6f Disable the offscreen video driver if EGL is unavailable (#6234) 2022-11-23 10:55:34 -08:00
Ryan C. Gordon
3983c98ece Merge branch 'main' into no-ie 2022-11-23 13:46:27 -05:00
Rémy Tassoux
a94d2e929d Prevent the delay conversion result from being truncated to 32bits 2022-11-23 10:44:53 -08:00
Rémy Tassoux
7d5ffbdab7 Use CREATE_WAITABLE_TIMER_HIGH_RESOLUTION flag in SDL_Delay on Windows 10 version 1803 and later 2022-11-23 10:44:53 -08:00
SDL Wiki Bot
6d5526f3a5 Sync SDL3 wiki -> header 2022-11-23 18:43:14 +00:00
Sam Lantinga
a635a485bc Re-added WinRT support until we're sure that it's no longer being used 2022-11-23 10:41:43 -08:00
David Carlier
d5572559a5 disable VS 2022-11-23 13:29:49 -05:00
David Carlier
975ffaea77 alloc api having new attributes for micro optimisations.
- SDL_MALLOC when the pointer returned is not aliased.
- SDL_ALLOC_SIZE* to gives hint about the size.
2022-11-23 13:29:49 -05:00
Ryan C. Gordon
a5e9d9bd7e Merge pull request #6142 from Daft-Freak/em-webgl-selector-hint
emscripten: use webgl APIs directly and add canvas selector hint
2022-11-23 13:23:15 -05:00
Ryan C. Gordon
c2f26087c8 Merge branch 'main' into em-webgl-selector-hint 2022-11-23 13:22:23 -05:00
Yevhen Babiichuk (DustDFG)
a05b2fbeee Use alias types for which members of event structs instead of plain types
Signed-off-by: Yevhen Babiichuk (DustDFG) <dfgdust@gmail.com>
2022-11-23 10:19:13 -08:00
Anonymous Maarten
b9e45ae0bb ci: correctly print install tree of CMake install 2022-11-23 19:18:26 +01:00
Susko3
8f991d7576 Define TOUCHEVENTF_PEN if not defined 2022-11-23 10:09:08 -08:00
Susko3
42796c56a9 Differentiate between Windows Ink (pen) and regular touch input 2022-11-23 10:09:08 -08:00
Ozkan Sezer
34231f5ba0 reverted opengles removal. 2022-11-23 18:50:02 +03:00
Ozkan Sezer
7767e0c5f9 SDL_config_windows.h: fixed misplaced #endif
was introduced by commit 8d6fda4810
2022-11-23 08:47:14 +03:00
Ozkan Sezer
5db60670ba removed linkage to OpenGLES framework 2022-11-23 07:47:00 +03:00
Ozkan Sezer
016b757311 reverted jack audio backend removal. 2022-11-23 06:50:20 +03:00
SDL Wiki Bot
8a16761cb5 Sync SDL3 wiki -> header 2022-11-22 23:21:29 +00:00
Ryan C. Gordon
4c39dd5c72 Testing the wiki, disregard this commit. 2022-11-22 18:12:08 -05:00
SDL Wiki Bot
290bd8b910 Sync SDL wiki -> header 2022-11-22 22:40:14 +00:00
Ryan C. Gordon
8b18b09027 fnsince.pl: Make this work with SDL3. 2022-11-22 17:39:56 -05:00
Ethan Lee
ecc4b8773c wasapi: Removed WinRT PrivateAudioData members 2022-11-22 17:12:56 -05:00
Ethan Lee
57458588ee wasapi: Merge wasapi_win32.c into wasapi.c 2022-11-22 16:46:12 -05:00
Ozkan Sezer
f4864656d9 removed WinRT-specific hints. 2022-11-22 23:50:00 +03:00
Ozkan Sezer
dc2a3e06e9 removed WinRT support. 2022-11-22 23:36:24 +03:00
Ozkan Sezer
bd5d26071a removed testgles.c remnants. 2022-11-22 22:14:14 +03:00
Anonymous Maarten
4d60056a98 VC: Remove all references to SDL_winmm.[hc] 2022-11-22 20:11:04 +01:00
Ozkan Sezer
7df102d220 reverted sndio backend removal. 2022-11-22 22:04:10 +03:00
Sam Lantinga
3b318f981e Removed G29 from controller_type.c
We don't want the G29 to show up as a gamepad, Steam will create a virtual Xbox controller for it, which breaks racing games.

(cherry picked from commit dce6ed56d7)
2022-11-22 10:57:45 -08:00
Sam Lantinga
189f71efb3 Revert "Added Linux mappings for the Logitech G29 in PS3 and PS4 modes"
This reverts commit 33a68f575f.

We don't want the G29 to show up as a gamepad, Steam will create a virtual Xbox controller for it, which breaks racing games.

(cherry picked from commit e3d430b83e)
2022-11-22 10:57:39 -08:00
Ryan C. Gordon
b33000448e .wikiheaders-options: Add a warning that SDL3 is WIP. 2022-11-22 13:49:03 -05:00
Ozkan Sezer
30b1ab2add removed opengles. 2022-11-22 21:48:40 +03:00
Ozkan Sezer
e581c5d000 removed SDL_VIDEO_DRIVER_MIR remnants. 2022-11-22 20:53:04 +03:00
Ozkan Sezer
be6853b6f1 removed WinCE readmes. 2022-11-22 20:51:50 +03:00
Ozkan Sezer
3cccaeba6c removed jack audio remnants. 2022-11-22 20:51:07 +03:00
Ryan C. Gordon
94f19d974d .wikiheader-options: Whoops, this isn't SDL_mixer. :) 2022-11-22 12:48:33 -05:00
Ozkan Sezer
3aea865cdf removed directfb support. 2022-11-22 20:45:45 +03:00
Anonymous Maarten
47c37a8e9d android.mk: LOCAL_EXPORT_C_INCLUDES does not need to add include subfolder 2022-11-22 18:35:49 +01:00
Sam Lantinga
0c1f9118a7 Removed version updates/checks for Makefile.os2 and Makefile.w32 2022-11-22 09:29:09 -08:00
Sam Lantinga
e95819fae2 Update SDL info and Xcode marketing version with version update scripts 2022-11-22 09:27:25 -08:00
Ozkan Sezer
eae9c79c21 SDL_syswm.h: removed SDL_SYSWM_MIR 2022-11-22 20:26:24 +03:00
Ozkan Sezer
5cedc2f1ff removed QNX support. 2022-11-22 20:23:40 +03:00
Ozkan Sezer
b6604a456f regenerated configure. 2022-11-22 20:11:50 +03:00
Ozkan Sezer
e89a1f9157 removed NaCL support. 2022-11-22 20:10:47 +03:00
Ozkan Sezer
cdb54ad21e removed arts, esd, fusionsound, nas, paudio, sndio, sunaudio, winmm audio backends. 2022-11-22 19:51:56 +03:00
Cameron Cawley
05e2c8f2ce Update README-riscos.md to reflect that atomic functions have been fixed 2022-11-22 08:32:18 -08:00
pionere
68b30d24e0 cmake: get rid of the duplicated _USE_MATH_DEFINES
- define _USE_MATH_DEFINES in SDL_stdinc.h only
- define _USE_MATH_DEFINES if not defined already
2022-11-22 08:31:35 -08:00
Sam Lantinga
ed8637f437 Fixed typo 2022-11-22 08:28:56 -08:00
Ozkan Sezer
8d6fda4810 removed os2 support & support for building SDL with watcom. 2022-11-22 19:18:47 +03:00
Sam Lantinga
01d137592c Updated SDL_VERSIONNUM macro for new SDL version convention
Fixes https://github.com/libsdl-org/SDL/issues/6578
2022-11-22 07:58:03 -08:00
Ozkan Sezer
63243eb3a5 removed pandora support 2022-11-22 18:50:00 +03:00
Ozkan Sezer
d8864ea11d removed visualtest 2022-11-22 18:47:03 +03:00
Anonymous Maarten
ea21628045 ci: replace references to SDL2 with SDL3 2022-11-22 06:45:46 +01:00
SDL Wiki Bot
1b9c4c5ca1 Sync SDL wiki -> header 2022-11-22 04:30:16 +00:00
Sam Lantinga
2c4159b99a First pass at changing SDL 2.0 to SDL 3.0 2022-11-21 20:28:58 -08:00
Sam Lantinga
0bfeed061b Updated to version 2.26.0 for release 2022-11-21 16:15:58 -08:00
Sam Lantinga
d167cd6715 Added the Gunfighter Mk.III ‘Space Combat Edition’ as a flight stick 2022-11-21 09:02:10 -08:00
Sam Lantinga
8b20b568b0 Don't report battery level for disconnected batteries
Fixes https://github.com/libsdl-org/SDL/issues/6536
2022-11-21 07:42:14 -08:00
Sam Lantinga
8ae46a49ea Save the version in VERSION.txt instead of VERSION
Fixes https://github.com/libsdl-org/SDL/issues/6558
2022-11-21 06:57:02 -08:00
Sam Lantinga
802c624ab3 Strip trailing newline when reading the VERSION file 2022-11-20 14:37:05 -08:00
Ozkan Sezer
3bc4bad8fb add missing strcasestr checks to cmake and autotools build systems,
and update config files.
2022-11-20 14:20:33 -08:00
Frank Praznik
fe396e306e wayland: Use the cached window size when switching from non-floating to floating window state
When changing the window state from non-floating to floating (e.g. leaving fullscreen), libdecor can send bogus content sizes that are +/- the height of the window title bar and start 'walking' the window height in one direction or the other with every transition.

The floating window size is known, so use the cached value instead of the size reported by libdecor when restoring the floating state.
2022-11-19 09:15:27 -08:00
Sam Lantinga
509939b1b6 Disable the third party PS3 HIDAPI driver by default, the L3/R3 buttons are unknown 2022-11-18 18:20:53 -08:00
Sam Lantinga
ff99e56d3a Fixed KMSDRM window creation failing if OpenGL libraries are not available, but GLES 2.0 libraries are 2022-11-18 12:54:55 -08:00
Sam Lantinga
da9ba3a2a1 If a CRTC doesn't have a mode configured, use the preferred or largest mode as the default mode
Fixes https://github.com/libsdl-org/SDL/issues/6421
2022-11-18 12:17:27 -08:00
Sam Lantinga
ea4ea27a59 Don't trigger an error if we try to delete a touch device after shutting down the touch system
This can happen on Raspberry Pi if the display system fails to initialize.
2022-11-18 11:14:14 -08:00
David Gow
81479d8784 wayland: keyboard: Cache text input parameters.
Some applications (and embarrassingly, testime is one of them) call
SDL_StartTextInput() or SDL_SetTextInputRect() every frame. On KDE/KWin
with fcitx5, this causes there to be several preedit events every frame
(particularly given some of the workarounds in Wayland_StartTextInput),
which slows testime down to an unusable crawl.

Instead, make SDL_StartTextInput() a no-op if text input is already
enabled, and cache the input rect, only changing it when the new rect is
actually different.

With these changes, we only get preedit events (and hence
SDL_TEXTEDITING events) when the preedit string actually changes. This
matches the behaviour under XWayland, and works very smoothly.
2022-11-18 07:18:36 -08:00
Ozkan Sezer
6dc96aa745 SDL_UDEV_DelCallback: return early if _this is NULL
Fixes https://github.com/libsdl-org/SDL/issues/6548
2022-11-18 18:02:10 +03:00
Sylvain
16824865c2 Cleanup of SDL_SetError that already return -1 value 2022-11-18 06:59:10 -08:00
Sylvain
3e70553c48 Unneed test before calling SDL_FreeSurface 2022-11-18 06:58:34 -08:00
Sam Lantinga
9209942949 Revert "sdl2-config.in: Deprecate sdl2-config"
This reverts commit e0d904e90b.

SDL 3 will have the recommended path forward, we don't need to nag in SDL 2.
2022-11-18 06:53:13 -08:00
Sam Lantinga
769ae185d6 Revert "sdl2.m4: Deprecate AM_PATH_SDL2 in favour of PKG_CHECK_MODULES"
This reverts commit a66cb8cf21.

SDL 3 will have the recommended path forward, we don't need to nag in SDL 2.
2022-11-18 06:52:12 -08:00
Steven Noonan
3d8a7e4c15 cocoa: implement GL_GetDrawableSize for OpenGL ES 2022-11-10 18:06:12 -08:00
Steven Noonan
e8fbb02d16 windows: support forcing EGL for GL desktop
This will theoretically support ANGLE's GL desktop frontend whenever it
becomes fully implemented and enabled in the future.
2022-11-10 18:06:12 -08:00
Steven Noonan
085a276d6c egl: implement callbacks for defining custom EGL attributes
Depending on the underlying EGL library, it may be desirable to
conditionally set some specific EGL attributes depending on available
extensions and other application state.

SDL's EGL usage makes this a little bit complicated because:

- there are multiple functions used to set up a working EGL context
- some of these functions take different types of EGL attributes
  (EGLAttrib vs EGLint)
- the EGL extension list before creating an EGLDisplay differs from the
  extension list after (i.e. display vs client extensions)
- all of the above happens in a single SDL_CreateWindow call

This leaves no place for the application to discover what EGL extensions
are available and provide custom attribute lists.

Until now, if a developer wants to add a custom EGL attribute for
eglGetPlatformDisplay, eglCreateWindowSurface or eglCreateContext, they
needed to patch SDL itself. This is very undesirable, since such
developers would have to disable the SDL dynapi in order to maintain
compatibility with their needs.

This patch implements some callbacks which developers can use to
dynamically generate custom EGL attributes for SDL to use during
SDL_CreateWindow.
2022-11-10 18:06:12 -08:00
Steven Noonan
0644042eb8 egl: implement public functions to obtain internal EGL handles
These functions allow applications to call EGL functions against the SDL
EGL context. For example, applications can use an EGL API loader via
SDL_EGL_GetCurrentDisplay and SDL_EGL_GetProcAddress, and can call
functions such as eglQuerySurface against the internal EGLSurface and
EGLDisplay.
2022-11-10 18:06:11 -08:00
Steven Noonan
eacf6dc15e egl: fix function prototype for eglGetPlatformDisplay
The EGL 1.5 specification says that eglGetPlatformDisplay (unlike
eglGetPlatformDisplayExt) takes an EGLAttrib* rather than EGLint* for
the attribute list.
2022-11-10 18:06:11 -08:00
Steven Noonan
fb1a581209 egl: add hint to disable eglGetDisplay fallback when eglGetPlatformDisplay fails
This fallback is undesirable when using ANGLE, because it will end up
using some default configuration (e.g. on Windows it defaults to the
D3D11 backend).
2022-11-10 18:06:11 -08:00
Steven Noonan
c608cf6222 egl: implement SDL_GL_EGL_PLATFORM attribute
This implements a new SDL_GL_EGL_PLATFORM attribute to set the
"platform" argument for SDL_EGL_LoadLibrary on Windows, macOS, and
Linux. I've limited it to those three operating systems because that's
what I've been able to test against.
2022-11-10 18:06:11 -08:00
Steven Noonan
aed980526c SDL_video: defer destroying window until GL/EGL/Vulkan unloaded 2022-11-10 18:06:11 -08:00
Steven Noonan
5a7c20b945 hints: replace SDL_HINT_VIDEO_X11_FORCE_EGL with platform-agnostic SDL_HINT_VIDEO_FORCE_EGL
This adds support for forcing the use of EGL on Windows and MacOS. The
SDL_HINT_VIDEO_X11_FORCE_EGL hint is retained for backwards
compatibility but is now deprecated.
2022-11-10 18:06:10 -08:00
Charlie Birks
90e7d05c3b emscripten: drop CanvasPixelArray support from cursor 2022-09-30 16:33:10 +01:00
Charlie Birks
0c6d5b3ac8 emscripten: drop CanvasPixelArray support from framebuffer 2022-09-30 16:28:57 +01:00
Charlie Birks
d75fb0995d emscripten: Add a hint for specifying the canvas selector
Now that we're not going through EGL, this is easy
2022-08-26 15:20:24 +01:00
Charlie Birks
b5aedaad59 emscripten: Modify UpdateWindowFramebuffer
To work with multiple canvases
2022-08-26 15:20:24 +01:00
Charlie Birks
539efc1bba emscripten: Return an error for webgl context limitations 2022-08-26 15:18:22 +01:00
Charlie Birks
eebbf3457c emscripten: Use emscripten_webgl_ API directly 2022-08-26 15:18:19 +01:00
2570 changed files with 720803 additions and 576450 deletions

View File

@@ -16,8 +16,8 @@ AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: All
AlwaysBreakAfterReturnType: AllDefinitions
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
@@ -35,7 +35,7 @@ BraceWrapping:
AfterUnion: true
AfterExternBlock: false
BeforeElse: false
BeforeWhile: true
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
@@ -62,7 +62,8 @@ IndentGotoLabels: true
IndentPPDirectives: None
IndentExternBlock: NoIndent
SpaceAfterCStyleCast: true
PointerAlignment: Right
SpaceAfterCStyleCast: false
SpacesInCStyleCastParentheses: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
@@ -81,6 +82,7 @@ ForEachMacros:
"spa_list_for_each",
"spa_list_for_each_safe",
"wl_list_for_each",
"wl_list_for_each_safe",
"wl_array_for_each",
"udev_list_entry_foreach",
]

59
.clang-tidy Normal file
View File

@@ -0,0 +1,59 @@
---
Checks: >
-*,
bugprone-assert-side-effect,
bugprone-assignment-in-if-condition,
bugprone-bool-pointer-implicit-conversion,
bugprone-dangling-handle,
bugprone-dynamic-static-initializers,
bugprone-infinite-loop,
bugprone-integer-division,
bugprone-macro-repeated-side-effects,
bugprone-misplaced-operator-in-strlen-in-alloc,
bugprone-misplaced-pointer-arithmetic-in-alloc,
bugprone-misplaced-widening-cast,
bugprone-not-null-terminated-result,
bugprone-posix-return,
bugprone-redundant-branch-condition,
bugprone-string-literal-with-embedded-nul,
bugprone-suspicious-memset-usage,
bugprone-suspicious-semicolon,
bugprone-suspicious-string-compare,
bugprone-too-small-loop-variable,
bugprone-unused-return-value,
cert-err33-c,
clang-analyzer-core.*,
clang-analyzer-valist.*,
clang-analyzer-unix.Malloc,
clang-diagnostic-*,
google-readability-casting,
misc-misleading-bidirectional,
misc-misleading-identifier,
misc-misplaced-const,
misc-redundant-expression,
objc-*,
performance-type-promotion-in-math-fn,
readability-avoid-const-params-in-decls,
readability-braces-around-statements,
readability-const-return-type,
readability-duplicate-include,
readability-inconsistent-declaration-parameter-name,
readability-misplaced-array-index,
readability-non-const-parameter,
readability-redundant-control-flow,
readability-redundant-declaration,
readability-redundant-function-ptr-dereference,
readability-redundant-preprocessor,
readability-simplify-boolean-expr
CheckOptions:
- key: bugprone-assert-side-effect.AssertMacros
value: "SDL_assert, SDL_assert_release, SDL_assert_paranoid, SDL_assert_always, SDL_COMPILE_TIME_ASSERT"
- key: bugprone-misplaced-widening-cast.CheckImplicitCasts
value: true
- key: bugprone-not-null-terminated-result.WantToUseSafeFunctions
value: false # Do not recommend _s functions
FormatStyle: "file"
HeaderFilterRegex: "*.h$"
WarningsAsErrors: ""

View File

@@ -4,49 +4,38 @@
root = true
[*.{c,cg,cpp,gradle,h,java,m,metal,pl,py,S,sh,txt}]
[*.{c,cc,cg,cpp,gradle,h,java,m,metal,pl,py,S,sh,txt}]
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.{html,js,json,m4,yml,yaml,vcxproj,vcxproj.filters}]
indent_size = 2
indent_style = space
trim_tailing_whitespace = true
[*.xml]
indent_size = 4
indent_style = space
[{CMakeLists.txt,sdl2-config*.cmake.in,cmake/*.cmake}]
[{CMakeLists.txt,cmake/*.cmake}]
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[{cmake_uninstall.cmake.in,test/CMakeLists.txt}]
indent_size = 4
indent_style = space
[configure.ac]
# Inconsistently 2-, 4- or occasionally 3-space indented, but mostly 4,
# so let's use 4 for new code
[{cmake/cmake_uninstall.cmake.in,test/CMakeLists.txt,cmake/SDL3Config.cmake.in}]
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[{Makefile.*,*.mk,*.sln,*.pbxproj,*.plist}]
indent_size = 8
indent_style = tab
tab_width = 8
[Makefile.os2]
indent_size = 4
indent_style = space
[test/Makefile.os2]
indent_size = 2
indent_style = space
[{src/core/os2/geniconv/makefile,src/core/os2/geniconv/os2cp.c}]
indent_size = 2
indent_style = space
[src/joystick/controller_type.*]
indent_style = tab
@@ -75,3 +64,6 @@ tab_width = 4
[{*.bat,*.rc}]
end_of_line = crlf
[*.cocci]
insert_final_newline = true

View File

@@ -0,0 +1,82 @@
name: 'Setup GDK (Game Development Kit) for Windows Desktop'
description: 'Download GDK and install into MSBuild'
inputs:
# Keep edition and ref in sync!
edition:
description: 'GDK edition'
default: '240601' # YYMMUU (Year Month Update)
ref:
description: 'Git reference'
default: 'June_2024_Update_1'
folder:
description: 'Folder where to create Directory.Build.props'
required: true
default: '${{ github.workspace }}'
runs:
using: 'composite'
steps:
- uses: actions/setup-python@main
with:
python-version: 3.x
- name: 'Calculate variables'
id: calc
shell: pwsh
run: |
$vs_folder=@(vswhere -latest -property installationPath)
echo "vs-folder=${vs_folder}" >> $Env:GITHUB_OUTPUT
echo "gdk-path=${{ runner.temp }}\GDK-${{ inputs.edition }}" >> $Env:GITHUB_OUTPUT
echo "cache-key=gdk-${{ inputs.ref }}-${{ inputs.edition }}" >> $Env:GITHUB_OUTPUT
- name: 'Restore cached GDK'
id: cache-restore
uses: actions/cache/restore@v4
with:
path: '${{ steps.calc.outputs.gdk-path }}'
key: ${{ steps.calc.outputs.cache-key }}
- name: 'Download GDK'
if: ${{ !steps.cache-restore.outputs.cache-hit }}
shell: pwsh
run: |
python build-scripts/setup-gdk-desktop.py `
--download `
--temp-folder "${{ runner.temp }}" `
--gdk-path="${{ steps.calc.outputs.gdk-path }}" `
--ref-edition "${{ inputs.ref }},${{ inputs.edition }}" `
--vs-folder="${{ steps.calc.outputs.vs-folder }}" `
--no-user-props
- name: 'Extract GDK'
if: ${{ !steps.cache-restore.outputs.cache-hit }}
shell: pwsh
run: |
python build-scripts/setup-gdk-desktop.py `
--extract `
--ref-edition "${{ inputs.ref }},${{ inputs.edition }}" `
--temp-folder "${{ runner.temp }}" `
--gdk-path="${{ steps.calc.outputs.gdk-path }}" `
--vs-folder="${{ steps.calc.outputs.vs-folder }}" `
--no-user-props
- name: 'Cache GDK'
if: ${{ !steps.cache-restore.outputs.cache-hit }}
uses: actions/cache/save@v4
with:
path: '${{ steps.calc.outputs.gdk-path }}'
key: ${{ steps.calc.outputs.cache-key }}
- name: 'Copy MSBuild files into GDK'
shell: pwsh
run: |
python build-scripts/setup-gdk-desktop.py `
--ref-edition "${{ inputs.ref }},${{ inputs.edition }}" `
--gdk-path="${{ steps.calc.outputs.gdk-path }}" `
--vs-folder="${{ steps.calc.outputs.vs-folder }}" `
--copy-msbuild `
--no-user-props
- name: 'Write user props'
shell: pwsh
run: |
python build-scripts/setup-gdk-desktop.py `
--ref-edition "${{ inputs.ref }},${{ inputs.edition }}" `
--temp-folder "${{ runner.temp }}" `
--vs-folder="${{ steps.calc.outputs.vs-folder }}" `
--gdk-path="${{ steps.calc.outputs.gdk-path }}" `
"--props-folder=${{ inputs.folder }}"

View File

@@ -0,0 +1,53 @@
name: 'Setup LoongArch64 toolchain'
description: 'Download Linux LoongArch64 toolchain and set output variables'
inputs:
version:
description: 'LoongArch64 version'
default: '2023.08.08'
outputs:
prefix:
description: "LoongArch toolchain prefix"
value: ${{ steps.final.outputs.prefix }}
cc:
description: "LoongArch C compiler"
value: ${{ steps.final.outputs.cc }}
cxx:
description: "LoongArch C++ compiler"
value: ${{ steps.final.outputs.cxx }}
runs:
using: 'composite'
steps:
- uses: actions/cache/restore@v4
id: restore-cache
with:
path: /opt/cross-tools
key: loongarch64-${{ inputs.version }}
- name: 'Download LoongArch64 gcc+glibc toolchain'
if: ${{ !steps.restore-cache.outputs.cache-hit }}
shell: bash
run: |
url="https://github.com/loongson/build-tools/releases/download/${{ inputs.version }}/CLFS-loongarch64-8.1-x86_64-cross-tools-gcc-glibc.tar.xz"
wget "$url" -O /tmp/toolchain.tar.xz
mkdir -p /opt
tar -C /opt -x -f /tmp/toolchain.tar.xz
- uses: actions/cache/save@v4
if: ${{ !steps.restore-cache.outputs.cache-hit }}
with:
path: /opt/cross-tools
key: loongarch64-${{ inputs.version }}
- name: 'Set output vars'
id: final
shell: bash
run: |
prefix=/opt/cross-tools
echo "prefix=${prefix}" >> $GITHUB_OUTPUT
cc="${prefix}/bin/loongarch64-unknown-linux-gnu-gcc"
cxx="${prefix}/bin/loongarch64-unknown-linux-gnu-g++"
echo "cc=${cc}" >> $GITHUB_OUTPUT
echo "cxx=${cxx}" >> $GITHUB_OUTPUT
echo "LOONGARCH64_CC=${cc}" >>$GITHUB_ENV
echo "LOONGARCH64_CXX=${cxx}" >>$GITHUB_ENV

View File

@@ -0,0 +1,71 @@
name: 'Setup libusb for MSVC'
description: 'Download libusb sdk for MSVC, and set output/environment variables'
inputs:
version:
description: 'libusb version'
required: true
default: '1.0.27'
arch:
description: "libusb architecture (x86 or x64)"
rqeuired: true
outputs:
root:
description: "libusb root directory"
value: ${{ steps.final.outputs.root }}
runs:
using: 'composite'
steps:
- name: 'Restore cached libusb-${{ inputs.version }}.7z'
id: cache-restore
uses: actions/cache/restore@v4
with:
path: 'C:\temp\libusb-${{ inputs.version }}.7z'
key: libusb-msvc-${{ inputs.version }}
- name: 'Download libusb ${{ inputs.version }}'
if: ${{ !steps.cache-restore.outputs.cache-hit }}
shell: pwsh
run: |
Invoke-WebRequest "https://github.com/libusb/libusb/releases/download/v${{ inputs.version }}/libusb-${{ inputs.version }}.7z" -OutFile "C:\temp\libusb-${{ inputs.version }}.7z"
- name: 'Cache libusb-${{ inputs.version }}.7z'
if: ${{ !steps.cache-restore.outputs.cache-hit }}
uses: actions/cache/save@v4
with:
path: 'C:\temp\libusb-${{ inputs.version }}.7z'
key: libusb-msvc-${{ inputs.version }}
- name: 'Extract libusb'
shell: pwsh
run: |
7z "-oC:\temp\libusb-${{ inputs.version }}" x "C:\temp\libusb-${{ inputs.version }}.7z"
- name: 'Set output vars'
id: final
shell: pwsh
run: |
if ('${{ inputs.arch }}' -eq 'x86') {
$archdir = "MS32";
} elseif ('${{ inputs.arch }}' -eq 'x64') {
$archdir = "MS64";
} else {
write-host "Invalid arch=${{ inputs.arch }}"
exit 1
}
$libusb_incdir = "C:\temp\libusb-${{ inputs.version }}\include";
$libusb_libdir = "C:\temp\libusb-${{ inputs.version }}\VS2022\${archdir}\dll";
$libusb_header = "${libusb_incdir}\libusb.h";
$libusb_implib = "${libusb_libdir}\libusb-1.0.lib";
$libusb_dll = "${libusb_libdir}\libusb-1.0.dll";
if (!(Test-Path "${libusb_header}")) {
write-host "${libusb_header} does not exist!"
exit 1
}
if (!(Test-Path "${libusb_implib}")){
write-host "${libusb_implib} does not exist!"
exit 1
}
if (!(Test-Path "${libusb_dll}")) {
write-host "${libusb_dll} does not exist!"
exit 1
}
echo "root=${libusb_incdir};${libusb_libdir}" >> $env:GITHUB_OUTPUT
echo "LibUSB_ROOT=${libusb_incdir};${libusb_libdir}" >> $env:GITHUB_ENV

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

62
.github/actions/setup-ninja/action.yml vendored Normal file
View File

@@ -0,0 +1,62 @@
name: 'Setup ninja'
description: 'Download ninja and add it to the PATH environment variable'
inputs:
version:
description: 'Ninja version'
default: '1.12.1'
runs:
using: 'composite'
steps:
- name: 'Calculate variables'
id: calc
shell: sh
run: |
case "${{ runner.os }}-${{ runner.arch }}" in
"Linux-X86" | "Linux-X64")
archive="ninja-linux.zip"
;;
"Linux-ARM64")
archive="ninja-linux-aarch64.zip"
;;
"macOS-X86" | "macOS-X64" | "macOS-ARM64")
archive="ninja-mac.zip"
;;
"Windows-X86" | "Windows-X64")
archive="ninja-win.zip"
;;
"Windows-ARM64")
archive="ninja-winarm64.zip"
;;
*)
echo "Unsupported ${{ runner.os }}-${{ runner.arch }}"
exit 1;
;;
esac
echo "archive=${archive}" >> ${GITHUB_OUTPUT}
echo "cache-key=${archive}-${{ inputs.version }}-${{ runner.os }}-${{ runner.arch }}" >> ${GITHUB_OUTPUT}
- name: 'Restore cached ${{ steps.calc.outputs.archive }}'
id: cache-restore
uses: actions/cache/restore@v4
with:
path: '${{ runner.temp }}/${{ steps.calc.outputs.archive }}'
key: ${{ steps.calc.outputs.cache-key }}
- name: 'Download ninja ${{ inputs.version }} for ${{ runner.os }} (${{ runner.arch }})'
if: ${{ !steps.cache-restore.outputs.cache-hit || steps.cache-restore.outputs.cache-hit == 'false' }}
shell: pwsh
run: |
Invoke-WebRequest "https://github.com/ninja-build/ninja/releases/download/v${{ inputs.version }}/${{ steps.calc.outputs.archive }}" -OutFile "${{ runner.temp }}/${{ steps.calc.outputs.archive }}"
- 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 }}/${{ steps.calc.outputs.archive }}'
key: ${{ steps.calc.outputs.cache-key }}
- name: 'Extract ninja'
shell: pwsh
run: |
7z "-o${{ runner.temp }}/ninja-${{ inputs.version }}-${{ runner.arch }}" x "${{ runner.temp }}/${{ steps.calc.outputs.archive }}"
- name: 'Set output variables'
id: final
shell: pwsh
run: |
echo "${{ runner.temp }}/ninja-${{ inputs.version }}-${{ runner.arch }}" >> $env:GITHUB_PATH

View File

@@ -0,0 +1,93 @@
name: 'Setup GLES for PlayStation Vita'
description: 'Download GLES for VITA (PVR or PIB), and copy it into the vita sdk'
inputs:
pib-version:
description: 'PIB version'
default: '1.1.4'
pvr-version:
description: 'PVR_PSP2 version'
default: '3.9'
type:
description: '"pib" or "pvr"'
default: ''
runs:
using: 'composite'
steps:
- name: 'Calculate variables'
id: calc
shell: sh
run: |
if test "x${VITASDK}" = "x"; then
echo "VITASDK must be defined"
exit 1;
fi
case "x${{ inputs.type }}" in
"xpvr")
echo "cache-key=SDL-vita-gles-pvr-${{ inputs.pvr-version}}" >> ${GITHUB_OUTPUT}
;;
"xpib")
echo "cache-key=SDL-vita-gles-pib-${{ inputs.pib-version}}" >> ${GITHUB_OUTPUT}
;;
*)
echo "Invalid type. Must be 'pib' or 'pvr'."
exit 1
;;
esac
- uses: actions/cache/restore@v4
id: restore-cache
with:
path: /vita/dependencies
key: '${{ steps.calc.outputs.cache-key }}'
- name: 'Download PVR_PSP2 (GLES)'
if: ${{ !steps.restore-cache.outputs.cache-hit && inputs.type == 'pvr' }}
shell: sh
run: |
pvr_psp2_version=${{ inputs.pvr-version }}
mkdir -p /vita/dependencies/include
mkdir -p /vita/dependencies/lib
# Configure PVR_PSP2 headers
wget https://github.com/GrapheneCt/PVR_PSP2/archive/refs/tags/v$pvr_psp2_version.zip -P/tmp
unzip /tmp/v$pvr_psp2_version.zip -d/tmp
cp -r /tmp/PVR_PSP2-$pvr_psp2_version/include/* /vita/dependencies/include
rm /tmp/v$pvr_psp2_version.zip
# include guard of PVR_PSP2's khrplatform.h does not match the usual one
sed -i -e s/__drvkhrplatform_h_/__khrplatform_h_/ /vita/dependencies/include/KHR/khrplatform.h
# Configure PVR_PSP2 stub libraries
wget https://github.com/GrapheneCt/PVR_PSP2/releases/download/v$pvr_psp2_version/vitasdk_stubs.zip -P/tmp
unzip /tmp/vitasdk_stubs.zip -d/tmp/pvr_psp2_stubs
find /tmp/pvr_psp2_stubs -type f -name "*.a" -exec cp {} /vita/dependencies/lib \;
rm /tmp/vitasdk_stubs.zip
rm -rf /tmp/pvr_psp2_stubs
- name: 'Download gl4es4vita (OpenGL)'
if: ${{ !steps.restore-cache.outputs.cache-hit && inputs.type == 'pib' }}
shell: sh
run: |
gl4es4vita_version=${{ inputs.pib-version }}
mkdir -p /vita/dependencies/include
mkdir -p /vita/dependencies/lib
# Configure gl4es4vita headers
wget https://github.com/SonicMastr/gl4es4vita/releases/download/v$gl4es4vita_version-vita/include.zip -P/tmp
unzip -o /tmp/include.zip -d/vita/dependencies/include
rm /tmp/include.zip
# Configure gl4es4vita stub libraries
wget https://github.com/SonicMastr/gl4es4vita/releases/download/v$gl4es4vita_version-vita/vitasdk_stubs.zip -P/tmp
unzip /tmp/vitasdk_stubs.zip -d/vita/dependencies/lib
- uses: actions/cache/save@v4
if: ${{ !steps.restore-cache.outputs.cache-hit }}
with:
path: /vita/dependencies
key: '${{ steps.calc.outputs.cache-key }}'
- name: Copy PVR_PSP2 (GLES) or gl4es4vita (OpenGL) to vita toolchain dir
shell: sh
run: |
cp -rv /vita/dependencies/* ${VITASDK}/arm-vita-eabi

16
.github/cmake/CMakeLists.txt vendored Normal file
View File

@@ -0,0 +1,16 @@
cmake_minimum_required(VERSION 3.0...3.5)
project(ci_utils C CXX)
set(txt "CC=${CMAKE_C_COMPILER}
CXX=${CMAKE_CXX_COMPILER}
CFLAGS=${CMAKE_C_FLAGS}
CXXFLAGS=${CMAKE_CXX_FLAGS}
LDFLAGS=${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_C_STANDARD_LIBRARIES}
")
message("${txt}")
set(VAR_PATH "/tmp/env.txt" CACHE PATH "Where to write environment file")
message(STATUS "Writing CC/CXX/CFLAGS/CXXFLAGS/LDFLAGS environment to ${VAR_PATH}")
file(WRITE "${VAR_PATH}" "${txt}")

View File

@@ -1,81 +0,0 @@
name: Build (Android)
on: [push, pull_request]
jobs:
android:
name: ${{ matrix.platform.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- { name: Android.mk }
- { name: CMake, cmake: 1, android_abi: "arm64-v8a", android_platform: 23, arch: "aarch64" }
steps:
- uses: actions/checkout@v3
- uses: nttld/setup-ndk@v1
id: setup_ndk
with:
ndk-version: r21e
- name: Build (Android.mk)
if: ${{ matrix.platform.name == 'Android.mk' }}
run: |
./build-scripts/androidbuildlibs.sh
- name: Setup (CMake)
if: ${{ matrix.platform.name == 'CMake' }}
run: |
sudo apt-get update
sudo apt-get install ninja-build pkg-config
- name: Configure (CMake)
if: ${{ matrix.platform.name == 'CMake' }}
run: |
cmake -B build \
-DCMAKE_TOOLCHAIN_FILE=${{ steps.setup_ndk.outputs.ndk-path }}/build/cmake/android.toolchain.cmake \
-DSDL_WERROR=ON \
-DANDROID_PLATFORM=${{ matrix.platform.android_platform }} \
-DANDROID_ABI=${{ matrix.platform.android_abi }} \
-DSDL_STATIC_PIC=ON \
-DSDL_VENDOR_INFO="Github Workflow" \
-DCMAKE_INSTALL_PREFIX=prefix \
-DCMAKE_BUILD_TYPE=Release \
-GNinja
- name: Build (CMake)
if: ${{ matrix.platform.name == 'CMake' }}
run: |
cmake --build build --config Release --parallel --verbose
- name: Install (CMake)
if: ${{ matrix.platform.name == 'CMake' }}
run: |
cmake --install build --config Release
echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV
( cd prefix; find ) | LC_ALL=C sort -u
- name: Verify CMake configuration files
if: ${{ matrix.platform.name == 'CMake' }}
run: |
cmake -S cmake/test -B cmake_config_build -G Ninja \
-DCMAKE_TOOLCHAIN_FILE=${{ steps.setup_ndk.outputs.ndk-path }}/build/cmake/android.toolchain.cmake \
-DANDROID_PLATFORM=${{ matrix.platform.android_platform }} \
-DANDROID_ABI=${{ matrix.platform.android_abi }} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }}
cmake --build cmake_config_build --verbose
- name: Verify sdl2-config
if: ${{ matrix.platform.name == 'CMake' }}
run: |
export CC="${{ steps.setup_ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=${{ matrix.platform.arch }}-none-linux-androideabi${{ matrix.platform.android_platform }}"
export PATH=${{ env.SDL2_DIR }}/bin:$PATH
cmake/test/test_sdlconfig.sh
- name: Verify sdl2.pc
if: ${{ matrix.platform.name == 'CMake' }}
run: |
export CC="${{ steps.setup_ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=${{ matrix.platform.arch }}-none-linux-androideabi${{ matrix.platform.android_platform }}"
export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig
cmake/test/test_pkgconfig.sh
- name: Verify Android.mk
if: ${{ matrix.platform.name == 'CMake' }}
run: |
export NDK_MODULE_PATH=${{ env.SDL2_DIR }}/share/ndk-modules
ndk-build -C ${{ github.workspace }}/cmake/test APP_PLATFORM=android-${{ matrix.platform.android_platform }} APP_ABI=${{ matrix.platform.android_abi }} NDK_OUT=$PWD NDK_LIBS_OUT=$PWD V=1

48
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,48 @@
name: 'Build (All)'
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
controller:
name: 'Create test plan'
runs-on: 'ubuntu-latest'
outputs:
platforms-level1: ${{ steps.plan.outputs.platforms-level1 }}
platforms-others: ${{ steps.plan.outputs.platforms-others }}
steps:
- uses: actions/setup-python@main
with:
python-version: 3.x
- uses: actions/checkout@main
with:
sparse-checkout: '.github/workflows/create-test-plan.py'
- name: 'Create plan'
id: plan
run: |
# Adding [sdl-ci-filter GLOB] to the commit message will limit the jobs
# e.g. [sdl-ci-filter msvc-*]
EOF=$(openssl rand -hex 32)
cat >/tmp/commit_message.txt <<$EOF
${{ github.event.head_commit.message }}
$EOF
python .github/workflows/create-test-plan.py \
--github-variable-prefix platforms \
--github-ci \
--verbose \
${{ (github.repository_owner != 'libsdl-org' && '--no-artifact') || '' }} \
--commit-message-file /tmp/commit_message.txt
level1:
needs: [controller]
uses: './.github/workflows/generic.yml'
with:
platforms: ${{ needs.controller.outputs.platforms-level1 }}
level2:
needs: [controller, level1]
uses: './.github/workflows/generic.yml'
with:
platforms: ${{ needs.controller.outputs.platforms-others }}

902
.github/workflows/create-test-plan.py vendored Executable file
View File

@@ -0,0 +1,902 @@
#!/usr/bin/env python
import argparse
import dataclasses
import fnmatch
from enum import Enum
import json
import logging
import os
import re
from typing import Optional
logger = logging.getLogger(__name__)
class AppleArch(Enum):
Aarch64 = "aarch64"
X86_64 = "x86_64"
class MsvcArch(Enum):
X86 = "x86"
X64 = "x64"
Arm32 = "arm"
Arm64 = "arm64"
class JobOs(Enum):
WindowsLatest = "windows-latest"
UbuntuLatest = "ubuntu-latest"
MacosLatest = "macos-latest"
Ubuntu22_04 = "ubuntu-22.04"
Ubuntu24_04 = "ubuntu-24.04"
Ubuntu24_04_arm = "ubuntu-24.04-arm"
Macos13 = "macos-13"
class SdlPlatform(Enum):
Android = "android"
Emscripten = "emscripten"
Haiku = "haiku"
LoongArch64 = "loongarch64"
Msys2 = "msys2"
Linux = "linux"
MacOS = "macos"
Ios = "ios"
Tvos = "tvos"
Msvc = "msvc"
N3ds = "n3ds"
PowerPC = "powerpc"
PowerPC64 = "powerpc64"
Ps2 = "ps2"
Psp = "psp"
Vita = "vita"
Riscos = "riscos"
FreeBSD = "freebsd"
NetBSD = "netbsd"
OpenBSD = "openbsd"
NGage = "ngage"
class Msys2Platform(Enum):
Mingw32 = "mingw32"
Mingw64 = "mingw64"
Clang64 = "clang64"
Ucrt64 = "ucrt64"
class IntelCompiler(Enum):
Icc = "icc"
Icx = "icx"
class VitaGLES(Enum):
Pib = "pib"
Pvr = "pvr"
@dataclasses.dataclass(slots=True)
class JobSpec:
name: str
os: JobOs
platform: SdlPlatform
artifact: Optional[str]
container: Optional[str] = None
no_cmake: bool = False
xcode: bool = False
android_mk: bool = False
android_gradle: bool = False
lean: bool = False
android_arch: Optional[str] = None
android_abi: Optional[str] = None
android_platform: Optional[int] = None
msys2_platform: Optional[Msys2Platform] = None
intel: Optional[IntelCompiler] = None
apple_framework: Optional[bool] = None
apple_archs: Optional[set[AppleArch]] = None
msvc_project: Optional[str] = None
msvc_arch: Optional[MsvcArch] = None
clang_cl: bool = False
gdk: bool = False
vita_gles: Optional[VitaGLES] = None
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-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):
STATIC_LIB = "SDL3-static.lib"
A = "libSDL3.a"
class SharedLibType(Enum):
WIN32 = "SDL3.dll"
SO_0 = "libSDL3.so.0"
SO = "libSDL3.so"
DYLIB = "libSDL3.0.dylib"
FRAMEWORK = "SDL3.framework/Versions/A/SDL3"
@dataclasses.dataclass(slots=True)
class JobDetails:
name: str
key: str
os: str
platform: str
artifact: str
no_cmake: bool
ccache: bool = False
build_tests: bool = True
container: str = ""
cmake_build_type: str = "RelWithDebInfo"
shell: str = "sh"
sudo: str = "sudo"
cmake_config_emulator: str = ""
apk_packages: list[str] = dataclasses.field(default_factory=list)
apt_packages: list[str] = dataclasses.field(default_factory=list)
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)
cc: str = ""
cxx: str = ""
cflags: list[str] = dataclasses.field(default_factory=list)
cxxflags: list[str] = dataclasses.field(default_factory=list)
ldflags: list[str] = dataclasses.field(default_factory=list)
pollute_directories: list[str] = dataclasses.field(default_factory=list)
use_cmake: bool = True
shared: bool = True
static: bool = True
shared_lib: Optional[SharedLibType] = None
static_lib: Optional[StaticLibType] = None
run_tests: bool = True
test_pkg_config: bool = True
cc_from_cmake: bool = False
source_cmd: str = ""
pretest_cmd: str = ""
java: bool = False
android_apks: list[str] = dataclasses.field(default_factory=list)
android_ndk: bool = False
android_mk: bool = False
android_gradle: bool = False
minidump: bool = False
intel: bool = False
msys2_msystem: str = ""
msys2_env: str = ""
msys2_no_perl: bool = False
werror: bool = True
msvc_vcvars_arch: str = ""
msvc_vcvars_sdk: str = ""
msvc_project: str = ""
msvc_project_flags: list[str] = dataclasses.field(default_factory=list)
setup_ninja: bool = False
setup_libusb_arch: str = ""
xcode_sdk: str = ""
cpactions: bool = False
setup_gdk_folder: str = ""
cpactions_os: str = ""
cpactions_version: str = ""
cpactions_arch: str = ""
cpactions_setup_cmd: str = ""
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,
"enable-artifacts": enable_artifacts,
"shell": self.shell,
"msys2-msystem": self.msys2_msystem,
"msys2-env": self.msys2_env,
"msys2-no-perl": self.msys2_no_perl,
"android-ndk": self.android_ndk,
"java": self.java,
"intel": self.intel,
"apk-packages": my_shlex_join(self.apk_packages),
"apt-packages": my_shlex_join(self.apt_packages),
"test-pkg-config": self.test_pkg_config,
"brew-packages": my_shlex_join(self.brew_packages),
"pollute-directories": my_shlex_join(self.pollute_directories),
"no-cmake": self.no_cmake,
"build-tests": self.build_tests,
"source-cmd": self.source_cmd,
"pretest-cmd": self.pretest_cmd,
"cmake-config-emulator": self.cmake_config_emulator,
"cc": self.cc,
"cxx": self.cxx,
"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),
"cmake-build-arguments": my_shlex_join(self.cmake_build_arguments),
"shared": self.shared,
"static": self.static,
"shared-lib": self.shared_lib.value if self.shared_lib else None,
"static-lib": self.static_lib.value if self.static_lib else None,
"cmake-build-type": self.cmake_build_type,
"run-tests": self.run_tests,
"android-apks": my_shlex_join(self.android_apks),
"android-gradle": self.android_gradle,
"android-mk": self.android_mk,
"werror": self.werror,
"sudo": self.sudo,
"msvc-vcvars-arch": self.msvc_vcvars_arch,
"msvc-vcvars-sdk": self.msvc_vcvars_sdk,
"msvc-project": self.msvc_project,
"msvc-project-flags": my_shlex_join(self.msvc_project_flags),
"setup-ninja": self.setup_ninja,
"setup-libusb-arch": self.setup_libusb_arch,
"cc-from-cmake": self.cc_from_cmake,
"xcode-sdk": self.xcode_sdk,
"cpactions": self.cpactions,
"cpactions-os": self.cpactions_os,
"cpactions-version": self.cpactions_version,
"cpactions-arch": self.cpactions_arch,
"cpactions-setup-cmd": self.cpactions_setup_cmd,
"cpactions-install-cmd": self.cpactions_install_cmd,
"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 != ""}
def my_shlex_join(s):
def escape(s):
if s[:1] == "'" and s[-1:] == "'":
return s
if set(s).intersection(set("; \t")):
return f'"{s}"'
return s
return " ".join(escape(s))
def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDetails:
job = JobDetails(
name=spec.name,
key=key,
os=spec.os.value,
artifact=spec.artifact or "",
container=spec.container or "",
platform=spec.platform.value,
sudo="sudo",
no_cmake=spec.no_cmake,
)
if job.os.startswith("ubuntu"):
job.apt_packages.extend([
"ninja-build",
"pkg-config",
])
pretest_cmd = []
if trackmem_symbol_names:
pretest_cmd.append("export SDL_TRACKMEM_SYMBOL_NAMES=1")
else:
pretest_cmd.append("export SDL_TRACKMEM_SYMBOL_NAMES=0")
win32 = spec.platform in (SdlPlatform.Msys2, SdlPlatform.Msvc)
fpic = None
build_parallel = True
if spec.lean:
job.cppflags.append("-DSDL_LEAN_AND_MEAN=1")
if win32:
job.cmake_arguments.append("-DSDLTEST_PROCDUMP=ON")
job.minidump = True
if spec.intel is not None:
match spec.intel:
case IntelCompiler.Icx:
job.cc = "icx"
job.cxx = "icpx"
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}")
job.source_cmd = f"source /opt/intel/oneapi/setvars.sh;"
job.intel = True
job.shell = "bash"
job.cmake_arguments.extend((
f"-DCMAKE_C_COMPILER={job.cc}",
f"-DCMAKE_CXX_COMPILER={job.cxx}",
"-DCMAKE_SYSTEM_NAME=Linux",
))
match spec.platform:
case SdlPlatform.Msvc:
job.setup_ninja = not spec.gdk
job.clang_tidy = False # complains about \threadsafety: "unknown command tag name [clang-diagnostic-documentation-unknown-command]"
job.msvc_project = spec.msvc_project if spec.msvc_project else ""
job.msvc_project_flags.append("-p:TreatWarningsAsError=true")
job.test_pkg_config = False
job.shared_lib = SharedLibType.WIN32
job.static_lib = StaticLibType.STATIC_LIB
job.cmake_arguments.extend((
"-DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=ProgramDatabase",
"-DCMAKE_EXE_LINKER_FLAGS=-DEBUG",
"-DCMAKE_SHARED_LINKER_FLAGS=-DEBUG",
))
job.cmake_arguments.append("'-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded$<$<CONFIG:Debug>:Debug>'")
if spec.clang_cl:
job.cmake_arguments.extend((
"-DCMAKE_C_COMPILER=clang-cl",
"-DCMAKE_CXX_COMPILER=clang-cl",
))
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})")
if spec.msvc_project:
match spec.msvc_arch:
case MsvcArch.X86:
msvc_platform = "Win32"
case MsvcArch.X64:
msvc_platform = "x64"
case _:
raise ValueError(f"Unsupported vcxproj architecture (arch={spec.msvc_arch})")
if spec.gdk:
msvc_platform = f"Gaming.Desktop.{msvc_platform}"
job.msvc_project_flags.append(f"-p:Platform={msvc_platform}")
match spec.msvc_arch:
case MsvcArch.X86:
job.msvc_vcvars_arch = "x64_x86"
case MsvcArch.X64:
job.msvc_vcvars_arch = "x64"
case MsvcArch.Arm32:
job.msvc_vcvars_arch = "x64_arm"
job.msvc_vcvars_sdk = "10.0.22621.0" # 10.0.26100.0 dropped ARM32 um and ucrt libraries
job.run_tests = False
case MsvcArch.Arm64:
job.msvc_vcvars_arch = "x64_arm64"
job.run_tests = False
if spec.gdk:
job.setup_gdk_folder = "VisualC-GDK"
else:
match spec.msvc_arch:
case MsvcArch.X86:
job.setup_libusb_arch = "x86"
case MsvcArch.X64:
job.setup_libusb_arch = "x64"
case SdlPlatform.Linux:
if spec.name.startswith("Ubuntu"):
assert spec.os.value.startswith("ubuntu-")
job.apt_packages.extend((
"ccache",
"gnome-desktop-testing",
"libasound2-dev",
"libpulse-dev",
"libaudio-dev",
"libjack-dev",
"libsndio-dev",
"libusb-1.0-0-dev",
"libx11-dev",
"libxext-dev",
"libxrandr-dev",
"libxcursor-dev",
"libxfixes-dev",
"libxi-dev",
"libxss-dev",
"libwayland-dev",
"libxkbcommon-dev",
"libdrm-dev",
"libgbm-dev",
"libgl1-mesa-dev",
"libgles2-mesa-dev",
"libegl1-mesa-dev",
"libdbus-1-dev",
"libibus-1.0-dev",
"libudev-dev",
"fcitx-libs-dev",
))
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")
job.shared_lib = SharedLibType.SO_0
job.static_lib = StaticLibType.A
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
job.shared_lib = SharedLibType.DYLIB
job.static_lib = StaticLibType.A
match spec.platform:
case SdlPlatform.Ios:
if spec.xcode:
job.xcode_sdk = 'iphoneos'
job.cmake_arguments.extend([
"-DCMAKE_SYSTEM_NAME=iOS",
"-DCMAKE_OSX_ARCHITECTURES=\"arm64\"",
"-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0",
])
case SdlPlatform.Tvos:
if spec.xcode:
job.xcode_sdk = 'appletvos'
job.cmake_arguments.extend([
"-DCMAKE_SYSTEM_NAME=tvOS",
"-DCMAKE_OSX_ARCHITECTURES=\"arm64\"",
"-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0",
])
case SdlPlatform.MacOS:
if spec.apple_framework:
job.static = False
job.clang_tidy = False
job.test_pkg_config = False
job.cmake_arguments.extend((
"'-DCMAKE_OSX_ARCHITECTURES=x86_64;arm64'",
"-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13",
"-DSDL_FRAMEWORK=ON",
))
job.shared_lib = SharedLibType.FRAMEWORK
else:
job.clang_tidy = True
job.cmake_arguments.extend((
"-DCMAKE_OSX_ARCHITECTURES=arm64",
"-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13",
"-DCLANG_TIDY_BINARY=$(brew --prefix llvm)/bin/clang-tidy",
))
job.shared_lib = SharedLibType.DYLIB
job.static_lib = StaticLibType.A
job.ccache = True
job.apt_packages = []
job.brew_packages.extend((
"ccache",
"ninja",
))
if job.clang_tidy:
job.brew_packages.append("llvm")
if spec.xcode:
job.xcode_sdk = "macosx"
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
if spec.android_mk or not spec.no_cmake:
job.android_ndk = True
if spec.android_gradle or not spec.no_cmake:
job.java = True
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}",
))
job.cmake_toolchain_file = "${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake"
job.cc = f"${{ANDROID_NDK_HOME}}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target={spec.android_arch}-none-linux-androideabi{spec.android_platform}"
job.android_apks = [
"testaudiorecording-apk",
"testautomation-apk",
"testcontroller-apk",
"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.cmake_arguments.extend((
"-DSDLTEST_BROWSER=chrome",
"-DSDLTEST_TIMEOUT_MULTIPLIER=4",
"-DSDLTEST_CHROME_BINARY=${CHROME_BINARY}",
))
job.cflags.extend((
"-gsource-map",
"-ffile-prefix-map=${PWD}=/SDL",
))
job.ldflags.extend((
"--source-map-base", "/",
))
pretest_cmd.extend((
"# Start local HTTP server",
"cmake --build build --target serve-sdl-tests --verbose &",
"chrome --version",
"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 = ["ccache", "cmake", "gmp", "mpc1", "mpfr4", "ninja", "pkgconf", "git", ]
job.cmake_toolchain_file = "${PS2DEV}/ps2sdk/ps2dev.cmake"
job.clang_tidy = False
job.run_tests = False
job.shared = False
job.cc = "mips64r5900el-ps2-elf-gcc"
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 = ["ccache", "cmake", "gmp", "mpc1", "mpfr4", "ninja", "pkgconf", ]
job.cmake_toolchain_file = "${PSPDEV}/psp/share/pspdev.cmake"
job.clang_tidy = False
job.run_tests = False
job.shared = False
job.cc = "psp-gcc"
job.ldflags = ["-L${PSPDEV}/lib", "-L${PSPDEV}/psp/lib", "-L${PSPDEV}/psp/sdk/lib", ]
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 = ["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 = {
VitaGLES.Pib: "pib",
VitaGLES.Pvr: "pvr",
}[spec.vita_gles]
job.cmake_arguments.extend((
f"-DVIDEO_VITA_PIB={ 'true' if spec.vita_gles == VitaGLES.Pib else 'false' }",
f"-DVIDEO_VITA_PVR={ 'true' if spec.vita_gles == VitaGLES.Pvr else 'false' }",
"-DSDL_ARMNEON=ON",
"-DSDL_ARMSIMD=ON",
))
# Fix vita.toolchain.cmake (https://github.com/vitasdk/vita-toolchain/pull/253)
job.source_cmd = r"""sed -i -E "s#set\\( PKG_CONFIG_EXECUTABLE \"\\$\\{VITASDK}/bin/arm-vita-eabi-pkg-config\" \\)#set\\( PKG_CONFIG_EXECUTABLE \"${VITASDK}/bin/arm-vita-eabi-pkg-config\" CACHE PATH \"Path of pkg-config executable\" \\)#" ${VITASDK}/share/vita.toolchain.cmake"""
job.clang_tidy = False
job.run_tests = False
job.shared = False
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}",
"-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 = ["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((
f"-DCMAKE_C_COMPILER={job.cc}",
f"-DCMAKE_CXX_COMPILER={job.cxx}",
"-DSDL_UNIX_CONSOLE_BUILD=ON",
"-DCMAKE_SYSTEM_NAME=Linux",
))
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 = []
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",
"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, )
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 = ["ccache", "cmake", "ninja-build"]
job.test_pkg_config = False
job.shared = False
job.run_tests = False
job.sudo = ""
job.cmake_arguments.extend((
"-DRISCOS:BOOL=ON",
"-DCMAKE_DISABLE_PRECOMPILE_HEADERS:BOOL=ON",
"-DSDL_GCC_ATOMICS:BOOL=OFF",
))
job.cmake_toolchain_file = "/home/riscos/env/toolchain-riscos.cmake"
job.static_lib = StaticLibType.A
case SdlPlatform.FreeBSD | SdlPlatform.NetBSD | SdlPlatform.OpenBSD:
job.cpactions = True
job.no_cmake = True
job.run_tests = False
job.apt_packages = []
job.shared_lib = SharedLibType.SO_0
job.static_lib = StaticLibType.A
match spec.platform:
case SdlPlatform.FreeBSD:
job.cpactions_os = "freebsd"
job.cpactions_version = "14.2"
job.cpactions_arch = "x86-64"
job.cpactions_setup_cmd = "sudo pkg update"
job.cpactions_install_cmd = "sudo pkg install -y cmake ninja pkgconf libXcursor libXext libXinerama libXi libXfixes libXrandr libXScrnSaver libXxf86vm wayland wayland-protocols libxkbcommon mesa-libs libglvnd evdev-proto libinotify alsa-lib jackit pipewire pulseaudio sndio dbus zh-fcitx ibus libudev-devd"
job.cmake_arguments.extend((
"-DSDL_CHECK_REQUIRED_INCLUDES=/usr/local/include",
"-DSDL_CHECK_REQUIRED_LINK_OPTIONS=-L/usr/local/lib",
))
case SdlPlatform.NetBSD:
job.cpactions_os = "netbsd"
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 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)}\"")
job.pretest_cmd = "\n".join(pretest_cmd)
def tf(b):
return "ON" if b else "OFF"
if fpic is not None:
job.cmake_arguments.append(f"-DCMAKE_POSITION_INDEPENDENT_CODE={tf(fpic)}")
if job.no_cmake:
job.cmake_arguments = []
return job
def spec_to_platform(spec: JobSpec, key: str, enable_artifacts: bool, trackmem_symbol_names: bool) -> dict[str, str|bool]:
logger.info("spec=%r", spec)
job = spec_to_job(spec, key=key, trackmem_symbol_names=trackmem_symbol_names)
logger.info("job=%r", job)
platform = job.to_workflow(enable_artifacts=enable_artifacts)
logger.info("platform=%r", platform)
return platform
def main():
parser = argparse.ArgumentParser(allow_abbrev=False)
parser.add_argument("--github-variable-prefix", default="platforms")
parser.add_argument("--github-ci", action="store_true")
parser.add_argument("--verbose", action="store_true")
parser.add_argument("--commit-message-file")
parser.add_argument("--no-artifact", dest="enable_artifacts", action="store_false")
parser.add_argument("--trackmem-symbol-names", dest="trackmem_symbol_names", action="store_true")
args = parser.parse_args()
logging.basicConfig(level=logging.INFO if args.verbose else logging.WARNING)
remaining_keys = set(JOB_SPECS.keys())
all_level_keys = (
# Level 1
(
"haiku",
),
)
filters = []
if args.commit_message_file:
with open(args.commit_message_file, "r") as f:
commit_message = f.read()
for m in re.finditer(r"\[sdl-ci-filter (.*)]", commit_message, flags=re.M):
filters.append(m.group(1).strip(" \t\n\r\t'\""))
if re.search(r"\[sdl-ci-artifacts?]", commit_message, flags=re.M):
args.enable_artifacts = True
if re.search(r"\[sdl-ci-(full-)?trackmem(-symbol-names)?]", commit_message, flags=re.M):
args.trackmem_symbol_names = True
if not filters:
filters.append("*")
logger.info("filters: %r", filters)
all_level_platforms = {}
all_platforms = {key: spec_to_platform(spec, key=key, enable_artifacts=args.enable_artifacts, trackmem_symbol_names=args.trackmem_symbol_names) for key, spec in JOB_SPECS.items()}
for level_i, level_keys in enumerate(all_level_keys, 1):
level_key = f"level{level_i}"
logger.info("Level %d: keys=%r", level_i, level_keys)
assert all(k in remaining_keys for k in level_keys)
level_platforms = tuple(all_platforms[key] for key in level_keys)
remaining_keys.difference_update(level_keys)
all_level_platforms[level_key] = level_platforms
logger.info("=" * 80)
logger.info("Keys before filter: %r", remaining_keys)
filtered_remaining_keys = set()
for filter in filters:
filtered_remaining_keys.update(fnmatch.filter(remaining_keys, filter))
logger.info("Keys after filter: %r", filtered_remaining_keys)
remaining_keys = filtered_remaining_keys
logger.info("Remaining: %r", remaining_keys)
all_level_platforms["others"] = tuple(all_platforms[key] for key in remaining_keys)
if args.github_ci:
for level, platforms in all_level_platforms.items():
platforms_json = json.dumps(platforms)
txt = f"{args.github_variable_prefix}-{level}={platforms_json}"
logger.info("%s", txt)
if "GITHUB_OUTPUT" in os.environ:
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
f.write(txt)
f.write("\n")
else:
logger.warning("GITHUB_OUTPUT not defined")
return 0
if __name__ == "__main__":
raise SystemExit(main())

View File

@@ -1,45 +0,0 @@
name: Build (Emscripten)
on: [push, pull_request]
jobs:
emscripten:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: mymindstorm/setup-emsdk@v10
with:
version: 2.0.32
- name: Install ninja
run: |
sudo apt-get -y update
sudo apt-get install -y ninja-build
- name: Configure CMake
run: |
emcmake cmake -S . -B build \
-DSDL_WERROR=ON \
-DSDL_TESTS=ON \
-DSDL_INSTALL_TESTS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=prefix \
-GNinja
- name: Build
run: cmake --build build/ --verbose
- name: Run build-time tests
run: |
set -eu
export SDL_TESTS_QUICK=1
# FIXME: enable Emscripten build time tests
# ctest -VV --test-dir build/
- name: Install
run: |
echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV
cmake --install build/
- name: Verify CMake configuration files
run: |
emcmake cmake -S cmake/test -B cmake_config_build \
-DCMAKE_BUILD_TYPE=Release \
-DSDL_VENDOR_INFO="Github Workflow" \
-DTEST_SHARED=FALSE \
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }}
cmake --build cmake_config_build --verbose

444
.github/workflows/generic.yml vendored Normal file
View File

@@ -0,0 +1,444 @@
name: 'Build'
run-name: 'Configure, Build and Test SDL'
on:
workflow_call:
inputs:
platforms:
description: 'JSON-encoded test properties'
type: string
required: true
jobs:
build:
name: ${{ matrix.platform.name }}
runs-on: ${{ matrix.platform.os }}
container: ${{ matrix.platform.container }}
defaults:
run:
shell: ${{ matrix.platform.shell }}
strategy:
fail-fast: false
matrix:
platform: ${{ fromJSON(inputs.platforms) }}
steps:
- name: 'Set up MSYS2'
if: ${{ matrix.platform.platform == 'msys2' }}
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.platform.msys2-msystem }}
install: >-
${{ matrix.platform.msys2-env }}-cc
${{ matrix.platform.msys2-env }}-cmake
${{ matrix.platform.msys2-env }}-ninja
${{ (!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 }}"
echo "name=${{ matrix.platform.name }}"
echo "os=${{ matrix.platform.os }}"
echo ""
echo "Add [sdl-ci-filter ${{ matrix.platform.key }}] to your commit message to reduce the number of jobs."
- uses: actions/checkout@v4
- name: 'Set up ninja'
if: ${{ matrix.platform.setup-ninja }}
uses: ./.github/actions/setup-ninja
- name: 'Set up libusb for MSVC'
if: ${{ matrix.platform.setup-libusb-arch != '' }}
uses: ./.github/actions/setup-msvc-libusb
with:
arch: ${{ matrix.platform.setup-libusb-arch }}
- uses: mymindstorm/setup-emsdk@v14
if: ${{ matrix.platform.platform == 'emscripten' }}
with:
version: 3.1.35
- uses: browser-actions/setup-chrome@v1
id: setup-chrome
if: ${{ matrix.platform.platform == 'emscripten' }}
with:
install-chromedriver: true
- name: 'Add chrome to PATH'
if: ${{ matrix.platform.platform == 'emscripten' }}
run: |
chrome_dir="$(dirname "${{ steps.setup-chrome.outputs.chrome-path }}")"
chromedriver_dir="$(dirname "${{ steps.setup-chrome.outputs.chromedriver-path }}")"
echo "CHROME_BINARY=${{ steps.setup-chrome.outputs.chrome-path }}" >>$GITHUB_ENV
echo "CHROMEDRIVER_BINARY=${{ steps.setup-chrome.outputs.chromedriver-path }}" >>$GITHUB_ENV
echo "chrome_dir=${chrome_dir}"
echo "chromedriver_dir=${chromedriver_dir}"
echo "${chrome_dir}" >>${GITHUB_PATH}
echo "${chromedriver_dir}" >>${GITHUB_PATH}
- uses: nttld/setup-ndk@v1
if: ${{ matrix.platform.android-ndk }}
id: setup-ndk
with:
local-cache: true
ndk-version: r28c
- name: 'Configure Android NDK variables'
if: ${{ matrix.platform.android-ndk }}
shell: sh
run: |
# We cannot use GitHub expressions in the controller job
echo "ANDROID_NDK_HOME=${{ steps.setup-ndk.outputs.ndk-path }}" >>$GITHUB_ENV
- uses: actions/setup-java@v4
if: ${{ matrix.platform.java }}
with:
distribution: 'temurin'
java-version: '17'
- uses: ilammy/msvc-dev-cmd@v1
if: ${{ matrix.platform.platform == 'msvc' }}
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 != '' }}
with:
folder: '${{ matrix.platform.setup-gdk-folder }}'
- name: 'Set up LoongArch64 toolchain'
uses: ./.github/actions/setup-loongarch64-toolchain
id: setup-loongarch64-toolchain
if: ${{ matrix.platform.platform == 'loongarch64' }}
- name: 'Setup Intel oneAPI toolchain'
id: intel
if: ${{ matrix.platform.intel }}
run: |
# Download the key to system keyring
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
| gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
# Add signed entry to apt sources and configure the APT client to use Intel repository:
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
# Update package list
sudo apt-get update -y
# Install oneAPI
sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
- name: 'Install apk packages'
if: ${{ matrix.platform.apk-packages != '' }}
run: |
${{ matrix.platform.sudo }} apk update
${{ matrix.platform.sudo }} apk add ${{ matrix.platform.apk-packages }}
- name: 'Install apt packages'
if: ${{ matrix.platform.apt-packages != '' }}
run: |
${{ matrix.platform.sudo }} apt-get update
${{ matrix.platform.sudo }} apt-get install -y ${{ matrix.platform.apt-packages }}
- name: 'Install brew packages'
if: ${{ matrix.platform.brew-packages != '' }}
run: |
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
with:
type: ${{ matrix.platform.setup-vita-gles-type }}
- name: 'Pollute toolchain with "bad" SDL headers'
if: ${{ matrix.platform.pollute-directories != '' }}
#shell: ${{ matrix.platform.shell }}
run: |
# Create "bad" SDL headers in the toolchain.
# SDL sources should not use these.
for include in ${{ matrix.platform.pollute-directories }}; do
toolchain_directory="${include}/SDL3"
echo "Creating directory ${toolchain_directory}"
mkdir -p "${toolchain_directory}/SDL3"
for header in include/SDL3/*.h; do
dest="${toolchain_directory}/SDL3/$(basename "${header}")"
echo "Creating ${dest}"
echo '#error "System SDL headers must not be used by build system"' >"$dest"
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 -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 }} \
-DSDL_EXAMPLES=${{ matrix.platform.build-tests }} \
-DSDL_TESTS=${{ matrix.platform.build-tests }} \
-DSDLTEST_TRACKMEM=ON \
-DSDL_INSTALL_TESTS=${{ matrix.platform.build-tests }} \
-DSDL_CLANG_TIDY=${{ matrix.platform.clang-tidy }} \
-DSDL_INSTALL_DOCS=ON \
-DSDL_INSTALL_CPACK=ON \
-DSDL_INSTALL_DOCS=ON \
${{ matrix.platform.cmake-arguments }} \
-DSDL_SHARED=${{ matrix.platform.shared }} \
-DSDL_STATIC=${{ matrix.platform.static }} \
-DSDL_VENDOR_INFO="Github Workflow" \
-DCMAKE_INSTALL_PREFIX=prefix \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_BUILD_TYPE=${{ matrix.platform.cmake-build-type }}
- name: 'Build (CMake)'
id: build
if: ${{ !matrix.platform.no-cmake }}
# shell: ${{ matrix.platform.shell }}
run: |
${{ matrix.platform.source-cmd }}
cmake --build build --config ${{ matrix.platform.cmake-build-type }} --verbose -- ${{ matrix.platform.cmake-build-arguments }}
- name: 'Verify SDL_REVISION'
if: ${{ !matrix.platform.no-cmake }}
run: |
echo "This should show us the SDL_REVISION"
echo "Shared library:"
${{ (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('{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 }}
# shell: ${{ matrix.platform.shell }}
run: |
${{ matrix.platform.source-cmd }}
${{ matrix.platform.pretest-cmd }}
set -eu
export SDL_TESTS_QUICK=1
ctest -VV --test-dir build/ -j2
- name: "Build test apk's (CMake)"
id: apks
if: ${{ always() && steps.build.outcome == 'success' && matrix.platform.android-apks != '' }}
# shell: ${{ matrix.platform.shell }}
run: |
${{ matrix.platform.source-cmd }}
cmake --build build --config ${{ matrix.platform.cmake-build-type }} \
--target \
${{ matrix.platform.android-apks }} \
--verbose \
-- ${{ matrix.platform.cmake-build-arguments }}
- name: 'Install (CMake)'
id: install
if: ${{ always() && steps.build.outcome == 'success' }}
# shell: ${{ matrix.platform.shell }}
run: |
${{ matrix.platform.source-cmd }}
cmake --install build --config ${{ matrix.platform.cmake-build-type }}
echo "prefix=$(pwd)/prefix" >> $GITHUB_OUTPUT
( cd prefix; find . ) | LC_ALL=C sort -u
- name: 'Package (CPack)'
id: package
if: ${{ always() && steps.build.outcome == 'success' }}
# shell: ${{ matrix.platform.shell }}
run: |
# DMG creation on macOS occasionally fails, so try multiple times
# https://gitlab.kitware.com/cmake/cmake/-/issues/25671
success=0
max_tries=10
for i in $(seq $max_tries); do
cmake --build build/ --config ${{ matrix.platform.cmake-build-type }} --target package -- ${{ matrix.platform.cmake-build-arguments }} && success=1
if test $success = 1; then
break
fi
echo "Package creation failed. Sleep 1 second and try again."
sleep 1
done
if test $success = 0; then
echo "Package creation failed after $max_tries attempts."
exit 1
fi
- name: 'Verify CMake configuration files'
if: ${{ steps.install.outcome == 'success' }}
# shell: ${{ matrix.platform.shell }}
run: |
${{ matrix.platform.source-cmd }}
${{ matrix.platform.cmake-config-emulator }} cmake -S cmake/test -B cmake_test_build -GNinja \
${{ matrix.platform.cmake-toolchain-file != '' && format('-DCMAKE_TOOLCHAIN_FILE={0}', matrix.platform.cmake-toolchain-file) || '' }} \
-DTEST_SHARED=${{ matrix.platform.shared }} \
-DTEST_STATIC=${{ matrix.platform.static }} \
${{ matrix.platform.cmake-arguments }} \
-DCMAKE_BUILD_TYPE=${{ matrix.platform.cmake-build-type }} \
-DCMAKE_PREFIX_PATH="${{ steps.install.outputs.prefix }}"
cmake --build cmake_test_build --verbose --config ${{ matrix.platform.cmake-build-type }} -- ${{ matrix.platform.cmake-build-arguments }}
- name: 'Extract CC/CXX/CFLAGS/CXXFLAGS from CMake toolchain'
if: ${{ steps.install.outcome == 'success' && matrix.platform.cc-from-cmake }}
# shell: ${{ matrix.platform.shell }}
run: |
cmake -S .github/cmake -B /tmp/cmake_extract \
${{ matrix.platform.cmake-toolchain-file != '' && format('-DCMAKE_TOOLCHAIN_FILE={0}', matrix.platform.cmake-toolchain-file) || '' }} \
-DCMAKE_BUILD_TYPE=${{ matrix.platform.cmake-build-type }} \
-DVAR_PATH=/tmp/env.txt
cat /tmp/env.txt >> $GITHUB_ENV
- name: 'Verify sdl3.pc'
# shell: ${{ matrix.platform.shell }}
if: ${{ steps.install.outcome == 'success' && matrix.platform.test-pkg-config }}
run: |
${{ matrix.platform.source-cmd }}
${{ matrix.platform.cc && format('export CC="{0}"', matrix.platform.cc) || '' }}
${{ matrix.platform.cflags && format('export CFLAGS="{0}"', matrix.platform.cflags) || '' }}
${{ matrix.platform.ldflags && format('export LDFLAGS="{0}"', matrix.platform.ldflags) || '' }}
export PKG_CONFIG_PATH=${{ steps.install.outputs.prefix }}/lib/pkgconfig
cmake/test/test_pkgconfig.sh
- name: 'Build (cross-platform-actions, BSD)'
id: cpactions
if: ${{ matrix.platform.cpactions }}
uses: cross-platform-actions/action@v0.27.0
with:
operating_system: '${{ matrix.platform.cpactions-os }}'
architecture: '${{ matrix.platform.cpactions-arch }}'
version: '${{ matrix.platform.cpactions-version }}'
run: |
${{ matrix.platform.cpactions-setup-cmd }}
${{ matrix.platform.cpactions-install-cmd }}
cmake -S . -B build -GNinja \
${{ matrix.platform.cmake-toolchain-file != '' && format('-DCMAKE_TOOLCHAIN_FILE={0}', matrix.platform.cmake-toolchain-file) || '' }} \
-Wdeprecated -Wdev -Werror \
-DSDL_WERROR=${{ matrix.platform.werror }} \
-DSDL_INSTALL_DOCS=ON \
${{ matrix.platform.cmake-arguments }} \
-DSDL_SHARED=${{ matrix.platform.shared }} \
-DSDL_STATIC=${{ matrix.platform.static }} \
-DSDL_VENDOR_INFO="Github Workflow" \
-DCMAKE_INSTALL_PREFIX=prefix \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_BUILD_TYPE=${{ matrix.platform.cmake-build-type }}
cmake --build build/ --config ${{ matrix.platform.cmake-build-type }} --verbose
cmake --build build/ --config ${{ matrix.platform.cmake-build-type }} --target package
cmake --build build/ --config ${{ matrix.platform.cmake-build-type }} --target clean
rm -rf build/dist/_CPack_Packages
rm -rf build/CMakeFiles
rm -rf build/docs
- name: Add msbuild to PATH
id: setup-msbuild
if: ${{ matrix.platform.msvc-project != '' }}
uses: microsoft/setup-msbuild@v2
- name: Build msbuild
if: ${{ matrix.platform.msvc-project != '' }}
run: |
"$(cygpath -u '${{ steps.setup-msbuild.outputs.msbuildPath }}\msbuild.exe')" ${{ matrix.platform.msvc-project }} -m -p:BuildInParallel=true -p:Configuration=Release ${{ matrix.platform.msvc-project-flags }}
- name: 'Build (Android.mk)'
if: ${{ matrix.platform.android-mk }}
run: |
./build-scripts/androidbuildlibs.sh
- name: 'Create Gradle project (Android)'
if: ${{ matrix.platform.android-gradle }}
run: |
for folder in build-ndk-build build-cmake; do
python build-scripts/create-android-project.py \
--output "${folder}" \
--variant copy \
org.libsdl.testspriteminimal \
test/testspriteminimal.c test/icon.h
done
echo ""
echo "Project contents:"
echo ""
find "build-ndk-build/org.libsdl.testspriteminimal"
- name: 'Build Android app (Gradle & ndk-build)'
if: ${{ matrix.platform.android-gradle }}
run: |
cd build-ndk-build/org.libsdl.testspriteminimal
./gradlew -i assembleRelease
- name: 'Build Android app (Gradle & CMake)'
if: ${{ matrix.platform.android-gradle }}
run: |
cd build-cmake/org.libsdl.testspriteminimal
./gradlew -i assembleRelease -PBUILD_WITH_CMAKE=1
- name: 'Build (xcode)'
if: ${{ matrix.platform.xcode-sdk != '' }}
run: |
xcodebuild -project Xcode/SDL/SDL.xcodeproj -target SDL3 -configuration Release -sdk ${{ matrix.platform.xcode-sdk }} clean build
- 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:
path: ${{ runner.temp }}/ccache
key: ${{ steps.restore-ccache.outputs.cache-primary-key }}
- name: 'Check Sources'
if: ${{ matrix.platform.check-sources }}
run: |
set -e
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') }}
with:
if-no-files-found: error
name: '${{ matrix.platform.artifact }}'
path: |
build/dist/SDL3*
build/include*
- name: 'Upload minidumps'
uses: actions/upload-artifact@v4
if: ${{ always() && steps.tests.outcome == 'failure' && (matrix.platform.platform == 'msvc' || matrix.platform.platform == 'msys2') }}
with:
if-no-files-found: ignore
name: '${{ matrix.platform.artifact }}-minidumps'
path: build/**/*.dmp
- name: "Upload Android test apk's"
uses: actions/upload-artifact@v4
if: ${{ matrix.platform.enable-artifacts && always() && matrix.platform.artifact != '' && steps.apks.outcome == 'success' }}
with:
if-no-files-found: error
name: '${{ matrix.platform.artifact }}-apks'
path: build/test/*.apk

View File

@@ -1,20 +0,0 @@
name: Build (iOS/tvOS)
on: [push, pull_request]
jobs:
Build:
name: ${{ matrix.platform.name }}
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
platform:
- { name: iOS, target: Static Library-iOS, sdk: iphoneos }
- { name: tvOS, target: Static Library-tvOS, sdk: appletvos }
steps:
- uses: actions/checkout@v3
- name: Build
run: xcodebuild -project Xcode/SDL/SDL.xcodeproj -target '${{ matrix.platform.target }}' -configuration Release -sdk ${{ matrix.platform.sdk }} clean build

View File

@@ -1,206 +0,0 @@
name: Build
on: [push, pull_request]
jobs:
Build:
name: ${{ matrix.platform.name }}
runs-on: ${{ matrix.platform.os }}
defaults:
run:
shell: ${{ matrix.platform.shell }}
strategy:
fail-fast: false
matrix:
platform:
- { name: Windows (mingw32), os: windows-latest, shell: 'msys2 {0}', msystem: mingw32, msys-env: mingw-w64-i686 }
- { name: Windows (mingw64), os: windows-latest, shell: 'msys2 {0}', msystem: mingw64, msys-env: mingw-w64-x86_64 }
- { name: Windows (clang32), os: windows-latest, shell: 'msys2 {0}', msystem: clang32, msys-env: mingw-w64-clang-i686 }
- { name: Windows (clang64), os: windows-latest, shell: 'msys2 {0}', msystem: clang64, msys-env: mingw-w64-clang-x86_64 }
- { name: Windows (ucrt64), os: windows-latest, shell: 'msys2 {0}', msystem: ucrt64, msys-env: mingw-w64-ucrt-x86_64 }
- { name: Ubuntu 20.04 (CMake), os: ubuntu-20.04, shell: sh }
- { name: Ubuntu 20.04 (autotools), os: ubuntu-20.04, shell: sh, autotools: true }
- { name: Ubuntu 22.04 (CMake), os: ubuntu-22.04, shell: sh }
- { name: Ubuntu 22.04 (autotools), os: ubuntu-22.04, shell: sh, autotools: true }
- { name: MacOS (CMake), os: macos-latest, shell: sh, cmake: '-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"' }
- { name: MacOS (autotools), os: macos-latest, shell: sh, autotools: true }
steps:
- name: Set up MSYS2
if: matrix.platform.shell == 'msys2 {0}'
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.platform.msystem }}
install: >-
${{ matrix.platform.msys-env }}-cc
${{ matrix.platform.msys-env }}-cmake
${{ matrix.platform.msys-env }}-ninja
${{ matrix.platform.msys-env }}-pkg-config
- name: Setup Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install build-essential git make autoconf automake libtool \
pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev \
libaudio-dev libjack-dev libsndio-dev libsamplerate0-dev libx11-dev libxext-dev \
libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libwayland-dev \
libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \
libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev
- name: Setup extra Ubuntu 22.04 dependencies
if: matrix.platform.os == 'ubuntu-22.04'
run: |
sudo apt-get install libpipewire-0.3-dev libdecor-0-dev
- name: Setup Macos dependencies
if: runner.os == 'macOS'
run: |
brew install \
ninja
- uses: actions/checkout@v3
- name: Check that versioning is consistent
# We only need to run this once: arbitrarily use the Linux/CMake build
if: "runner.os == 'Linux' && ! matrix.platform.autotools"
run: ./build-scripts/test-versioning.sh
- name: Configure (CMake)
if: "! matrix.platform.autotools"
run: |
cmake -S . -B build -G Ninja \
-DSDL_TESTS=ON \
-DSDL_WERROR=ON \
-DSDL_INSTALL_TESTS=ON \
-DSDL_VENDOR_INFO="Github Workflow" \
-DCMAKE_INSTALL_PREFIX=cmake_prefix \
-DCMAKE_BUILD_TYPE=Release \
${{ matrix.platform.cmake }}
- name: Build (CMake)
if: "! matrix.platform.autotools"
run: |
cmake --build build/ --config Release --verbose --parallel
- name: Run build-time tests (CMake)
if: "! matrix.platform.autotools"
run: |
set -eu
export SDL_TESTS_QUICK=1
ctest -VV --test-dir build/
if test "${{ runner.os }}" = "Linux"; then
# This should show us the SDL_REVISION
strings build/libSDL2-2.0.so.0 | grep SDL-
fi
- name: Install (CMake)
if: "! matrix.platform.autotools"
run: |
set -eu
cmake --install build/ --config Release
echo "SDL2_DIR=$(pwd)/cmake_prefix" >> $GITHUB_ENV
( cd cmake_prefix; find ) | LC_ALL=C sort -u
- name: Configure (Autotools)
if: matrix.platform.autotools
run: |
set -eu
rm -fr build-autotools
mkdir build-autotools
./autogen.sh
(
cd build-autotools
${{ github.workspace }}/configure \
--enable-vendor-info="Github Workflow" \
--enable-werror \
--prefix=${{ github.workspace }}/autotools_prefix \
)
if test "${{ runner.os }}" != "macOS" ; then
curdir="$(pwd)"
multiarch="$(dpkg-architecture -qDEB_HOST_MULTIARCH)"
(
mkdir -p build-autotools/test
cd build-autotools/test
${{ github.workspace }}/test/configure \
--enable-werror \
--x-includes=/usr/include \
--x-libraries="/usr/lib/${multiarch}" \
--prefix=${{ github.workspace }}/autotools_prefix \
SDL_CFLAGS="-I${curdir}/include" \
SDL_LIBS="-L${curdir}/build-autotools/build/.libs -lSDL2" \
ac_cv_lib_SDL2_ttf_TTF_Init=no \
${NULL+}
)
fi
- name: Build (Autotools)
if: matrix.platform.autotools
run: |
set -eu
parallel="$(getconf _NPROCESSORS_ONLN)"
make -j"${parallel}" -C build-autotools V=1
if test "${{ runner.os }}" != "macOS" ; then
make -j"${parallel}" -C build-autotools/test V=1
fi
- name: Run build-time tests (Autotools)
if: ${{ matrix.platform.autotools && (runner.os != 'macOS') }}
run: |
set -eu
curdir="$(pwd)"
parallel="$(getconf _NPROCESSORS_ONLN)"
export SDL_TESTS_QUICK=1
make -j"${parallel}" -C build-autotools/test check LD_LIBRARY_PATH="${curdir}/build-autotools/build/.libs"
if test "${{ runner.os }}" = "Linux"; then
# This should show us the SDL_REVISION
strings "${curdir}/build-autotools/build/.libs/libSDL2-2.0.so.0" | grep SDL-
fi
- name: Install (Autotools)
if: matrix.platform.autotools
run: |
set -eu
curdir="$(pwd)"
parallel="$(getconf _NPROCESSORS_ONLN)"
make -j"${parallel}" -C build-autotools install V=1
if test "${{ runner.os }}" != "macOS" ; then
make -j"${parallel}" -C build-autotools/test install V=1
fi
( cd autotools_prefix; find . ) | LC_ALL=C sort -u
echo "SDL2_DIR=$(pwd)/autotools_prefix" >> $GITHUB_ENV
- name: Verify CMake configuration files
run: |
cmake -S cmake/test -B cmake_config_build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }}
cmake --build cmake_config_build --verbose
- name: Verify sdl2-config
run: |
export PATH=${{ env.SDL2_DIR }}/bin:$PATH
cmake/test/test_sdlconfig.sh
- name: Verify sdl2.pc
run: |
export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig
cmake/test/test_pkgconfig.sh
- name: Distcheck (Autotools)
if: matrix.platform.autotools
run: |
set -eu
parallel="$(getconf _NPROCESSORS_ONLN)"
make -j"${parallel}" -C build-autotools dist V=1
# Similar to Automake `make distcheck`: check that the tarball
# release is sufficient to do a new build
mkdir distcheck
tar -C distcheck -zxf build-autotools/SDL2-*.tar.gz
( cd distcheck/SDL2-* && ./configure )
make -j"${parallel}" -C distcheck/SDL2-*
- name: Run installed-tests (Autotools)
if: "runner.os == 'Linux' && matrix.platform.autotools"
run: |
set -eu
parallel="$(getconf _NPROCESSORS_ONLN)"
sudo make -j"${parallel}" -C build-autotools install
sudo make -j"${parallel}" -C build-autotools/test install
export SDL_TESTS_QUICK=1
# We need to set LD_LIBRARY_PATH because it isn't in the default
# linker search path. We don't need to set XDG_DATA_DIRS for
# ginsttest-runner, because /usr/local/share *is* in the default
# search path for that.
env --chdir=/ \
LD_LIBRARY_PATH=/usr/local/lib \
SDL_AUDIODRIVER=dummy \
SDL_VIDEODRIVER=dummy \
ginsttest-runner --tap SDL2

View File

@@ -1,74 +0,0 @@
name: Build (MSVC)
on: [push, pull_request]
jobs:
Build:
name: ${{ matrix.platform.name }}
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
platform:
- { name: Windows (x64), flags: -A x64, project: VisualC/SDL.sln, projectflags: '/p:Platform=x64' }
- { name: Windows (x86), flags: -A Win32, project: VisualC/SDL.sln, projectflags: '/p:Platform=Win32' }
- { name: Windows static VCRT (x64), flags: -A x64 -DSDL_FORCE_STATIC_VCRT=ON }
- { name: Windows static VCRT (x86), flags: -A Win32 -DSDL_FORCE_STATIC_VCRT=ON }
- { name: Windows (clang-cl x64), flags: -T ClangCL -A x64 }
- { name: Windows (clang-cl x86), flags: -T ClangCL -A Win32 }
- { name: Windows (ARM), flags: -A ARM }
- { name: Windows (ARM64), flags: -A ARM64 }
- { name: UWP (x64), flags: -A x64 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0" -DSDL_TESTS=OFF, nowerror: true,
project: VisualC-WinRT/SDL-UWP.sln, projectflags: '/p:Platform=x64 /p:WindowsTargetPlatformVersion=10.0.17763.0' }
steps:
- uses: actions/checkout@v3
- name: Create CMake project using SDL as a subproject
shell: python
run: |
import os
import textwrap
srcdir = r"${{ github.workspace }}".replace("\\", "/")
builddir = f"{ srcdir }/build"
os.makedirs(builddir)
with open(f"{ builddir }/CMakeLists.txt", "w") as f:
f.write(textwrap.dedent(f"""\
cmake_minimum_required(VERSION 3.0)
project(sdl_user)
add_subdirectory("{ srcdir }" SDL)
"""))
- name: Configure (CMake)
run: cmake -S build -B build `
-DSDL_WERROR=${{ !matrix.platform.nowerror }} `
-DSDL_TESTS=ON `
-DSDL_INSTALL_TESTS=ON `
-DSDL_VENDOR_INFO="Github Workflow" `
-DSDL2_DISABLE_INSTALL=OFF `
${{ matrix.platform.flags }} `
-DCMAKE_INSTALL_PREFIX=prefix
- name: Build (CMake)
run: cmake --build build/ --config Release --parallel
- name: Run build-time tests
if: "! contains(matrix.platform.name, 'ARM')"
run: |
$env:SDL_TESTS_QUICK=1
ctest -VV --test-dir build/ -C Release
- name: Install (CMake)
run: |
echo "SDL2_DIR=$Env:GITHUB_WORKSPACE/prefix" >> $Env:GITHUB_ENV
cmake --install build/
- name: Verify CMake configuration files
if: ${{ !contains(matrix.platform.name, 'UWP') }} # FIXME: cmake/test/CMakeLists.txt should support UWP
run: |
cmake -S cmake/test -B cmake_config_build `
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} `
${{ matrix.platform.flags }}
cmake --build cmake_config_build --config Release
- name: Add msbuild to PATH
if: ${{ matrix.platform.project != '' }}
uses: microsoft/setup-msbuild@v1.1.3
- name: Build msbuild
if: ${{ matrix.platform.project != '' }}
run: msbuild ${{ matrix.platform.project }} /m /p:BuildInParallel=true /p:Configuration=Release ${{ matrix.platform.projectflags }}

View File

@@ -1,42 +0,0 @@
name: Build (Nintendo 3DS)
on: [push, pull_request]
jobs:
n3ds:
runs-on: ubuntu-latest
container:
image: devkitpro/devkitarm:latest
steps:
- uses: actions/checkout@v3
- name: Install build requirements
run: |
apt update
apt install ninja-build
- name: Configure CMake
run: |
cmake -S . -B build -G Ninja \
-DCMAKE_TOOLCHAIN_FILE=${DEVKITPRO}/cmake/3DS.cmake \
-DSDL_WERROR=ON \
-DSDL_TESTS=ON \
-DSDL_INSTALL_TESTS=ON \
-DSDL_VENDOR_INFO="Github Workflow" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=prefix
- name: Build
run: cmake --build build --verbose
- name: Install CMake
run: |
echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV
cmake --install build/
( cd prefix; find ) | LC_ALL=C sort -u
- name: Verify CMake configuration files
run: |
cmake -S cmake/test -B cmake_config_build -G Ninja \
-DCMAKE_TOOLCHAIN_FILE=${DEVKITPRO}/cmake/3DS.cmake \
-DTEST_SHARED=FALSE \
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \
-DCMAKE_BUILD_TYPE=Release
cmake --build cmake_config_build --verbose
# Not running test_pkgconfig.sh and test_sdlconfig.sh
# as invoking the compiler manually is not supported

View File

@@ -1,73 +0,0 @@
name: Build (Sony Playstation 2)
on: [push, pull_request]
jobs:
ps2:
runs-on: ubuntu-latest
container: ps2dev/ps2dev:latest
steps:
- uses: actions/checkout@v3
- name: Setup dependencies
run: |
apk update
apk add cmake gmp mpc1 mpfr4 ninja pkgconf make git
# To be removed once ps2_drivers is part of PS2DEV
- name: Install ps2_drivers lib
run: |
git clone https://github.com/fjtrujy/ps2_drivers.git
cd ps2_drivers
make -j $(getconf _NPROCESSORS_ONLN) clean
make -j $(getconf _NPROCESSORS_ONLN)
make -j $(getconf _NPROCESSORS_ONLN) install
- name: Configure (CMake)
run: |
cmake -S . -B build -G Ninja \
-DCMAKE_TOOLCHAIN_FILE=$PS2DEV/ps2sdk/ps2dev.cmake \
-DSDL_WERROR=ON \
-DSDL_TESTS=ON \
-DCMAKE_INSTALL_PREFIX=cmake_prefix \
-DCMAKE_BUILD_TYPE=Release
- name: Build
run: cmake --build build --config Release --verbose --parallel
- name: Install (CMake)
run: |
set -eu
cmake --install build/ --config Release
echo "SDL2_DIR=$(pwd)/cmake_prefix" >> $GITHUB_ENV
( cd cmake_prefix; find ) | LC_ALL=C sort -u
- name: Verify CMake configuration files
run: |
cmake -S cmake/test -B cmake_config_build -G Ninja \
-DCMAKE_TOOLCHAIN_FILE=$PS2DEV/ps2sdk/ps2dev.cmake \
-DTEST_SHARED=FALSE \
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \
-DCMAKE_BUILD_TYPE=Release
cmake --build cmake_config_build --verbose
- name: Verify sdl2-config
run: |
export CC=mips64r5900el-ps2-elf-gcc
export PATH=${{ env.SDL2_DIR }}/bin:$PATH
export EXTRA_LDFLAGS="-L$PS2DEV/ps2sdk/ee/lib -L$PS2DEV/gsKit/lib -L$PS2DEV/ps2sdk/ports/lib"
cmake/test/test_sdlconfig.sh
- name: Verify sdl2.pc
run: |
export CC=mips64r5900el-ps2-elf-gcc
export EXTRA_LDFLAGS="-L$PS2DEV/ps2sdk/ee/lib -L$PS2DEV/gsKit/lib -L$PS2DEV/ps2sdk/ports/lib"
export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig
cmake/test/test_pkgconfig.sh
- name: Get short SHA
id: slug
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
- name: Upload artifacts
if: ${{ success() }}
uses: actions/upload-artifact@v3
with:
name: tests-${{ steps.slug.outputs.sha8 }}
path: |
build/test

View File

@@ -1,50 +0,0 @@
name: Build (Sony Playstation Portable)
on: [push, pull_request]
jobs:
psp:
runs-on: ubuntu-latest
container: pspdev/pspdev:latest
steps:
- uses: actions/checkout@v3
- name: Setup dependencies
run: |
apk update
apk add cmake gmp mpc1 mpfr4 make pkgconf
- name: Configure CMake
run: |
cmake -S . -B build \
-DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake \
-DSDL_WERROR=ON \
-DSDL_TESTS=ON \
-DSDL_INSTALL_TESTS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=prefix
- name: Build
run: cmake --build build --config Release
- name: Install
run: |
echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV
cmake --install build --config Release
( cd prefix; find ) | LC_ALL=C sort -u
- name: Verify CMake configuration files
run: |
cmake -S cmake/test -B cmake_config_build \
-DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake \
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \
-DTEST_SHARED=FALSE \
-DCMAKE_BUILD_TYPE=Release
cmake --build cmake_config_build --verbose
- name: Verify sdl2-config
run: |
export CC=psp-gcc
export PATH=${{ env.SDL2_DIR }}/bin:$PATH
export EXTRA_LDFLAGS="-L$PSPDEV/lib -L$PSPDEV/psp/lib -L$PSPDEV/psp/sdk/lib"
cmake/test/test_sdlconfig.sh
- name: Verify sdl2.pc
run: |
export CC=psp-gcc
export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig
export EXTRA_LDFLAGS="-L$PSPDEV/lib -L$PSPDEV/psp/lib -L$PSPDEV/psp/sdk/lib"
cmake/test/test_pkgconfig.sh

655
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,655 @@
name: 'release'
run-name: 'Create SDL release artifacts for ${{ inputs.commit }}'
on:
workflow_dispatch:
inputs:
commit:
description: 'Commit of SDL'
required: true
jobs:
src:
runs-on: ubuntu-latest
outputs:
project: ${{ steps.releaser.outputs.project }}
version: ${{ steps.releaser.outputs.version }}
src-tar-gz: ${{ steps.releaser.outputs.src-tar-gz }}
src-tar-xz: ${{ steps.releaser.outputs.src-tar-xz }}
src-zip: ${{ steps.releaser.outputs.src-zip }}
steps:
- name: 'Set up Python'
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: 'Fetch build-release.py'
uses: actions/checkout@v4
with:
sparse-checkout: 'build-scripts/build-release.py'
- name: 'Set up SDL sources'
uses: actions/checkout@v4
with:
path: 'SDL'
fetch-depth: 0
- name: 'Build Source archive'
id: releaser
shell: bash
run: |
python build-scripts/build-release.py \
--actions source \
--commit ${{ inputs.commit }} \
--root "${{ github.workspace }}/SDL" \
--github \
--debug
- name: 'Store source archives'
uses: actions/upload-artifact@v4
with:
name: sources
path: '${{ github.workspace}}/dist'
- name: 'Generate summary'
run: |
echo "Run the following commands to download all artifacts:" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "mkdir -p /tmp/${{ steps.releaser.outputs.project }}-${{ steps.releaser.outputs.version }}" >> $GITHUB_STEP_SUMMARY
echo "cd /tmp/${{ steps.releaser.outputs.project }}-${{ steps.releaser.outputs.version }}" >> $GITHUB_STEP_SUMMARY
echo "gh run -R ${{ github.repository }} download ${{ github.run_id }}" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
linux-verify:
needs: [src]
runs-on: ubuntu-latest
steps:
- name: 'Download source archives'
uses: actions/download-artifact@v4
with:
name: sources
path: '${{ github.workspace }}'
- name: 'Unzip ${{ needs.src.outputs.src-zip }}'
id: zip
run: |
mkdir /tmp/zipdir
cd /tmp/zipdir
unzip "${{ github.workspace }}/${{ needs.src.outputs.src-zip }}"
echo "path=/tmp/zipdir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
- name: 'Untar ${{ needs.src.outputs.src-tar-gz }}'
id: tar
run: |
mkdir -p /tmp/tardir
tar -C /tmp/tardir -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}"
echo "path=/tmp/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
- name: 'Compare contents of ${{ needs.src.outputs.src-zip }} and ${{ needs.src.outputs.src-tar-gz }}'
run: |
diff /tmp/zipdir /tmp/tardir
- name: 'Test versioning'
shell: bash
run: |
${{ steps.tar.outputs.path }}/build-scripts/test-versioning.sh
- name: 'Install Linux dependencies'
run: |
sudo apt-get update -y
sudo apt-get install -y \
gnome-desktop-testing libasound2-dev libpulse-dev libaudio-dev libjack-dev libsndio-dev \
libusb-1.0-0-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev \
libxss-dev libwayland-dev libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \
libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev
- name: 'CMake (configure + build + tests + examples)'
run: |
cmake -S ${{ steps.tar.outputs.path }} -B /tmp/build -DSDL_TEST_LIBRARY=TRUE -DSDL_TESTS=TRUE -DSDL_EXAMPLES=TRUE
cmake --build /tmp/build --verbose
ctest --test-dir /tmp/build --no-tests=error --output-on-failure
dmg:
needs: [src]
runs-on: macos-latest
outputs:
dmg: ${{ steps.releaser.outputs.dmg }}
steps:
- name: 'Set up Python'
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: 'Fetch build-release.py'
uses: actions/checkout@v4
with:
sparse-checkout: 'build-scripts/build-release.py'
- name: 'Download source archives'
uses: actions/download-artifact@v4
with:
name: sources
path: '${{ github.workspace }}'
- name: 'Untar ${{ needs.src.outputs.src-tar-gz }}'
id: tar
run: |
mkdir -p "${{ github.workspace }}/tardir"
tar -C "${{ github.workspace }}/tardir" -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}"
echo "path=${{ github.workspace }}/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
- name: 'Build SDL3.dmg'
id: releaser
shell: bash
run: |
python build-scripts/build-release.py \
--actions dmg \
--commit ${{ inputs.commit }} \
--root "${{ steps.tar.outputs.path }}" \
--github \
--debug
- name: 'Store DMG image file'
uses: actions/upload-artifact@v4
with:
name: dmg
path: '${{ github.workspace }}/dist'
dmg-verify:
needs: [dmg, src]
runs-on: macos-latest
steps:
- name: 'Download source archives'
uses: actions/download-artifact@v4
with:
name: sources
path: '${{ github.workspace }}'
- name: 'Download ${{ needs.dmg.outputs.dmg }}'
uses: actions/download-artifact@v4
with:
name: dmg
path: '${{ github.workspace }}'
- name: 'Untar ${{ needs.src.outputs.src-tar-gz }}'
id: src
run: |
mkdir -p /tmp/tardir
tar -C /tmp/tardir -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}"
echo "path=/tmp/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
- name: 'Mount ${{ needs.dmg.outputs.dmg }}'
id: mount
run: |
hdiutil attach '${{ github.workspace }}/${{ needs.dmg.outputs.dmg }}'
mount_point="/Volumes/${{ needs.src.outputs.project }}"
if [ ! -d "$mount_point/${{ needs.src.outputs.project }}.xcframework" ]; then
echo "Cannot find ${{ needs.src.outputs.project }}.xcframework!"
exit 1
fi
echo "mount_point=$mount_point">>$GITHUB_OUTPUT
- name: 'CMake (configure + build) Darwin'
run: |
cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
-DTEST_FULL=FALSE \
-DTEST_STATIC=FALSE \
-DTEST_TEST=FALSE \
-DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}" \
-DCMAKE_SYSTEM_NAME=Darwin \
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 \
-Werror=dev \
-B build_darwin
cmake --build build_darwin --config Release --verbose
cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
-DTEST_FULL=FALSE \
-DTEST_STATIC=FALSE \
-DTEST_TEST=FALSE \
-DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}/SDL3.xcframework/macos-arm64_x86_64" \
-DCMAKE_SYSTEM_NAME=Darwin \
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 \
-Werror=dev \
-B build_darwin_2
cmake --build build_darwin --config Release --verbose
- name: 'CMake (configure + build) iOS'
run: |
cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
-DTEST_FULL=FALSE \
-DTEST_STATIC=FALSE \
-DTEST_TEST=FALSE \
-DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}" \
-DCMAKE_SYSTEM_NAME=iOS \
-DCMAKE_OSX_ARCHITECTURES="arm64" \
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
-Werror=dev \
-B build_ios
cmake --build build_ios --config Release --verbose
- name: 'CMake (configure + build) tvOS'
run: |
cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
-DTEST_FULL=FALSE \
-DTEST_STATIC=FALSE \
-DTEST_TEST=FALSE \
-DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}" \
-DCMAKE_SYSTEM_NAME=tvOS \
-DCMAKE_OSX_ARCHITECTURES="arm64" \
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
-Werror=dev \
-B build_tvos
cmake --build build_tvos --config Release --verbose
- name: 'CMake (configure + build) iOS simulator'
run: |
sysroot=$(xcodebuild -version -sdk iphonesimulator Path)
echo "sysroot=$sysroot"
cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
-DTEST_FULL=FALSE \
-DTEST_STATIC=FALSE \
-DTEST_TEST=FALSE \
-DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}" \
-DCMAKE_SYSTEM_NAME=iOS \
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
-DCMAKE_OSX_SYSROOT="${sysroot}" \
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
-Werror=dev \
-B build_ios_simulator
cmake --build build_ios_simulator --config Release --verbose
- name: 'CMake (configure + build) tvOS simulator'
run: |
sysroot=$(xcodebuild -version -sdk appletvsimulator Path)
echo "sysroot=$sysroot"
cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
-DTEST_FULL=FALSE \
-DTEST_STATIC=FALSE \
-DTEST_TEST=FALSE \
-DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}" \
-DCMAKE_SYSTEM_NAME=tvOS \
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
-DCMAKE_OSX_SYSROOT="${sysroot}" \
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
-Werror=dev \
-B build_tvos_simulator
cmake --build build_tvos_simulator --config Release --verbose
msvc:
needs: [src]
runs-on: windows-2025
outputs:
VC-x86: ${{ steps.releaser.outputs.VC-x86 }}
VC-x64: ${{ steps.releaser.outputs.VC-x64 }}
VC-arm64: ${{ steps.releaser.outputs.VC-arm64 }}
VC-devel: ${{ steps.releaser.outputs.VC-devel }}
steps:
- name: 'Set up Python'
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: 'Fetch build-release.py'
uses: actions/checkout@v4
with:
sparse-checkout: 'build-scripts/build-release.py'
- name: 'Download source archives'
uses: actions/download-artifact@v4
with:
name: sources
path: '${{ github.workspace }}'
- name: 'Unzip ${{ needs.src.outputs.src-zip }}'
id: zip
run: |
New-Item C:\temp -ItemType Directory -ErrorAction SilentlyContinue
cd C:\temp
unzip "${{ github.workspace }}/${{ needs.src.outputs.src-zip }}"
echo "path=C:\temp\${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$Env:GITHUB_OUTPUT
- name: 'Build MSVC binary archives'
id: releaser
run: |
python build-scripts/build-release.py `
--actions msvc `
--commit ${{ inputs.commit }} `
--root "${{ steps.zip.outputs.path }}" `
--github `
--debug
- name: 'Store MSVC archives'
uses: actions/upload-artifact@v4
with:
name: win32
path: '${{ github.workspace }}/dist'
msvc-verify:
needs: [msvc, src]
runs-on: windows-latest
steps:
- name: 'Fetch .github/actions/setup-ninja/action.yml'
uses: actions/checkout@v4
with:
sparse-checkout: '.github/actions/setup-ninja/action.yml'
- name: 'Download source archives'
uses: actions/download-artifact@v4
with:
name: sources
path: '${{ github.workspace }}'
- name: 'Download MSVC binaries'
uses: actions/download-artifact@v4
with:
name: win32
path: '${{ github.workspace }}'
- name: 'Unzip ${{ needs.src.outputs.src-zip }}'
id: src
run: |
mkdir '${{ github.workspace }}/sources'
cd '${{ github.workspace }}/sources'
unzip "${{ github.workspace }}/${{ needs.src.outputs.src-zip }}"
echo "path=${{ github.workspace }}/sources/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$env:GITHUB_OUTPUT
- name: 'Unzip ${{ needs.msvc.outputs.VC-devel }}'
id: bin
run: |
mkdir '${{ github.workspace }}/vc'
cd '${{ github.workspace }}/vc'
unzip "${{ github.workspace }}/${{ needs.msvc.outputs.VC-devel }}"
echo "path=${{ github.workspace }}/vc/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$env:GITHUB_OUTPUT
- name: Set up ninja
uses: ./.github/actions/setup-ninja
- name: 'Configure vcvars x86'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64_x86
- name: 'CMake (configure + build + tests) x86'
run: |
cmake -S "${{ steps.src.outputs.path }}/cmake/test" `
-B build_x86 `
-GNinja `
-DCMAKE_BUILD_TYPE=Debug `
-Werror=dev `
-DTEST_FULL=TRUE `
-DTEST_STATIC=FALSE `
-DTEST_SHARED=TRUE `
-DTEST_TEST=TRUE `
-DCMAKE_SUPPRESS_REGENERATION=TRUE `
-DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}"
Start-Sleep -Seconds 2
cmake --build build_x86 --config Release --verbose
ctest --test-dir build_x86 --no-tests=error -C Release --output-on-failure
- name: 'Configure vcvars x64'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: 'CMake (configure + build + tests) x64'
run: |
cmake -S "${{ steps.src.outputs.path }}/cmake/test" `
-B build_x64 `
-GNinja `
-DCMAKE_BUILD_TYPE=Debug `
-Werror=dev `
-DTEST_FULL=TRUE `
-DTEST_STATIC=FALSE `
-DTEST_SHARED=TRUE `
-DTEST_TEST=TRUE `
-DCMAKE_SUPPRESS_REGENERATION=TRUE `
-DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}"
Start-Sleep -Seconds 2
cmake --build build_x64 --config Release --verbose
ctest --test-dir build_x64 --no-tests=error -C Release --output-on-failure
- name: 'Configure vcvars arm64'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64_arm64
- name: 'CMake (configure + build) arm64'
run: |
cmake -S "${{ steps.src.outputs.path }}/cmake/test" `
-B build_arm64 `
-GNinja `
-DCMAKE_BUILD_TYPE=Debug `
-Werror=dev `
-DTEST_FULL=TRUE `
-DTEST_STATIC=FALSE `
-DTEST_SHARED=TRUE `
-DTEST_TEST=TRUE `
-DCMAKE_SUPPRESS_REGENERATION=TRUE `
-DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}"
Start-Sleep -Seconds 2
cmake --build build_arm64 --config Release --verbose
- name: 'CMake (configure + build) arm64ec'
run: |
cmake -S "${{ steps.src.outputs.path }}/cmake/test" `
-B build_arm64ec `
-GNinja `
-DCMAKE_BUILD_TYPE=Debug `
-Werror=dev `
-DTEST_FULL=TRUE `
-DTEST_STATIC=FALSE `
-DTEST_SHARED=TRUE `
-DTEST_TEST=TRUE `
-DSDL_DISABLE_AVX=TRUE `
-DSDL_DISABLE_AVX2=TRUE `
-DSDL_DISABLE_AVX512F=TRUE `
-DCMAKE_SUPPRESS_REGENERATION=TRUE `
-DCMAKE_C_FLAGS="/arm64EC" `
-DCMAKE_CXX_FLAGS="/arm64EC" `
-DCMAKE_EXE_LINKER_FLAGS="/MACHINE:ARM64EC" `
-DCMAKE_SHARED_LINKER_FLAGS="/MACHINE:ARM64EC" `
-DCMAKE_STATIC_LINKER_FLAGS="/MACHINE:ARM64EC" `
-DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}"
Start-Sleep -Seconds 2
cmake --build build_arm64ec --config Release --verbose
mingw:
needs: [src]
runs-on: ubuntu-24.04 # FIXME: current ubuntu-latest ships an outdated mingw, replace with ubuntu-latest once 24.04 becomes the new default
outputs:
mingw-devel-tar-gz: ${{ steps.releaser.outputs.mingw-devel-tar-gz }}
mingw-devel-tar-xz: ${{ steps.releaser.outputs.mingw-devel-tar-xz }}
steps:
- name: 'Set up Python'
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: 'Fetch build-release.py'
uses: actions/checkout@v4
with:
sparse-checkout: 'build-scripts/build-release.py'
- name: 'Install Mingw toolchain'
run: |
sudo apt-get update -y
sudo apt-get install -y gcc-mingw-w64 g++-mingw-w64 ninja-build
- name: 'Download source archives'
uses: actions/download-artifact@v4
with:
name: sources
path: '${{ github.workspace }}'
- name: 'Untar ${{ needs.src.outputs.src-tar-gz }}'
id: tar
run: |
mkdir -p /tmp/tardir
tar -C /tmp/tardir -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}"
echo "path=/tmp/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
- name: 'Build MinGW binary archives'
id: releaser
run: |
python build-scripts/build-release.py \
--actions mingw \
--commit ${{ inputs.commit }} \
--root "${{ steps.tar.outputs.path }}" \
--github \
--debug
- name: 'Store MinGW archives'
uses: actions/upload-artifact@v4
with:
name: mingw
path: '${{ github.workspace }}/dist'
mingw-verify:
needs: [mingw, src]
runs-on: ubuntu-latest
steps:
- name: 'Install Mingw toolchain'
run: |
sudo apt-get update -y
sudo apt-get install -y gcc-mingw-w64 g++-mingw-w64 ninja-build
- name: 'Download source archives'
uses: actions/download-artifact@v4
with:
name: sources
path: '${{ github.workspace }}'
- name: 'Download MinGW binaries'
uses: actions/download-artifact@v4
with:
name: mingw
path: '${{ github.workspace }}'
- name: 'Untar ${{ needs.src.outputs.src-tar-gz }}'
id: src
run: |
mkdir -p /tmp/tardir
tar -C /tmp/tardir -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}"
echo "path=/tmp/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
- name: 'Untar ${{ needs.mingw.outputs.mingw-devel-tar-gz }}'
id: bin
run: |
mkdir -p /tmp/mingw-tardir
tar -C /tmp/mingw-tardir -v -x -f "${{ github.workspace }}/${{ needs.mingw.outputs.mingw-devel-tar-gz }}"
echo "path=/tmp/mingw-tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
- name: 'CMake (configure + build) i686'
run: |
cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
-DCMAKE_BUILD_TYPE="Release" \
-DTEST_FULL=TRUE \
-DTEST_STATIC=FALSE \
-DTEST_TEST=TRUE \
-DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}" \
-DCMAKE_TOOLCHAIN_FILE="${{ steps.src.outputs.path }}/build-scripts/cmake-toolchain-mingw64-i686.cmake" \
-DCMAKE_C_FLAGS="-DSDL_DISABLE_SSE4_2" \
-Werror=dev \
-B build_x86
cmake --build build_x86 --config Release --verbose
- name: 'CMake (configure + build) x86_64'
run: |
cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
-DCMAKE_BUILD_TYPE="Release" \
-DTEST_FULL=TRUE \
-DTEST_STATIC=false \
-DTEST_TEST=TRUE \
-DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}" \
-DCMAKE_TOOLCHAIN_FILE="${{ steps.src.outputs.path }}/build-scripts/cmake-toolchain-mingw64-x86_64.cmake" \
-DCMAKE_C_FLAGS="-DSDL_DISABLE_SSE4_2" \
-Werror=dev \
-B build_x64
cmake --build build_x64 --config Release --verbose
android:
needs: [src]
runs-on: ubuntu-latest
outputs:
android-aar: ${{ steps.releaser.outputs.android-aar }}
steps:
- name: 'Set up Python'
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: 'Fetch build-release.py'
uses: actions/checkout@v4
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: r28c
- name: 'Setup Java JDK'
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
- name: 'Install ninja'
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build
- name: 'Download source archives'
uses: actions/download-artifact@v4
with:
name: sources
path: '${{ github.workspace }}'
- name: 'Untar ${{ needs.src.outputs.src-tar-gz }}'
id: tar
run: |
mkdir -p /tmp/tardir
tar -C /tmp/tardir -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}"
echo "path=/tmp/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
- name: 'Build Android prefab binary archive(s)'
id: releaser
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 \
--debug
- name: 'Store Android archive(s)'
uses: actions/upload-artifact@v4
with:
name: android
path: '${{ github.workspace }}/dist'
android-verify:
needs: [android, src]
runs-on: ubuntu-latest
steps:
- name: 'Set up Python'
uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: 'Download source archives'
uses: actions/download-artifact@v4
with:
name: sources
path: '${{ github.workspace }}'
- name: 'Download Android .aar archive'
uses: actions/download-artifact@v4
with:
name: android
path: '${{ github.workspace }}'
- name: 'Untar ${{ needs.src.outputs.src-tar-gz }}'
id: src
run: |
mkdir -p /tmp/tardir
tar -C /tmp/tardir -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}"
echo "path=/tmp/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
- name: 'Extract Android SDK from AAR'
id: sdk
run: |
cd /tmp
unzip "${{ github.workspace }}/${{ needs.android.outputs.android-aar }}"
python "${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}.aar" -o /tmp/SDL3-android
echo "prefix=/tmp/SDL3-android" >>$GITHUB_OUTPUT
echo "sdl3-aar=/tmp/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}.aar" >>$GITHUB_OUTPUT
- name: 'CMake (configure + build) x86, x64, arm32, arm64'
run: |
android_abis="x86 x86_64 armeabi-v7a arm64-v8a"
for android_abi in ${android_abis}; do
echo "Configuring ${android_abi}..."
cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
-DTEST_FULL=TRUE \
-DTEST_STATIC=FALSE \
-DTEST_TEST=TRUE \
-DCMAKE_PREFIX_PATH="${{ steps.sdk.outputs.prefix }}" \
-DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake \
-DANDROID_ABI=${android_abi} \
-DCMAKE_BUILD_TYPE=Release \
-B "${android_abi}"
echo "Building ${android_abi}..."
cmake --build "${android_abi}" --config Release --verbose
done
- name: 'Create gradle project'
id: create-gradle-project
run: |
python ${{ steps.src.outputs.path }}/build-scripts/create-android-project.py \
org.libsdl.testspriteminimal \
${{ steps.src.outputs.path }}/test/testspriteminimal.c \
${{ steps.src.outputs.path }}/test/icon.h \
--variant aar \
--output "/tmp/projects"
echo "path=/tmp/projects/org.libsdl.testspriteminimal" >>$GITHUB_OUTPUT
- name: 'Copy SDL3 aar into Gradle project'
run: |
cp "${{ steps.sdk.outputs.sdl3-aar }}" "${{ steps.create-gradle-project.outputs.path }}/app/libs"
echo ""
echo "Project contents:"
echo ""
find "${{ steps.create-gradle-project.outputs.path }}"
- name: 'Build app (Gradle & CMake)'
run: |
cd "${{ steps.create-gradle-project.outputs.path }}"
./gradlew -i assembleRelease -Pandroid.native.buildOutput=verbose -PBUILD_WITH_CMAKE=1
- name: 'Build app (Gradle & ndk-build)'
run: |
cd "${{ steps.create-gradle-project.outputs.path }}"
./gradlew -i assembleRelease -Pandroid.native.buildOutput=verbose

View File

@@ -1,68 +0,0 @@
name: Build (RISC OS)
on: [push, pull_request]
jobs:
Build:
name: ${{ matrix.platform.name }}
runs-on: ubuntu-latest
container: riscosdotinfo/riscos-gccsdk-4.7:latest
strategy:
fail-fast: false
matrix:
platform:
- { name: autotools, test_args: '-DTEST_SHARED=FALSE' } # FIXME: autotools should build and install shared libraries
- { name: CMake }
steps:
- name: Setup dependencies
run: apt-get update && apt-get install -y cmake ninja-build
- uses: actions/checkout@v3
- name: Configure (autotools)
if: ${{ contains(matrix.platform.name, 'autotools') }}
run: |
mkdir build_autotools
cd build_autotools
../configure \
--host=arm-unknown-riscos \
--disable-gcc-atomics \
--prefix=${{ github.workspace }}/prefix_autotools
- name: Build (autotools)
if: ${{ contains(matrix.platform.name, 'autotools') }}
run: make -C build_autotools -j`nproc` V=1
- name: Install (autotools)
if: ${{ contains(matrix.platform.name, 'autotools') }}
run: |
echo "SDL2_DIR=${{ github.workspace }}/prefix_autotools" >> $GITHUB_ENV
make -C build_autotools install
( cd ${{ github.workspace }}/prefix_autotools; find ) | LC_ALL=C sort -u
- name: Configure (CMake)
if: ${{ contains(matrix.platform.name, 'CMake') }}
run: |
cmake -S . -B build -G Ninja \
-DCMAKE_TOOLCHAIN_FILE=/home/riscos/env/toolchain-riscos.cmake \
-DRISCOS=ON \
-DSDL_GCC_ATOMICS=OFF \
-DSDL_TESTS=ON \
-DSDL_INSTALL_TESTS=ON \
-DSDL_VENDOR_INFO="Github Workflow" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/prefix_cmake
- name: Build (CMake)
if: ${{ contains(matrix.platform.name, 'CMake') }}
run: cmake --build build --verbose
- name: Install (CMake)
if: ${{ contains(matrix.platform.name, 'CMake') }}
run: |
echo "SDL2_DIR=${{ github.workspace }}/prefix_cmake" >> $GITHUB_ENV
cmake --install build/
( cd ${{ github.workspace }}/prefix_cmake; find ) | LC_ALL=C sort -u
- name: Verify CMake configuration files
run: |
cmake -S cmake/test -B cmake_config_build -G Ninja \
-DCMAKE_TOOLCHAIN_FILE=/home/riscos/env/toolchain-riscos.cmake \
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \
-DCMAKE_BUILD_TYPE=Release \
${{ matrix.platform.test_args }}
cmake --build cmake_config_build --verbose

View File

@@ -1,53 +0,0 @@
name: Build (Sony Playstation Vita)
on: [push, pull_request]
defaults:
run:
shell: sh
jobs:
vita:
runs-on: ubuntu-latest
container:
image: vitasdk/vitasdk:latest
steps:
- uses: actions/checkout@v3
- name: Install build requirements
run: |
apk update
apk add cmake ninja pkgconf bash
- name: Configure CMake
run: |
cmake -S . -B build -G Ninja \
-DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake \
-DSDL_WERROR=ON \
-DSDL_TESTS=ON \
-DSDL_INSTALL_TESTS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=prefix
- name: Build
run: cmake --build build --verbose
- name: Install CMake
run: |
echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV
cmake --install build/
( cd prefix; find ) | LC_ALL=C sort -u
- name: Verify CMake configuration files
run: |
cmake -S cmake/test -B cmake_config_build -G Ninja \
-DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake \
-DTEST_SHARED=FALSE \
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \
-DCMAKE_BUILD_TYPE=Release
cmake --build cmake_config_build --verbose
- name: Verify sdl2-config
run: |
export CC=arm-vita-eabi-gcc
export PATH=${{ env.SDL2_DIR }}/bin:$PATH
cmake/test/test_sdlconfig.sh
- name: Verify sdl2.pc
run: |
export CC=arm-vita-eabi-gcc
export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig
cmake/test/test_pkgconfig.sh

View File

@@ -1,49 +0,0 @@
name: Build (VM Actions)
on: [push, pull_request]
jobs:
freebsd:
runs-on: macos-12
name: FreeBSD
steps:
- uses: actions/checkout@v3
- name: Build
uses: vmactions/freebsd-vm@v0
with:
usesh: true
prepare: |
pkg install -y \
gmake \
pkgconf \
libXcursor \
libXext \
libXinerama \
libXi \
libXfixes \
libXrandr \
libXScrnSaver \
libXxf86vm \
wayland \
wayland-protocols \
libxkbcommon \
mesa-libs \
libglvnd \
evdev-proto \
libinotify \
alsa-lib \
jackit \
nas \
pipewire \
pulseaudio \
sndio \
dbus \
zh-fcitx \
ibus \
libsamplerate \
libudev-devd
run: |
mkdir build_autotools
(cd build_autotools && CFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib" ../configure)
gmake -C build_autotools -j`sysctl -n hw.ncpu` V=1

View File

@@ -1,35 +0,0 @@
name: Build (OpenWatcom)
on: [push, pull_request]
jobs:
os2:
name: ${{ matrix.platform.name }}
runs-on: windows-latest
strategy:
matrix:
platform:
- { name: Windows, makefile: Makefile.w32 }
- { name: OS/2, makefile: Makefile.os2 }
steps:
- uses: actions/checkout@v3
- uses: open-watcom/setup-watcom@v0
- name: Build SDL2
run: |
wmake -f ${{ matrix.platform.makefile }} ENABLE_WERROR=1
- name: Build tests
run: |
cd test && wmake -f ${{ matrix.platform.makefile }} ENABLE_WERROR=1
cd ..
- name: Run tests
if: "matrix.platform.makefile == 'Makefile.w32'"
run: |
cd test && wmake -f ${{ matrix.platform.makefile }} check-quick
cd ..
- name: distclean
run: |
wmake -f ${{ matrix.platform.makefile }} distclean
cd test && wmake -f ${{ matrix.platform.makefile }} distclean
cd ..

108
.gitignore vendored
View File

@@ -1,21 +1,9 @@
aclocal.m4
autom4te*
config.cache
config.log
config.status
libtool
Makefile
Makefile.rules
sdl2-config
sdl2-config.cmake
sdl2-config-version.cmake
sdl2.pc
SDL2.spec
build
gen
Build
buildbot
/VERSION
build/
build-*/
!build-scripts/
buildbot/
/VERSION.txt
__pycache__
*.so
*.so.*
@@ -41,13 +29,27 @@ buildbot
*.rej
# for CMake
.cmake
CMakeFiles/
CMakeCache.txt
cmake_install.cmake
cmake_uninstall.cmake
SDL2ConfigVersion.cmake
install_manifest.txt
*Targets.cmake
*Config.cmake
*ConfigVersion.cmake
CTestTestfile.cmake
Testing
compile_commands.json
.cache/
/include-config-*
/include-revision
/Makefile
.ninja_*
*.ninja
*.pc
test/*.test
wayland-generated-protocols
# for CLion
.idea
@@ -61,6 +63,10 @@ cmake-build-*
.DS_Store
xcuserdata
*.xcworkspace
Xcode/build.xcconfig
# for Visual Studio Code
.vscode/
# for Visual C++
.vs
@@ -70,34 +76,28 @@ Release
*.ncb
*.suo
*.sdf
VisualC/tests/controllermap/axis.bmp
VisualC/tests/controllermap/button.bmp
VisualC/tests/controllermap/controllermap.bmp
VisualC/tests/controllermap/controllermap_back.bmp
VisualC/tests/gamepadmap/axis.bmp
VisualC/tests/gamepadmap/button.bmp
VisualC/tests/gamepadmap/gamepadmap.bmp
VisualC/tests/gamepadmap/gamepadmap_back.bmp
VisualC/tests/loopwave/sample.wav
VisualC/tests/testautomation/CompareSurfaces0001_Reference.bmp
VisualC/tests/testautomation/CompareSurfaces0001_TestOutput.bmp
VisualC/tests/testgamecontroller/axis.bmp
VisualC/tests/testgamecontroller/button.bmp
VisualC/tests/testgamecontroller/controllermap.bmp
VisualC/tests/testgamecontroller/controllermap_back.bmp
VisualC/tests/testoverlay2/moose.dat
VisualC/tests/testautomation/*.bmp
VisualC/tests/testgamepad/axis.bmp
VisualC/tests/testgamepad/button.bmp
VisualC/tests/testgamepad/gamepadmap.bmp
VisualC/tests/testgamepad/gamepadmap_back.bmp
VisualC/tests/testoverlay/moose.dat
VisualC/tests/testrendertarget/icon.bmp
VisualC/tests/testrendertarget/sample.bmp
VisualC/tests/testscale/icon.bmp
VisualC/tests/testscale/sample.bmp
VisualC/tests/testsprite2/icon.bmp
VisualC/tests/testsprite/icon.bmp
VisualC/tests/testyuv/testyuv.bmp
VisualC/visualtest/icon.bmp
VisualC/visualtest/testquit.actions
VisualC/visualtest/testquit.config
VisualC/visualtest/testquit.exe
VisualC/visualtest/testquit.parameters
VisualC/visualtest/testsprite2.exe
VisualC/visualtest/testsprite2_sample.actions
VisualC/visualtest/testsprite2_sample.config
VisualC/visualtest/testsprite2_sample.parameters
VisualC-GDK/**/Layout
src/render/direct3d12/D3D12_*_One.h
src/render/direct3d12/D3D12_*_Series.h
src/gpu/d3d12/D3D12_*_One.h
src/gpu/d3d12/D3D12_*_Series.h
# for Android
android-project/local.properties
@@ -105,28 +105,28 @@ android-project/.gradle/
test/checkkeys
test/checkkeysthreads
test/controllermap
test/gamepadmap
test/loopwave
test/loopwavequeue
test/testatomic
test/testaudiocapture
test/testaudiorecording
test/testaudiohotplug
test/testaudioinfo
test/testautomation
test/testbounds
test/testcustomcursor
test/testdisplayinfo
test/testdraw2
test/testdraw
test/testdrawchessboard
test/testdropfile
test/testerror
test/testevdev
test/testfile
test/testfilesystem
test/testgamecontroller
test/testgamepad
test/testgeometry
test/testgesture
test/testgl2
test/testgl
test/testgles
test/testgles2
test/testhaptic
@@ -144,7 +144,7 @@ test/testmessage
test/testmouse
test/testmultiaudio
test/testnative
test/testoverlay2
test/testoverlay
test/testplatform
test/testpower
test/testqsort
@@ -158,7 +158,7 @@ test/testsem
test/testsensor
test/testshader
test/testshape
test/testsprite2
test/testsprite
test/testspriteminimal
test/teststreaming
test/testsurround
@@ -168,15 +168,11 @@ test/testurl
test/testver
test/testviewport
test/testvulkan
test/testwm2
test/testwm
test/testyuv
test/torturethread
builddir/
debian/*.debhelper.log
debian/*.substvars
debian/*.tar.gz
debian/.debhelper/
debian/files
debian/libsdl*/
debian/tmp/
# for Doxygen
docs/output
SDL.tag
doxygen_warn.txt

View File

@@ -1,15 +1,41 @@
projectfullname = SDL_mixer
projectshortname = SDL_mixer
incsubdir = include
projectfullname = Simple Directmedia Layer
projectshortname = SDL
incsubdir = include/SDL3
wikisubdir =
apiprefixregex = (SDL_|SDLK_|KMOD_|AUDIO_)
mainincludefname = SDL.h
versionfname = include/SDL_version.h
readmesubdir = docs
apiprefixregex = (SDL_|SDLK_|[US]int\d+)
mainincludefname = SDL3/SDL.h
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
versionpatchregex = \A\#define\s+SDL_PATCHLEVEL\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!)
wikiheaderfiletext = Defined in [<SDL3/%fname%>](https://github.com/libsdl-org/SDL/blob/main/include/SDL3/%fname%)
manpageheaderfiletext = Defined in SDL3/%fname%
manpagesymbolfilterregex = \A[US]int\d+\Z
# All SDL_test_* headers become undefined categories, everything else just converts like SDL_audio.h -> Audio
# A handful of others we fix up in the header itself with /* WIKI CATEGORY: x */ comments.
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,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

@@ -8,11 +8,11 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := SDL2
LOCAL_MODULE := SDL3
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/include/build_config $(LOCAL_PATH)/src
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
LOCAL_SRC_FILES := \
$(subst $(LOCAL_PATH)/,, \
@@ -24,46 +24,70 @@ LOCAL_SRC_FILES := \
$(wildcard $(LOCAL_PATH)/src/audio/openslES/*.c) \
$(LOCAL_PATH)/src/atomic/SDL_atomic.c.arm \
$(LOCAL_PATH)/src/atomic/SDL_spinlock.c.arm \
$(wildcard $(LOCAL_PATH)/src/camera/*.c) \
$(wildcard $(LOCAL_PATH)/src/camera/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/camera/dummy/*.c) \
$(wildcard $(LOCAL_PATH)/src/core/*.c) \
$(wildcard $(LOCAL_PATH)/src/core/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/cpuinfo/*.c) \
$(LOCAL_PATH)/src/dialog/SDL_dialog.c \
$(LOCAL_PATH)/src/dialog/SDL_dialog_utils.c \
$(LOCAL_PATH)/src/dialog/android/SDL_androiddialog.c \
$(wildcard $(LOCAL_PATH)/src/dynapi/*.c) \
$(wildcard $(LOCAL_PATH)/src/events/*.c) \
$(wildcard $(LOCAL_PATH)/src/file/*.c) \
$(wildcard $(LOCAL_PATH)/src/io/*.c) \
$(wildcard $(LOCAL_PATH)/src/io/generic/*.c) \
$(wildcard $(LOCAL_PATH)/src/gpu/*.c) \
$(wildcard $(LOCAL_PATH)/src/gpu/vulkan/*.c) \
$(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) \
$(wildcard $(LOCAL_PATH)/src/joystick/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/joystick/dummy/*.c) \
$(wildcard $(LOCAL_PATH)/src/joystick/hidapi/*.c) \
$(wildcard $(LOCAL_PATH)/src/joystick/steam/*.c) \
$(wildcard $(LOCAL_PATH)/src/joystick/virtual/*.c) \
$(wildcard $(LOCAL_PATH)/src/loadso/dlopen/*.c) \
$(wildcard $(LOCAL_PATH)/src/locale/*.c) \
$(wildcard $(LOCAL_PATH)/src/locale/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/main/*.c) \
$(wildcard $(LOCAL_PATH)/src/main/generic/*.c) \
$(wildcard $(LOCAL_PATH)/src/misc/*.c) \
$(wildcard $(LOCAL_PATH)/src/misc/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/power/*.c) \
$(wildcard $(LOCAL_PATH)/src/power/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/process/*.c) \
$(wildcard $(LOCAL_PATH)/src/process/dummy/*.c) \
$(wildcard $(LOCAL_PATH)/src/filesystem/*.c) \
$(wildcard $(LOCAL_PATH)/src/filesystem/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/filesystem/posix/*.c) \
$(wildcard $(LOCAL_PATH)/src/sensor/*.c) \
$(wildcard $(LOCAL_PATH)/src/sensor/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/sensor/dummy/*.c) \
$(wildcard $(LOCAL_PATH)/src/render/*.c) \
$(wildcard $(LOCAL_PATH)/src/render/*/*.c) \
$(wildcard $(LOCAL_PATH)/src/stdlib/*.c) \
$(wildcard $(LOCAL_PATH)/src/storage/*.c) \
$(wildcard $(LOCAL_PATH)/src/storage/generic/*.c) \
$(wildcard $(LOCAL_PATH)/src/thread/*.c) \
$(wildcard $(LOCAL_PATH)/src/thread/pthread/*.c) \
$(wildcard $(LOCAL_PATH)/src/time/*.c) \
$(wildcard $(LOCAL_PATH)/src/time/unix/*.c) \
$(wildcard $(LOCAL_PATH)/src/timer/*.c) \
$(wildcard $(LOCAL_PATH)/src/timer/unix/*.c) \
$(wildcard $(LOCAL_PATH)/src/tray/dummy/*.c) \
$(wildcard $(LOCAL_PATH)/src/tray/*.c) \
$(wildcard $(LOCAL_PATH)/src/video/*.c) \
$(wildcard $(LOCAL_PATH)/src/video/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/video/yuv2rgb/*.c) \
$(wildcard $(LOCAL_PATH)/src/test/*.c))
$(wildcard $(LOCAL_PATH)/src/video/yuv2rgb/*.c))
LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES
LOCAL_CFLAGS += \
-Wall -Wextra \
-Wdocumentation \
-Wdocumentation-unknown-command \
-Wmissing-prototypes \
-Wunreachable-code-break \
-Wunneeded-internal-declaration \
@@ -78,9 +102,11 @@ LOCAL_CFLAGS += \
# Warnings we haven't fixed (yet)
LOCAL_CFLAGS += -Wno-unused-parameter -Wno-sign-compare
LOCAL_CXXFLAGS += -std=gnu++11
LOCAL_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -lOpenSLES -llog -landroid
LOCAL_LDFLAGS := -Wl,--no-undefined
LOCAL_LDFLAGS := -Wl,--no-undefined -Wl,--no-undefined-version -Wl,--version-script=$(LOCAL_PATH)/src/dynapi/SDL_dynapi.sym
ifeq ($(NDK_DEBUG),1)
cmd-strip :=
@@ -91,15 +117,38 @@ LOCAL_STATIC_LIBRARIES := cpufeatures
include $(BUILD_SHARED_LIBRARY)
###########################
#
# SDL_test static library
#
###########################
LOCAL_MODULE := SDL3_test
LOCAL_MODULE_FILENAME := libSDL3_test
LOCAL_SRC_FILES := \
$(subst $(LOCAL_PATH)/,, \
$(wildcard $(LOCAL_PATH)/src/test/*.c))
LOCAL_LDLIBS :=
LOCAL_LDFLAGS :=
LOCAL_EXPORT_LDLIBS :=
include $(BUILD_STATIC_LIBRARY)
###########################
#
# SDL static library
#
###########################
LOCAL_MODULE := SDL2_static
LOCAL_MODULE := SDL3_static
LOCAL_MODULE_FILENAME := libSDL2
LOCAL_MODULE_FILENAME := libSDL3
LOCAL_LDLIBS :=
@@ -109,21 +158,5 @@ LOCAL_EXPORT_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -llog -landroid
include $(BUILD_STATIC_LIBRARY)
###########################
#
# SDL main static library
#
###########################
include $(CLEAR_VARS)
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
LOCAL_MODULE := SDL2_main
LOCAL_MODULE_FILENAME := libSDL2main
include $(BUILD_STATIC_LIBRARY)
$(call import-module,android/cpufeatures)

View File

@@ -1,16 +1,19 @@
Bugs are now managed in the SDL issue tracker, here:
https://github.com/libsdl-org/SDL/issues
You may report bugs there, and search to see if a given issue has already
been reported, discussed, and maybe even fixed.
You may also find help at the SDL forums/mailing list:
https://discourse.libsdl.org/
Bug reports are welcome here, but we really appreciate if you use the issue
tracker, as bugs discussed on the mailing list may be forgotten or missed.
Bugs are now managed in the SDL issue tracker, here:
https://github.com/libsdl-org/SDL/issues
You may report bugs there, and search to see if a given issue has already
been reported, discussed, and maybe even fixed.
You may also find help at the SDL forums/mailing list:
https://discourse.libsdl.org/
or on Discord:
https://discord.com/invite/BwpFGBWsv8
Bug reports are welcome here, but we really appreciate if you use the issue tracker, as bugs discussed on the mailing list or Discord may be forgotten or missed.

File diff suppressed because it is too large Load Diff

38
CREDITS.md Normal file
View File

@@ -0,0 +1,38 @@
# Simple DirectMedia Layer CREDITS
Thanks to everyone who made this possible, including:
- Cliff Matthews, for giving me a reason to start this project. :) -- Executor rocks! *grin*
- Ryan Gordon for helping everybody out and keeping the dream alive. :)
- Frank Praznik for his Wayland support and general windowing development.
- Ozkan Sezer for sanity checks and make sure the i's are dotted and t's are crossed.
- Anonymous Maarten for CMake support and build system development.
- Evan Hemsley, Caleb Cornett, and Ethan Lee for SDL GPU development.
- Gabriel Jacobo for his work on the Android port and generally helping out all around.
- Philipp Wiesemann for his attention to detail reviewing the entire SDL code base and proposes patches.
- Andreas Schiffler for his dedication to unit tests, Visual Studio projects, and managing the Google Summer of Code.
- Mike Sartain for incorporating SDL into Team Fortress 2 and cheering me on at Valve.
- Alfred Reynolds for the game controller API and general (in)sanity
- Jørgen Tjernø¸ for numerous magical macOS fixes.
- Pierre-Loup Griffais for his deep knowledge of OpenGL drivers.
- Julian Winter for the SDL 2.0 website.
- Sheena Smith for many months of great work on the SDL wiki creating the API documentation and style guides.
- Paul Hunkin for his port of SDL to Android during the Google Summer of Code 2010.
- Eli Gottlieb for his work on shaped windows during the Google Summer of Code 2010.
- Jim Grandpre for his work on multi-touch and gesture recognition during
the Google Summer of Code 2010.
- Edgar "bobbens" Simo for his force feedback API development during the
Google Summer of Code 2008.
- Aaron Wishnick for his work on audio resampling and pitch shifting during
the Google Summer of Code 2008.
- Holmes Futrell for his port of SDL to the iPhone and iPod Touch during the
Google Summer of Code 2008.
- Jon Atkins for SDL_image, SDL_mixer and SDL_net documentation.
- Everybody at Loki Software, Inc. and Valve Corporation for their great contributions!
And a big hand to everyone else who has contributed over the years.
THANKS! :)
-- Sam Lantinga <slouken@libsdl.org>

View File

@@ -1,53 +0,0 @@
Simple DirectMedia Layer CREDITS
Thanks to everyone who made this possible, including:
* Cliff Matthews, for giving me a reason to start this project. :)
-- Executor rocks! *grin*
* Ryan Gordon for helping everybody out and keeping the dream alive. :)
* Gabriel Jacobo for his work on the Android port and generally helping out all around.
* Philipp Wiesemann for his attention to detail reviewing the entire SDL code base and proposes patches.
* Andreas Schiffler for his dedication to unit tests, Visual Studio projects, and managing the Google Summer of Code.
* Mike Sartain for incorporating SDL into Team Fortress 2 and cheering me on at Valve.
* Alfred Reynolds for the game controller API and general (in)sanity
* Jørgen Tjernø for numerous magical Mac OS X fixes.
* Pierre-Loup Griffais for his deep knowledge of OpenGL drivers.
* Julian Winter for the SDL 2.0 website.
* Sheena Smith for many months of great work on the SDL wiki creating the API documentation and style guides.
* Paul Hunkin for his port of SDL to Android during the Google Summer of Code 2010.
* Eli Gottlieb for his work on shaped windows during the Google Summer of Code 2010.
* Jim Grandpre for his work on multi-touch and gesture recognition during
the Google Summer of Code 2010.
* Edgar "bobbens" Simo for his force feedback API development during the
Google Summer of Code 2008.
* Aaron Wishnick for his work on audio resampling and pitch shifting during
the Google Summer of Code 2008.
* Holmes Futrell for his port of SDL to the iPhone and iPod Touch during the
Google Summer of Code 2008.
* Jon Atkins for SDL_image, SDL_mixer and SDL_net documentation.
* Everybody at Loki Software, Inc. for their great contributions!
And a big hand to everyone else who has contributed over the years.
THANKS! :)
-- Sam Lantinga <slouken@libsdl.org>

48
INSTALL.md Normal file
View File

@@ -0,0 +1,48 @@
# To build and use SDL:
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)
SDL is also usable in other environments. The basic steps are to use CMake to build the library and then use the headers and library that you built in your project. You can search online to see if anyone has specific steps for your setup.
# Documentation
An API reference, tutorials, and additional documentation is available at:
https://wiki.libsdl.org/SDL3
# Example code
There are simple example programs in the examples directory, and you can view them online at:
https://examples.libsdl.org/SDL3
More in-depth test programs are available in the tests directory and can be built by adding `-DSDL_TESTS=ON` to the CMake command line when building SDL.
# 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

@@ -1,41 +0,0 @@
To compile and install SDL:
1. Windows with Visual Studio:
* Read ./docs/README-visualc.md
Windows with gcc, either native or cross-compiling:
* Read the FAQ at https://wiki.libsdl.org/FAQWindows
* Run './configure; make; make install'
macOS with Xcode:
* Read docs/README-macosx.md
macOS from the command line:
* Run './configure; make; make install'
Linux and other UNIX systems:
* Run './configure; make; make install'
Android:
* Read docs/README-android.md
iOS:
* Read docs/README-ios.md
Using Cmake:
* Read docs/README-cmake.md
2. Look at the example programs in ./test, and check out the online
documentation at https://wiki.libsdl.org/
3. Join the SDL developer discussions, sign up on
https://discourse.libsdl.org/
and go to the development forum
https://discourse.libsdl.org/c/sdl-development/6
4. Sign up for the announcement list through the web interface:
https://www.libsdl.org/mailing-list.php
That's it!
Sam Lantinga <slouken@libsdl.org>

View File

@@ -1,4 +1,4 @@
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages

View File

@@ -1,262 +0,0 @@
# Makefile to build and install the SDL library
top_builddir = .
srcdir = @srcdir@
objects = build
gen = gen
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
includedir = @includedir@
datarootdir = @datarootdir@
datadir = @datadir@
auxdir = @ac_aux_dir@
distpath = $(srcdir)/..
distdir = SDL2-@SDL_VERSION@
distfile = $(distdir).tar.gz
@SET_MAKE@
SHELL = @SHELL@
CC = @CC@
CXX = @CXX@
INCLUDE = @INCLUDE@
CFLAGS = @BUILD_CFLAGS@
EXTRA_CFLAGS = @EXTRA_CFLAGS@
LDFLAGS = @BUILD_LDFLAGS@
EXTRA_LDFLAGS = @EXTRA_LDFLAGS@
LIBTOOL = @LIBTOOL@
INSTALL = @INSTALL@
AR = @AR@
RANLIB = @RANLIB@
RC = @RC@
LINKER = @LINKER@
LIBTOOLLINKERTAG = @LIBTOOLLINKERTAG@
SDL_VENDOR_INFO = @SDL_VENDOR_INFO@
TARGET = libSDL2.la
OBJECTS = @OBJECTS@
GEN_HEADERS = @GEN_HEADERS@
GEN_OBJECTS = @GEN_OBJECTS@
VERSION_OBJECTS = @VERSION_OBJECTS@
SDLMAIN_TARGET = libSDL2main.la
SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@
SDLTEST_TARGET = libSDL2_test.la
SDLTEST_OBJECTS = @SDLTEST_OBJECTS@
WAYLAND_SCANNER = @WAYLAND_SCANNER@
WAYLAND_SCANNER_CODE_MODE = @WAYLAND_SCANNER_CODE_MODE@
INSTALL_SDL2_CONFIG = @INSTALL_SDL2_CONFIG@
SRC_DIST = *.md *.txt acinclude Android.mk autogen.sh android-project build-scripts cmake cmake_uninstall.cmake.in configure configure.ac docs include Makefile.* mingw sdl2-config.cmake.in sdl2-config-version.cmake.in sdl2-config.in sdl2.m4 sdl2.pc.in SDL2.spec.in SDL2Config.cmake.in src test VisualC VisualC-WinRT Xcode Xcode-iOS wayland-protocols
GEN_DIST = SDL2.spec
ifneq ($V,1)
RUN_CMD_AR = @echo " AR " $@;
RUN_CMD_CC = @echo " CC " $@;
RUN_CMD_CXX = @echo " CXX " $@;
RUN_CMD_LTLINK = @echo " LTLINK" $@;
RUN_CMD_RANLIB = @echo " RANLIB" $@;
RUN_CMD_RC = @echo " RC " $@;
RUN_CMD_GEN = @echo " GEN " $@;
LIBTOOL += --quiet
endif
HDRS = \
SDL.h \
SDL_assert.h \
SDL_atomic.h \
SDL_audio.h \
SDL_bits.h \
SDL_blendmode.h \
SDL_clipboard.h \
SDL_cpuinfo.h \
SDL_egl.h \
SDL_endian.h \
SDL_error.h \
SDL_events.h \
SDL_filesystem.h \
SDL_gamecontroller.h \
SDL_gesture.h \
SDL_guid.h \
SDL_haptic.h \
SDL_hidapi.h \
SDL_hints.h \
SDL_joystick.h \
SDL_keyboard.h \
SDL_keycode.h \
SDL_loadso.h \
SDL_locale.h \
SDL_log.h \
SDL_main.h \
SDL_messagebox.h \
SDL_metal.h \
SDL_misc.h \
SDL_mouse.h \
SDL_mutex.h \
SDL_name.h \
SDL_opengl.h \
SDL_opengl_glext.h \
SDL_opengles.h \
SDL_opengles2_gl2ext.h \
SDL_opengles2_gl2.h \
SDL_opengles2_gl2platform.h \
SDL_opengles2.h \
SDL_opengles2_khrplatform.h \
SDL_pixels.h \
SDL_platform.h \
SDL_power.h \
SDL_quit.h \
SDL_rect.h \
SDL_render.h \
SDL_rwops.h \
SDL_scancode.h \
SDL_sensor.h \
SDL_shape.h \
SDL_stdinc.h \
SDL_surface.h \
SDL_system.h \
SDL_syswm.h \
SDL_thread.h \
SDL_timer.h \
SDL_touch.h \
SDL_types.h \
SDL_version.h \
SDL_video.h \
SDL_vulkan.h \
begin_code.h \
close_code.h
SDLTEST_HDRS = $(shell ls $(srcdir)/include | fgrep SDL_test)
LT_AGE = @LT_AGE@
LT_CURRENT = @LT_CURRENT@
LT_RELEASE = @LT_RELEASE@
LT_REVISION = @LT_REVISION@
LT_LDFLAGS = -no-undefined -rpath $(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
all: $(srcdir)/configure Makefile $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
$(srcdir)/configure: $(srcdir)/configure.ac
@echo "Warning, configure is out of date, please re-run autogen.sh"
Makefile: $(srcdir)/Makefile.in
$(SHELL) config.status $@
Makefile.in:;
$(objects)/.created:
$(SHELL) $(auxdir)/mkinstalldirs $(objects)
touch $@
update-revision:
$(SHELL) $(auxdir)/updaterev.sh --vendor "$(SDL_VENDOR_INFO)"
.PHONY: all update-revision install install-bin install-hdrs install-lib install-data uninstall uninstall-bin uninstall-hdrs uninstall-lib uninstall-data clean distclean dist $(OBJECTS:.lo=.d)
$(objects)/$(TARGET): $(GEN_HEADERS) $(GEN_OBJECTS) $(OBJECTS) $(VERSION_OBJECTS)
$(RUN_CMD_LTLINK)$(LIBTOOL) --tag=$(LIBTOOLLINKERTAG) --mode=link $(LINKER) -o $@ $(OBJECTS) $(GEN_OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
$(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
$(RUN_CMD_LTLINK)$(LIBTOOL) --tag=$(LIBTOOLLINKERTAG) --mode=link $(LINKER) -static -o $@ $(SDLMAIN_OBJECTS) -rpath $(libdir)
$(objects)/$(SDLTEST_TARGET): $(SDLTEST_OBJECTS)
$(RUN_CMD_LTLINK)$(LIBTOOL) --tag=$(LIBTOOLLINKERTAG) --mode=link $(LINKER) -static -o $@ $(SDLTEST_OBJECTS) -rpath $(libdir)
install: all install-bin install-hdrs install-lib install-data
install-bin:
ifeq ($(INSTALL_SDL2_CONFIG),TRUE)
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(bindir)
$(INSTALL) -m 755 sdl2-config $(DESTDIR)$(bindir)/sdl2-config
endif
install-hdrs: update-revision
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(includedir)/SDL2
for file in $(HDRS) $(SDLTEST_HDRS); do \
$(INSTALL) -m 644 $(srcdir)/include/$$file $(DESTDIR)$(includedir)/SDL2/$$file; \
done
$(INSTALL) -m 644 include/SDL_config.h $(DESTDIR)$(includedir)/SDL2/SDL_config.h
if test -f include/SDL_revision.h; then \
$(INSTALL) -m 644 include/SDL_revision.h $(DESTDIR)$(includedir)/SDL2/SDL_revision.h; \
else \
$(INSTALL) -m 644 $(srcdir)/include/SDL_revision.h $(DESTDIR)$(includedir)/SDL2/SDL_revision.h; \
fi
install-lib: $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)
$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(DESTDIR)$(libdir)/$(TARGET)
$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(SDLMAIN_TARGET) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(SDLTEST_TARGET) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
install-data:
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(datadir)/aclocal
$(INSTALL) -m 644 $(srcdir)/sdl2.m4 $(DESTDIR)$(datadir)/aclocal/sdl2.m4
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/pkgconfig
$(INSTALL) -m 644 sdl2.pc $(DESTDIR)$(libdir)/pkgconfig
ifeq ($(INSTALL_SDL2_CONFIG),TRUE)
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/cmake/SDL2
$(INSTALL) -m 644 sdl2-config.cmake $(DESTDIR)$(libdir)/cmake/SDL2
$(INSTALL) -m 644 sdl2-config-version.cmake $(DESTDIR)$(libdir)/cmake/SDL2
endif
uninstall: uninstall-bin uninstall-hdrs uninstall-lib uninstall-data
uninstall-bin:
rm -f $(DESTDIR)$(bindir)/sdl2-config
uninstall-hdrs:
for file in $(HDRS) $(SDLTEST_HDRS); do \
rm -f $(DESTDIR)$(includedir)/SDL2/$$file; \
done
rm -f $(DESTDIR)$(includedir)/SDL2/SDL_config.h
rm -f $(DESTDIR)$(includedir)/SDL2/SDL_revision.h
-rmdir $(DESTDIR)$(includedir)/SDL2
uninstall-lib:
$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(TARGET)
rm -f $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
rm -f $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
uninstall-data:
rm -f $(DESTDIR)$(datadir)/aclocal/sdl2.m4
rm -f $(DESTDIR)$(libdir)/pkgconfig/sdl2.pc
rm -f $(DESTDIR)$(libdir)/cmake/SDL2/sdl2-config.cmake
rm -f $(DESTDIR)$(libdir)/cmake/SDL2/sdl2-config-version.cmake
clean:
rm -rf $(objects)
rm -rf $(gen)
if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
distclean: clean
rm -f Makefile Makefile.rules sdl2-config
rm -f config.status config.cache config.log libtool
rm -rf $(srcdir)/autom4te*
find $(srcdir) \( \
-name '*~' -o \
-name '*.bak' -o \
-name '*.old' -o \
-name '*.rej' -o \
-name '*.orig' -o \
-name '.#*' \) \
-exec rm -f {} \;
if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
dist $(distfile):
$(SHELL) $(auxdir)/mkinstalldirs $(distdir)
(cd $(srcdir); tar cf - $(SRC_DIST)) | (cd $(distdir); tar xf -)
tar cf - $(GEN_DIST) | (cd $(distdir); tar xf -)
find $(distdir) \( \
-name '*~' -o \
-name '*.bak' -o \
-name '*.old' -o \
-name '*.rej' -o \
-name '*.orig' -o \
-name '.#*' \) \
-exec rm -f {} \;
if test -f $(distdir)/test/Makefile; then (cd $(distdir)/test && make distclean); fi
# Intentionally no vendor suffix: that's a property of the build, not the source
(cd $(distdir); $(srcdir)/build-scripts/updaterev.sh --dist)
tar cvf - $(distdir) | gzip --best >$(distfile)
rm -rf $(distdir)
rpm: $(distfile)
rpmbuild -ta $?

View File

@@ -1,61 +0,0 @@
# Makefile to build the SDL library
INCLUDE = -I./include
CFLAGS = -g -O2 $(INCLUDE)
AR = ar
RANLIB = ranlib
TARGET = libSDL2.a
TESTTARGET = libSDL2_test.a
SOURCES = \
src/*.c \
src/atomic/*.c \
src/audio/*.c \
src/audio/dummy/*.c \
src/cpuinfo/*.c \
src/events/*.c \
src/file/*.c \
src/haptic/*.c \
src/haptic/dummy/*.c \
src/hidapi/*.c \
src/joystick/*.c \
src/joystick/dummy/*.c \
src/loadso/dummy/*.c \
src/power/*.c \
src/filesystem/dummy/*.c \
src/locale/*.c \
src/locale/dummy/*.c \
src/misc/*.c \
src/misc/dummy/*.c \
src/render/*.c \
src/render/software/*.c \
src/sensor/*.c \
src/sensor/dummy/*.c \
src/stdlib/*.c \
src/libm/*.c \
src/thread/*.c \
src/thread/generic/*.c \
src/timer/*.c \
src/timer/dummy/*.c \
src/video/*.c \
src/video/yuv2rgb/*.c \
src/video/dummy/*.c \
TSOURCES = src/test/*.c
OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g')
TOBJECTS= $(shell echo $(TSOURCES) | sed -e 's,\.c,\.o,g')
all: $(TARGET) $(TESTTARGET)
$(TARGET): $(OBJECTS)
$(AR) crv $@ $^
$(RANLIB) $@
$(TESTTARGET): $(TOBJECTS)
$(AR) crv $@ $^
$(RANLIB) $@
clean:
rm -f $(TARGET) $(TESTTARGET) $(OBJECTS) $(TOBJECTS)

View File

@@ -1,296 +0,0 @@
# Open Watcom makefile to build SDL2.dll for OS/2
# wmake -f Makefile.os2
#
# If you have GNU libiconv installed (iconv2.dll), you
# can compile against it by specifying LIBICONV=1, e.g.:
# wmake -f Makefile.os2 LIBICONV=1
#
# If you have libusb-1.0 installed (usb100.dll, libusb.h), you
# can compile hidapi joystick support against it (experimental)
# by specifying HIDAPI=1, e.g.:
# wmake -f Makefile.os2 HIDAPI=1
#
# To error out upon warnings: wmake -f Makefile.os2 ENABLE_WERROR=1
LIBNAME = SDL2
MAJOR_VERSION = 2
MINOR_VERSION = 25
MICRO_VERSION = 1
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
DESCRIPTION = Simple DirectMedia Layer 2
LIBICONV=0
ICONVLIB=$(LIBICONV_LIB)
LIBHOME = .
DLLFILE = $(LIBHOME)/$(LIBNAME).dll
LIBFILE = $(LIBHOME)/$(LIBNAME).lib
LNKFILE = $(LIBNAME).lnk
INCPATH = -I"$(%WATCOM)/h/os2" -I"$(%WATCOM)/h"
INCPATH+= -Iinclude
LIBM = SDL2libm.lib
TLIB = SDL2test.lib
LIBS = mmpm2.lib $(LIBM)
CFLAGS = -bt=os2 -d0 -q -bm -5s -fp5 -fpi87 -sg -oeatxhn -ei
# Debug options:
# - debug messages from OS/2 related code to stdout:
#CFLAGS+= -DOS2DEBUG
# - debug messages from OS/2 code via SDL_LogDebug():
#CFLAGS+= -DOS2DEBUG=2
# max warnings:
CFLAGS+= -wx
!ifeq ENABLE_WERROR 1
CFLAGS+= -we
!endif
# newer OpenWatcom versions enable W303 by default
CFLAGS+= -wcd=303
# the include paths :
CFLAGS+= $(INCPATH)
CFLAGS_STATIC=$(CFLAGS)
# building dll:
CFLAGS_DLL =$(CFLAGS)
CFLAGS_DLL+= -bd
# iconv:
LIBICONV_LIB=iconv2.lib
!ifeq LIBICONV 1
CFLAGS_DLL+= -DHAVE_ICONV=1 -DHAVE_ICONV_H=1
LIBS+= $(ICONVLIB)
!else
LIBS+= libuls.lib libconv.lib
!endif
# hidapi (libusb):
!ifeq HIDAPI 1
CFLAGS_DLL+= -DHAVE_LIBUSB_H=1
!endif
# building SDL itself (for DECLSPEC):
CFLAGS_DLL+= -DBUILD_SDL
CFLAGS_DLL+= -DSDL_BUILD_MAJOR_VERSION=$(MAJOR_VERSION)
CFLAGS_DLL+= -DSDL_BUILD_MINOR_VERSION=$(MINOR_VERSION)
CFLAGS_DLL+= -DSDL_BUILD_MICRO_VERSION=$(MICRO_VERSION)
SRCS = SDL.c SDL_assert.c SDL_error.c SDL_guid.c SDL_log.c SDL_dataqueue.c SDL_hints.c SDL_list.c SDL_utils.c
SRCS+= SDL_getenv.c SDL_iconv.c SDL_malloc.c SDL_qsort.c SDL_stdlib.c SDL_string.c SDL_strtokr.c SDL_crc16.c SDL_crc32.c
SRCS+= SDL_cpuinfo.c SDL_atomic.c SDL_spinlock.c SDL_thread.c SDL_timer.c
SRCS+= SDL_rwops.c SDL_power.c
SRCS+= SDL_audio.c SDL_audiocvt.c SDL_audiodev.c SDL_audiotypecvt.c SDL_mixer.c SDL_wave.c
SRCS+= SDL_events.c SDL_quit.c SDL_keyboard.c SDL_mouse.c SDL_windowevents.c &
SDL_clipboardevents.c SDL_dropevents.c SDL_displayevents.c SDL_gesture.c &
SDL_sensor.c SDL_touch.c
SRCS+= SDL_haptic.c SDL_hidapi.c SDL_gamecontroller.c SDL_joystick.c controller_type.c
SRCS+= SDL_render.c yuv_rgb.c SDL_yuv.c SDL_yuv_sw.c SDL_blendfillrect.c &
SDL_blendline.c SDL_blendpoint.c SDL_drawline.c SDL_drawpoint.c &
SDL_render_sw.c SDL_rotate.c SDL_triangle.c
SRCS+= SDL_blit.c SDL_blit_0.c SDL_blit_1.c SDL_blit_A.c SDL_blit_auto.c &
SDL_blit_copy.c SDL_blit_N.c SDL_blit_slow.c SDL_fillrect.c SDL_bmp.c &
SDL_pixels.c SDL_rect.c SDL_RLEaccel.c SDL_shape.c SDL_stretch.c &
SDL_surface.c SDL_video.c SDL_clipboard.c SDL_vulkan_utils.c SDL_egl.c
SRCS+= SDL_syscond.c SDL_sysmutex.c SDL_syssem.c SDL_systhread.c SDL_systls.c
SRCS+= SDL_systimer.c
SRCS+= SDL_sysloadso.c
SRCS+= SDL_sysfilesystem.c
SRCS+= SDL_os2joystick.c SDL_syshaptic.c SDL_sysjoystick.c SDL_virtualjoystick.c
SRCS+= SDL_hidapijoystick.c SDL_hidapi_rumble.c SDL_hidapi_combined.c SDL_hidapi_gamecube.c SDL_hidapi_luna.c SDL_hidapi_ps3.c SDL_hidapi_ps4.c SDL_hidapi_ps5.c SDL_hidapi_shield.c SDL_hidapi_stadia.c SDL_hidapi_switch.c SDL_hidapi_wii.c SDL_hidapi_xbox360.c SDL_hidapi_xbox360w.c SDL_hidapi_xboxone.c SDL_hidapi_steam.c
SRCS+= SDL_dummyaudio.c SDL_diskaudio.c
SRCS+= SDL_nullvideo.c SDL_nullframebuffer.c SDL_nullevents.c
SRCS+= SDL_dummysensor.c
SRCS+= SDL_locale.c SDL_syslocale.c
SRCS+= SDL_url.c SDL_sysurl.c
SRCS+= SDL_os2.c
!ifeq LIBICONV 0
SRCS+= geniconv.c os2cp.c os2iconv.c sys2utf8.c
!endif
SRCS+= SDL_os2audio.c
SRCS+= SDL_os2video.c SDL_os2util.c SDL_os2dive.c SDL_os2vman.c &
SDL_os2mouse.c SDL_os2messagebox.c
SRCS+= SDL_dynapi.c
OBJS = $(SRCS:.c=.obj)
.extensions:
.extensions: .lib .dll .obj .c .asm
.c: ./src;./src/dynapi;./src/audio;./src/cpuinfo;./src/events;./src/file;./src/haptic;./src/joystick;./src/power;./src/render;./src/render/software;./src/sensor;./src/stdlib;./src/thread;./src/timer;./src/video;./src/video/yuv2rgb;./src/atomic;./src/audio/disk;
.c: ./src/haptic/dummy;./src/joystick/dummy;./src/joystick/virtual;./src/audio/dummy;./src/video/dummy;./src/sensor/dummy;
.c: ./src/core/os2;./src/audio/os2;./src/loadso/os2;./src/filesystem/os2;./src/joystick/os2;./src/thread/os2;./src/timer/os2;./src/video/os2;
.c: ./src/core/os2/geniconv;
.c: ./src/locale/;./src/locale/unix;./src/misc;./src/misc/dummy;./src/joystick/hidapi;./src/hidapi
all: $(DLLFILE) $(LIBFILE) $(TLIB) .symbolic
build_dll: .symbolic
@echo * Compiling dll objects
$(DLLFILE): build_dll $(OBJS) $(LIBM) $(LIBICONV_LIB) $(LNKFILE)
@echo * Linking: $@
wlink @$(LNKFILE)
$(LIBFILE): $(DLLFILE)
@echo * Creating LIB file: $@
wlib -q -b -n -c -pa -s -t -zld -ii -io $* $(DLLFILE)
.c.obj:
wcc386 $(CFLAGS_DLL) -fo=$^@ $<
SDL_syscond.obj: "src/thread/generic/SDL_syscond.c"
wcc386 $(CFLAGS_DLL) -fo=$^@ $<
SDL_cpuinfo.obj: SDL_cpuinfo.c
wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $<
SDL_wave.obj: SDL_wave.c
wcc386 $(CFLAGS_DLL) -wcd=124 -fo=$^@ $<
SDL_blendfillrect.obj: SDL_blendfillrect.c
wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $<
SDL_blendline.obj: SDL_blendline.c
wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $<
SDL_blendpoint.obj: SDL_blendpoint.c
wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $<
SDL_RLEaccel.obj: SDL_RLEaccel.c
wcc386 $(CFLAGS_DLL) -wcd=201 -fo=$^@ $<
!ifeq HIDAPI 1
# c99 mode needed because of structs with flexible array members in libusb.h
SDL_hidapi.obj: SDL_hidapi.c
wcc386 $(CFLAGS_DLL) -za99 -fo=$^@ $<
!endif
$(LIBICONV_LIB): "src/core/os2/iconv2.lbc"
@echo * Creating: $@
wlib -q -b -n -c -pa -s -t -zld -ii -io $@ @$<
# SDL2libm
MSRCS= e_atan2.c e_exp.c e_fmod.c e_log10.c e_log.c e_pow.c e_rem_pio2.c e_sqrt.c &
k_cos.c k_rem_pio2.c k_sin.c k_tan.c &
s_atan.c s_copysign.c s_cos.c s_fabs.c s_floor.c s_scalbn.c s_sin.c s_tan.c
MOBJS= $(MSRCS:.c=.obj)
.c: ./src/libm;
e_atan2.obj: e_atan2.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
e_exp.obj: e_exp.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
e_fmod.obj: e_fmod.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
e_log10.obj: e_log10.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
e_log.obj: e_log.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
e_pow.obj: e_pow.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
e_rem_pio2.obj: e_rem_pio2.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
e_sqrt.obj: e_sqrt.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
k_cos.obj: k_cos.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
k_rem_pio2.obj: k_rem_pio2.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
k_sin.obj: k_sin.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
k_tan.obj: k_tan.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
s_atan.obj: s_atan.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
s_copysign.obj: s_copysign.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
s_cos.obj: s_cos.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
s_fabs.obj: s_fabs.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
s_floor.obj: s_floor.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
s_scalbn.obj: s_scalbn.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
s_sin.obj: s_sin.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
s_tan.obj: s_tan.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
build_libm: .symbolic
@echo * Compiling libm objects
$(LIBM): build_libm $(MOBJS)
@echo * Creating: $@
wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $(MOBJS)
# SDL2test
TSRCS = SDL_test_assert.c SDL_test_common.c SDL_test_compare.c &
SDL_test_crc32.c SDL_test_font.c SDL_test_fuzzer.c SDL_test_harness.c &
SDL_test_imageBlit.c SDL_test_imageBlitBlend.c SDL_test_imageFace.c &
SDL_test_imagePrimitives.c SDL_test_imagePrimitivesBlend.c &
SDL_test_log.c SDL_test_md5.c SDL_test_random.c SDL_test_memory.c
TOBJS= $(TSRCS:.c=.obj)
.c: ./src/test;
SDL_test_assert.obj: SDL_test_assert.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_common.obj: SDL_test_common.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_compare.obj: SDL_test_compare.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_crc32.obj: SDL_test_crc32.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_font.obj: SDL_test_font.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_fuzzer.obj: SDL_test_fuzzer.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_harness.obj: SDL_test_harness.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_imageBlit.obj: SDL_test_imageBlit.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_imageBlitBlend.obj: SDL_test_imageBlitBlend.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_imageFace.obj: SDL_test_imageFace.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_imagePrimitives.obj: SDL_test_imagePrimitives.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_imagePrimitivesBlend.obj: SDL_test_imagePrimitivesBlend.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_log.obj: SDL_test_log.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_md5.obj: SDL_test_md5.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_random.obj: SDL_test_random.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_memory.obj: SDL_test_memory.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
build_tlib: .symbolic
@echo * Compiling testlib objects
$(TLIB): build_tlib $(TOBJS)
@echo * Creating: $@
wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $(TOBJS)
$(LNKFILE):
@echo * Creating linker file: $@
@%create $@
@%append $@ SYSTEM os2v2_dll INITINSTANCE TERMINSTANCE
@%append $@ NAME $(DLLFILE)
@for %i in ($(OBJS)) do @%append $@ FILE %i
@for %i in ($(LIBS)) do @%append $@ LIB %i
@%append $@ OPTION QUIET
@%append $@ OPTION IMPF=$(LIBHOME)/$^&.exp
@%append $@ OPTION MAP=$(LIBHOME)/$^&.map
@%append $@ OPTION DESCRIPTION '@$#libsdl org:$(VERSION)$#@$(DESCRIPTION)'
@%append $@ OPTION ELIMINATE
@%append $@ OPTION MANYAUTODATA
@%append $@ OPTION OSNAME='OS/2 and eComStation'
@%append $@ OPTION SHOWDEAD
clean: .SYMBOLIC
@echo * Clean: $(LIBNAME)
@if exist *.obj rm *.obj
@if exist *.err rm *.err
@if exist $(LNKFILE) rm $(LNKFILE)
@if exist $(LIBM) rm $(LIBM)
@if exist $(LIBICONV_LIB) rm $(LIBICONV_LIB)
distclean: .SYMBOLIC clean
@if exist $(LIBHOME)/*.exp rm $(LIBHOME)/*.exp
@if exist $(LIBHOME)/*.map rm $(LIBHOME)/*.map
@if exist $(LIBFILE) rm $(LIBFILE)
@if exist $(DLLFILE) rm $(DLLFILE)
@if exist $(TLIB) rm $(TLIB)

View File

@@ -1,64 +0,0 @@
# Makefile to build the pandora SDL library
AR = arm-none-linux-gnueabi-ar
RANLIB = arm-none-linux-gnueabi-ranlib
CC = arm-none-linux-gnueabi-gcc
CXX = arm-none-linux-gnueabi-g++
STRIP = arm-none-linux-gnueabi-strip
CFLAGS = -O3 -march=armv7-a -mcpu=cortex-a8 -mtune=cortex-a8 -mfloat-abi=softfp \
-mfpu=neon -ftree-vectorize -ffast-math -fomit-frame-pointer -fno-strict-aliasing -fsingle-precision-constant \
-I./include -I$(PNDSDK)/usr/include
TARGET = libSDL2.a
SOURCES =
./src/*.c \
./src/atomic/*.c \
./src/audio/*.c \
./src/audio/disk/*.c \
./src/audio/dsp/*.c \
./src/audio/dummy/*.c \
./src/cpuinfo/*.c \
./src/events/*.c \
./src/file/*.c \
./src/filesystem/unix/*.c \
./src/haptic/*.c \
./src/haptic/linux/*.c \
./src/hidapi/*.c \
./src/joystick/*.c \
./src/joystick/linux/*.c \
./src/loadso/dlopen/*.c \
./src/locale/*.c \
./src/locale/unix/*.c \
./src/misc/*.c \
./src/misc/unix/*.c \
./src/power/*.c \
./src/sensor/*.c \
./src/sensor/dummy/*.c \
./src/stdlib/*.c \
./src/thread/*.c \
./src/thread/pthread/SDL_syscond.c \
./src/thread/pthread/SDL_sysmutex.c \
./src/thread/pthread/SDL_syssem.c \
./src/thread/pthread/SDL_systhread.c \
./src/timer/*.c \
./src/timer/unix/*.c \
./src/video/*.c \
./src/video/yuv2rgb/*.c \
./src/video/dummy/*.c \
./src/video/x11/*.c \
./src/video/pandora/*.c
OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g')
CONFIG_H = $(shell cp include/SDL_config_pandora.h include/SDL_config.h)
all: $(TARGET)
$(TARGET): $(CONFIG_H) $(OBJECTS)
$(AR) crv $@ $^
$(RANLIB) $@
clean:
rm -f $(TARGET) $(OBJECTS)

View File

@@ -1,280 +0,0 @@
# Open Watcom makefile to build SDL2.dll for Win32
# wmake -f Makefile.w32
#
# To error out upon warnings: wmake -f Makefile.w32 ENABLE_WERROR=1
LIBNAME = SDL2
MAJOR_VERSION = 2
MINOR_VERSION = 25
MICRO_VERSION = 1
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
LIBHOME = .
DLLFILE = $(LIBHOME)/$(LIBNAME).dll
LIBFILE = $(LIBHOME)/$(LIBNAME).lib
EXPFILE = $(LIBHOME)/$(LIBNAME).exp
LNKFILE = $(LIBNAME).lnk
INCPATH = -I"$(%WATCOM)/h/nt" -I"$(%WATCOM)/h/nt/directx" -I"$(%WATCOM)/h"
INCPATH+= -Iinclude
INCPATH+= -I"src/video/khronos"
LIBM = SDL2libm.lib
TLIB = SDL2test.lib
# user32.lib, gdi32.lib, ole32.lib and oleaut32.lib are actually
# among the default libraries in wlink.lnk for nt_dll linkage...
LIBS = user32.lib gdi32.lib winmm.lib imm32.lib ole32.lib oleaut32.lib shell32.lib setupapi.lib version.lib uuid.lib dxguid.lib $(LIBM)
CFLAGS = -bt=nt -d0 -q -bm -5s -fp5 -fpi87 -sg -oeatxhn -ei
# max warnings:
CFLAGS+= -wx
!ifeq ENABLE_WERROR 1
CFLAGS+= -we
!endif
# newer OpenWatcom versions enable W303 by default
CFLAGS+= -wcd=303
# new vulkan headers result in lots of W202 warnings
CFLAGS+= -wcd=202
# the include paths :
CFLAGS+= $(INCPATH)
CFLAGS_STATIC=$(CFLAGS)
# building dll:
CFLAGS_DLL =$(CFLAGS)
CFLAGS_DLL+= -bd
# we override the DECLSPEC define in begin_code.h, because we are using
# an exports file to remove the _cdecl '_' prefix from the symbol names
CFLAGS_DLL+= -DDECLSPEC=
CFLAGS_DLL+= -DSDL_BUILD_MAJOR_VERSION=$(MAJOR_VERSION)
CFLAGS_DLL+= -DSDL_BUILD_MINOR_VERSION=$(MINOR_VERSION)
CFLAGS_DLL+= -DSDL_BUILD_MICRO_VERSION=$(MICRO_VERSION)
RCFLAGS = -q -r -bt=nt $(INCPATH)
SRCS = SDL.c SDL_assert.c SDL_error.c SDL_guid.c SDL_log.c SDL_dataqueue.c SDL_hints.c SDL_list.c SDL_utils.c
SRCS+= SDL_getenv.c SDL_iconv.c SDL_malloc.c SDL_qsort.c SDL_stdlib.c SDL_string.c SDL_strtokr.c SDL_crc16.c SDL_crc32.c
SRCS+= SDL_cpuinfo.c SDL_atomic.c SDL_spinlock.c SDL_thread.c SDL_timer.c
SRCS+= SDL_rwops.c SDL_power.c
SRCS+= SDL_audio.c SDL_audiocvt.c SDL_audiodev.c SDL_audiotypecvt.c SDL_mixer.c SDL_wave.c
SRCS+= SDL_events.c SDL_quit.c SDL_keyboard.c SDL_mouse.c SDL_windowevents.c &
SDL_clipboardevents.c SDL_dropevents.c SDL_displayevents.c SDL_gesture.c &
SDL_sensor.c SDL_touch.c
SRCS+= SDL_haptic.c SDL_hidapi.c SDL_gamecontroller.c SDL_joystick.c controller_type.c
SRCS+= SDL_render.c yuv_rgb.c SDL_yuv.c SDL_yuv_sw.c SDL_blendfillrect.c &
SDL_blendline.c SDL_blendpoint.c SDL_drawline.c SDL_drawpoint.c &
SDL_render_sw.c SDL_rotate.c SDL_triangle.c
SRCS+= SDL_blit.c SDL_blit_0.c SDL_blit_1.c SDL_blit_A.c SDL_blit_auto.c &
SDL_blit_copy.c SDL_blit_N.c SDL_blit_slow.c SDL_fillrect.c SDL_bmp.c &
SDL_pixels.c SDL_rect.c SDL_RLEaccel.c SDL_shape.c SDL_stretch.c &
SDL_surface.c SDL_video.c SDL_clipboard.c SDL_vulkan_utils.c SDL_egl.c
SRCS+= SDL_syscond.c SDL_sysmutex.c SDL_syssem.c SDL_systhread.c SDL_systls.c
SRCS+= SDL_systimer.c
SRCS+= SDL_sysloadso.c
SRCS+= SDL_sysfilesystem.c
SRCS+= SDL_syshaptic.c SDL_sysjoystick.c SDL_virtualjoystick.c
SRCS+= SDL_hidapijoystick.c SDL_hidapi_rumble.c SDL_hidapi_combined.c SDL_hidapi_gamecube.c SDL_hidapi_luna.c SDL_hidapi_ps3.c SDL_hidapi_ps4.c SDL_hidapi_ps5.c SDL_hidapi_shield.c SDL_hidapi_stadia.c SDL_hidapi_switch.c SDL_hidapi_wii.c SDL_hidapi_xbox360.c SDL_hidapi_xbox360w.c SDL_hidapi_xboxone.c SDL_hidapi_steam.c
SRCS+= SDL_dummyaudio.c SDL_diskaudio.c
SRCS+= SDL_nullvideo.c SDL_nullframebuffer.c SDL_nullevents.c
SRCS+= SDL_dummysensor.c
SRCS+= SDL_locale.c SDL_syslocale.c
SRCS+= SDL_url.c SDL_sysurl.c
SRCS+= SDL_winmm.c SDL_directsound.c SDL_wasapi.c SDL_wasapi_win32.c
SRCS+= SDL_hid.c SDL_immdevice.c SDL_windows.c SDL_xinput.c
SRCS+= SDL_dinputhaptic.c SDL_windowshaptic.c SDL_xinputhaptic.c
SRCS+= SDL_dinputjoystick.c SDL_rawinputjoystick.c SDL_windowsjoystick.c SDL_windows_gaming_input.c SDL_xinputjoystick.c
SRCS+= SDL_syspower.c
SRCS+= SDL_d3dmath.c
SRCS+= SDL_render_d3d.c SDL_shaders_d3d.c
SRCS+= SDL_render_d3d11.c SDL_shaders_d3d11.c
SRCS+= SDL_render_d3d12.c SDL_shaders_d3d12.c
SRCS+= SDL_render_gl.c SDL_shaders_gl.c
SRCS+= SDL_render_gles2.c SDL_shaders_gles2.c
SRCS+= SDL_windowssensor.c
SRCS+= SDL_syscond_cv.c
SRCS+= SDL_windowsclipboard.c SDL_windowsevents.c SDL_windowsframebuffer.c SDL_windowskeyboard.c SDL_windowsmessagebox.c SDL_windowsmodes.c SDL_windowsmouse.c SDL_windowsopengl.c SDL_windowsopengles.c SDL_windowsshape.c SDL_windowsvideo.c SDL_windowsvulkan.c SDL_windowswindow.c
SRCS+= SDL_dynapi.c
RCSRCS = version.rc
OBJS = $(SRCS:.c=.obj)
RCOBJS= $(RCSRCS:.rc=.res)
.extensions:
.extensions: .lib .dll .obj .res .c .rc .asm
.c: ./src;./src/dynapi;./src/audio;./src/cpuinfo;./src/events;./src/file;./src/haptic;./src/joystick;./src/power;./src/render;./src/render/software;./src/sensor;./src/stdlib;./src/thread;./src/timer;./src/video;./src/video/yuv2rgb;./src/atomic;./src/audio/disk;
.c: ./src/haptic/dummy;./src/joystick/dummy;./src/joystick/virtual;./src/audio/dummy;./src/video/dummy;./src/sensor/dummy;
.c: ./src/core/windows;./src/audio/winmm;./src/audio/directsound;./src/audio/wasapi;./src/loadso/windows;./src/filesystem/windows;./src/haptic/windows;./src/joystick/windows;./src/sensor/windows;./src/thread/windows;./src/timer/windows;./src/video/windows;
.c: ./src/locale/;./src/locale/windows;./src/misc;./src/misc/windows;./src/power/windows;./src/joystick/hidapi;./src/hidapi;./src/render/direct3d;./src/render/direct3d11;./src/render/direct3d12;./src/render/opengl;./src/render/opengles2
.rc: ./src/main/windows
all: $(DLLFILE) $(LIBFILE) $(TLIB) .symbolic
build_dll: .symbolic
@echo * Compiling dll objects
$(DLLFILE): build_dll $(OBJS) $(LIBM) $(RCOBJS) $(LNKFILE)
@echo * Linking: $@
wlink @$(LNKFILE)
$(LIBFILE): $(DLLFILE)
@echo * Creating LIB file: $@
wlib -q -b -n -c -pa -s -t -zld -ii -io $* @$(EXPFILE)
.c.obj:
wcc386 $(CFLAGS_DLL) -fo=$^@ $<
.rc.res:
wrc $(RCFLAGS) -fo=$^@ $<
SDL_syscond.obj: "src/thread/generic/SDL_syscond.c"
wcc386 $(CFLAGS_DLL) -fo=$^@ $<
SDL_cpuinfo.obj: SDL_cpuinfo.c
wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $<
SDL_wave.obj: SDL_wave.c
wcc386 $(CFLAGS_DLL) -wcd=124 -fo=$^@ $<
SDL_blendfillrect.obj: SDL_blendfillrect.c
wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $<
SDL_blendline.obj: SDL_blendline.c
wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $<
SDL_blendpoint.obj: SDL_blendpoint.c
wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $<
SDL_RLEaccel.obj: SDL_RLEaccel.c
wcc386 $(CFLAGS_DLL) -wcd=201 -fo=$^@ $<
SDL_malloc.obj: SDL_malloc.c
wcc386 $(CFLAGS_DLL) -wcd=201 -fo=$^@ $<
# SDL2libm
MSRCS= e_atan2.c e_exp.c e_fmod.c e_log10.c e_log.c e_pow.c e_rem_pio2.c e_sqrt.c &
k_cos.c k_rem_pio2.c k_sin.c k_tan.c &
s_atan.c s_copysign.c s_cos.c s_fabs.c s_floor.c s_scalbn.c s_sin.c s_tan.c
MOBJS= $(MSRCS:.c=.obj)
.c: ./src/libm;
e_atan2.obj: e_atan2.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
e_exp.obj: e_exp.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
e_fmod.obj: e_fmod.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
e_log10.obj: e_log10.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
e_log.obj: e_log.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
e_pow.obj: e_pow.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
e_rem_pio2.obj: e_rem_pio2.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
e_sqrt.obj: e_sqrt.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
k_cos.obj: k_cos.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
k_rem_pio2.obj: k_rem_pio2.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
k_sin.obj: k_sin.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
k_tan.obj: k_tan.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
s_atan.obj: s_atan.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
s_copysign.obj: s_copysign.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
s_cos.obj: s_cos.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
s_fabs.obj: s_fabs.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
s_floor.obj: s_floor.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
s_scalbn.obj: s_scalbn.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
s_sin.obj: s_sin.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
s_tan.obj: s_tan.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
build_libm: .symbolic
@echo * Compiling libm objects
$(LIBM): build_libm $(MOBJS)
@echo * Creating: $@
wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $(MOBJS)
# SDL2test
TSRCS = SDL_test_assert.c SDL_test_common.c SDL_test_compare.c &
SDL_test_crc32.c SDL_test_font.c SDL_test_fuzzer.c SDL_test_harness.c &
SDL_test_imageBlit.c SDL_test_imageBlitBlend.c SDL_test_imageFace.c &
SDL_test_imagePrimitives.c SDL_test_imagePrimitivesBlend.c &
SDL_test_log.c SDL_test_md5.c SDL_test_random.c SDL_test_memory.c
TOBJS= $(TSRCS:.c=.obj)
.c: ./src/test;
SDL_test_assert.obj: SDL_test_assert.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_common.obj: SDL_test_common.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_compare.obj: SDL_test_compare.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_crc32.obj: SDL_test_crc32.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_font.obj: SDL_test_font.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_fuzzer.obj: SDL_test_fuzzer.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_harness.obj: SDL_test_harness.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_imageBlit.obj: SDL_test_imageBlit.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_imageBlitBlend.obj: SDL_test_imageBlitBlend.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_imageFace.obj: SDL_test_imageFace.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_imagePrimitives.obj: SDL_test_imagePrimitives.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_imagePrimitivesBlend.obj: SDL_test_imagePrimitivesBlend.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_log.obj: SDL_test_log.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_md5.obj: SDL_test_md5.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_random.obj: SDL_test_random.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
SDL_test_memory.obj: SDL_test_memory.c
wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
build_tlib: .symbolic
@echo * Compiling testlib objects
$(TLIB): build_tlib $(TOBJS)
@echo * Creating: $@
wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $(TOBJS)
$(LNKFILE): Makefile.w32
@echo * Creating linker file: $@
@%create $@
@%append $@ SYSTEM nt_dll INITINSTANCE TERMINSTANCE
@%append $@ NAME $(DLLFILE)
@for %i in ($(OBJS)) do @%append $@ FILE %i
@for %i in ($(LIBS)) do @%append $@ LIB %i
@%append $@ OPTION RESOURCE=$(RCOBJS)
@%append $@ EXPORT=src/dynapi/SDL2.exports
@%append $@ OPTION QUIET
@%append $@ OPTION IMPF=$(EXPFILE)
@%append $@ OPTION MAP=$(LIBHOME)/$^&.map
@%append $@ OPTION ELIMINATE
@%append $@ OPTION SHOWDEAD
clean: .SYMBOLIC
@echo * Clean: $(LIBNAME)
@if exist *.obj rm *.obj
@if exist *.res rm *.res
@if exist *.err rm *.err
@if exist $(LNKFILE) rm $(LNKFILE)
@if exist $(LIBM) rm $(LIBM)
distclean: .SYMBOLIC clean
@if exist $(LIBHOME)/*.exp rm $(LIBHOME)/*.exp
@if exist $(LIBHOME)/*.map rm $(LIBHOME)/*.map
@if exist $(LIBFILE) rm $(LIBFILE)
@if exist $(DLLFILE) rm $(DLLFILE)
@if exist $(TLIB) rm $(TLIB)

View File

@@ -1,13 +0,0 @@
Please distribute this file with the SDL runtime environment:
The Simple DirectMedia Layer (SDL for short) is a cross-platform library
designed to make it easy to write multi-media software, such as games
and emulators.
The Simple DirectMedia Layer library source code is available from:
https://www.libsdl.org/
This library is distributed under the terms of the zlib license:
http://www.zlib.net/zlib_license.html

View File

@@ -1,17 +1,17 @@
# Simple DirectMedia Layer (SDL) Version 2.0
https://www.libsdl.org/
Simple DirectMedia Layer is a cross-platform development library designed
to provide low level access to audio, keyboard, mouse, joystick, and graphics
hardware via OpenGL and Direct3D. It is used by video playback software,
emulators, and popular games including Valve's award winning catalog
and many Humble Bundle games.
More extensive documentation is available in the docs directory, starting
with README.md
Enjoy!
Sam Lantinga (slouken@libsdl.org)
Simple DirectMedia Layer (SDL for short) is a cross-platform library
designed to make it easy to write multi-media software, such as games
and emulators.
You can find the latest release and additional information at:
https://www.libsdl.org/
Installation instructions and a quick introduction is available in
[INSTALL.md](INSTALL.md)
This library is distributed under the terms of the zlib license,
available in [LICENSE.txt](LICENSE.txt).
Enjoy!
Sam Lantinga (slouken@libsdl.org)

View File

@@ -1,119 +0,0 @@
Summary: Simple DirectMedia Layer
Name: SDL2
Version: @SDL_VERSION@
Release: 2
Source: http://www.libsdl.org/release/%{name}-%{version}.tar.gz
URL: http://www.libsdl.org/
License: zlib
Group: System Environment/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
Prefix: %{_prefix}
%ifos linux
Provides: libSDL2-2.0.so.0
%endif
%define __defattr %defattr(-,root,root)
%define __soext so
%description
This is the Simple DirectMedia Layer, a generic API that provides low
level access to audio, keyboard, mouse, and display framebuffer across
multiple platforms.
%package devel
Summary: Libraries, includes and more to develop SDL applications.
Group: Development/Libraries
Requires: %{name} = %{version}
%description devel
This is the Simple DirectMedia Layer, a generic API that provides low
level access to audio, keyboard, mouse, and display framebuffer across
multiple platforms.
This is the libraries, include files and other resources you can use
to develop SDL applications.
%prep
%setup -q
%build
%ifos linux
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} --disable-video-directfb
%else
%configure
%endif
make
%install
rm -rf $RPM_BUILD_ROOT
%ifos linux
make install prefix=$RPM_BUILD_ROOT%{prefix} \
bindir=$RPM_BUILD_ROOT%{_bindir} \
libdir=$RPM_BUILD_ROOT%{_libdir} \
includedir=$RPM_BUILD_ROOT%{_includedir} \
datadir=$RPM_BUILD_ROOT%{_datadir} \
mandir=$RPM_BUILD_ROOT%{_mandir}
%else
%makeinstall
%endif
%clean
rm -rf $RPM_BUILD_ROOT
%files
%{__defattr}
%doc README*.txt LICENSE.txt CREDITS.txt BUGS.txt
%{_libdir}/lib*.%{__soext}.*
%files devel
%{__defattr}
%doc docs/README*.md
%{_bindir}/*-config
%{_libdir}/lib*.a
%{_libdir}/lib*.la
%{_libdir}/lib*.%{__soext}
%{_includedir}/*/*.h
%{_libdir}/cmake/*
%{_libdir}/pkgconfig/SDL2/*
%{_datadir}/aclocal/*
%changelog
* Thu Jun 04 2015 Ryan C. Gordon <icculus@icculus.org>
- Fixed README paths.
* Sun Dec 07 2014 Simone Contini <s.contini@oltrelinux.com>
- Fixed changelog date issue and docs filenames
* Sun Jan 22 2012 Sam Lantinga <slouken@libsdl.org>
- Updated for SDL 2.0
* Tue May 16 2006 Sam Lantinga <slouken@libsdl.org>
- Removed support for Darwin, due to build problems on ps2linux
* Sat Jan 03 2004 Anders Bjorklund <afb@algonet.se>
- Added support for Darwin, updated spec file
* Wed Jan 19 2000 Sam Lantinga <slouken@libsdl.org>
- Re-integrated spec file into SDL distribution
- 'name' and 'version' come from configure
- Some of the documentation is devel specific
- Removed SMP support from %build - it doesn't work with libtool anyway
* Tue Jan 18 2000 Hakan Tandogan <hakan@iconsult.com>
- Hacked Mandrake sdl spec to build 1.1
* Sun Dec 19 1999 John Buswell <johnb@mandrakesoft.com>
- Build Release
* Sat Dec 18 1999 John Buswell <johnb@mandrakesoft.com>
- Add symlink for libSDL-1.0.so.0 required by sdlbomber
- Added docs
* Thu Dec 09 1999 Lenny Cartier <lenny@mandrakesoft.com>
- v 1.0.0
* Mon Nov 1 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com>
- First spec file for Mandrake distribution.
# end of file

View File

@@ -1,65 +0,0 @@
# sdl2 cmake project-config input for CMakeLists.txt script
include(FeatureSummary)
set_package_properties(SDL2 PROPERTIES
URL "https://www.libsdl.org/"
DESCRIPTION "low level access to audio, keyboard, mouse, joystick, and graphics hardware"
)
@PACKAGE_INIT@
set(SDL2_FOUND TRUE)
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL2Targets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/SDL2Targets.cmake")
set(SDL2_SDL2_FOUND TRUE)
endif()
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL2staticTargets.cmake")
if(ANDROID)
enable_language(CXX)
endif()
include("${CMAKE_CURRENT_LIST_DIR}/SDL2staticTargets.cmake")
set(SDL2_SDL2-static_FOUND TRUE)
endif()
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL2mainTargets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/SDL2mainTargets.cmake")
set(SDL2_SDL2main_FOUND TRUE)
endif()
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL2testTargets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/SDL2testTargets.cmake")
set(SDL2_SDL2test_FOUND TRUE)
endif()
check_required_components(SDL2)
# Create SDL2::SDL2 alias for static-only builds
if(TARGET SDL2::SDL2-static AND NOT TARGET SDL2::SDL2)
if(CMAKE_VERSION VERSION_LESS "3.18")
# FIXME: Aliasing local targets is not supported on CMake < 3.18, so make it global.
add_library(SDL2::SDL2 INTERFACE IMPORTED)
set_target_properties(SDL2::SDL2 PROPERTIES INTERFACE_LINK_LIBRARIES "SDL2::SDL2-static")
else()
add_library(SDL2::SDL2 ALIAS SDL2::SDL2-static)
endif()
endif()
# For compatibility with autotools sdl2-config.cmake, provide SDL2_* variables.
set(SDL2_PREFIX "@PACKAGE_CMAKE_INSTALL_PREFIX@")
set(SDL2_EXEC_PREFIX "@PACKAGE_CMAKE_INSTALL_PREFIX@")
set(SDL2_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_FULL_INCLUDEDIR@/SDL2")
set(SDL2_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_FULL_INCLUDEDIR@;@PACKAGE_CMAKE_INSTALL_FULL_INCLUDEDIR@/SDL2")
set(SDL2_BINDIR "@PACKAGE_CMAKE_INSTALL_FULL_BINDIR@")
set(SDL2_LIBDIR "@PACKAGE_CMAKE_INSTALL_FULL_LIBDIR@")
set(SDL2_LIBRARIES SDL2::SDL2)
set(SDL2_STATIC_LIBRARIES SDL2::SDL2-static)
set(SDL2_STATIC_PRIVATE_LIBS)
set(SDL2MAIN_LIBRARY)
if(TARGET SDL2::SDL2main)
set(SDL2MAIN_LIBRARY SDL2::SDL2main)
list(INSERT SDL2_LIBRARIES 0 SDL2::SDL2main)
list(INSERT SDL2_STATIC_LIBRARIES 0 SDL2::SDL2main)
endif()
set(SDL2TEST_LIBRARY SDL2::SDL2test)

View File

@@ -1,10 +0,0 @@
Future work roadmap:
* http://wiki.libsdl.org/Roadmap
* Check 1.2 revisions:
3554 - Need to resolve semantics for locking keys on different platforms
4874 - Do we want screen rotation? At what level?
4974 - Windows file code needs to convert UTF-8 to Unicode, but we don't need to tap dance for Windows 95/98
4865 - See if this is still needed (mouse coordinate clamping)
4866 - See if this is still needed (blocking window repositioning)

View File

@@ -4,15 +4,16 @@ VisualStudioVersion = 17.1.32414.318
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{D69D5741-611F-4E14-8541-1FEE94F50B5A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2", "SDL\SDL.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL3", "SDL\SDL.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2main", "SDLmain\SDLmain.vcxproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite", "tests\testsprite\testsprite.vcxproj", "{40FB7794-D3C3-4CFE-BCF4-A80C96635682}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite2", "tests\testsprite2\testsprite2.vcxproj", "{40FB7794-D3C3-4CFE-BCF4-A80C96635682}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL3_test", "SDL_test\SDL_test.vcxproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2test", "SDLtest\SDLtest.vcxproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgamecontroller", "tests\testgamecontroller\testgamecontroller.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08305}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testcontroller", "tests\testcontroller\testcontroller.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08305}"
ProjectSection(ProjectDependencies) = postProject
{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgdk", "tests\testgdk\testgdk.vcxproj", "{1C9A3F71-35A5-4C56-B292-F4375B3C3649}"
EndProject
@@ -38,18 +39,6 @@ Global
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Gaming.Xbox.Scarlett.x64.Build.0 = Release|Gaming.Xbox.Scarlett.x64
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Gaming.Xbox.XboxOne.x64.ActiveCfg = Release|Gaming.Xbox.XboxOne.x64
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Gaming.Xbox.XboxOne.x64.Build.0 = Release|Gaming.Xbox.XboxOne.x64
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Gaming.Desktop.x64.ActiveCfg = Debug|Gaming.Desktop.x64
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Gaming.Desktop.x64.Build.0 = Debug|Gaming.Desktop.x64
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Gaming.Xbox.Scarlett.x64.ActiveCfg = Debug|Gaming.Xbox.Scarlett.x64
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Gaming.Xbox.Scarlett.x64.Build.0 = Debug|Gaming.Xbox.Scarlett.x64
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Gaming.Xbox.XboxOne.x64.ActiveCfg = Debug|Gaming.Xbox.XboxOne.x64
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Gaming.Xbox.XboxOne.x64.Build.0 = Debug|Gaming.Xbox.XboxOne.x64
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Gaming.Desktop.x64.ActiveCfg = Release|Gaming.Desktop.x64
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Gaming.Desktop.x64.Build.0 = Release|Gaming.Desktop.x64
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Gaming.Xbox.Scarlett.x64.ActiveCfg = Release|Gaming.Xbox.Scarlett.x64
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Gaming.Xbox.Scarlett.x64.Build.0 = Release|Gaming.Xbox.Scarlett.x64
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Gaming.Xbox.XboxOne.x64.ActiveCfg = Release|Gaming.Xbox.XboxOne.x64
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Gaming.Xbox.XboxOne.x64.Build.0 = Release|Gaming.Xbox.XboxOne.x64
{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Gaming.Desktop.x64.ActiveCfg = Debug|Gaming.Desktop.x64
{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Gaming.Desktop.x64.Build.0 = Debug|Gaming.Desktop.x64
{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Gaming.Desktop.x64.Deploy.0 = Debug|Gaming.Desktop.x64

View File

@@ -27,7 +27,7 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>SDL2</ProjectName>
<ProjectName>SDL3</ProjectName>
<ProjectGuid>{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}</ProjectGuid>
<RootNamespace>SDL</RootNamespace>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
@@ -59,46 +59,29 @@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(Platform)\$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">$(Platform)\$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">$(Platform)\$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(Platform)\$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">$(Platform)\$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">$(Platform)\$(Configuration)\</IntDir>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
@@ -118,6 +101,12 @@
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'" />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">
<IncludePath>$(ProjectDir)../../src;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">
<IncludePath>$(ProjectDir)../../src;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">
<Midl>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -126,8 +115,9 @@
<TypeLibraryName>.\Debug/SDL.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\include\build_config;$(ProjectDir)\..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>DLL_EXPORT;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BufferSecurityCheck>false</BufferSecurityCheck>
@@ -135,6 +125,8 @@
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<OmitDefaultLibName>true</OmitDefaultLibName>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>SDL_internal.h</PrecompiledHeaderFile>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -154,8 +146,9 @@
<TypeLibraryName>.\Debug/SDL.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\include\build_config;$(ProjectDir)\..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>DLL_EXPORT;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BufferSecurityCheck>false</BufferSecurityCheck>
@@ -173,6 +166,15 @@
<SubSystem>Windows</SubSystem>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Link>
<PreBuildEvent>
<Command>
call "$(ProjectDir)..\..\src\render\direct3d12\compile_shaders_xbox.bat" "$(ProjectDir)..\"
call "$(ProjectDir)..\..\src\gpu\d3d12\compile_shaders_xbox.bat" "$(ProjectDir)..\"
</Command>
</PreBuildEvent>
<PreBuildEvent>
<Message>Building shader blobs (Xbox Series)</Message>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">
<Midl>
@@ -182,8 +184,9 @@
<TypeLibraryName>.\Debug/SDL.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\include\build_config;$(ProjectDir)\..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>DLL_EXPORT;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BufferSecurityCheck>false</BufferSecurityCheck>
@@ -201,6 +204,15 @@
<SubSystem>Windows</SubSystem>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Link>
<PreBuildEvent>
<Command>
call $(ProjectDir)..\..\src\render\direct3d12\compile_shaders_xbox.bat $(ProjectDir)..\ one
call $(ProjectDir)..\..\src\gpu\d3d12\compile_shaders_xbox.bat $(ProjectDir)..\ one
</Command>
</PreBuildEvent>
<PreBuildEvent>
<Message>Building shader blobs (Xbox One)</Message>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">
<Midl>
@@ -210,7 +222,8 @@
<TypeLibraryName>.\Release/SDL.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<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>
<BufferSecurityCheck>false</BufferSecurityCheck>
@@ -218,6 +231,8 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<OmitDefaultLibName>true</OmitDefaultLibName>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>SDL_internal.h</PrecompiledHeaderFile>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -239,7 +254,8 @@
<TypeLibraryName>.\Release/SDL.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<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>
<BufferSecurityCheck>false</BufferSecurityCheck>
@@ -259,6 +275,15 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Link>
<PreBuildEvent>
<Command>
call $(ProjectDir)..\..\src\render\direct3d12\compile_shaders_xbox.bat $(ProjectDir)..\
call $(ProjectDir)..\..\src\gpu\d3d12\compile_shaders_xbox.bat $(ProjectDir)..\
</Command>
</PreBuildEvent>
<PreBuildEvent>
<Message>Building shader blobs (Xbox Series)</Message>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">
<Midl>
@@ -268,7 +293,8 @@
<TypeLibraryName>.\Release/SDL.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<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>
<BufferSecurityCheck>false</BufferSecurityCheck>
@@ -288,130 +314,158 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Link>
<PreBuildEvent>
<Command>
call $(ProjectDir)..\..\src\render\direct3d12\compile_shaders_xbox.bat $(ProjectDir)..\ one
call $(ProjectDir)..\..\src\gpu\d3d12\compile_shaders_xbox.bat $(ProjectDir)..\ one
</Command>
</PreBuildEvent>
<PreBuildEvent>
<Message>Building shader blobs (Xbox One)</Message>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(TreatWarningsAsError)'!=''">
<ClCompile>
<TreatWarningAsError>$(TreatWarningsAsError)</TreatWarningAsError>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\..\include\begin_code.h" />
<ClInclude Include="..\..\include\close_code.h" />
<ClInclude Include="..\..\include\SDL.h" />
<ClInclude Include="..\..\include\SDL_assert.h" />
<ClInclude Include="..\..\include\SDL_atomic.h" />
<ClInclude Include="..\..\include\SDL_audio.h" />
<ClInclude Include="..\..\include\SDL_bits.h" />
<ClInclude Include="..\..\include\SDL_blendmode.h" />
<ClInclude Include="..\..\include\SDL_clipboard.h" />
<ClInclude Include="..\..\include\SDL_config.h" />
<ClInclude Include="..\..\include\SDL_config_wingdk.h" />
<ClInclude Include="..\..\include\SDL_copying.h" />
<ClInclude Include="..\..\include\SDL_cpuinfo.h" />
<ClInclude Include="..\..\include\SDL_egl.h" />
<ClInclude Include="..\..\include\SDL_endian.h" />
<ClInclude Include="..\..\include\SDL_error.h" />
<ClInclude Include="..\..\include\SDL_events.h" />
<ClInclude Include="..\..\include\SDL_filesystem.h" />
<ClInclude Include="..\..\include\SDL_gamecontroller.h" />
<ClInclude Include="..\..\include\SDL_gesture.h" />
<ClInclude Include="..\..\include\SDL_guid.h" />
<ClInclude Include="..\..\include\SDL_haptic.h" />
<ClInclude Include="..\..\include\SDL_hints.h" />
<ClInclude Include="..\..\include\SDL_hidapi.h" />
<ClInclude Include="..\..\include\SDL_joystick.h" />
<ClInclude Include="..\..\include\SDL_keyboard.h" />
<ClInclude Include="..\..\include\SDL_keycode.h" />
<ClInclude Include="..\..\include\SDL_loadso.h" />
<ClInclude Include="..\..\include\SDL_locale.h" />
<ClInclude Include="..\..\include\SDL_log.h" />
<ClInclude Include="..\..\include\SDL_main.h" />
<ClInclude Include="..\..\include\SDL_messagebox.h" />
<ClInclude Include="..\..\include\SDL_metal.h" />
<ClInclude Include="..\..\include\SDL_misc.h" />
<ClInclude Include="..\..\include\SDL_mouse.h" />
<ClInclude Include="..\..\include\SDL_mutex.h" />
<ClInclude Include="..\..\include\SDL_name.h" />
<ClInclude Include="..\..\include\SDL_opengl.h" />
<ClInclude Include="..\..\include\SDL_opengl_glext.h" />
<ClInclude Include="..\..\include\SDL_opengles.h" />
<ClInclude Include="..\..\include\SDL_opengles2.h" />
<ClInclude Include="..\..\include\SDL_opengles2_gl2.h" />
<ClInclude Include="..\..\include\SDL_opengles2_gl2ext.h" />
<ClInclude Include="..\..\include\SDL_opengles2_gl2platform.h" />
<ClInclude Include="..\..\include\SDL_opengles2_khrplatform.h" />
<ClInclude Include="..\..\include\SDL_pixels.h" />
<ClInclude Include="..\..\include\SDL_platform.h" />
<ClInclude Include="..\..\include\SDL_power.h" />
<ClInclude Include="..\..\include\SDL_quit.h" />
<ClInclude Include="..\..\include\SDL_rect.h" />
<ClInclude Include="..\..\include\SDL_render.h" />
<ClInclude Include="..\..\include\SDL_revision.h" />
<ClInclude Include="..\..\include\SDL_rwops.h" />
<ClInclude Include="..\..\include\SDL_scancode.h" />
<ClInclude Include="..\..\include\SDL_sensor.h" />
<ClInclude Include="..\..\include\SDL_shape.h" />
<ClInclude Include="..\..\include\SDL_stdinc.h" />
<ClInclude Include="..\..\include\SDL_surface.h" />
<ClInclude Include="..\..\include\SDL_system.h" />
<ClInclude Include="..\..\include\SDL_syswm.h" />
<ClInclude Include="..\..\include\SDL_test.h" />
<ClInclude Include="..\..\include\SDL_test_assert.h" />
<ClInclude Include="..\..\include\SDL_test_common.h" />
<ClInclude Include="..\..\include\SDL_test_compare.h" />
<ClInclude Include="..\..\include\SDL_test_crc32.h" />
<ClInclude Include="..\..\include\SDL_test_font.h" />
<ClInclude Include="..\..\include\SDL_test_fuzzer.h" />
<ClInclude Include="..\..\include\SDL_test_harness.h" />
<ClInclude Include="..\..\include\SDL_test_images.h" />
<ClInclude Include="..\..\include\SDL_test_log.h" />
<ClInclude Include="..\..\include\SDL_test_md5.h" />
<ClInclude Include="..\..\include\SDL_test_memory.h" />
<ClInclude Include="..\..\include\SDL_test_random.h" />
<ClInclude Include="..\..\include\SDL_thread.h" />
<ClInclude Include="..\..\include\SDL_timer.h" />
<ClInclude Include="..\..\include\SDL_touch.h" />
<ClInclude Include="..\..\include\SDL_types.h" />
<ClInclude Include="..\..\include\SDL_version.h" />
<ClInclude Include="..\..\include\SDL_video.h" />
<ClInclude Include="..\..\include\SDL_vulkan.h" />
<ClInclude Include="..\..\include\SDL3\SDL_begin_code.h" />
<ClInclude Include="..\..\include\SDL3\SDL_camera.h" />
<ClInclude Include="..\..\include\SDL3\SDL_close_code.h" />
<ClInclude Include="..\..\include\SDL3\SDL.h" />
<ClInclude Include="..\..\include\SDL3\SDL_assert.h" />
<ClInclude Include="..\..\include\SDL3\SDL_atomic.h" />
<ClInclude Include="..\..\include\SDL3\SDL_audio.h" />
<ClInclude Include="..\..\include\SDL3\SDL_bits.h" />
<ClInclude Include="..\..\include\SDL3\SDL_blendmode.h" />
<ClInclude Include="..\..\include\SDL3\SDL_clipboard.h" />
<ClInclude Include="..\..\include\SDL3\SDL_copying.h" />
<ClInclude Include="..\..\include\SDL3\SDL_cpuinfo.h" />
<ClInclude Include="..\..\include\SDL3\SDL_egl.h" />
<ClInclude Include="..\..\include\SDL3\SDL_endian.h" />
<ClInclude Include="..\..\include\SDL3\SDL_error.h" />
<ClInclude Include="..\..\include\SDL3\SDL_events.h" />
<ClInclude Include="..\..\include\SDL3\SDL_filesystem.h" />
<ClInclude Include="..\..\include\SDL3\SDL_gamepad.h" />
<ClInclude Include="..\..\include\SDL3\SDL_gpu.h" />
<ClInclude Include="..\..\include\SDL3\SDL_guid.h" />
<ClInclude Include="..\..\include\SDL3\SDL_haptic.h" />
<ClInclude Include="..\..\include\SDL3\SDL_hints.h" />
<ClInclude Include="..\..\include\SDL3\SDL_hidapi.h" />
<ClInclude Include="..\..\include\SDL3\SDL_asyncio.h" />
<ClInclude Include="..\..\include\SDL3\SDL_joystick.h" />
<ClInclude Include="..\..\include\SDL3\SDL_keyboard.h" />
<ClInclude Include="..\..\include\SDL3\SDL_keycode.h" />
<ClInclude Include="..\..\include\SDL3\SDL_loadso.h" />
<ClInclude Include="..\..\include\SDL3\SDL_locale.h" />
<ClInclude Include="..\..\include\SDL3\SDL_log.h" />
<ClInclude Include="..\..\include\SDL3\SDL_main.h" />
<ClInclude Include="..\..\include\SDL3\SDL_messagebox.h" />
<ClInclude Include="..\..\include\SDL3\SDL_metal.h" />
<ClInclude Include="..\..\include\SDL3\SDL_misc.h" />
<ClInclude Include="..\..\include\SDL3\SDL_mouse.h" />
<ClInclude Include="..\..\include\SDL3\SDL_mutex.h" />
<ClInclude Include="..\..\include\SDL3\SDL_opengl.h" />
<ClInclude Include="..\..\include\SDL3\SDL_opengl_glext.h" />
<ClInclude Include="..\..\include\SDL3\SDL_opengles.h" />
<ClInclude Include="..\..\include\SDL3\SDL_opengles2.h" />
<ClInclude Include="..\..\include\SDL3\SDL_opengles2_gl2.h" />
<ClInclude Include="..\..\include\SDL3\SDL_opengles2_gl2ext.h" />
<ClInclude Include="..\..\include\SDL3\SDL_opengles2_gl2platform.h" />
<ClInclude Include="..\..\include\SDL3\SDL_opengles2_khrplatform.h" />
<ClInclude Include="..\..\include\SDL3\SDL_pen.h" />
<ClInclude Include="..\..\include\SDL3\SDL_pixels.h" />
<ClInclude Include="..\..\include\SDL3\SDL_platform.h" />
<ClInclude Include="..\..\include\SDL3\SDL_platform_defines.h" />
<ClInclude Include="..\..\include\SDL3\SDL_power.h" />
<ClInclude Include="..\..\include\SDL3\SDL_process.h" />
<ClInclude Include="..\..\include\SDL3\SDL_properties.h" />
<ClInclude Include="..\..\include\SDL3\SDL_rect.h" />
<ClInclude Include="..\..\include\SDL3\SDL_render.h" />
<ClInclude Include="..\..\include\SDL3\SDL_revision.h" />
<ClInclude Include="..\..\include\SDL3\SDL_iostream.h" />
<ClInclude Include="..\..\include\SDL3\SDL_scancode.h" />
<ClInclude Include="..\..\include\SDL3\SDL_sensor.h" />
<ClInclude Include="..\..\include\SDL3\SDL_stdinc.h" />
<ClInclude Include="..\..\include\SDL3\SDL_storage.h" />
<ClInclude Include="..\..\include\SDL3\SDL_surface.h" />
<ClInclude Include="..\..\include\SDL3\SDL_system.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test_assert.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test_common.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test_compare.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test_crc32.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test_font.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test_fuzzer.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test_harness.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test_log.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test_md5.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test_memory.h" />
<ClInclude Include="..\..\include\SDL3\SDL_thread.h" />
<ClInclude Include="..\..\include\SDL3\SDL_time.h" />
<ClInclude Include="..\..\include\SDL3\SDL_timer.h" />
<ClInclude Include="..\..\include\SDL3\SDL_touch.h" />
<ClInclude Include="..\..\include\SDL3\SDL_types.h" />
<ClInclude Include="..\..\include\SDL3\SDL_version.h" />
<ClInclude Include="..\..\include\SDL3\SDL_video.h" />
<ClInclude Include="..\..\include\SDL3\SDL_vulkan.h" />
<ClInclude Include="..\..\src\audio\directsound\SDL_directsound.h" />
<ClInclude Include="..\..\src\audio\disk\SDL_diskaudio.h" />
<ClInclude Include="..\..\src\audio\dummy\SDL_dummyaudio.h" />
<ClInclude Include="..\..\src\audio\SDL_audio_c.h" />
<ClInclude Include="..\..\src\audio\SDL_audiodev_c.h" />
<ClInclude Include="..\..\src\audio\SDL_sysaudio.h" />
<ClInclude Include="..\..\src\audio\SDL_audioqueue.h" />
<ClInclude Include="..\..\src\audio\SDL_audioresample.h" />
<ClInclude Include="..\..\src\audio\SDL_wave.h" />
<ClInclude Include="..\..\src\audio\wasapi\SDL_wasapi.h" />
<ClInclude Include="..\..\src\audio\winmm\SDL_winmm.h" />
<ClInclude Include="..\..\src\camera\SDL_camera_c.h" />
<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" />
<ClInclude Include="..\..\src\core\windows\SDL_xinput.h" />
<ClInclude Include="..\..\src\cpuinfo\SDL_cpuinfo_c.h" />
<ClInclude Include="..\..\src\dynapi\SDL_dynapi.h" />
<ClInclude Include="..\..\src\dynapi\SDL_dynapi_overrides.h" />
<ClInclude Include="..\..\src\dynapi\SDL_dynapi_procs.h" />
<ClInclude Include="..\..\src\events\blank_cursor.h" />
<ClInclude Include="..\..\src\events\default_cursor.h" />
<ClInclude Include="..\..\src\events\scancodes_windows.h" />
<ClInclude Include="..\..\src\events\SDL_categories_c.h" />
<ClInclude Include="..\..\src\events\SDL_clipboardevents_c.h" />
<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_gesture_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" />
<ClInclude Include="..\..\src\events\SDL_touch_c.h" />
<ClInclude Include="..\..\src\events\SDL_windowevents_c.h" />
<ClInclude Include="..\..\src\filesystem\SDL_sysfilesystem.h" />
<ClInclude Include="..\..\src\gpu\SDL_sysgpu.h" />
<ClInclude Include="..\..\src\io\SDL_asyncio_c.h" />
<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\windows\SDL_xinputhaptic_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" />
<ClInclude Include="..\..\src\joystick\hidapi\SDL_hidapijoystick_c.h" />
<ClInclude Include="..\..\src\joystick\hidapi\SDL_hidapi_rumble.h" />
<ClInclude Include="..\..\src\joystick\SDL_gamecontrollerdb.h" />
<ClInclude Include="..\..\src\joystick\SDL_gamepad_c.h" />
<ClInclude Include="..\..\src\joystick\SDL_gamepad_db.h" />
<ClInclude Include="..\..\src\joystick\SDL_joystick_c.h" />
<ClInclude Include="..\..\src\joystick\SDL_steam_virtual_gamepad.h" />
<ClInclude Include="..\..\src\joystick\SDL_sysjoystick.h" />
<ClInclude Include="..\..\src\joystick\usb_ids.h" />
<ClInclude Include="..\..\src\joystick\virtual\SDL_virtualjoystick_c.h" />
@@ -422,6 +476,7 @@
<ClInclude Include="..\..\src\libm\math_libm.h" />
<ClInclude Include="..\..\src\libm\math_private.h" />
<ClInclude Include="..\..\src\locale\SDL_syslocale.h" />
<ClInclude Include="..\..\src\main\SDL_main_callbacks.h" />
<ClInclude Include="..\..\src\misc\SDL_sysurl.h" />
<ClInclude Include="..\..\src\power\SDL_syspower.h" />
<ClInclude Include="..\..\src\render\direct3d11\SDL_shaders_d3d11.h" />
@@ -445,21 +500,64 @@
<ClInclude Include="..\..\src\render\software\SDL_rotate.h" />
<ClInclude Include="..\..\src\render\software\SDL_triangle.h" />
<ClInclude Include="..\..\src\SDL_assert_c.h" />
<ClInclude Include="..\..\src\SDL_dataqueue.h" />
<ClInclude Include="..\..\src\SDL_error_c.h" />
<ClCompile Include="..\..\src\core\gdk\SDL_gdk.cpp" />
<ClCompile Include="..\..\src\render\direct3d12\SDL_render_d3d12_xbox.cpp" />
<ClCompile Include="..\..\src\render\direct3d12\SDL_shaders_d3d12_xboxone.cpp" />
<ClCompile Include="..\..\src\render\direct3d12\SDL_shaders_d3d12_xboxseries.cpp" />
<ClCompile Include="..\..\src\core\gdk\SDL_gdk.cpp">
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
</ClCompile>
<ClCompile Include="..\..\src\core\windows\pch.c">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\..\src\core\windows\pch_cpp.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">Create</PrecompiledHeader>
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">Create</PrecompiledHeader>
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
</ClCompile>
<ClCompile Include="..\..\src\filesystem\windows\SDL_sysfilesystem.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\render\direct3d12\SDL_render_d3d12_xbox.cpp">
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
</ClCompile>
<ClCompile Include="..\..\src\render\direct3d12\SDL_shaders_d3d12_xboxone.cpp">
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
</ClCompile>
<ClCompile Include="..\..\src\render\direct3d12\SDL_shaders_d3d12_xboxseries.cpp">
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
</ClCompile>
<ClCompile Include="..\..\src\camera\dummy\SDL_camera_dummy.c" />
<ClCompile Include="..\..\src\camera\SDL_camera.c" />
<ClCompile Include="..\..\src\dialog\SDL_dialog.c" />
<ClCompile Include="..\..\src\dialog\SDL_dialog_utils.c" />
<ClCompile Include="..\..\src\filesystem\SDL_filesystem.c" />
<ClCompile Include="..\..\src\filesystem\windows\SDL_sysfsops.c" />
<ClCompile Include="..\..\src\io\generic\SDL_asyncio_generic.c" />
<ClCompile Include="..\..\src\io\SDL_asyncio.c" />
<ClCompile Include="..\..\src\io\windows\SDL_asyncio_windows_ioring.c" />
<ClCompile Include="..\..\src\main\gdk\SDL_sysmain_runapp.cpp" />
<ClCompile Include="..\..\src\main\generic\SDL_sysmain_callbacks.c" />
<ClCompile Include="..\..\src\main\SDL_main_callbacks.c" />
<ClCompile Include="..\..\src\main\SDL_runapp.c" />
<ClCompile Include="..\..\src\SDL_guid.c" />
<ClInclude Include="..\..\src\SDL_hashtable.h" />
<ClInclude Include="..\..\src\SDL_hints_c.h" />
<ClInclude Include="..\..\src\SDL_internal.h" />
<ClInclude Include="..\..\src\SDL_list.h" />
<ClInclude Include="..\..\src\SDL_log_c.h" />
<ClInclude Include="..\..\src\SDL_properties_c.h" />
<ClInclude Include="..\..\src\sensor\dummy\SDL_dummysensor.h" />
<ClInclude Include="..\..\src\sensor\SDL_sensor_c.h" />
<ClInclude Include="..\..\src\sensor\SDL_syssensor.h" />
<ClInclude Include="..\..\src\sensor\windows\SDL_windowssensor.h" />
<ClInclude Include="..\..\src\thread\generic\SDL_sysrwlock_c.h" />
<ClInclude Include="..\..\src\thread\SDL_systhread.h" />
<ClInclude Include="..\..\src\thread\SDL_thread_c.h" />
<ClInclude Include="..\..\src\thread\generic\SDL_syscond_c.h" />
@@ -469,12 +567,12 @@
<ClInclude Include="..\..\src\video\dummy\SDL_nullevents_c.h" />
<ClInclude Include="..\..\src\video\dummy\SDL_nullframebuffer_c.h" />
<ClInclude Include="..\..\src\video\dummy\SDL_nullvideo.h" />
<ClInclude Include="..\..\src\video\gdk\SDL_gdktextinput.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vk_icd.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vk_layer.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vk_platform.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vk_sdk_platform.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan.hpp" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_android.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_beta.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_core.h" />
@@ -494,35 +592,43 @@
<ClInclude Include="..\..\src\video\SDL_blit_auto.h" />
<ClInclude Include="..\..\src\video\SDL_blit_copy.h" />
<ClInclude Include="..\..\src\video\SDL_blit_slow.h" />
<ClInclude Include="..\..\src\video\SDL_clipboard_c.h" />
<ClInclude Include="..\..\src\video\SDL_egl_c.h" />
<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_shape_internals.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" />
<ClInclude Include="..\..\src\video\SDL_yuv_c.h" />
<ClInclude Include="..\..\src\video\windows\SDL_msctf.h" />
<ClInclude Include="..\..\src\video\windows\SDL_vkeys.h" />
<ClInclude Include="..\..\src\video\windows\SDL_surface_utils.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsclipboard.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsevents.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsframebuffer.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowskeyboard.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsgameinput.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsmessagebox.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsmodes.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsmouse.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsopengl.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsopengles.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsrawinput.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsshape.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsvideo.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsvulkan.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowswindow.h" />
<ClInclude Include="..\..\src\video\windows\wmmsg.h" />
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb.h" />
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_common.h" />
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_internal.h" />
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_lsx.h" />
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_lsx_func.h" />
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_sse.h" />
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_std.h" />
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_sse_func.h" />
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_std_func.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\atomic\SDL_atomic.c" />
<ClCompile Include="..\..\src\atomic\SDL_spinlock.c" />
<ClCompile Include="..\..\src\audio\directsound\SDL_directsound.c" />
@@ -532,11 +638,13 @@
<ClCompile Include="..\..\src\audio\SDL_audiocvt.c" />
<ClCompile Include="..\..\src\audio\SDL_audiodev.c" />
<ClCompile Include="..\..\src\audio\SDL_audiotypecvt.c" />
<ClCompile Include="..\..\src\audio\SDL_audioqueue.c" />
<ClCompile Include="..\..\src\audio\SDL_audioresample.c" />
<ClCompile Include="..\..\src\audio\SDL_mixer.c" />
<ClCompile Include="..\..\src\audio\SDL_wave.c" />
<ClCompile Include="..\..\src\audio\winmm\SDL_winmm.c" />
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi.c" />
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi_win32.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" />
@@ -551,19 +659,38 @@
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">stdcpp17</LanguageStandard>
</ClCompile>
<ClCompile Include="..\..\src\cpuinfo\SDL_cpuinfo.c" />
<ClCompile Include="..\..\src\dynapi\SDL_dynapi.c" />
<ClCompile Include="..\..\src\dialog\dummy\SDL_dummydialog.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\dialog\windows\SDL_windowsdialog.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\dynapi\SDL_dynapi.c">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\..\src\events\SDL_categories.c" />
<ClCompile Include="..\..\src\events\SDL_clipboardevents.c" />
<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_gesture.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" />
<ClCompile Include="..\..\src\events\SDL_pen.c" />
<ClCompile Include="..\..\src\events\SDL_quit.c" />
<ClCompile Include="..\..\src\events\SDL_touch.c" />
<ClCompile Include="..\..\src\events\SDL_windowevents.c" />
<ClCompile Include="..\..\src\file\SDL_rwops.c" />
<ClCompile Include="..\..\src\filesystem\windows\SDL_sysfilesystem.c" />
<ClCompile Include="..\..\src\io\SDL_iostream.c" />
<ClCompile Include="..\..\src\filesystem\gdk\SDL_sysfilesystem.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\haptic\dummy\SDL_syshaptic.c" />
<ClCompile Include="..\..\src\haptic\SDL_haptic.c" />
<ClCompile Include="..\..\src\haptic\windows\SDL_dinputhaptic.c" />
@@ -577,37 +704,39 @@
<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\windows\SDL_xinputhaptic.c">
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">stdcpp17</LanguageStandard>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">stdcpp17</LanguageStandard>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">stdcpp17</LanguageStandard>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">stdcpp17</LanguageStandard>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">CompileAsCpp</CompileAs>
</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.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\SDL_gamecontroller.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" />
<ClCompile Include="..\..\src\joystick\virtual\SDL_virtualjoystick.c" />
<ClCompile Include="..\..\src\joystick\windows\SDL_dinputjoystick.c" />
<ClCompile Include="..\..\src\joystick\windows\SDL_rawinputjoystick.c" />
@@ -632,33 +761,18 @@
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">CompileAsCpp</CompileAs>
</ClCompile>
<ClCompile Include="..\..\src\libm\e_atan2.c" />
<ClCompile Include="..\..\src\libm\e_exp.c" />
<ClCompile Include="..\..\src\libm\e_fmod.c" />
<ClCompile Include="..\..\src\libm\e_log.c" />
<ClCompile Include="..\..\src\libm\e_log10.c" />
<ClCompile Include="..\..\src\libm\e_pow.c" />
<ClCompile Include="..\..\src\libm\e_rem_pio2.c" />
<ClCompile Include="..\..\src\libm\e_sqrt.c" />
<ClCompile Include="..\..\src\libm\k_cos.c" />
<ClCompile Include="..\..\src\libm\k_rem_pio2.c" />
<ClCompile Include="..\..\src\libm\k_sin.c" />
<ClCompile Include="..\..\src\libm\k_tan.c" />
<ClCompile Include="..\..\src\libm\s_atan.c" />
<ClCompile Include="..\..\src\libm\s_copysign.c" />
<ClCompile Include="..\..\src\libm\s_cos.c" />
<ClCompile Include="..\..\src\libm\s_fabs.c" />
<ClCompile Include="..\..\src\libm\s_floor.c" />
<ClCompile Include="..\..\src\libm\s_scalbn.c" />
<ClCompile Include="..\..\src\libm\s_sin.c" />
<ClCompile Include="..\..\src\libm\s_tan.c" />
<ClCompile Include="..\..\src\libm\s_modf.c" />
<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" />
<ClCompile Include="..\..\src\power\windows\SDL_syspower.c" />
<ClCompile Include="..\..\src\process\SDL_process.c" />
<ClCompile Include="..\..\src\process\dummy\SDL_dummyprocess.c" />
<ClCompile Include="..\..\src\process\windows\SDL_windowsprocess.c" />
<ClCompile Include="..\..\src\render\direct3d11\SDL_shaders_d3d11.c" />
<ClCompile Include="..\..\src\render\direct3d12\SDL_render_d3d12.c">
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">CompileAsCpp</CompileAs>
@@ -670,12 +784,16 @@
<ClCompile Include="..\..\src\render\direct3d\SDL_render_d3d.c" />
<ClCompile Include="..\..\src\render\direct3d11\SDL_render_d3d11.c" />
<ClCompile Include="..\..\src\render\direct3d\SDL_shaders_d3d.c" />
<ClCompile Include="..\..\src\render\gpu\SDL_pipeline_gpu.c" />
<ClCompile Include="..\..\src\render\gpu\SDL_render_gpu.c" />
<ClCompile Include="..\..\src\render\gpu\SDL_shaders_gpu.c" />
<ClCompile Include="..\..\src\render\opengl\SDL_render_gl.c" />
<ClCompile Include="..\..\src\render\opengl\SDL_shaders_gl.c" />
<ClCompile Include="..\..\src\render\opengles2\SDL_render_gles2.c" />
<ClCompile Include="..\..\src\render\opengles2\SDL_shaders_gles2.c" />
<ClCompile Include="..\..\src\render\SDL_d3dmath.c" />
<ClCompile Include="..\..\src\render\SDL_render.c" />
<ClCompile Include="..\..\src\render\SDL_render_unsupported.c" />
<ClCompile Include="..\..\src\render\SDL_yuv_sw.c" />
<ClCompile Include="..\..\src\render\software\SDL_blendfillrect.c" />
<ClCompile Include="..\..\src\render\software\SDL_blendline.c" />
@@ -685,13 +803,16 @@
<ClCompile Include="..\..\src\render\software\SDL_render_sw.c" />
<ClCompile Include="..\..\src\render\software\SDL_rotate.c" />
<ClCompile Include="..\..\src\render\software\SDL_triangle.c" />
<ClCompile Include="..\..\src\render\vulkan\SDL_render_vulkan.c" />
<ClCompile Include="..\..\src\render\vulkan\SDL_shaders_vulkan.c" />
<ClCompile Include="..\..\src\SDL.c" />
<ClCompile Include="..\..\src\SDL_assert.c" />
<ClCompile Include="..\..\src\SDL_dataqueue.c" />
<ClCompile Include="..\..\src\SDL_list.c" />
<ClCompile Include="..\..\src\SDL_error.c" />
<ClCompile Include="..\..\src\SDL_hashtable.c" />
<ClCompile Include="..\..\src\SDL_hints.c" />
<ClCompile Include="..\..\src\SDL_log.c" />
<ClCompile Include="..\..\src\SDL_properties.c" />
<ClCompile Include="..\..\src\SDL_utils.c" />
<ClCompile Include="..\..\src\sensor\dummy\SDL_dummysensor.c" />
<ClCompile Include="..\..\src\sensor\SDL_sensor.c" />
@@ -701,23 +822,52 @@
<ClCompile Include="..\..\src\stdlib\SDL_getenv.c" />
<ClCompile Include="..\..\src\stdlib\SDL_iconv.c" />
<ClCompile Include="..\..\src\stdlib\SDL_malloc.c" />
<ClCompile Include="..\..\src\stdlib\SDL_memcpy.c" />
<ClCompile Include="..\..\src\stdlib\SDL_memmove.c" />
<ClCompile Include="..\..\src\stdlib\SDL_memset.c" />
<ClCompile Include="..\..\src\stdlib\SDL_mslibc.c" />
<MASM Condition="'$(Platform)'=='x64'" Include="..\..\src\stdlib\SDL_mslibc_x64.masm">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</MASM>
<ClCompile Include="..\..\src\stdlib\SDL_murmur3.c" />
<ClCompile Include="..\..\src\stdlib\SDL_qsort.c" />
<ClCompile Include="..\..\src\stdlib\SDL_random.c" />
<ClCompile Include="..\..\src\stdlib\SDL_stdlib.c" />
<ClCompile Include="..\..\src\stdlib\SDL_string.c" />
<ClCompile Include="..\..\src\stdlib\SDL_strtokr.c" />
<ClCompile Include="..\..\src\storage\generic\SDL_genericstorage.c" />
<ClCompile Include="..\..\src\storage\SDL_storage.c" />
<ClCompile Include="..\..\src\thread\generic\SDL_syscond.c" />
<ClCompile Include="..\..\src\thread\generic\SDL_sysrwlock.c" />
<ClCompile Include="..\..\src\thread\SDL_thread.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_syscond_cv.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_sysmutex.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_sysrwlock_srw.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_syssem.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_systhread.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_systls.c" />
<ClCompile Include="..\..\src\timer\SDL_timer.c" />
<ClCompile Include="..\..\src\timer\windows\SDL_systimer.c" />
<ClCompile Include="..\..\src\time\SDL_time.c" />
<ClCompile Include="..\..\src\time\windows\SDL_systime.c" />
<ClCompile Include="..\..\src\tray\dummy\SDL_tray.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\tray\windows\SDL_tray.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\tray\SDL_tray_utils.c" />
<ClCompile Include="..\..\src\video\dummy\SDL_nullevents.c" />
<ClCompile Include="..\..\src\video\dummy\SDL_nullframebuffer.c" />
<ClCompile Include="..\..\src\video\dummy\SDL_nullvideo.c" />
<ClCompile Include="..\..\src\video\gdk\SDL_gdktextinput.cpp">
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
<PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(IntDir)$(TargetName)_cpp.pch</PrecompiledHeaderOutputFile>
</ClCompile>
<ClCompile Include="..\..\src\video\SDL_blit.c" />
<ClCompile Include="..\..\src\video\SDL_blit_0.c" />
<ClCompile Include="..\..\src\video\SDL_blit_1.c" />
@@ -733,31 +883,45 @@
<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_shape.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_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.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" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsopengl.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsopengles.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsrawinput.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsshape.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsvideo.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsvulkan.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowswindow.c" />
<ClCompile Include="..\..\src\video\yuv2rgb\yuv_rgb.c" />
<ClCompile Include="..\..\src\video\yuv2rgb\yuv_rgb_lsx.c" />
<ClCompile Include="..\..\src\video\yuv2rgb\yuv_rgb_sse.c" />
<ClCompile Include="..\..\src\video\yuv2rgb\yuv_rgb_std.c" />
<ClCompile Include="..\..\src\gpu\SDL_gpu.c" />
<ClCompile Include="..\..\src\gpu\d3d12\SDL_gpu_d3d12.c">
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">CompileAsCpp</CompileAs>
</ClCompile>
<ClCompile Include="..\..\src\gpu\vulkan\SDL_gpu_vulkan.c" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\src\main\windows\version.rc" />
<ResourceCompile Include="..\..\src\core\windows\version.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />
</ImportGroup>
</Project>

File diff suppressed because it is too large Load Diff

View File

@@ -26,13 +26,10 @@
<Platform>Gaming.Xbox.XboxOne.x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\main\gdk\SDL_gdk_main.c" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>SDL2main</ProjectName>
<ProjectGuid>{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}</ProjectGuid>
<RootNamespace>SDLmain</RootNamespace>
<ProjectName>SDL3_test</ProjectName>
<ProjectGuid>{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}</ProjectGuid>
<RootNamespace>SDL_test</RootNamespace>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -65,43 +62,25 @@
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(Platform)\$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">$(Platform)\$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">$(Platform)\$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(Platform)\$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">$(Platform)\$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">$(Platform)\$(Configuration)\</IntDir>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
@@ -124,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>
@@ -138,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>
@@ -152,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>
@@ -166,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>
@@ -180,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>
@@ -194,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>
@@ -205,7 +190,24 @@
<OmitDefaultLibName>true</OmitDefaultLibName>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(TreatWarningsAsError)'!=''">
<ClCompile>
<TreatWarningAsError>$(TreatWarningsAsError)</TreatWarningAsError>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\src\test\SDL_test_assert.c" />
<ClCompile Include="..\..\src\test\SDL_test_common.c" />
<ClCompile Include="..\..\src\test\SDL_test_compare.c" />
<ClCompile Include="..\..\src\test\SDL_test_crc32.c" />
<ClCompile Include="..\..\src\test\SDL_test_font.c" />
<ClCompile Include="..\..\src\test\SDL_test_fuzzer.c" />
<ClCompile Include="..\..\src\test\SDL_test_harness.c" />
<ClCompile Include="..\..\src\test\SDL_test_log.c" />
<ClCompile Include="..\..\src\test\SDL_test_md5.c" />
<ClCompile Include="..\..\src\test\SDL_test_memory.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@@ -1,226 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Gaming.Desktop.x64">
<Configuration>Debug</Configuration>
<Platform>Gaming.Desktop.x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Gaming.Xbox.Scarlett.x64">
<Configuration>Debug</Configuration>
<Platform>Gaming.Xbox.Scarlett.x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Gaming.Xbox.XboxOne.x64">
<Configuration>Debug</Configuration>
<Platform>Gaming.Xbox.XboxOne.x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Gaming.Desktop.x64">
<Configuration>Release</Configuration>
<Platform>Gaming.Desktop.x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Gaming.Xbox.Scarlett.x64">
<Configuration>Release</Configuration>
<Platform>Gaming.Xbox.Scarlett.x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Gaming.Xbox.XboxOne.x64">
<Configuration>Release</Configuration>
<Platform>Gaming.Xbox.XboxOne.x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>SDL2test</ProjectName>
<ProjectGuid>{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}</ProjectGuid>
<RootNamespace>SDLtest</RootNamespace>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(Platform)\$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">$(Platform)\$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">$(Platform)\$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(Platform)\$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">$(Platform)\$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">$(Platform)\$(Configuration)\</IntDir>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'" />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">
<Midl />
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<OmitDefaultLibName>true</OmitDefaultLibName>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">
<Midl />
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<OmitDefaultLibName>true</OmitDefaultLibName>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">
<Midl />
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<OmitDefaultLibName>true</OmitDefaultLibName>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">
<Midl />
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<OmitDefaultLibName>true</OmitDefaultLibName>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">
<Midl />
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<OmitDefaultLibName>true</OmitDefaultLibName>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">
<Midl />
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<OmitDefaultLibName>true</OmitDefaultLibName>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\src\test\SDL_test_assert.c" />
<ClCompile Include="..\..\src\test\SDL_test_common.c" />
<ClCompile Include="..\..\src\test\SDL_test_compare.c" />
<ClCompile Include="..\..\src\test\SDL_test_crc32.c" />
<ClCompile Include="..\..\src\test\SDL_test_font.c" />
<ClCompile Include="..\..\src\test\SDL_test_fuzzer.c" />
<ClCompile Include="..\..\src\test\SDL_test_harness.c" />
<ClCompile Include="..\..\src\test\SDL_test_imageBlit.c" />
<ClCompile Include="..\..\src\test\SDL_test_imageBlitBlend.c" />
<ClCompile Include="..\..\src\test\SDL_test_imageFace.c" />
<ClCompile Include="..\..\src\test\SDL_test_imagePrimitives.c" />
<ClCompile Include="..\..\src\test\SDL_test_imagePrimitivesBlend.c" />
<ClCompile Include="..\..\src\test\SDL_test_log.c" />
<ClCompile Include="..\..\src\test\SDL_test_md5.c" />
<ClCompile Include="..\..\src\test\SDL_test_memory.c" />
<ClCompile Include="..\..\src\test\SDL_test_random.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -4,3 +4,4 @@ find . -type f \( -name '*.bmp' -o -name '*.wav' -o -name '*.dat' \) -print -del
find . -depth -type d \( -name Gaming.Desktop.x64 \) -exec rm -rv {} \;
find . -depth -type d \( -name Gaming.Xbox.Scarlett.x64 \) -exec rm -rv {} \;
find . -depth -type d \( -name Gaming.Xbox.XboxOne.x64 \) -exec rm -rv {} \;
rm shaders/*.h

View File

@@ -1,6 +1,6 @@
<Package>
<Chunk Id="1000" Marker="Launch">
<FileGroup DestinationPath="." SourcePath="." Include="testgamecontroller.exe" />
<FileGroup DestinationPath="." SourcePath="." Include="testcontroller.exe" />
<FileGroup DestinationPath="." SourcePath="." Include="MicrosoftGame.config" />
<FileGroup DestinationPath="." SourcePath="." Include="*.bmp" />
<FileGroup DestinationPath="." SourcePath="." Include="*.png" />

View File

@@ -1,444 +1,344 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Gaming.Desktop.x64">
<Configuration>Debug</Configuration>
<Platform>Gaming.Desktop.x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Gaming.Xbox.Scarlett.x64">
<Configuration>Debug</Configuration>
<Platform>Gaming.Xbox.Scarlett.x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Gaming.Xbox.XboxOne.x64">
<Configuration>Debug</Configuration>
<Platform>Gaming.Xbox.XboxOne.x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Gaming.Desktop.x64">
<Configuration>Release</Configuration>
<Platform>Gaming.Desktop.x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Gaming.Xbox.Scarlett.x64">
<Configuration>Release</Configuration>
<Platform>Gaming.Xbox.Scarlett.x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Gaming.Xbox.XboxOne.x64">
<Configuration>Release</Configuration>
<Platform>Gaming.Xbox.XboxOne.x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{55812185-D13C-4022-9C81-32E0F4A08305}</ProjectGuid>
<RootNamespace>testgamecontroller</RootNamespace>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(Platform)\$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">$(Platform)\$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">$(Platform)\$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(Platform)\$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">$(Platform)\$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">$(Platform)\$(Configuration)\</IntDir>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'" />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">
<Midl>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Release/testgamecontroller.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<SubSystem>Windows</SubSystem>
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">
<Midl>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Release/testgamecontroller.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<SubSystem>Windows</SubSystem>
<AdditionalDependencies>xgameruntime.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">
<Midl>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Release/testgamecontroller.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<SubSystem>Windows</SubSystem>
<AdditionalDependencies>xgameruntime.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">
<Midl>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Debug/testgamecontroller.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">
<Midl>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Debug/testgamecontroller.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<AdditionalDependencies>xgameruntime.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">
<Midl>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Debug/testgamecontroller.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<AdditionalDependencies>xgameruntime.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ProjectReference Include="..\..\SDL\SDL.vcxproj">
<Project>{81ce8daf-ebb2-4761-8e45-b71abcca8c68}</Project>
<Private>false</Private>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\..\SDLmain\SDLmain.vcxproj">
<Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
<Private>false</Private>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="..\..\..\test\axis.bmp">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">Copying %(Filename)%(Extension)</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">Copying %(Filename)%(Extension)</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">Copying %(Filename)%(Extension)</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">Copying %(Filename)%(Extension)</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">Copying %(Filename)%(Extension)</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">Copying %(Filename)%(Extension)</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
</CopyFileToFolders>
<CopyFileToFolders Include="..\..\..\test\button.bmp">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">Copying %(Filename)%(Extension)</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">Copying %(Filename)%(Extension)</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">Copying %(Filename)%(Extension)</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">Copying %(Filename)%(Extension)</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">Copying %(Filename)%(Extension)</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">Copying %(Filename)%(Extension)</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
</CopyFileToFolders>
<CopyFileToFolders Include="..\..\..\test\controllermap.bmp">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">Copying %(Filename)%(Extension)</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">Copying %(Filename)%(Extension)</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">Copying %(Filename)%(Extension)</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">Copying %(Filename)%(Extension)</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">Copying %(Filename)%(Extension)</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">Copying %(Filename)%(Extension)</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
</CopyFileToFolders>
<CopyFileToFolders Include="..\..\..\test\controllermap_back.bmp">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">Copying %(Filename)%(Extension)</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">Copying %(Filename)%(Extension)</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">Copying %(Filename)%(Extension)</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">Copying %(Filename)%(Extension)</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">Copying %(Filename)%(Extension)</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">Copying %(Filename)%(Extension)</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
</CopyFileToFolders>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\test\testgamecontroller.c" />
<ClCompile Include="..\..\..\test\testutils.c" />
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="wingdk\MicrosoftGame.config">
<FileType>Document</FileType>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
</CopyFileToFolders>
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="PackageLayout.xml" />
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="..\..\logos\Logo100x100.png" />
<CopyFileToFolders Include="..\..\logos\Logo150x150.png" />
<CopyFileToFolders Include="..\..\logos\Logo44x44.png" />
<CopyFileToFolders Include="..\..\logos\Logo480x480.png" />
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.141.GDK.C.Thunks.dll">
<FileType>Document</FileType>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
</CopyFileToFolders>
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="xboxseries\MicrosoftGame.config">
<FileType>Document</FileType>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
</CopyFileToFolders>
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="xboxone\MicrosoftGame.config">
<FileType>Document</FileType>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">true</ExcludedFromBuild>
</CopyFileToFolders>
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="..\..\logos\SplashScreenImage.png" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Gaming.Desktop.x64">
<Configuration>Debug</Configuration>
<Platform>Gaming.Desktop.x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Gaming.Xbox.Scarlett.x64">
<Configuration>Debug</Configuration>
<Platform>Gaming.Xbox.Scarlett.x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Gaming.Xbox.XboxOne.x64">
<Configuration>Debug</Configuration>
<Platform>Gaming.Xbox.XboxOne.x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Gaming.Desktop.x64">
<Configuration>Release</Configuration>
<Platform>Gaming.Desktop.x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Gaming.Xbox.Scarlett.x64">
<Configuration>Release</Configuration>
<Platform>Gaming.Xbox.Scarlett.x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Gaming.Xbox.XboxOne.x64">
<Configuration>Release</Configuration>
<Platform>Gaming.Xbox.XboxOne.x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{55812185-D13C-4022-9C81-32E0F4A08305}</ProjectGuid>
<RootNamespace>testcontroller</RootNamespace>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(Platform)\$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">$(Platform)\$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">$(Platform)\$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(Platform)\$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">$(Platform)\$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">$(Platform)\$(Configuration)\</IntDir>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'" />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">
<Midl>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<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>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<SubSystem>Windows</SubSystem>
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">
<Midl>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<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>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<SubSystem>Windows</SubSystem>
<AdditionalDependencies>xgameruntime.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">
<Midl>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<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>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<SubSystem>Windows</SubSystem>
<AdditionalDependencies>xgameruntime.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">
<Midl>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Debug/testcontroller.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">
<Midl>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Debug/testcontroller.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<AdditionalDependencies>xgameruntime.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">
<Midl>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Debug/testcontroller.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<AdditionalDependencies>xgameruntime.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(TreatWarningsAsError)'!=''">
<ClCompile>
<TreatWarningAsError>$(TreatWarningsAsError)</TreatWarningAsError>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ProjectReference Include="..\..\SDL\SDL.vcxproj">
<Project>{81ce8daf-ebb2-4761-8e45-b71abcca8c68}</Project>
<Private>false</Private>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\..\SDL_test\SDL_test.vcxproj">
<Project>{da956fd3-e143-46f2-9fe5-c77bebc56b1a}</Project>
<Private>false</Private>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\test\gamepadutils.c" />
<ClCompile Include="..\..\..\test\testcontroller.c" />
<ClCompile Include="..\..\..\test\testutils.c" />
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="wingdk\MicrosoftGame.config">
<FileType>Document</FileType>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
</CopyFileToFolders>
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="PackageLayout.xml" />
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="..\..\logos\Logo100x100.png" />
<CopyFileToFolders Include="..\..\logos\Logo150x150.png" />
<CopyFileToFolders Include="..\..\logos\Logo44x44.png" />
<CopyFileToFolders Include="..\..\logos\Logo480x480.png" />
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.GDK.C.Thunks.dll">
<FileType>Document</FileType>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
</CopyFileToFolders>
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="xboxseries\MicrosoftGame.config">
<FileType>Document</FileType>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
</CopyFileToFolders>
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="xboxone\MicrosoftGame.config">
<FileType>Document</FileType>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">true</ExcludedFromBuild>
</CopyFileToFolders>
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="..\..\logos\SplashScreenImage.png" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,55 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="..\..\..\test\testgamecontroller.c" />
<ClCompile Include="..\..\..\test\testutils.c" />
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="..\..\..\test\controllermap_back.bmp" />
<CopyFileToFolders Include="..\..\..\test\axis.bmp" />
<CopyFileToFolders Include="..\..\..\test\button.bmp" />
<CopyFileToFolders Include="..\..\..\test\controllermap.bmp" />
<CopyFileToFolders Include="..\..\logos\Logo44x44.png">
<Filter>logos</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="..\..\logos\Logo100x100.png">
<Filter>logos</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="..\..\logos\Logo150x150.png">
<Filter>logos</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="..\..\logos\Logo480x480.png">
<Filter>logos</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.141.GDK.C.Thunks.dll">
<Filter>wingdk</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="wingdk\MicrosoftGame.config">
<Filter>wingdk</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="xboxseries\MicrosoftGame.config">
<Filter>xboxseries</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="xboxone\MicrosoftGame.config">
<Filter>xboxone</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="..\..\logos\SplashScreenImage.png">
<Filter>logos</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="PackageLayout.xml" />
</ItemGroup>
<ItemGroup>
<Filter Include="logos">
<UniqueIdentifier>{5e858cf0-6fba-498d-b33d-11c8ecbb79c7}</UniqueIdentifier>
</Filter>
<Filter Include="xboxseries">
<UniqueIdentifier>{5790a250-283e-4f51-8f28-6a977d3c7a6c}</UniqueIdentifier>
</Filter>
<Filter Include="wingdk">
<UniqueIdentifier>{a4d235e4-4017-4193-af62-ecb2ac249be4}</UniqueIdentifier>
</Filter>
<Filter Include="xboxone">
<UniqueIdentifier>{e704dcb9-c83c-4c94-a139-b0f3e3f428f2}</UniqueIdentifier>
</Filter>
</ItemGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="..\..\..\test\testcontroller.c" />
<ClCompile Include="..\..\..\test\testutils.c" />
<ClCompile Include="..\..\..\test\gamepadutils.c" />
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="..\..\logos\Logo44x44.png">
<Filter>logos</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="..\..\logos\Logo100x100.png">
<Filter>logos</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="..\..\logos\Logo150x150.png">
<Filter>logos</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="..\..\logos\Logo480x480.png">
<Filter>logos</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="wingdk\MicrosoftGame.config">
<Filter>wingdk</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="xboxseries\MicrosoftGame.config">
<Filter>xboxseries</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="xboxone\MicrosoftGame.config">
<Filter>xboxone</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="..\..\logos\SplashScreenImage.png">
<Filter>logos</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="PackageLayout.xml" />
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.GDK.C.Thunks.dll">
<Filter>wingdk</Filter>
</CopyFileToFolders>
</ItemGroup>
<ItemGroup>
<Filter Include="logos">
<UniqueIdentifier>{5e858cf0-6fba-498d-b33d-11c8ecbb79c7}</UniqueIdentifier>
</Filter>
<Filter Include="xboxseries">
<UniqueIdentifier>{5790a250-283e-4f51-8f28-6a977d3c7a6c}</UniqueIdentifier>
</Filter>
<Filter Include="wingdk">
<UniqueIdentifier>{a4d235e4-4017-4193-af62-ecb2ac249be4}</UniqueIdentifier>
</Filter>
<Filter Include="xboxone">
<UniqueIdentifier>{e704dcb9-c83c-4c94-a139-b0f3e3f428f2}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>

View File

@@ -7,7 +7,7 @@
Publisher="CN=Publisher"/>
<ExecutableList>
<Executable Name="testgamecontroller.exe"
<Executable Name="testcontroller.exe"
TargetDeviceFamily="PC"
Id="Game" />
</ExecutableList>
@@ -22,13 +22,13 @@
<MSAAppId>PleaseChangeMe</MSAAppId>
<TitleId>FFFFFFFF</TitleId>
<ShellVisuals DefaultDisplayName="testgamecontroller"
<ShellVisuals DefaultDisplayName="testcontroller"
PublisherDisplayName="SDL"
Square480x480Logo="Logo480x480.png"
Square150x150Logo="Logo150x150.png"
Square44x44Logo="Logo44x44.png"
Description="testgamecontroller"
Description="testcontroller"
ForegroundText="light"
BackgroundColor="#000000"
StoreLogo="Logo100x100.png"/>
</Game>
</Game>

View File

@@ -7,7 +7,7 @@
Publisher="CN=Publisher"/>
<ExecutableList>
<Executable Name="testgamecontroller.exe"
<Executable Name="testcontroller.exe"
TargetDeviceFamily="XboxOne"
Id="Game" />
</ExecutableList>
@@ -16,14 +16,14 @@
<MSAAppId>PleaseChangeMe</MSAAppId>
<TitleId>FFFFFFFF</TitleId>
<ShellVisuals DefaultDisplayName="testgamecontroller"
<ShellVisuals DefaultDisplayName="testcontroller"
PublisherDisplayName="SDL"
Square480x480Logo="Logo480x480.png"
Square150x150Logo="Logo150x150.png"
Square44x44Logo="Logo44x44.png"
SplashScreenImage="SplashScreenImage.png"
Description="testgamecontroller"
Description="testcontroller"
ForegroundText="light"
BackgroundColor="#000000"
StoreLogo="Logo100x100.png"/>
</Game>
</Game>

View File

@@ -7,7 +7,7 @@
Publisher="CN=Publisher"/>
<ExecutableList>
<Executable Name="testgamecontroller.exe"
<Executable Name="testcontroller.exe"
TargetDeviceFamily="Scarlett"
Id="Game" />
</ExecutableList>
@@ -16,14 +16,14 @@
<MSAAppId>PleaseChangeMe</MSAAppId>
<TitleId>FFFFFFFF</TitleId>
<ShellVisuals DefaultDisplayName="testgamecontroller"
<ShellVisuals DefaultDisplayName="testcontroller"
PublisherDisplayName="SDL"
Square480x480Logo="Logo480x480.png"
Square150x150Logo="Logo150x150.png"
Square44x44Logo="Logo44x44.png"
SplashScreenImage="SplashScreenImage.png"
Description="testgamecontroller"
Description="testcontroller"
ForegroundText="light"
BackgroundColor="#000000"
StoreLogo="Logo100x100.png"/>
</Game>
</Game>

View File

@@ -1,5 +1,5 @@
/*
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -18,9 +18,10 @@
#include <stdio.h>
#include <time.h>
#include "SDL_test.h"
#include "SDL_test_common.h"
#include <SDL3/SDL_test.h>
#include <SDL3/SDL_test_common.h>
#include "../src/core/windows/SDL_windows.h"
#include <SDL3/SDL_main.h>
extern "C" {
#include "../test/testutils.h"
@@ -34,8 +35,8 @@ extern "C" {
static SDLTest_CommonState *state;
static int num_sprites;
static SDL_Texture **sprites;
static SDL_bool cycle_color;
static SDL_bool cycle_alpha;
static bool cycle_color;
static bool cycle_alpha;
static int cycle_direction = 1;
static int current_alpha = 0;
static int current_color = 0;
@@ -52,24 +53,14 @@ static struct
int soundpos; /* Current play position */
} wave;
static SDL_AudioDeviceID device;
static void
close_audio()
{
if (device != 0) {
SDL_CloseAudioDevice(device);
device = 0;
}
}
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);
close_audio();
SDL_FreeWAV(wave.sound);
SDL_DestroyAudioStream(stream);
SDL_free(wave.sound);
SDLTest_CommonQuit(state);
/* If rc is 0, just let main return normally rather than calling exit.
* This allows testing of platforms where SDL_main is required and does meaningful cleanup.
@@ -79,53 +70,16 @@ quit(int rc)
}
}
static void
open_audio()
static int fillerup(void)
{
/* Initialize fillerup() variables */
device = SDL_OpenAudioDevice(NULL, SDL_FALSE, &wave.spec, NULL, 0);
if (!device) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't open audio: %s\n", SDL_GetError());
SDL_FreeWAV(wave.sound);
quit(2);
const int minimum = (wave.soundlen / SDL_AUDIO_FRAMESIZE(wave.spec)) / 2;
if (SDL_GetAudioStreamQueued(stream) < minimum) {
SDL_PutAudioStreamData(stream, wave.sound, wave.soundlen);
}
/* Let the audio run */
SDL_PauseAudioDevice(device, SDL_FALSE);
return 0;
}
static void
reopen_audio()
{
close_audio();
open_audio();
}
void SDLCALL
fillerup(void *unused, Uint8 *stream, int len)
{
Uint8 *waveptr;
int waveleft;
/* Set up the pointers */
waveptr = wave.sound + wave.soundpos;
waveleft = wave.soundlen - wave.soundpos;
/* Go! */
while (waveleft <= len) {
SDL_memcpy(stream, waveptr, waveleft);
stream += waveleft;
len -= waveleft;
waveptr = wave.sound;
waveleft = wave.soundlen;
wave.soundpos = 0;
}
SDL_memcpy(stream, waveptr, len);
wave.soundpos += len;
}
void
UserLoggedIn(XUserHandle user)
static void UserLoggedIn(XUserHandle user)
{
HRESULT hr;
char gamertag[128];
@@ -140,8 +94,7 @@ UserLoggedIn(XUserHandle user)
XUserCloseHandle(user);
}
void
AddUserUICallback(XAsyncBlock *asyncBlock)
static void AddUserUICallback(XAsyncBlock *asyncBlock)
{
HRESULT hr;
XUserHandle user = NULL;
@@ -167,8 +120,7 @@ AddUserUICallback(XAsyncBlock *asyncBlock)
delete asyncBlock;
}
void
AddUserUI()
static void AddUserUI()
{
HRESULT hr;
XAsyncBlock *asyncBlock = new XAsyncBlock;
@@ -185,8 +137,7 @@ AddUserUI()
}
}
void
AddUserSilentCallback(XAsyncBlock *asyncBlock)
static void AddUserSilentCallback(XAsyncBlock *asyncBlock)
{
HRESULT hr;
XUserHandle user = NULL;
@@ -212,8 +163,7 @@ AddUserSilentCallback(XAsyncBlock *asyncBlock)
delete asyncBlock;
}
void
AddUserSilent()
static void AddUserSilent()
{
HRESULT hr;
XAsyncBlock *asyncBlock = new XAsyncBlock;
@@ -230,35 +180,33 @@ 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, SDL_TRUE, &sprite_w, &sprite_h);
sprites[i] = LoadTexture(state->renderers[i], file, true);
if (!sprites[i]) {
return (-1);
}
if (SDL_SetTextureBlendMode(sprites[i], blendMode) < 0) {
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, temp;
SDL_Rect viewport;
SDL_FRect temp;
/* Query the sizes */
SDL_RenderGetViewport(renderer, &viewport);
SDL_GetRenderViewport(renderer, &viewport);
/* Cycle the color and alpha, if desired */
if (cycle_color) {
@@ -293,70 +241,69 @@ DrawSprites(SDL_Renderer * renderer, SDL_Texture * sprite)
/* Test points */
SDL_SetRenderDrawColor(renderer, 0xFF, 0x00, 0x00, 0xFF);
SDL_RenderDrawPoint(renderer, 0, 0);
SDL_RenderDrawPoint(renderer, viewport.w-1, 0);
SDL_RenderDrawPoint(renderer, 0, viewport.h-1);
SDL_RenderDrawPoint(renderer, viewport.w-1, viewport.h-1);
SDL_RenderPoint(renderer, 0.0f, 0.0f);
SDL_RenderPoint(renderer, (float)(viewport.w - 1), 0.0f);
SDL_RenderPoint(renderer, 0.0f, (float)(viewport.h - 1));
SDL_RenderPoint(renderer, (float)(viewport.w - 1), (float)(viewport.h - 1));
/* Test horizontal and vertical lines */
SDL_SetRenderDrawColor(renderer, 0x00, 0xFF, 0x00, 0xFF);
SDL_RenderDrawLine(renderer, 1, 0, viewport.w-2, 0);
SDL_RenderDrawLine(renderer, 1, viewport.h-1, viewport.w-2, viewport.h-1);
SDL_RenderDrawLine(renderer, 0, 1, 0, viewport.h-2);
SDL_RenderDrawLine(renderer, viewport.w-1, 1, viewport.w-1, viewport.h-2);
SDL_RenderLine(renderer, 1.0f, 0.0f, (float)(viewport.w - 2), 0.0f);
SDL_RenderLine(renderer, 1.0f, (float)(viewport.h - 1), (float)(viewport.w - 2), (float)(viewport.h - 1));
SDL_RenderLine(renderer, 0.0f, 1.0f, 0.0f, (float)(viewport.h - 2));
SDL_RenderLine(renderer, (float)(viewport.w - 1), 1, (float)(viewport.w - 1), (float)(viewport.h - 2));
/* Test fill and copy */
SDL_SetRenderDrawColor(renderer, 0xFF, 0xFF, 0xFF, 0xFF);
temp.x = 1;
temp.y = 1;
temp.w = sprite_w;
temp.h = sprite_h;
temp.x = 1.0f;
temp.y = 1.0f;
temp.w = (float)sprite_w;
temp.h = (float)sprite_h;
SDL_RenderFillRect(renderer, &temp);
SDL_RenderCopy(renderer, sprite, NULL, &temp);
temp.x = viewport.w-sprite_w-1;
temp.y = 1;
temp.w = sprite_w;
temp.h = sprite_h;
SDL_RenderTexture(renderer, sprite, NULL, &temp);
temp.x = (float)(viewport.w-sprite_w-1);
temp.y = 1.0f;
temp.w = (float)sprite_w;
temp.h = (float)sprite_h;
SDL_RenderFillRect(renderer, &temp);
SDL_RenderCopy(renderer, sprite, NULL, &temp);
temp.x = 1;
temp.y = viewport.h-sprite_h-1;
temp.w = sprite_w;
temp.h = sprite_h;
SDL_RenderTexture(renderer, sprite, NULL, &temp);
temp.x = 1.0f;
temp.y = (float)(viewport.h-sprite_h-1);
temp.w = (float)sprite_w;
temp.h = (float)sprite_h;
SDL_RenderFillRect(renderer, &temp);
SDL_RenderCopy(renderer, sprite, NULL, &temp);
temp.x = viewport.w-sprite_w-1;
temp.y = viewport.h-sprite_h-1;
temp.w = sprite_w;
temp.h = sprite_h;
SDL_RenderTexture(renderer, sprite, NULL, &temp);
temp.x = (float)(viewport.w-sprite_w-1);
temp.y = (float)(viewport.h-sprite_h-1);
temp.w = (float)(sprite_w);
temp.h = (float)(sprite_h);
SDL_RenderFillRect(renderer, &temp);
SDL_RenderCopy(renderer, sprite, NULL, &temp);
SDL_RenderTexture(renderer, sprite, NULL, &temp);
/* Test diagonal lines */
SDL_SetRenderDrawColor(renderer, 0x00, 0xFF, 0x00, 0xFF);
SDL_RenderDrawLine(renderer, sprite_w, sprite_h,
viewport.w-sprite_w-2, viewport.h-sprite_h-2);
SDL_RenderDrawLine(renderer, viewport.w-sprite_w-2, sprite_h,
sprite_w, viewport.h-sprite_h-2);
SDL_RenderLine(renderer, (float)sprite_w, (float)sprite_h,
(float)(viewport.w-sprite_w-2), (float)(viewport.h-sprite_h-2));
SDL_RenderLine(renderer, (float)(viewport.w-sprite_w-2), (float)sprite_h,
(float)sprite_w, (float)(viewport.h-sprite_h-2));
/* Update the screen! */
SDL_RenderPresent(renderer);
}
void
loop()
static void loop()
{
int i;
SDL_Event event;
/* Check for events */
while (SDL_PollEvent(&event)) {
if (event.type == SDL_KEYDOWN && !event.key.repeat) {
SDL_Log("Initial SDL_KEYDOWN: %s", SDL_GetScancodeName(event.key.keysym.scancode));
if (event.type == SDL_EVENT_KEY_DOWN && !event.key.repeat) {
SDL_Log("Initial SDL_EVENT_KEY_DOWN: %s", SDL_GetScancodeName(event.key.scancode));
}
#if defined(__XBOXONE__) || defined(__XBOXSERIES__)
#if defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES)
/* On Xbox, ignore the keydown event because the features aren't supported */
if (event.type != SDL_KEYDOWN) {
if (event.type != SDL_EVENT_KEY_DOWN) {
SDLTest_CommonEvent(state, &event, &done);
}
#else
@@ -364,14 +311,15 @@ loop()
#endif
}
for (i = 0; i < state->num_windows; ++i) {
if (state->windows[i] == NULL)
if (state->windows[i] == NULL) {
continue;
}
DrawSprites(state->renderers[i], sprites[i]);
}
fillerup();
}
int
main(int argc, char *argv[])
int main(int argc, char *argv[])
{
int i;
const char *icon = "icon.bmp";
@@ -412,10 +360,10 @@ main(int argc, char *argv[])
}
}
} else if (SDL_strcasecmp(argv[i], "--cyclecolor") == 0) {
cycle_color = SDL_TRUE;
cycle_color = true;
consumed = 1;
} else if (SDL_strcasecmp(argv[i], "--cyclealpha") == 0) {
cycle_alpha = SDL_TRUE;
cycle_alpha = true;
consumed = 1;
} else if (SDL_isdigit(*argv[i])) {
num_sprites = SDL_atoi(argv[i]);
@@ -446,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) {
@@ -454,34 +402,37 @@ 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 == NULL) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "%s\n", SDL_GetError());
if (!soundname) {
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) == NULL) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s\n", soundname, SDL_GetError());
if (!SDL_LoadWAV(soundname, &wave.spec, &wave.sound, &wave.soundlen)) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s", soundname, SDL_GetError());
quit(1);
}
wave.spec.callback = fillerup;
/* Show the list of available drivers */
SDL_Log("Available audio drivers:");
for (i = 0; i < SDL_GetNumAudioDrivers(); ++i) {
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());
open_audio();
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", SDL_GetError());
return -1;
}
SDL_ResumeAudioDevice(SDL_GetAudioStreamDevice(stream));
/* Main render loop */
done = 0;
@@ -498,5 +449,3 @@ main(int argc, char *argv[])
SDL_free(soundname);
return 0;
}
/* vi: set ts=4 sw=4 expandtab: */

View File

@@ -28,7 +28,7 @@
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{1C9A3F71-35A5-4C56-B292-F4375B3C3649}</ProjectGuid>
<RootNamespace>testsprite2</RootNamespace>
<RootNamespace>testsprite</RootNamespace>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -63,27 +63,21 @@
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
@@ -124,9 +118,10 @@
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Release/testsprite2.tlb</TypeLibraryName>
<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>
@@ -139,7 +134,7 @@
</ResourceCompile>
<Link>
<SubSystem>Windows</SubSystem>
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>
@@ -151,9 +146,10 @@
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Release/testsprite2.tlb</TypeLibraryName>
<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>
@@ -178,9 +174,10 @@
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Release/testsprite2.tlb</TypeLibraryName>
<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>
@@ -205,9 +202,10 @@
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Debug/testsprite2.tlb</TypeLibraryName>
<TypeLibraryName>.\Debug/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -223,7 +221,7 @@
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>
@@ -235,9 +233,10 @@
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Debug/testsprite2.tlb</TypeLibraryName>
<TypeLibraryName>.\Debug/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -265,9 +264,10 @@
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Debug/testsprite2.tlb</TypeLibraryName>
<TypeLibraryName>.\Debug/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -290,6 +290,11 @@
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(TreatWarningsAsError)'!=''">
<ClCompile>
<TreatWarningAsError>$(TreatWarningsAsError)</TreatWarningAsError>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ProjectReference Include="..\..\SDL\SDL.vcxproj">
<Project>{81ce8daf-ebb2-4761-8e45-b71abcca8c68}</Project>
@@ -297,13 +302,7 @@
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\..\SDLmain\SDLmain.vcxproj">
<Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
<Private>false</Private>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\..\SDLtest\SDLtest.vcxproj">
<ProjectReference Include="..\..\SDL_test\SDL_test.vcxproj">
<Project>{da956fd3-e143-46f2-9fe5-c77bebc56b1a}</Project>
<Private>false</Private>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
@@ -352,7 +351,7 @@ copy "%(FullPath)" "$(OutDir)\"</Command>
</CopyFileToFolders>
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.141.GDK.C.Thunks.dll">
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.GDK.C.Thunks.dll">
<FileType>Document</FileType>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>

View File

@@ -18,9 +18,6 @@
<CopyFileToFolders Include="..\..\logos\Logo480x480.png">
<Filter>logos</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.141.GDK.C.Thunks.dll">
<Filter>wingdk</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="wingdk\MicrosoftGame.config">
<Filter>wingdk</Filter>
</CopyFileToFolders>
@@ -35,6 +32,9 @@
<Filter>logos</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="PackageLayout.xml" />
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.GDK.C.Thunks.dll">
<Filter>wingdk</Filter>
</CopyFileToFolders>
</ItemGroup>
<ItemGroup>
<Filter Include="logos">

View File

@@ -1,6 +1,6 @@
<Package>
<Chunk Id="1000" Marker="Launch">
<FileGroup DestinationPath="." SourcePath="." Include="testsprite2.exe" />
<FileGroup DestinationPath="." SourcePath="." Include="testsprite.exe" />
<FileGroup DestinationPath="." SourcePath="." Include="MicrosoftGame.config" />
<FileGroup DestinationPath="." SourcePath="." Include="*.bmp" />
<FileGroup DestinationPath="." SourcePath="." Include="*.png" />

View File

@@ -28,7 +28,7 @@
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{40FB7794-D3C3-4CFE-BCF4-A80C96635682}</ProjectGuid>
<RootNamespace>testsprite2</RootNamespace>
<RootNamespace>testsprite</RootNamespace>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -63,27 +63,21 @@
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
@@ -124,9 +118,10 @@
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Release/testsprite2.tlb</TypeLibraryName>
<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>
@@ -139,7 +134,7 @@
</ResourceCompile>
<Link>
<SubSystem>Windows</SubSystem>
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>
@@ -151,9 +146,10 @@
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Release/testsprite2.tlb</TypeLibraryName>
<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>
@@ -178,9 +174,10 @@
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Release/testsprite2.tlb</TypeLibraryName>
<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>
@@ -205,9 +202,10 @@
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Debug/testsprite2.tlb</TypeLibraryName>
<TypeLibraryName>.\Debug/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -223,7 +221,7 @@
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>
@@ -235,9 +233,10 @@
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Debug/testsprite2.tlb</TypeLibraryName>
<TypeLibraryName>.\Debug/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -265,9 +264,10 @@
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Debug/testsprite2.tlb</TypeLibraryName>
<TypeLibraryName>.\Debug/testsprite.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -290,6 +290,11 @@
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(TreatWarningsAsError)'!=''">
<ClCompile>
<TreatWarningAsError>$(TreatWarningsAsError)</TreatWarningAsError>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ProjectReference Include="..\..\SDL\SDL.vcxproj">
<Project>{81ce8daf-ebb2-4761-8e45-b71abcca8c68}</Project>
@@ -297,13 +302,7 @@
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\..\SDLmain\SDLmain.vcxproj">
<Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
<Private>false</Private>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\..\SDLtest\SDLtest.vcxproj">
<ProjectReference Include="..\..\SDL_test\SDL_test.vcxproj">
<Project>{da956fd3-e143-46f2-9fe5-c77bebc56b1a}</Project>
<Private>false</Private>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
@@ -339,7 +338,7 @@ copy "%(FullPath)" "$(OutDir)\"</Command>
</CopyFileToFolders>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\test\testsprite2.c" />
<ClCompile Include="..\..\..\test\testsprite.c" />
<ClCompile Include="..\..\..\test\testutils.c" />
</ItemGroup>
<ItemGroup>
@@ -352,7 +351,7 @@ copy "%(FullPath)" "$(OutDir)\"</Command>
</CopyFileToFolders>
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.141.GDK.C.Thunks.dll">
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.GDK.C.Thunks.dll">
<FileType>Document</FileType>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">true</ExcludedFromBuild>
@@ -392,4 +391,4 @@ copy "%(FullPath)" "$(OutDir)\"</Command>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="..\..\..\test\testsprite2.c" />
<ClCompile Include="..\..\..\test\testsprite.c" />
<ClCompile Include="..\..\..\test\testutils.c" />
</ItemGroup>
<ItemGroup>
@@ -18,9 +18,6 @@
<CopyFileToFolders Include="..\..\logos\Logo480x480.png">
<Filter>logos</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.141.GDK.C.Thunks.dll">
<Filter>wingdk</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="xboxseries\MicrosoftGame.config">
<Filter>xboxseries</Filter>
</CopyFileToFolders>
@@ -34,6 +31,9 @@
<Filter>logos</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="PackageLayout.xml" />
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.GDK.C.Thunks.dll">
<Filter>wingdk</Filter>
</CopyFileToFolders>
</ItemGroup>
<ItemGroup>
<Filter Include="logos">

View File

@@ -7,7 +7,7 @@
Publisher="CN=Publisher"/>
<ExecutableList>
<Executable Name="testsprite2.exe"
<Executable Name="testsprite.exe"
TargetDeviceFamily="PC"
Id="Game" />
</ExecutableList>
@@ -22,12 +22,12 @@
<MSAAppId>PleaseChangeMe</MSAAppId>
<TitleId>FFFFFFFF</TitleId>
<ShellVisuals DefaultDisplayName="testsprite2"
<ShellVisuals DefaultDisplayName="testsprite"
PublisherDisplayName="SDL"
Square480x480Logo="Logo480x480.png"
Square150x150Logo="Logo150x150.png"
Square44x44Logo="Logo44x44.png"
Description="testsprite2"
Description="testsprite"
ForegroundText="light"
BackgroundColor="#000000"
StoreLogo="Logo100x100.png"/>

View File

@@ -7,7 +7,7 @@
Publisher="CN=Publisher"/>
<ExecutableList>
<Executable Name="testsprite2.exe"
<Executable Name="testsprite.exe"
TargetDeviceFamily="XboxOne"
Id="Game" />
</ExecutableList>
@@ -16,13 +16,13 @@
<MSAAppId>PleaseChangeMe</MSAAppId>
<TitleId>FFFFFFFF</TitleId>
<ShellVisuals DefaultDisplayName="testsprite2"
<ShellVisuals DefaultDisplayName="testsprite"
PublisherDisplayName="SDL"
Square480x480Logo="Logo480x480.png"
Square150x150Logo="Logo150x150.png"
Square44x44Logo="Logo44x44.png"
SplashScreenImage="SplashScreenImage.png"
Description="testsprite2"
Description="testsprite"
ForegroundText="light"
BackgroundColor="#000000"
StoreLogo="Logo100x100.png"/>

View File

@@ -7,7 +7,7 @@
Publisher="CN=Publisher"/>
<ExecutableList>
<Executable Name="testsprite2.exe"
<Executable Name="testsprite.exe"
TargetDeviceFamily="Scarlett"
Id="Game" />
</ExecutableList>
@@ -16,12 +16,12 @@
<MSAAppId>PleaseChangeMe</MSAAppId>
<TitleId>FFFFFFFF</TitleId>
<ShellVisuals DefaultDisplayName="testsprite2"
<ShellVisuals DefaultDisplayName="testsprite"
PublisherDisplayName="SDL"
Square480x480Logo="Logo480x480.png"
Square150x150Logo="Logo150x150.png"
Square44x44Logo="Logo44x44.png"
Description="testsprite2"
Description="testsprite"
SplashScreenImage="SplashScreenImage.png"
ForegroundText="light"
BackgroundColor="#000000"

View File

@@ -1,40 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2-UWP", "SDL-UWP.vcxproj", "{89E9B32E-A86A-47C3-A948-D2B1622925CE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
Debug|ARM64 = Debug|ARM64
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|ARM = Release|ARM
Release|ARM64 = Release|ARM64
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{89E9B32E-A86A-47C3-A948-D2B1622925CE}.Debug|ARM.ActiveCfg = Debug|ARM
{89E9B32E-A86A-47C3-A948-D2B1622925CE}.Debug|ARM.Build.0 = Debug|ARM
{89E9B32E-A86A-47C3-A948-D2B1622925CE}.Debug|ARM64.ActiveCfg = Debug|ARM64
{89E9B32E-A86A-47C3-A948-D2B1622925CE}.Debug|ARM64.Build.0 = Debug|ARM64
{89E9B32E-A86A-47C3-A948-D2B1622925CE}.Debug|x64.ActiveCfg = Debug|x64
{89E9B32E-A86A-47C3-A948-D2B1622925CE}.Debug|x64.Build.0 = Debug|x64
{89E9B32E-A86A-47C3-A948-D2B1622925CE}.Debug|x86.ActiveCfg = Debug|Win32
{89E9B32E-A86A-47C3-A948-D2B1622925CE}.Debug|x86.Build.0 = Debug|Win32
{89E9B32E-A86A-47C3-A948-D2B1622925CE}.Release|ARM.ActiveCfg = Release|ARM
{89E9B32E-A86A-47C3-A948-D2B1622925CE}.Release|ARM.Build.0 = Release|ARM
{89E9B32E-A86A-47C3-A948-D2B1622925CE}.Release|ARM64.ActiveCfg = Release|ARM64
{89E9B32E-A86A-47C3-A948-D2B1622925CE}.Release|ARM64.Build.0 = Release|ARM64
{89E9B32E-A86A-47C3-A948-D2B1622925CE}.Release|x64.ActiveCfg = Release|x64
{89E9B32E-A86A-47C3-A948-D2B1622925CE}.Release|x64.Build.0 = Release|x64
{89E9B32E-A86A-47C3-A948-D2B1622925CE}.Release|x86.ActiveCfg = Release|Win32
{89E9B32E-A86A-47C3-A948-D2B1622925CE}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -1,594 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\begin_code.h" />
<ClInclude Include="..\include\close_code.h" />
<ClInclude Include="..\include\SDL.h" />
<ClInclude Include="..\include\SDL_assert.h" />
<ClInclude Include="..\include\SDL_atomic.h" />
<ClInclude Include="..\include\SDL_audio.h" />
<ClInclude Include="..\include\SDL_blendmode.h" />
<ClInclude Include="..\include\SDL_clipboard.h" />
<ClInclude Include="..\include\SDL_config.h" />
<ClInclude Include="..\include\SDL_config_minimal.h" />
<ClInclude Include="..\include\SDL_config_winrt.h" />
<ClInclude Include="..\include\SDL_copying.h" />
<ClInclude Include="..\include\SDL_cpuinfo.h" />
<ClInclude Include="..\include\SDL_egl.h" />
<ClInclude Include="..\include\SDL_endian.h" />
<ClInclude Include="..\include\SDL_error.h" />
<ClInclude Include="..\include\SDL_events.h" />
<ClInclude Include="..\include\SDL_filesystem.h" />
<ClInclude Include="..\include\SDL_guid.h" />
<ClInclude Include="..\include\SDL_haptic.h" />
<ClInclude Include="..\include\SDL_hints.h" />
<ClInclude Include="..\include\SDL_hidapi.h" />
<ClInclude Include="..\include\SDL_input.h" />
<ClInclude Include="..\include\SDL_joystick.h" />
<ClInclude Include="..\include\SDL_keyboard.h" />
<ClInclude Include="..\include\SDL_keycode.h" />
<ClInclude Include="..\include\SDL_loadso.h" />
<ClInclude Include="..\include\SDL_locale.h" />
<ClInclude Include="..\include\SDL_log.h" />
<ClInclude Include="..\include\SDL_main.h" />
<ClInclude Include="..\include\SDL_misc.h" />
<ClInclude Include="..\include\SDL_mouse.h" />
<ClInclude Include="..\include\SDL_mutex.h" />
<ClInclude Include="..\include\SDL_name.h" />
<ClInclude Include="..\include\SDL_opengles2.h" />
<ClInclude Include="..\include\SDL_pixels.h" />
<ClInclude Include="..\include\SDL_platform.h" />
<ClInclude Include="..\include\SDL_power.h" />
<ClInclude Include="..\include\SDL_quit.h" />
<ClInclude Include="..\include\SDL_rect.h" />
<ClInclude Include="..\include\SDL_render.h" />
<ClInclude Include="..\include\SDL_revision.h" />
<ClInclude Include="..\include\SDL_rwops.h" />
<ClInclude Include="..\include\SDL_scancode.h" />
<ClInclude Include="..\include\SDL_sensor.h" />
<ClInclude Include="..\include\SDL_shape.h" />
<ClInclude Include="..\include\SDL_stdinc.h" />
<ClInclude Include="..\include\SDL_surface.h" />
<ClInclude Include="..\include\SDL_system.h" />
<ClInclude Include="..\include\SDL_syswm.h" />
<ClInclude Include="..\include\SDL_thread.h" />
<ClInclude Include="..\include\SDL_timer.h" />
<ClInclude Include="..\include\SDL_touch.h" />
<ClInclude Include="..\include\SDL_types.h" />
<ClInclude Include="..\include\SDL_version.h" />
<ClInclude Include="..\include\SDL_video.h" />
<ClInclude Include="..\src\audio\disk\SDL_diskaudio.h" />
<ClInclude Include="..\src\audio\dummy\SDL_dummyaudio.h" />
<ClInclude Include="..\src\audio\SDL_audiodev_c.h" />
<ClInclude Include="..\src\audio\SDL_audio_c.h" />
<ClInclude Include="..\src\audio\SDL_sysaudio.h" />
<ClInclude Include="..\src\audio\SDL_wave.h" />
<ClInclude Include="..\src\audio\wasapi\SDL_wasapi.h" />
<ClInclude Include="..\src\core\windows\SDL_directx.h" />
<ClInclude Include="..\src\core\windows\SDL_windows.h" />
<ClInclude Include="..\src\core\windows\SDL_xinput.h" />
<ClInclude Include="..\src\core\winrt\SDL_winrtapp_common.h" />
<ClInclude Include="..\src\core\winrt\SDL_winrtapp_direct3d.h" />
<ClInclude Include="..\src\core\winrt\SDL_winrtapp_xaml.h" />
<ClInclude Include="..\src\dynapi\SDL_dynapi.h" />
<ClInclude Include="..\src\dynapi\SDL_dynapi_overrides.h" />
<ClInclude Include="..\src\dynapi\SDL_dynapi_procs.h" />
<ClInclude Include="..\src\events\blank_cursor.h" />
<ClInclude Include="..\src\events\default_cursor.h" />
<ClInclude Include="..\src\events\SDL_clipboardevents_c.h" />
<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_keyboard_c.h" />
<ClInclude Include="..\src\events\SDL_mouse_c.h" />
<ClInclude Include="..\src\events\SDL_touch_c.h" />
<ClInclude Include="..\src\events\SDL_windowevents_c.h" />
<ClInclude Include="..\src\haptic\SDL_haptic_c.h" />
<ClInclude Include="..\src\haptic\SDL_syshaptic.h" />
<ClInclude Include="..\src\haptic\windows\SDL_dinputhaptic_c.h" />
<ClInclude Include="..\src\haptic\windows\SDL_windowshaptic_c.h" />
<ClInclude Include="..\src\haptic\windows\SDL_xinputhaptic_c.h" />
<ClInclude Include="..\src\joystick\controller_type.h" />
<ClInclude Include="..\src\joystick\SDL_gamecontrollerdb.h" />
<ClInclude Include="..\src\joystick\SDL_joystick_c.h" />
<ClInclude Include="..\src\joystick\SDL_sysjoystick.h" />
<ClInclude Include="..\src\joystick\virtual\SDL_virtualjoystick_c.h" />
<ClInclude Include="..\src\joystick\windows\SDL_dinputjoystick_c.h" />
<ClInclude Include="..\src\joystick\windows\SDL_windowsjoystick_c.h" />
<ClInclude Include="..\src\joystick\windows\SDL_xinputjoystick_c.h" />
<ClInclude Include="..\src\locale\SDL_syslocale.h" />
<ClInclude Include="..\src\render\direct3d11\SDL_render_winrt.h" />
<ClInclude Include="..\src\render\direct3d11\SDL_shaders_d3d11.h" />
<ClInclude Include="..\src\render\opengles2\SDL_gles2funcs.h" />
<ClInclude Include="..\src\render\opengles2\SDL_shaders_gles2.h" />
<ClInclude Include="..\src\render\SDL_d3dmath.h" />
<ClInclude Include="..\src\render\SDL_sysrender.h" />
<ClInclude Include="..\src\render\SDL_yuv_sw_c.h" />
<ClInclude Include="..\src\render\software\SDL_blendfillrect.h" />
<ClInclude Include="..\src\render\software\SDL_blendline.h" />
<ClInclude Include="..\src\render\software\SDL_blendpoint.h" />
<ClInclude Include="..\src\render\software\SDL_draw.h" />
<ClInclude Include="..\src\render\software\SDL_drawline.h" />
<ClInclude Include="..\src\render\software\SDL_drawpoint.h" />
<ClInclude Include="..\src\render\software\SDL_render_sw_c.h" />
<ClInclude Include="..\src\render\software\SDL_rotate.h" />
<ClInclude Include="..\src\render\software\SDL_triangle.h" />
<ClInclude Include="..\src\SDL_assert_c.h" />
<ClInclude Include="..\src\SDL_dataqueue.h" />
<ClInclude Include="..\src\SDL_error_c.h" />
<ClInclude Include="..\src\SDL_fatal.h" />
<ClInclude Include="..\src\SDL_hints_c.h" />
<ClInclude Include="..\src\SDL_internal.h" />
<ClInclude Include="..\src\SDL_list.h" />
<ClInclude Include="..\src\SDL_log_c.h" />
<ClInclude Include="..\src\sensor\dummy\SDL_dummysensor.h" />
<ClInclude Include="..\src\sensor\SDL_sensor_c.h" />
<ClInclude Include="..\src\sensor\SDL_syssensor.h" />
<ClInclude Include="..\src\thread\SDL_systhread.h" />
<ClInclude Include="..\src\thread\SDL_thread_c.h" />
<ClInclude Include="..\src\thread\stdcpp\SDL_sysmutex_c.h" />
<ClInclude Include="..\src\thread\stdcpp\SDL_systhread_c.h" />
<ClInclude Include="..\src\timer\SDL_timer_c.h" />
<ClInclude Include="..\src\video\dummy\SDL_nullevents_c.h" />
<ClInclude Include="..\src\video\dummy\SDL_nullframebuffer_c.h" />
<ClInclude Include="..\src\video\dummy\SDL_nullvideo.h" />
<ClInclude Include="..\src\video\SDL_blit.h" />
<ClInclude Include="..\src\video\SDL_blit_auto.h" />
<ClInclude Include="..\src\video\SDL_blit_copy.h" />
<ClInclude Include="..\src\video\SDL_blit_slow.h" />
<ClInclude Include="..\src\video\SDL_egl_c.h" />
<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_shape_internals.h" />
<ClInclude Include="..\src\video\SDL_sysvideo.h" />
<ClInclude Include="..\src\video\SDL_yuv_c.h" />
<ClInclude Include="..\src\video\winrt\SDL_winrtevents_c.h" />
<ClInclude Include="..\src\video\winrt\SDL_winrtgamebar_cpp.h" />
<ClInclude Include="..\src\video\winrt\SDL_winrtmessagebox.h" />
<ClInclude Include="..\src\video\winrt\SDL_winrtmouse_c.h" />
<ClInclude Include="..\src\video\winrt\SDL_winrtopengles.h" />
<ClInclude Include="..\src\video\winrt\SDL_winrtvideo_cpp.h" />
<ClInclude Include="..\src\video\yuv2rgb\yuv_rgb.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\atomic\SDL_atomic.c" />
<ClCompile Include="..\src\atomic\SDL_spinlock.c" />
<ClCompile Include="..\src\audio\disk\SDL_diskaudio.c" />
<ClCompile Include="..\src\audio\dummy\SDL_dummyaudio.c" />
<ClCompile Include="..\src\audio\SDL_audio.c" />
<ClCompile Include="..\src\audio\SDL_audiocvt.c" />
<ClCompile Include="..\src\audio\SDL_audiodev.c" />
<ClCompile Include="..\src\audio\SDL_audiotypecvt.c" />
<ClCompile Include="..\src\audio\SDL_mixer.c" />
<ClCompile Include="..\src\audio\SDL_wave.c" />
<ClCompile Include="..\src\audio\wasapi\SDL_wasapi.c" />
<ClCompile Include="..\src\audio\wasapi\SDL_wasapi_winrt.cpp">
<CompileAsWinRT>true</CompileAsWinRT>
</ClCompile>
<ClCompile Include="..\src\core\windows\SDL_windows.c" />
<ClCompile Include="..\src\core\windows\SDL_xinput.c" />
<ClCompile Include="..\src\core\winrt\SDL_winrtapp_common.cpp">
<CompileAsWinRT>true</CompileAsWinRT>
</ClCompile>
<ClCompile Include="..\src\core\winrt\SDL_winrtapp_direct3d.cpp">
<CompileAsWinRT>true</CompileAsWinRT>
</ClCompile>
<ClCompile Include="..\src\core\winrt\SDL_winrtapp_xaml.cpp">
<CompileAsWinRT>true</CompileAsWinRT>
</ClCompile>
<ClCompile Include="..\src\cpuinfo\SDL_cpuinfo.c" />
<ClCompile Include="..\src\dynapi\SDL_dynapi.c" />
<ClCompile Include="..\src\events\SDL_clipboardevents.c" />
<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_gesture.c" />
<ClCompile Include="..\src\events\SDL_keyboard.c" />
<ClCompile Include="..\src\events\SDL_mouse.c" />
<ClCompile Include="..\src\events\SDL_quit.c" />
<ClCompile Include="..\src\events\SDL_touch.c" />
<ClCompile Include="..\src\events\SDL_windowevents.c" />
<ClCompile Include="..\src\filesystem\winrt\SDL_sysfilesystem.cpp">
<CompileAsWinRT>true</CompileAsWinRT>
</ClCompile>
<ClCompile Include="..\src\file\SDL_rwops.c" />
<ClCompile Include="..\src\haptic\dummy\SDL_syshaptic.c" />
<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\windows\SDL_xinputhaptic.c" />
<ClCompile Include="..\src\hidapi\SDL_hidapi.c" />
<ClCompile Include="..\src\joystick\dummy\SDL_sysjoystick.c" />
<ClCompile Include="..\src\joystick\controller_type.c" />
<ClCompile Include="..\src\joystick\SDL_gamecontroller.c" />
<ClCompile Include="..\src\joystick\SDL_joystick.c" />
<ClCompile Include="..\src\joystick\virtual\SDL_virtualjoystick.c" />
<ClCompile Include="..\src\joystick\windows\SDL_dinputjoystick.c" />
<ClCompile Include="..\src\joystick\windows\SDL_windowsjoystick.c" />
<ClCompile Include="..\src\joystick\windows\SDL_windows_gaming_input.c" />
<ClCompile Include="..\src\joystick\windows\SDL_xinputjoystick.c" />
<ClCompile Include="..\src\loadso\windows\SDL_sysloadso.c" />
<ClCompile Include="..\src\locale\SDL_locale.c" />
<ClCompile Include="..\src\locale\winrt\SDL_syslocale.c" />
<ClCompile Include="..\src\misc\SDL_url.c" />
<ClCompile Include="..\src\misc\winrt\SDL_sysurl.cpp">
<CompileAsWinRT>true</CompileAsWinRT>
</ClCompile>
<ClCompile Include="..\src\power\SDL_power.c" />
<ClCompile Include="..\src\power\winrt\SDL_syspower.cpp" />
<ClCompile Include="..\src\render\direct3d11\SDL_render_d3d11.c" />
<ClCompile Include="..\src\render\direct3d11\SDL_render_winrt.cpp">
<CompileAsWinRT>true</CompileAsWinRT>
</ClCompile>
<ClCompile Include="..\src\render\direct3d11\SDL_shaders_d3d11.c" />
<ClCompile Include="..\src\render\opengles2\SDL_render_gles2.c" />
<ClCompile Include="..\src\render\opengles2\SDL_shaders_gles2.c" />
<ClCompile Include="..\src\render\SDL_d3dmath.c" />
<ClCompile Include="..\src\render\SDL_render.c" />
<ClCompile Include="..\src\render\SDL_yuv_sw.c" />
<ClCompile Include="..\src\render\software\SDL_blendfillrect.c" />
<ClCompile Include="..\src\render\software\SDL_blendline.c" />
<ClCompile Include="..\src\render\software\SDL_blendpoint.c" />
<ClCompile Include="..\src\render\software\SDL_drawline.c" />
<ClCompile Include="..\src\render\software\SDL_drawpoint.c" />
<ClCompile Include="..\src\render\software\SDL_render_sw.c" />
<ClCompile Include="..\src\render\software\SDL_rotate.c" />
<ClCompile Include="..\src\render\software\SDL_triangle.c" />
<ClCompile Include="..\src\SDL.c" />
<ClCompile Include="..\src\SDL_assert.c" />
<ClCompile Include="..\src\SDL_dataqueue.c" />
<ClCompile Include="..\src\SDL_list.c" />
<ClCompile Include="..\src\SDL_error.c" />
<ClCompile Include="..\src\SDL_guid.c" />
<ClCompile Include="..\src\SDL_hints.c" />
<ClCompile Include="..\src\SDL_log.c" />
<ClCompile Include="..\src\SDL_utils.c" />
<ClCompile Include="..\src\sensor\dummy\SDL_dummysensor.c" />
<ClCompile Include="..\src\sensor\SDL_sensor.c" />
<ClCompile Include="..\src\stdlib\SDL_crc16.c" />
<ClCompile Include="..\src\stdlib\SDL_crc32.c" />
<ClCompile Include="..\src\stdlib\SDL_getenv.c" />
<ClCompile Include="..\src\stdlib\SDL_iconv.c" />
<ClCompile Include="..\src\stdlib\SDL_malloc.c" />
<ClCompile Include="..\src\stdlib\SDL_mslibc.c" />
<ClCompile Include="..\src\stdlib\SDL_qsort.c" />
<ClCompile Include="..\src\stdlib\SDL_stdlib.c" />
<ClCompile Include="..\src\stdlib\SDL_string.c" />
<ClCompile Include="..\src\stdlib\SDL_strtokr.c" />
<ClCompile Include="..\src\thread\generic\SDL_syssem.c" />
<ClCompile Include="..\src\thread\SDL_thread.c" />
<ClCompile Include="..\src\thread\stdcpp\SDL_syscond.cpp" />
<ClCompile Include="..\src\thread\stdcpp\SDL_sysmutex.cpp" />
<ClCompile Include="..\src\thread\stdcpp\SDL_systhread.cpp" />
<ClCompile Include="..\src\timer\SDL_timer.c" />
<ClCompile Include="..\src\timer\windows\SDL_systimer.c" />
<ClCompile Include="..\src\video\dummy\SDL_nullevents.c" />
<ClCompile Include="..\src\video\dummy\SDL_nullframebuffer.c" />
<ClCompile Include="..\src\video\dummy\SDL_nullvideo.c" />
<ClCompile Include="..\src\video\SDL_blit.c" />
<ClCompile Include="..\src\video\SDL_blit_0.c" />
<ClCompile Include="..\src\video\SDL_blit_1.c" />
<ClCompile Include="..\src\video\SDL_blit_A.c" />
<ClCompile Include="..\src\video\SDL_blit_auto.c" />
<ClCompile Include="..\src\video\SDL_blit_copy.c" />
<ClCompile Include="..\src\video\SDL_blit_N.c" />
<ClCompile Include="..\src\video\SDL_blit_slow.c" />
<ClCompile Include="..\src\video\SDL_bmp.c" />
<ClCompile Include="..\src\video\SDL_clipboard.c" />
<ClCompile Include="..\src\video\SDL_egl.c" />
<ClCompile Include="..\src\video\SDL_fillrect.c" />
<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_shape.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_yuv.c" />
<ClCompile Include="..\src\video\winrt\SDL_winrtevents.cpp">
<CompileAsWinRT>true</CompileAsWinRT>
</ClCompile>
<ClCompile Include="..\src\video\winrt\SDL_winrtgamebar.cpp">
<CompileAsWinRT>true</CompileAsWinRT>
</ClCompile>
<ClCompile Include="..\src\video\winrt\SDL_winrtkeyboard.cpp">
<CompileAsWinRT>true</CompileAsWinRT>
</ClCompile>
<ClCompile Include="..\src\video\winrt\SDL_winrtmessagebox.cpp">
<CompileAsWinRT>true</CompileAsWinRT>
</ClCompile>
<ClCompile Include="..\src\video\winrt\SDL_winrtmouse.cpp">
<CompileAsWinRT>true</CompileAsWinRT>
</ClCompile>
<ClCompile Include="..\src\video\winrt\SDL_winrtopengles.cpp">
<CompileAsWinRT>true</CompileAsWinRT>
</ClCompile>
<ClCompile Include="..\src\video\winrt\SDL_winrtpointerinput.cpp">
<CompileAsWinRT>true</CompileAsWinRT>
</ClCompile>
<ClCompile Include="..\src\video\winrt\SDL_winrtvideo.cpp">
<CompileAsWinRT>true</CompileAsWinRT>
</ClCompile>
<ClCompile Include="..\src\video\yuv2rgb\yuv_rgb.c" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{89e9b32e-a86a-47c3-a948-d2b1622925ce}</ProjectGuid>
<Keyword>DynamicLibrary</Keyword>
<ProjectName>SDL2-UWP</ProjectName>
<RootNamespace>SDL2</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<AppContainerApplication>true</AppContainerApplication>
<ApplicationType>Windows Store</ApplicationType>
<ApplicationTypeRevision>8.2</ApplicationTypeRevision>
<TargetPlatformVersion>10.0.16299.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<GenerateManifest>false</GenerateManifest>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
<TargetName>SDL2</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<GenerateManifest>false</GenerateManifest>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
<TargetName>SDL2</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<GenerateManifest>false</GenerateManifest>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
<TargetName>SDL2</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<GenerateManifest>false</GenerateManifest>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
<TargetName>SDL2</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<GenerateManifest>false</GenerateManifest>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
<TargetName>SDL2</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<GenerateManifest>false</GenerateManifest>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
<TargetName>SDL2</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<GenerateManifest>false</GenerateManifest>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
<TargetName>SDL2</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<GenerateManifest>false</GenerateManifest>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
<TargetName>SDL2</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalIncludeDirectories>..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>DLL_EXPORT;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
<AdditionalOptions>/nodefaultlib:vccorlibd /nodefaultlib:msvcrtd vccorlibd.lib msvcrtd.lib %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalIncludeDirectories>..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>DLL_EXPORT;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
<AdditionalOptions>/nodefaultlib:vccorlib /nodefaultlib:msvcrt vccorlib.lib msvcrt.lib %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|arm'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalIncludeDirectories>..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>DLL_EXPORT;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
<AdditionalOptions>/nodefaultlib:vccorlibd /nodefaultlib:msvcrtd vccorlibd.lib msvcrtd.lib %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|arm'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalIncludeDirectories>..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>DLL_EXPORT;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
<AdditionalOptions>/nodefaultlib:vccorlib /nodefaultlib:msvcrt vccorlib.lib msvcrt.lib %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|arm64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalIncludeDirectories>..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>DLL_EXPORT;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
<AdditionalOptions>/nodefaultlib:vccorlibd /nodefaultlib:msvcrtd vccorlibd.lib msvcrtd.lib %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|arm64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalIncludeDirectories>..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>DLL_EXPORT;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
<AdditionalOptions>/nodefaultlib:vccorlib /nodefaultlib:msvcrt vccorlib.lib msvcrt.lib %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalIncludeDirectories>..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>DLL_EXPORT;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
<AdditionalOptions>/nodefaultlib:vccorlibd /nodefaultlib:msvcrtd vccorlibd.lib msvcrtd.lib %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalIncludeDirectories>..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>DLL_EXPORT;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
<AdditionalOptions>/nodefaultlib:vccorlib /nodefaultlib:msvcrt vccorlib.lib msvcrt.lib %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,849 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Header Files">
<UniqueIdentifier>{fa0ff2df-c3d6-498a-96f1-1f88e7ce0da3}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files">
<UniqueIdentifier>{68e1b30b-19ed-4612-93e4-6260c5a979e5}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\begin_code.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\close_code.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_assert.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_atomic.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_audio.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_blendmode.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_clipboard.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_config.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_config_minimal.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_config_winrt.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_copying.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_cpuinfo.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_egl.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_endian.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_error.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_events.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_filesystem.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_guid.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_haptic.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_hints.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_hidapi.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_input.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_joystick.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_keyboard.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_keycode.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_loadso.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_locale.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_log.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_main.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_mouse.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_mutex.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_name.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_opengles2.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_pixels.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_platform.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_power.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_quit.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_rect.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_render.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_revision.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_rwops.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_scancode.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_shape.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_stdinc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_surface.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_system.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_syswm.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_thread.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_timer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_touch.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_types.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_version.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_video.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\joystick\SDL_gamecontrollerdb.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\audio\disk\SDL_diskaudio.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\audio\dummy\SDL_dummyaudio.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\audio\SDL_audiodev_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\audio\SDL_audio_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\audio\SDL_sysaudio.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\audio\SDL_wave.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\core\windows\SDL_directx.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\core\windows\SDL_windows.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\core\windows\SDL_xinput.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\core\winrt\SDL_winrtapp_common.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\core\winrt\SDL_winrtapp_direct3d.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\core\winrt\SDL_winrtapp_xaml.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\dynapi\SDL_dynapi.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\dynapi\SDL_dynapi_overrides.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\dynapi\SDL_dynapi_procs.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\events\blank_cursor.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\events\default_cursor.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\events\SDL_clipboardevents_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\events\SDL_dropevents_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\events\SDL_events_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\events\SDL_keyboard_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\events\SDL_mouse_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\events\SDL_touch_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\events\SDL_windowevents_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\haptic\SDL_haptic_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\haptic\SDL_syshaptic.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\joystick\SDL_joystick_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\joystick\SDL_sysjoystick.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\joystick\virtual\SDL_virtualjoystick_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\joystick\windows\SDL_dinputjoystick_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\joystick\windows\SDL_windowsjoystick_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\joystick\windows\SDL_xinputjoystick_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\render\direct3d11\SDL_render_winrt.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\render\opengles2\SDL_gles2funcs.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\render\opengles2\SDL_shaders_gles2.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\render\SDL_d3dmath.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\render\SDL_sysrender.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\render\SDL_yuv_sw_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\render\software\SDL_blendfillrect.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\render\software\SDL_blendline.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\render\software\SDL_blendpoint.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\render\software\SDL_draw.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\render\software\SDL_drawline.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\render\software\SDL_drawpoint.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\render\software\SDL_render_sw_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\render\software\SDL_rotate.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\render\software\SDL_triangle.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\SDL_assert_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\SDL_error_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\SDL_fatal.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\SDL_hints_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\SDL_internal.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\SDL_log_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\locale\SDL_syslocale.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\thread\SDL_systhread.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\thread\SDL_thread_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\thread\stdcpp\SDL_sysmutex_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\thread\stdcpp\SDL_systhread_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\timer\SDL_timer_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\video\dummy\SDL_nullevents_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\video\dummy\SDL_nullframebuffer_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\video\dummy\SDL_nullvideo.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\video\SDL_blit.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\video\SDL_blit_auto.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\video\SDL_blit_copy.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\video\SDL_blit_slow.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\video\SDL_egl_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\video\SDL_pixels_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\video\SDL_rect_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\video\SDL_RLEaccel_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\video\SDL_shape_internals.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\video\SDL_sysvideo.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\video\winrt\SDL_winrtevents_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\video\winrt\SDL_winrtmessagebox.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\video\winrt\SDL_winrtmouse_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\video\winrt\SDL_winrtopengles.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\video\winrt\SDL_winrtvideo_cpp.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\audio\wasapi\SDL_wasapi.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\video\winrt\SDL_winrtgamebar_cpp.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\SDL_dataqueue.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\SDL_list.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\haptic\windows\SDL_xinputhaptic_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\haptic\windows\SDL_dinputhaptic_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\haptic\windows\SDL_windowshaptic_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\video\SDL_yuv_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\video\yuv2rgb\yuv_rgb.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\render\direct3d11\SDL_shaders_d3d11.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_sensor.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\sensor\SDL_sensor_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\sensor\SDL_syssensor.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\sensor\dummy\SDL_dummysensor.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\src\events\SDL_displayevents_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\include\SDL_misc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClCompile Include="..\src\atomic\SDL_atomic.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\atomic\SDL_spinlock.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\audio\disk\SDL_diskaudio.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\audio\dummy\SDL_dummyaudio.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\audio\SDL_audio.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\audio\SDL_audiocvt.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\audio\SDL_audiodev.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\audio\SDL_audiotypecvt.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\audio\SDL_mixer.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\audio\SDL_wave.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\audio\wasapi\SDL_wasapi_winrt.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\core\windows\SDL_windows.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\core\windows\SDL_xinput.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\core\winrt\SDL_winrtapp_common.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\core\winrt\SDL_winrtapp_direct3d.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\core\winrt\SDL_winrtapp_xaml.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\cpuinfo\SDL_cpuinfo.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\dynapi\SDL_dynapi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\events\SDL_clipboardevents.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\events\SDL_dropevents.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\events\SDL_events.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\events\SDL_gesture.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\events\SDL_keyboard.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\events\SDL_mouse.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\events\SDL_quit.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\events\SDL_touch.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\events\SDL_windowevents.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\filesystem\winrt\SDL_sysfilesystem.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\file\SDL_rwops.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\haptic\dummy\SDL_syshaptic.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\haptic\SDL_haptic.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\hidapi\SDL_hidapi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\joystick\dummy\SDL_sysjoystick.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\joystick\SDL_gamecontroller.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\joystick\SDL_joystick.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\joystick\virtual\SDL_virtualjoystick.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\joystick\windows\SDL_dinputjoystick.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\joystick\windows\SDL_windowsjoystick.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\joystick\windows\SDL_xinputjoystick.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\loadso\windows\SDL_sysloadso.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\power\SDL_power.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\power\winrt\SDL_syspower.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\render\direct3d11\SDL_render_d3d11.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\render\direct3d11\SDL_render_winrt.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\render\opengles2\SDL_render_gles2.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\render\opengles2\SDL_shaders_gles2.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\render\SDL_d3dmath.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\render\SDL_render.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\render\SDL_yuv_sw.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\render\software\SDL_blendfillrect.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\render\software\SDL_blendline.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\render\software\SDL_blendpoint.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\render\software\SDL_drawline.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\render\software\SDL_drawpoint.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\render\software\SDL_render_sw.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\render\software\SDL_rotate.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\render\software\SDL_triangle.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\SDL.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\SDL_assert.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\SDL_error.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\SDL_guid.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\SDL_hints.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\SDL_log.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\locale\SDL_locale.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\locale\winrt\SDL_syslocale.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\stdlib\SDL_crc16.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\stdlib\SDL_crc32.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\stdlib\SDL_getenv.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\stdlib\SDL_iconv.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\stdlib\SDL_malloc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\stdlib\SDL_qsort.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\stdlib\SDL_stdlib.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\stdlib\SDL_string.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\stdlib\SDL_strtokr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\thread\generic\SDL_syssem.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\thread\SDL_thread.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\thread\stdcpp\SDL_syscond.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\thread\stdcpp\SDL_sysmutex.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\thread\stdcpp\SDL_systhread.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\timer\SDL_timer.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\timer\windows\SDL_systimer.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\video\dummy\SDL_nullevents.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\video\dummy\SDL_nullframebuffer.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\video\dummy\SDL_nullvideo.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\video\SDL_blit.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\video\SDL_blit_0.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\video\SDL_blit_1.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\video\SDL_blit_A.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\video\SDL_blit_auto.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\video\SDL_blit_copy.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\video\SDL_blit_N.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\video\SDL_blit_slow.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\video\SDL_bmp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\video\SDL_clipboard.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\video\SDL_egl.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\video\SDL_fillrect.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\video\SDL_pixels.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\video\SDL_rect.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\video\SDL_RLEaccel.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\video\SDL_shape.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\video\SDL_stretch.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\video\SDL_surface.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\video\SDL_video.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\video\winrt\SDL_winrtevents.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\video\winrt\SDL_winrtkeyboard.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\video\winrt\SDL_winrtmessagebox.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\video\winrt\SDL_winrtmouse.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\video\winrt\SDL_winrtopengles.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\video\winrt\SDL_winrtpointerinput.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\video\winrt\SDL_winrtvideo.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\audio\wasapi\SDL_wasapi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\video\winrt\SDL_winrtgamebar.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\SDL_dataqueue.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\SDL_list.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\SDL_utils.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\haptic\windows\SDL_dinputhaptic.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\haptic\windows\SDL_windowshaptic.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\haptic\windows\SDL_xinputhaptic.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\video\SDL_yuv.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\video\yuv2rgb\yuv_rgb.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\render\direct3d11\SDL_shaders_d3d11.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\sensor\SDL_sensor.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\sensor\dummy\SDL_dummysensor.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\events\SDL_displayevents.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\misc\winrt\SDL_sysurl.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\misc\SDL_url.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClInclude Include="..\src\joystick\controller_type.h">
<Filter>Source Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\joystick\windows\SDL_windows_gaming_input.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\joystick\controller_type.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\stdlib\SDL_mslibc.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -2,9 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{D69D5741-611F-4E14-8541-1FEE94F50B5A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2", "SDL\SDL.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2main", "SDLmain\SDLmain.vcxproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL3", "SDL\SDL.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "checkkeys", "tests\checkkeys\checkkeys.vcxproj", "{26828762-C95D-4637-9CB1-7F0979523813}"
EndProject
@@ -14,17 +12,15 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testatomic", "tests\testato
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testautomation", "tests\testautomation\testautomation.vcxproj", "{9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testdraw2", "tests\testdraw2\testdraw2.vcxproj", "{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testdialog", "tests\testdialog\testdialog.vcxproj", "{97A3A89B-E023-48CD-905F-CDBDE8D951DE}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testdraw", "tests\testdraw\testdraw.vcxproj", "{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testfile", "tests\testfile\testfile.vcxproj", "{CAE4F1D0-314F-4B10-805B-0EFD670133A0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgesture", "tests\testgesture\testgesture.vcxproj", "{79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgl", "tests\testgl\testgl.vcxproj", "{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgl2", "tests\testgl2\testgl2.vcxproj", "{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testjoystick", "tests\testjoystick\testjoystick.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08304}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testoverlay2", "tests\testoverlay2\testoverlay2.vcxproj", "{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testoverlay", "tests\testoverlay\testoverlay.vcxproj", "{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testplatform", "tests\testplatform\testplatform.vcxproj", "{26932B24-EFC6-4E3A-B277-ED653DA37968}"
EndProject
@@ -38,19 +34,17 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testscale", "tests\testscal
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testshape", "tests\testshape\testshape.vcxproj", "{31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite2", "tests\testsprite2\testsprite2.vcxproj", "{40FB7794-D3C3-4CFE-BCF4-A80C96635682}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite", "tests\testsprite\testsprite.vcxproj", "{40FB7794-D3C3-4CFE-BCF4-A80C96635682}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2test", "SDLtest\SDLtest.vcxproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL3_test", "SDL_test\SDL_test.vcxproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgamecontroller", "tests\testgamecontroller\testgamecontroller.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08305}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testcontroller", "tests\testcontroller\testcontroller.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08305}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgles2", "tests\testgles2\testgles2.vcxproj", "{E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "controllermap", "tests\controllermap\controllermap.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08306}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testvulkan", "tests\testvulkan\testvulkan.vcxproj", "{0D604DFD-AAB6-442C-9368-F91A344146AB}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testwm2", "tests\testwm2\testwm2.vcxproj", "{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A5}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testwm", "tests\testwm\testwm.vcxproj", "{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A5}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testyuv", "tests\testyuv\testyuv.vcxproj", "{40FB7794-D3C3-4CFE-BCF4-A80C97635682}"
EndProject
@@ -58,6 +52,85 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsensor", "tests\testsen
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsurround", "tests\testsurround\testsurround.vcxproj", "{70B894A9-E306-49E8-ABC2-932A952A5E5F}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testpen", "tests\testpen\testpen.vcxproj", "{C4E04D18-EF76-4B42-B4C2-16A1BACDC1A3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{1498F0CD-F4DA-4847-9CB2-FB18D48061D5}"
ProjectSection(SolutionItems) = preProject
examples\Directory.Build.props = examples\Directory.Build.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "audio", "audio", "{1B61A1B7-92DE-4C37-9151-D2928D6449AB}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "01-simple-playback", "examples\audio\01-simple-playback\01-simple-playback.vcxproj", "{EB448819-74BC-40C9-A61A-4D4ECD55F9D5}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "02-simple-playback-callback", "examples\audio\02-simple-playback-callback\02-simple-playback-callback.vcxproj", "{6B710DFF-8A4A-40A2-BF2D-88D266F3D4F0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "camera", "camera", "{AAEC8338-4D33-4AF5-9A1F-B9FF027D4607}"
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}") = "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
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "pen", "pen", "{F2247885-8EE8-42F4-A702-4155587620E0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "01-drawing-lines", "examples\pen\01-drawing-lines\01-drawing-lines.vcxproj", "{5EDA1ED3-8213-4C12-B0DF-B631EB611804}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "renderer", "renderer", "{F91DDAF0-B74F-4516-A1A9-42ED8DFCBF6A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "01-clear", "examples\renderer\01-clear\01-clear.vcxproj", "{896557AC-7575-480C-8FFD-AB08B5DA305D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "02-primitives", "examples\renderer\02-primitives\02-primitives.vcxproj", "{504DC7EC-D82E-448E-9C7D-3BE7981592B3}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "03-lines", "examples\renderer\03-lines\03-lines.vcxproj", "{BDE7DBC0-DCE7-432E-8750-C4AE55463699}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "04-points", "examples\renderer\04-points\04-points.vcxproj", "{7B250AB1-92D3-4F1A-BEB4-19605A69CEDB}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "05-rectangles", "examples\renderer\05-rectangles\05-rectangles.vcxproj", "{4C0E3A60-24F8-4D4C-81C0-C1777F5E7B17}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "06-textures", "examples\renderer\06-textures\06-textures.vcxproj", "{B3D61611-BFA3-4B66-ADC7-A3CE578A6D36}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "07-streaming-textures", "examples\renderer\07-streaming-textures\07-streaming-textures.vcxproj", "{540AE143-A58F-4D3B-B843-94EA8576522D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "08-rotating-textures", "examples\renderer\08-rotating-textures\08-rotating-textures.vcxproj", "{7091C001-3D71-47D4-B27B-E99271E5B987}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "09-scaling-textures", "examples\renderer\09-scaling-textures\09-scaling-textures.vcxproj", "{AF8BC84E-0268-4D1F-9503-84D9EE84C65F}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "10-geometry", "examples\renderer\10-geometry\10-geometry.vcxproj", "{8B9AB23E-3F40-4145-BA1C-B2CEACFBBD72}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "11-color-mods", "examples\renderer\11-color-mods\11-color-mods.vcxproj", "{E9C6A7A6-22C0-42E6-AC9C-8580A396D077}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "14-viewport", "examples\renderer\14-viewport\14-viewport.vcxproj", "{B85BC466-C7F0-4C6D-8ECF-ED57E775FC73}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "15-cliprect", "examples\renderer\15-cliprect\15-cliprect.vcxproj", "{9DBD962F-EA4D-44E3-8E8E-31D7F060A2DC}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "17-read-pixels", "examples\renderer\17-read-pixels\17-read-pixels.vcxproj", "{EEF00329-4598-4E34-B969-9DD4B0815E6C}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "18-debug-text", "examples\renderer\18-debug-text\18-debug-text.vcxproj", "{CC0714AA-8A81-4E29-BEC5-2E4FBC50E7FE}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "03-load-wav", "examples\audio\03-load-wav\03-load-wav.vcxproj", "{608C6C67-7766-471F-BBFF-8B00086039AF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "02-woodeneye-008", "examples\demo\02-woodeneye-008\02-woodeneye-008.vcxproj", "{A3F601E0-B54C-4DD8-8A97-FDEF7624EE60}"
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
@@ -74,14 +147,6 @@ Global
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.Build.0 = Release|Win32
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.ActiveCfg = Release|x64
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.Build.0 = Release|x64
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.ActiveCfg = Debug|Win32
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.Build.0 = Debug|Win32
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.ActiveCfg = Debug|x64
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.Build.0 = Debug|x64
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.ActiveCfg = Release|Win32
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.Build.0 = Release|Win32
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.ActiveCfg = Release|x64
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.Build.0 = Release|x64
{26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.ActiveCfg = Debug|Win32
{26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.Build.0 = Debug|Win32
{26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.ActiveCfg = Debug|x64
@@ -114,6 +179,14 @@ Global
{9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Release|Win32.Build.0 = Release|Win32
{9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Release|x64.ActiveCfg = Release|x64
{9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Release|x64.Build.0 = Release|x64
{97A3A89B-E023-48CD-905F-CDBDE8D951DE}.Debug|Win32.ActiveCfg = Debug|Win32
{97A3A89B-E023-48CD-905F-CDBDE8D951DE}.Debug|Win32.Build.0 = Debug|Win32
{97A3A89B-E023-48CD-905F-CDBDE8D951DE}.Debug|x64.ActiveCfg = Debug|x64
{97A3A89B-E023-48CD-905F-CDBDE8D951DE}.Debug|x64.Build.0 = Debug|x64
{97A3A89B-E023-48CD-905F-CDBDE8D951DE}.Release|Win32.ActiveCfg = Release|Win32
{97A3A89B-E023-48CD-905F-CDBDE8D951DE}.Release|Win32.Build.0 = Release|Win32
{97A3A89B-E023-48CD-905F-CDBDE8D951DE}.Release|x64.ActiveCfg = Release|x64
{97A3A89B-E023-48CD-905F-CDBDE8D951DE}.Release|x64.Build.0 = Release|x64
{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.ActiveCfg = Debug|Win32
{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.Build.0 = Debug|Win32
{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.ActiveCfg = Debug|x64
@@ -130,14 +203,6 @@ Global
{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.Build.0 = Release|Win32
{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|x64.ActiveCfg = Release|x64
{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|x64.Build.0 = Release|x64
{79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Debug|Win32.ActiveCfg = Debug|Win32
{79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Debug|Win32.Build.0 = Debug|Win32
{79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Debug|x64.ActiveCfg = Debug|x64
{79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Debug|x64.Build.0 = Debug|x64
{79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Release|Win32.ActiveCfg = Release|Win32
{79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Release|Win32.Build.0 = Release|Win32
{79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Release|x64.ActiveCfg = Release|x64
{79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Release|x64.Build.0 = Release|x64
{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.ActiveCfg = Debug|Win32
{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.Build.0 = Debug|Win32
{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.ActiveCfg = Debug|x64
@@ -146,14 +211,6 @@ Global
{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.Build.0 = Release|Win32
{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|x64.ActiveCfg = Release|x64
{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|x64.Build.0 = Release|x64
{55812185-D13C-4022-9C81-32E0F4A08304}.Debug|Win32.ActiveCfg = Debug|Win32
{55812185-D13C-4022-9C81-32E0F4A08304}.Debug|Win32.Build.0 = Debug|Win32
{55812185-D13C-4022-9C81-32E0F4A08304}.Debug|x64.ActiveCfg = Debug|x64
{55812185-D13C-4022-9C81-32E0F4A08304}.Debug|x64.Build.0 = Debug|x64
{55812185-D13C-4022-9C81-32E0F4A08304}.Release|Win32.ActiveCfg = Release|Win32
{55812185-D13C-4022-9C81-32E0F4A08304}.Release|Win32.Build.0 = Release|Win32
{55812185-D13C-4022-9C81-32E0F4A08304}.Release|x64.ActiveCfg = Release|x64
{55812185-D13C-4022-9C81-32E0F4A08304}.Release|x64.Build.0 = Release|x64
{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Debug|Win32.ActiveCfg = Debug|Win32
{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Debug|Win32.Build.0 = Debug|Win32
{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Debug|x64.ActiveCfg = Debug|x64
@@ -242,14 +299,6 @@ Global
{E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}.Release|Win32.Build.0 = Release|Win32
{E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}.Release|x64.ActiveCfg = Release|x64
{E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}.Release|x64.Build.0 = Release|x64
{55812185-D13C-4022-9C81-32E0F4A08306}.Debug|Win32.ActiveCfg = Debug|Win32
{55812185-D13C-4022-9C81-32E0F4A08306}.Debug|Win32.Build.0 = Debug|Win32
{55812185-D13C-4022-9C81-32E0F4A08306}.Debug|x64.ActiveCfg = Debug|x64
{55812185-D13C-4022-9C81-32E0F4A08306}.Debug|x64.Build.0 = Debug|x64
{55812185-D13C-4022-9C81-32E0F4A08306}.Release|Win32.ActiveCfg = Release|Win32
{55812185-D13C-4022-9C81-32E0F4A08306}.Release|Win32.Build.0 = Release|Win32
{55812185-D13C-4022-9C81-32E0F4A08306}.Release|x64.ActiveCfg = Release|x64
{55812185-D13C-4022-9C81-32E0F4A08306}.Release|x64.Build.0 = Release|x64
{0D604DFD-AAB6-442C-9368-F91A344146AB}.Debug|Win32.ActiveCfg = Debug|Win32
{0D604DFD-AAB6-442C-9368-F91A344146AB}.Debug|Win32.Build.0 = Debug|Win32
{0D604DFD-AAB6-442C-9368-F91A344146AB}.Debug|x64.ActiveCfg = Debug|x64
@@ -290,6 +339,246 @@ Global
{70B894A9-E306-49E8-ABC2-932A952A5E5F}.Release|Win32.Build.0 = Release|Win32
{70B894A9-E306-49E8-ABC2-932A952A5E5F}.Release|x64.ActiveCfg = Release|x64
{70B894A9-E306-49E8-ABC2-932A952A5E5F}.Release|x64.Build.0 = Release|x64
{C4E04D18-EF76-4B42-B4C2-16A1BACDC1A3}.Debug|Win32.ActiveCfg = Debug|Win32
{C4E04D18-EF76-4B42-B4C2-16A1BACDC1A3}.Debug|Win32.Build.0 = Debug|Win32
{C4E04D18-EF76-4B42-B4C2-16A1BACDC1A3}.Debug|x64.ActiveCfg = Debug|x64
{C4E04D18-EF76-4B42-B4C2-16A1BACDC1A3}.Debug|x64.Build.0 = Debug|x64
{C4E04D18-EF76-4B42-B4C2-16A1BACDC1A3}.Release|Win32.ActiveCfg = Release|Win32
{C4E04D18-EF76-4B42-B4C2-16A1BACDC1A3}.Release|Win32.Build.0 = Release|Win32
{C4E04D18-EF76-4B42-B4C2-16A1BACDC1A3}.Release|x64.ActiveCfg = Release|x64
{C4E04D18-EF76-4B42-B4C2-16A1BACDC1A3}.Release|x64.Build.0 = Release|x64
{EB448819-74BC-40C9-A61A-4D4ECD55F9D5}.Debug|Win32.ActiveCfg = Debug|Win32
{EB448819-74BC-40C9-A61A-4D4ECD55F9D5}.Debug|Win32.Build.0 = Debug|Win32
{EB448819-74BC-40C9-A61A-4D4ECD55F9D5}.Debug|x64.ActiveCfg = Debug|x64
{EB448819-74BC-40C9-A61A-4D4ECD55F9D5}.Debug|x64.Build.0 = Debug|x64
{EB448819-74BC-40C9-A61A-4D4ECD55F9D5}.Release|Win32.ActiveCfg = Release|Win32
{EB448819-74BC-40C9-A61A-4D4ECD55F9D5}.Release|Win32.Build.0 = Release|Win32
{EB448819-74BC-40C9-A61A-4D4ECD55F9D5}.Release|x64.ActiveCfg = Release|x64
{EB448819-74BC-40C9-A61A-4D4ECD55F9D5}.Release|x64.Build.0 = Release|x64
{6B710DFF-8A4A-40A2-BF2D-88D266F3D4F0}.Debug|Win32.ActiveCfg = Debug|Win32
{6B710DFF-8A4A-40A2-BF2D-88D266F3D4F0}.Debug|Win32.Build.0 = Debug|Win32
{6B710DFF-8A4A-40A2-BF2D-88D266F3D4F0}.Debug|x64.ActiveCfg = Debug|x64
{6B710DFF-8A4A-40A2-BF2D-88D266F3D4F0}.Debug|x64.Build.0 = Debug|x64
{6B710DFF-8A4A-40A2-BF2D-88D266F3D4F0}.Release|Win32.ActiveCfg = Release|Win32
{6B710DFF-8A4A-40A2-BF2D-88D266F3D4F0}.Release|Win32.Build.0 = Release|Win32
{6B710DFF-8A4A-40A2-BF2D-88D266F3D4F0}.Release|x64.ActiveCfg = Release|x64
{6B710DFF-8A4A-40A2-BF2D-88D266F3D4F0}.Release|x64.Build.0 = Release|x64
{510ACF0C-4012-4216-98EF-E4F155DE33CE}.Debug|Win32.ActiveCfg = Debug|Win32
{510ACF0C-4012-4216-98EF-E4F155DE33CE}.Debug|Win32.Build.0 = Debug|Win32
{510ACF0C-4012-4216-98EF-E4F155DE33CE}.Debug|x64.ActiveCfg = Debug|x64
{510ACF0C-4012-4216-98EF-E4F155DE33CE}.Debug|x64.Build.0 = Debug|x64
{510ACF0C-4012-4216-98EF-E4F155DE33CE}.Release|Win32.ActiveCfg = Release|Win32
{510ACF0C-4012-4216-98EF-E4F155DE33CE}.Release|Win32.Build.0 = Release|Win32
{510ACF0C-4012-4216-98EF-E4F155DE33CE}.Release|x64.ActiveCfg = Release|x64
{510ACF0C-4012-4216-98EF-E4F155DE33CE}.Release|x64.Build.0 = Release|x64
{7820969A-5B7B-4046-BB0A-82905D457FC5}.Debug|Win32.ActiveCfg = Debug|Win32
{7820969A-5B7B-4046-BB0A-82905D457FC5}.Debug|Win32.Build.0 = Debug|Win32
{7820969A-5B7B-4046-BB0A-82905D457FC5}.Debug|x64.ActiveCfg = Debug|x64
{7820969A-5B7B-4046-BB0A-82905D457FC5}.Debug|x64.Build.0 = Debug|x64
{7820969A-5B7B-4046-BB0A-82905D457FC5}.Release|Win32.ActiveCfg = Release|Win32
{7820969A-5B7B-4046-BB0A-82905D457FC5}.Release|Win32.Build.0 = Release|Win32
{7820969A-5B7B-4046-BB0A-82905D457FC5}.Release|x64.ActiveCfg = Release|x64
{7820969A-5B7B-4046-BB0A-82905D457FC5}.Release|x64.Build.0 = Release|x64
{5EDA1ED3-8213-4C12-B0DF-B631EB611804}.Debug|Win32.ActiveCfg = Debug|Win32
{5EDA1ED3-8213-4C12-B0DF-B631EB611804}.Debug|Win32.Build.0 = Debug|Win32
{5EDA1ED3-8213-4C12-B0DF-B631EB611804}.Debug|x64.ActiveCfg = Debug|x64
{5EDA1ED3-8213-4C12-B0DF-B631EB611804}.Debug|x64.Build.0 = Debug|x64
{5EDA1ED3-8213-4C12-B0DF-B631EB611804}.Release|Win32.ActiveCfg = Release|Win32
{5EDA1ED3-8213-4C12-B0DF-B631EB611804}.Release|Win32.Build.0 = Release|Win32
{5EDA1ED3-8213-4C12-B0DF-B631EB611804}.Release|x64.ActiveCfg = Release|x64
{5EDA1ED3-8213-4C12-B0DF-B631EB611804}.Release|x64.Build.0 = Release|x64
{896557AC-7575-480C-8FFD-AB08B5DA305D}.Debug|Win32.ActiveCfg = Debug|Win32
{896557AC-7575-480C-8FFD-AB08B5DA305D}.Debug|Win32.Build.0 = Debug|Win32
{896557AC-7575-480C-8FFD-AB08B5DA305D}.Debug|x64.ActiveCfg = Debug|x64
{896557AC-7575-480C-8FFD-AB08B5DA305D}.Debug|x64.Build.0 = Debug|x64
{896557AC-7575-480C-8FFD-AB08B5DA305D}.Release|Win32.ActiveCfg = Release|Win32
{896557AC-7575-480C-8FFD-AB08B5DA305D}.Release|Win32.Build.0 = Release|Win32
{896557AC-7575-480C-8FFD-AB08B5DA305D}.Release|x64.ActiveCfg = Release|x64
{896557AC-7575-480C-8FFD-AB08B5DA305D}.Release|x64.Build.0 = Release|x64
{504DC7EC-D82E-448E-9C7D-3BE7981592B3}.Debug|Win32.ActiveCfg = Debug|Win32
{504DC7EC-D82E-448E-9C7D-3BE7981592B3}.Debug|Win32.Build.0 = Debug|Win32
{504DC7EC-D82E-448E-9C7D-3BE7981592B3}.Debug|x64.ActiveCfg = Debug|x64
{504DC7EC-D82E-448E-9C7D-3BE7981592B3}.Debug|x64.Build.0 = Debug|x64
{504DC7EC-D82E-448E-9C7D-3BE7981592B3}.Release|Win32.ActiveCfg = Release|Win32
{504DC7EC-D82E-448E-9C7D-3BE7981592B3}.Release|Win32.Build.0 = Release|Win32
{504DC7EC-D82E-448E-9C7D-3BE7981592B3}.Release|x64.ActiveCfg = Release|x64
{504DC7EC-D82E-448E-9C7D-3BE7981592B3}.Release|x64.Build.0 = Release|x64
{BDE7DBC0-DCE7-432E-8750-C4AE55463699}.Debug|Win32.ActiveCfg = Debug|Win32
{BDE7DBC0-DCE7-432E-8750-C4AE55463699}.Debug|Win32.Build.0 = Debug|Win32
{BDE7DBC0-DCE7-432E-8750-C4AE55463699}.Debug|x64.ActiveCfg = Debug|x64
{BDE7DBC0-DCE7-432E-8750-C4AE55463699}.Debug|x64.Build.0 = Debug|x64
{BDE7DBC0-DCE7-432E-8750-C4AE55463699}.Release|Win32.ActiveCfg = Release|Win32
{BDE7DBC0-DCE7-432E-8750-C4AE55463699}.Release|Win32.Build.0 = Release|Win32
{BDE7DBC0-DCE7-432E-8750-C4AE55463699}.Release|x64.ActiveCfg = Release|x64
{BDE7DBC0-DCE7-432E-8750-C4AE55463699}.Release|x64.Build.0 = Release|x64
{7B250AB1-92D3-4F1A-BEB4-19605A69CEDB}.Debug|Win32.ActiveCfg = Debug|Win32
{7B250AB1-92D3-4F1A-BEB4-19605A69CEDB}.Debug|Win32.Build.0 = Debug|Win32
{7B250AB1-92D3-4F1A-BEB4-19605A69CEDB}.Debug|x64.ActiveCfg = Debug|x64
{7B250AB1-92D3-4F1A-BEB4-19605A69CEDB}.Debug|x64.Build.0 = Debug|x64
{7B250AB1-92D3-4F1A-BEB4-19605A69CEDB}.Release|Win32.ActiveCfg = Release|Win32
{7B250AB1-92D3-4F1A-BEB4-19605A69CEDB}.Release|Win32.Build.0 = Release|Win32
{7B250AB1-92D3-4F1A-BEB4-19605A69CEDB}.Release|x64.ActiveCfg = Release|x64
{7B250AB1-92D3-4F1A-BEB4-19605A69CEDB}.Release|x64.Build.0 = Release|x64
{4C0E3A60-24F8-4D4C-81C0-C1777F5E7B17}.Debug|Win32.ActiveCfg = Debug|Win32
{4C0E3A60-24F8-4D4C-81C0-C1777F5E7B17}.Debug|Win32.Build.0 = Debug|Win32
{4C0E3A60-24F8-4D4C-81C0-C1777F5E7B17}.Debug|x64.ActiveCfg = Debug|x64
{4C0E3A60-24F8-4D4C-81C0-C1777F5E7B17}.Debug|x64.Build.0 = Debug|x64
{4C0E3A60-24F8-4D4C-81C0-C1777F5E7B17}.Release|Win32.ActiveCfg = Release|Win32
{4C0E3A60-24F8-4D4C-81C0-C1777F5E7B17}.Release|Win32.Build.0 = Release|Win32
{4C0E3A60-24F8-4D4C-81C0-C1777F5E7B17}.Release|x64.ActiveCfg = Release|x64
{4C0E3A60-24F8-4D4C-81C0-C1777F5E7B17}.Release|x64.Build.0 = Release|x64
{B3D61611-BFA3-4B66-ADC7-A3CE578A6D36}.Debug|Win32.ActiveCfg = Debug|Win32
{B3D61611-BFA3-4B66-ADC7-A3CE578A6D36}.Debug|Win32.Build.0 = Debug|Win32
{B3D61611-BFA3-4B66-ADC7-A3CE578A6D36}.Debug|x64.ActiveCfg = Debug|x64
{B3D61611-BFA3-4B66-ADC7-A3CE578A6D36}.Debug|x64.Build.0 = Debug|x64
{B3D61611-BFA3-4B66-ADC7-A3CE578A6D36}.Release|Win32.ActiveCfg = Release|Win32
{B3D61611-BFA3-4B66-ADC7-A3CE578A6D36}.Release|Win32.Build.0 = Release|Win32
{B3D61611-BFA3-4B66-ADC7-A3CE578A6D36}.Release|x64.ActiveCfg = Release|x64
{B3D61611-BFA3-4B66-ADC7-A3CE578A6D36}.Release|x64.Build.0 = Release|x64
{540AE143-A58F-4D3B-B843-94EA8576522D}.Debug|Win32.ActiveCfg = Debug|Win32
{540AE143-A58F-4D3B-B843-94EA8576522D}.Debug|Win32.Build.0 = Debug|Win32
{540AE143-A58F-4D3B-B843-94EA8576522D}.Debug|x64.ActiveCfg = Debug|x64
{540AE143-A58F-4D3B-B843-94EA8576522D}.Debug|x64.Build.0 = Debug|x64
{540AE143-A58F-4D3B-B843-94EA8576522D}.Release|Win32.ActiveCfg = Release|Win32
{540AE143-A58F-4D3B-B843-94EA8576522D}.Release|Win32.Build.0 = Release|Win32
{540AE143-A58F-4D3B-B843-94EA8576522D}.Release|x64.ActiveCfg = Release|x64
{540AE143-A58F-4D3B-B843-94EA8576522D}.Release|x64.Build.0 = Release|x64
{7091C001-3D71-47D4-B27B-E99271E5B987}.Debug|Win32.ActiveCfg = Debug|Win32
{7091C001-3D71-47D4-B27B-E99271E5B987}.Debug|Win32.Build.0 = Debug|Win32
{7091C001-3D71-47D4-B27B-E99271E5B987}.Debug|x64.ActiveCfg = Debug|x64
{7091C001-3D71-47D4-B27B-E99271E5B987}.Debug|x64.Build.0 = Debug|x64
{7091C001-3D71-47D4-B27B-E99271E5B987}.Release|Win32.ActiveCfg = Release|Win32
{7091C001-3D71-47D4-B27B-E99271E5B987}.Release|Win32.Build.0 = Release|Win32
{7091C001-3D71-47D4-B27B-E99271E5B987}.Release|x64.ActiveCfg = Release|x64
{7091C001-3D71-47D4-B27B-E99271E5B987}.Release|x64.Build.0 = Release|x64
{AF8BC84E-0268-4D1F-9503-84D9EE84C65F}.Debug|Win32.ActiveCfg = Debug|Win32
{AF8BC84E-0268-4D1F-9503-84D9EE84C65F}.Debug|Win32.Build.0 = Debug|Win32
{AF8BC84E-0268-4D1F-9503-84D9EE84C65F}.Debug|x64.ActiveCfg = Debug|x64
{AF8BC84E-0268-4D1F-9503-84D9EE84C65F}.Debug|x64.Build.0 = Debug|x64
{AF8BC84E-0268-4D1F-9503-84D9EE84C65F}.Release|Win32.ActiveCfg = Release|Win32
{AF8BC84E-0268-4D1F-9503-84D9EE84C65F}.Release|Win32.Build.0 = Release|Win32
{AF8BC84E-0268-4D1F-9503-84D9EE84C65F}.Release|x64.ActiveCfg = Release|x64
{AF8BC84E-0268-4D1F-9503-84D9EE84C65F}.Release|x64.Build.0 = Release|x64
{8B9AB23E-3F40-4145-BA1C-B2CEACFBBD72}.Debug|Win32.ActiveCfg = Debug|Win32
{8B9AB23E-3F40-4145-BA1C-B2CEACFBBD72}.Debug|Win32.Build.0 = Debug|Win32
{8B9AB23E-3F40-4145-BA1C-B2CEACFBBD72}.Debug|x64.ActiveCfg = Debug|x64
{8B9AB23E-3F40-4145-BA1C-B2CEACFBBD72}.Debug|x64.Build.0 = Debug|x64
{8B9AB23E-3F40-4145-BA1C-B2CEACFBBD72}.Release|Win32.ActiveCfg = Release|Win32
{8B9AB23E-3F40-4145-BA1C-B2CEACFBBD72}.Release|Win32.Build.0 = Release|Win32
{8B9AB23E-3F40-4145-BA1C-B2CEACFBBD72}.Release|x64.ActiveCfg = Release|x64
{8B9AB23E-3F40-4145-BA1C-B2CEACFBBD72}.Release|x64.Build.0 = Release|x64
{E9C6A7A6-22C0-42E6-AC9C-8580A396D077}.Debug|Win32.ActiveCfg = Debug|Win32
{E9C6A7A6-22C0-42E6-AC9C-8580A396D077}.Debug|Win32.Build.0 = Debug|Win32
{E9C6A7A6-22C0-42E6-AC9C-8580A396D077}.Debug|x64.ActiveCfg = Debug|x64
{E9C6A7A6-22C0-42E6-AC9C-8580A396D077}.Debug|x64.Build.0 = Debug|x64
{E9C6A7A6-22C0-42E6-AC9C-8580A396D077}.Release|Win32.ActiveCfg = Release|Win32
{E9C6A7A6-22C0-42E6-AC9C-8580A396D077}.Release|Win32.Build.0 = Release|Win32
{E9C6A7A6-22C0-42E6-AC9C-8580A396D077}.Release|x64.ActiveCfg = Release|x64
{E9C6A7A6-22C0-42E6-AC9C-8580A396D077}.Release|x64.Build.0 = Release|x64
{B85BC466-C7F0-4C6D-8ECF-ED57E775FC73}.Debug|Win32.ActiveCfg = Debug|Win32
{B85BC466-C7F0-4C6D-8ECF-ED57E775FC73}.Debug|Win32.Build.0 = Debug|Win32
{B85BC466-C7F0-4C6D-8ECF-ED57E775FC73}.Debug|x64.ActiveCfg = Debug|x64
{B85BC466-C7F0-4C6D-8ECF-ED57E775FC73}.Debug|x64.Build.0 = Debug|x64
{B85BC466-C7F0-4C6D-8ECF-ED57E775FC73}.Release|Win32.ActiveCfg = Release|Win32
{B85BC466-C7F0-4C6D-8ECF-ED57E775FC73}.Release|Win32.Build.0 = Release|Win32
{B85BC466-C7F0-4C6D-8ECF-ED57E775FC73}.Release|x64.ActiveCfg = Release|x64
{B85BC466-C7F0-4C6D-8ECF-ED57E775FC73}.Release|x64.Build.0 = Release|x64
{9DBD962F-EA4D-44E3-8E8E-31D7F060A2DC}.Debug|Win32.ActiveCfg = Debug|Win32
{9DBD962F-EA4D-44E3-8E8E-31D7F060A2DC}.Debug|Win32.Build.0 = Debug|Win32
{9DBD962F-EA4D-44E3-8E8E-31D7F060A2DC}.Debug|x64.ActiveCfg = Debug|x64
{9DBD962F-EA4D-44E3-8E8E-31D7F060A2DC}.Debug|x64.Build.0 = Debug|x64
{9DBD962F-EA4D-44E3-8E8E-31D7F060A2DC}.Release|Win32.ActiveCfg = Release|Win32
{9DBD962F-EA4D-44E3-8E8E-31D7F060A2DC}.Release|Win32.Build.0 = Release|Win32
{9DBD962F-EA4D-44E3-8E8E-31D7F060A2DC}.Release|x64.ActiveCfg = Release|x64
{9DBD962F-EA4D-44E3-8E8E-31D7F060A2DC}.Release|x64.Build.0 = Release|x64
{EEF00329-4598-4E34-B969-9DD4B0815E6C}.Debug|Win32.ActiveCfg = Debug|Win32
{EEF00329-4598-4E34-B969-9DD4B0815E6C}.Debug|Win32.Build.0 = Debug|Win32
{EEF00329-4598-4E34-B969-9DD4B0815E6C}.Debug|x64.ActiveCfg = Debug|x64
{EEF00329-4598-4E34-B969-9DD4B0815E6C}.Debug|x64.Build.0 = Debug|x64
{EEF00329-4598-4E34-B969-9DD4B0815E6C}.Release|Win32.ActiveCfg = Release|Win32
{EEF00329-4598-4E34-B969-9DD4B0815E6C}.Release|Win32.Build.0 = Release|Win32
{EEF00329-4598-4E34-B969-9DD4B0815E6C}.Release|x64.ActiveCfg = Release|x64
{EEF00329-4598-4E34-B969-9DD4B0815E6C}.Release|x64.Build.0 = Release|x64
{CC0714AA-8A81-4E29-BEC5-2E4FBC50E7FE}.Debug|Win32.ActiveCfg = Debug|Win32
{CC0714AA-8A81-4E29-BEC5-2E4FBC50E7FE}.Debug|Win32.Build.0 = Debug|Win32
{CC0714AA-8A81-4E29-BEC5-2E4FBC50E7FE}.Debug|x64.ActiveCfg = Debug|x64
{CC0714AA-8A81-4E29-BEC5-2E4FBC50E7FE}.Debug|x64.Build.0 = Debug|x64
{CC0714AA-8A81-4E29-BEC5-2E4FBC50E7FE}.Release|Win32.ActiveCfg = Release|Win32
{CC0714AA-8A81-4E29-BEC5-2E4FBC50E7FE}.Release|Win32.Build.0 = Release|Win32
{CC0714AA-8A81-4E29-BEC5-2E4FBC50E7FE}.Release|x64.ActiveCfg = Release|x64
{CC0714AA-8A81-4E29-BEC5-2E4FBC50E7FE}.Release|x64.Build.0 = Release|x64
{608C6C67-7766-471F-BBFF-8B00086039AF}.Debug|Win32.ActiveCfg = Debug|Win32
{608C6C67-7766-471F-BBFF-8B00086039AF}.Debug|Win32.Build.0 = Debug|Win32
{608C6C67-7766-471F-BBFF-8B00086039AF}.Debug|x64.ActiveCfg = Debug|x64
{608C6C67-7766-471F-BBFF-8B00086039AF}.Debug|x64.Build.0 = Debug|x64
{608C6C67-7766-471F-BBFF-8B00086039AF}.Release|Win32.ActiveCfg = Release|Win32
{608C6C67-7766-471F-BBFF-8B00086039AF}.Release|Win32.Build.0 = Release|Win32
{608C6C67-7766-471F-BBFF-8B00086039AF}.Release|x64.ActiveCfg = Release|x64
{608C6C67-7766-471F-BBFF-8B00086039AF}.Release|x64.Build.0 = Release|x64
{A3F601E0-B54C-4DD8-8A97-FDEF7624EE60}.Debug|Win32.ActiveCfg = Debug|Win32
{A3F601E0-B54C-4DD8-8A97-FDEF7624EE60}.Debug|Win32.Build.0 = Debug|Win32
{A3F601E0-B54C-4DD8-8A97-FDEF7624EE60}.Debug|x64.ActiveCfg = Debug|x64
{A3F601E0-B54C-4DD8-8A97-FDEF7624EE60}.Debug|x64.Build.0 = Debug|x64
{A3F601E0-B54C-4DD8-8A97-FDEF7624EE60}.Release|Win32.ActiveCfg = Release|Win32
{A3F601E0-B54C-4DD8-8A97-FDEF7624EE60}.Release|Win32.Build.0 = Release|Win32
{A3F601E0-B54C-4DD8-8A97-FDEF7624EE60}.Release|x64.ActiveCfg = Release|x64
{A3F601E0-B54C-4DD8-8A97-FDEF7624EE60}.Release|x64.Build.0 = Release|x64
{75AEE75A-C016-4497-960B-D767B822237D}.Debug|Win32.ActiveCfg = Debug|Win32
{75AEE75A-C016-4497-960B-D767B822237D}.Debug|Win32.Build.0 = Debug|Win32
{75AEE75A-C016-4497-960B-D767B822237D}.Debug|x64.ActiveCfg = Debug|x64
{75AEE75A-C016-4497-960B-D767B822237D}.Debug|x64.Build.0 = Debug|x64
{75AEE75A-C016-4497-960B-D767B822237D}.Release|Win32.ActiveCfg = Release|Win32
{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
@@ -299,11 +588,10 @@ Global
{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
{66B32F7E-5716-48D0-B5B9-D832FD052DD5} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
{9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
{97A3A89B-E023-48CD-905F-CDBDE8D951DE} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
{CAE4F1D0-314F-4B10-805B-0EFD670133A0} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
{79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
{8B5CFB38-CCBA-40A8-AD7A-89C57B070884} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
{55812185-D13C-4022-9C81-32E0F4A08304} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
{26932B24-EFC6-4E3A-B277-ED653DA37968} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
@@ -314,12 +602,48 @@ Global
{40FB7794-D3C3-4CFE-BCF4-A80C96635682} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
{55812185-D13C-4022-9C81-32E0F4A08305} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
{E9558DFE-1961-4DD4-B09B-DD0EEFD5C315} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
{55812185-D13C-4022-9C81-32E0F4A08306} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
{0D604DFD-AAB6-442C-9368-F91A344146AB} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A5} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
{40FB7794-D3C3-4CFE-BCF4-A80C97635682} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A4} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
{70B894A9-E306-49E8-ABC2-932A952A5E5F} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
{C4E04D18-EF76-4B42-B4C2-16A1BACDC1A3} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
{1B61A1B7-92DE-4C37-9151-D2928D6449AB} = {1498F0CD-F4DA-4847-9CB2-FB18D48061D5}
{EB448819-74BC-40C9-A61A-4D4ECD55F9D5} = {1B61A1B7-92DE-4C37-9151-D2928D6449AB}
{6B710DFF-8A4A-40A2-BF2D-88D266F3D4F0} = {1B61A1B7-92DE-4C37-9151-D2928D6449AB}
{AAEC8338-4D33-4AF5-9A1F-B9FF027D4607} = {1498F0CD-F4DA-4847-9CB2-FB18D48061D5}
{510ACF0C-4012-4216-98EF-E4F155DE33CE} = {AAEC8338-4D33-4AF5-9A1F-B9FF027D4607}
{D1BF59F6-22DC-493B-BDEB-451A50DA793D} = {1498F0CD-F4DA-4847-9CB2-FB18D48061D5}
{7820969A-5B7B-4046-BB0A-82905D457FC5} = {D1BF59F6-22DC-493B-BDEB-451A50DA793D}
{F2247885-8EE8-42F4-A702-4155587620E0} = {1498F0CD-F4DA-4847-9CB2-FB18D48061D5}
{5EDA1ED3-8213-4C12-B0DF-B631EB611804} = {F2247885-8EE8-42F4-A702-4155587620E0}
{F91DDAF0-B74F-4516-A1A9-42ED8DFCBF6A} = {1498F0CD-F4DA-4847-9CB2-FB18D48061D5}
{896557AC-7575-480C-8FFD-AB08B5DA305D} = {F91DDAF0-B74F-4516-A1A9-42ED8DFCBF6A}
{504DC7EC-D82E-448E-9C7D-3BE7981592B3} = {F91DDAF0-B74F-4516-A1A9-42ED8DFCBF6A}
{BDE7DBC0-DCE7-432E-8750-C4AE55463699} = {F91DDAF0-B74F-4516-A1A9-42ED8DFCBF6A}
{7B250AB1-92D3-4F1A-BEB4-19605A69CEDB} = {F91DDAF0-B74F-4516-A1A9-42ED8DFCBF6A}
{4C0E3A60-24F8-4D4C-81C0-C1777F5E7B17} = {F91DDAF0-B74F-4516-A1A9-42ED8DFCBF6A}
{B3D61611-BFA3-4B66-ADC7-A3CE578A6D36} = {F91DDAF0-B74F-4516-A1A9-42ED8DFCBF6A}
{540AE143-A58F-4D3B-B843-94EA8576522D} = {F91DDAF0-B74F-4516-A1A9-42ED8DFCBF6A}
{7091C001-3D71-47D4-B27B-E99271E5B987} = {F91DDAF0-B74F-4516-A1A9-42ED8DFCBF6A}
{AF8BC84E-0268-4D1F-9503-84D9EE84C65F} = {F91DDAF0-B74F-4516-A1A9-42ED8DFCBF6A}
{8B9AB23E-3F40-4145-BA1C-B2CEACFBBD72} = {F91DDAF0-B74F-4516-A1A9-42ED8DFCBF6A}
{E9C6A7A6-22C0-42E6-AC9C-8580A396D077} = {F91DDAF0-B74F-4516-A1A9-42ED8DFCBF6A}
{B85BC466-C7F0-4C6D-8ECF-ED57E775FC73} = {F91DDAF0-B74F-4516-A1A9-42ED8DFCBF6A}
{9DBD962F-EA4D-44E3-8E8E-31D7F060A2DC} = {F91DDAF0-B74F-4516-A1A9-42ED8DFCBF6A}
{EEF00329-4598-4E34-B969-9DD4B0815E6C} = {F91DDAF0-B74F-4516-A1A9-42ED8DFCBF6A}
{CC0714AA-8A81-4E29-BEC5-2E4FBC50E7FE} = {F91DDAF0-B74F-4516-A1A9-42ED8DFCBF6A}
{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

@@ -19,7 +19,7 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>SDL2</ProjectName>
<ProjectName>SDL3</ProjectName>
<ProjectGuid>{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}</ProjectGuid>
<RootNamespace>SDL</RootNamespace>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
@@ -46,19 +46,15 @@
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
@@ -85,6 +81,18 @@
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x86;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<IncludePath>$(ProjectDir)/../../src;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<IncludePath>$(ProjectDir)/../../src;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IncludePath>$(ProjectDir)/../../src;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IncludePath>$(ProjectDir)/../../src;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<PreBuildEvent>
<Command>
@@ -98,23 +106,27 @@
<TypeLibraryName>.\Debug/SDL.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;$(ProjectDir)/../../include/build_config;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>DLL_EXPORT;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BufferSecurityCheck>false</BufferSecurityCheck>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
<WarningLevel>Level3</WarningLevel>
<WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<OmitDefaultLibName>true</OmitDefaultLibName>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>SDL_internal.h</PrecompiledHeaderFile>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<DisableSpecificWarnings>4100;4127;4152;4201</DisableSpecificWarnings>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>setupapi.lib;winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
</Link>
@@ -128,22 +140,26 @@
<TypeLibraryName>.\Debug/SDL.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;$(ProjectDir)/../../include/build_config;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>DLL_EXPORT;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BufferSecurityCheck>false</BufferSecurityCheck>
<WarningLevel>Level3</WarningLevel>
<WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<OmitDefaultLibName>true</OmitDefaultLibName>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>SDL_internal.h</PrecompiledHeaderFile>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<DisableSpecificWarnings>4100;4127;4152;4201</DisableSpecificWarnings>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>setupapi.lib;winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
</Link>
@@ -161,22 +177,26 @@
<TypeLibraryName>.\Release/SDL.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;$(ProjectDir)/../../include/build_config;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>DLL_EXPORT;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BufferSecurityCheck>false</BufferSecurityCheck>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
<WarningLevel>Level3</WarningLevel>
<WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<OmitDefaultLibName>true</OmitDefaultLibName>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>SDL_internal.h</PrecompiledHeaderFile>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<DisableSpecificWarnings>4100;4127;4152;4201</DisableSpecificWarnings>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>setupapi.lib;winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
@@ -192,149 +212,173 @@
<TypeLibraryName>.\Release/SDL.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;$(ProjectDir)/../../include/build_config;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>DLL_EXPORT;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BufferSecurityCheck>false</BufferSecurityCheck>
<WarningLevel>Level3</WarningLevel>
<WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<OmitDefaultLibName>true</OmitDefaultLibName>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>SDL_internal.h</PrecompiledHeaderFile>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<DisableSpecificWarnings>4100;4127;4152;4201</DisableSpecificWarnings>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>setupapi.lib;winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(TreatWarningsAsError)'!=''">
<ClCompile>
<TreatWarningAsError>$(TreatWarningsAsError)</TreatWarningAsError>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\..\include\begin_code.h" />
<ClInclude Include="..\..\include\close_code.h" />
<ClInclude Include="..\..\include\SDL.h" />
<ClInclude Include="..\..\include\SDL_assert.h" />
<ClInclude Include="..\..\include\SDL_atomic.h" />
<ClInclude Include="..\..\include\SDL_audio.h" />
<ClInclude Include="..\..\include\SDL_bits.h" />
<ClInclude Include="..\..\include\SDL_blendmode.h" />
<ClInclude Include="..\..\include\SDL_clipboard.h" />
<ClInclude Include="..\..\include\SDL_config.h" />
<ClInclude Include="..\..\include\SDL_config_windows.h" />
<ClInclude Include="..\..\include\SDL_copying.h" />
<ClInclude Include="..\..\include\SDL_cpuinfo.h" />
<ClInclude Include="..\..\include\SDL_egl.h" />
<ClInclude Include="..\..\include\SDL_endian.h" />
<ClInclude Include="..\..\include\SDL_error.h" />
<ClInclude Include="..\..\include\SDL_events.h" />
<ClInclude Include="..\..\include\SDL_filesystem.h" />
<ClInclude Include="..\..\include\SDL_gamecontroller.h" />
<ClInclude Include="..\..\include\SDL_gesture.h" />
<ClInclude Include="..\..\include\SDL_guid.h" />
<ClInclude Include="..\..\include\SDL_haptic.h" />
<ClInclude Include="..\..\include\SDL_hints.h" />
<ClInclude Include="..\..\include\SDL_hidapi.h" />
<ClInclude Include="..\..\include\SDL_joystick.h" />
<ClInclude Include="..\..\include\SDL_keyboard.h" />
<ClInclude Include="..\..\include\SDL_keycode.h" />
<ClInclude Include="..\..\include\SDL_loadso.h" />
<ClInclude Include="..\..\include\SDL_locale.h" />
<ClInclude Include="..\..\include\SDL_log.h" />
<ClInclude Include="..\..\include\SDL_main.h" />
<ClInclude Include="..\..\include\SDL_messagebox.h" />
<ClInclude Include="..\..\include\SDL_metal.h" />
<ClInclude Include="..\..\include\SDL_misc.h" />
<ClInclude Include="..\..\include\SDL_mouse.h" />
<ClInclude Include="..\..\include\SDL_mutex.h" />
<ClInclude Include="..\..\include\SDL_name.h" />
<ClInclude Include="..\..\include\SDL_opengl.h" />
<ClInclude Include="..\..\include\SDL_opengl_glext.h" />
<ClInclude Include="..\..\include\SDL_opengles.h" />
<ClInclude Include="..\..\include\SDL_opengles2.h" />
<ClInclude Include="..\..\include\SDL_opengles2_gl2.h" />
<ClInclude Include="..\..\include\SDL_opengles2_gl2ext.h" />
<ClInclude Include="..\..\include\SDL_opengles2_gl2platform.h" />
<ClInclude Include="..\..\include\SDL_opengles2_khrplatform.h" />
<ClInclude Include="..\..\include\SDL_pixels.h" />
<ClInclude Include="..\..\include\SDL_platform.h" />
<ClInclude Include="..\..\include\SDL_power.h" />
<ClInclude Include="..\..\include\SDL_quit.h" />
<ClInclude Include="..\..\include\SDL_rect.h" />
<ClInclude Include="..\..\include\SDL_render.h" />
<ClInclude Include="..\..\include\SDL_revision.h" />
<ClInclude Include="..\..\include\SDL_rwops.h" />
<ClInclude Include="..\..\include\SDL_scancode.h" />
<ClInclude Include="..\..\include\SDL_sensor.h" />
<ClInclude Include="..\..\include\SDL_shape.h" />
<ClInclude Include="..\..\include\SDL_stdinc.h" />
<ClInclude Include="..\..\include\SDL_surface.h" />
<ClInclude Include="..\..\include\SDL_system.h" />
<ClInclude Include="..\..\include\SDL_syswm.h" />
<ClInclude Include="..\..\include\SDL_test.h" />
<ClInclude Include="..\..\include\SDL_test_assert.h" />
<ClInclude Include="..\..\include\SDL_test_common.h" />
<ClInclude Include="..\..\include\SDL_test_compare.h" />
<ClInclude Include="..\..\include\SDL_test_crc32.h" />
<ClInclude Include="..\..\include\SDL_test_font.h" />
<ClInclude Include="..\..\include\SDL_test_fuzzer.h" />
<ClInclude Include="..\..\include\SDL_test_harness.h" />
<ClInclude Include="..\..\include\SDL_test_images.h" />
<ClInclude Include="..\..\include\SDL_test_log.h" />
<ClInclude Include="..\..\include\SDL_test_md5.h" />
<ClInclude Include="..\..\include\SDL_test_memory.h" />
<ClInclude Include="..\..\include\SDL_test_random.h" />
<ClInclude Include="..\..\include\SDL_thread.h" />
<ClInclude Include="..\..\include\SDL_timer.h" />
<ClInclude Include="..\..\include\SDL_touch.h" />
<ClInclude Include="..\..\include\SDL_types.h" />
<ClInclude Include="..\..\include\SDL_version.h" />
<ClInclude Include="..\..\include\SDL_video.h" />
<ClInclude Include="..\..\include\SDL_vulkan.h" />
<ClInclude Include="..\..\include\SDL3\SDL_begin_code.h" />
<ClInclude Include="..\..\include\SDL3\SDL_camera.h" />
<ClInclude Include="..\..\include\SDL3\SDL_close_code.h" />
<ClInclude Include="..\..\include\SDL3\SDL.h" />
<ClInclude Include="..\..\include\SDL3\SDL_assert.h" />
<ClInclude Include="..\..\include\SDL3\SDL_atomic.h" />
<ClInclude Include="..\..\include\SDL3\SDL_audio.h" />
<ClInclude Include="..\..\include\SDL3\SDL_bits.h" />
<ClInclude Include="..\..\include\SDL3\SDL_blendmode.h" />
<ClInclude Include="..\..\include\SDL3\SDL_clipboard.h" />
<ClInclude Include="..\..\include\SDL3\SDL_copying.h" />
<ClInclude Include="..\..\include\SDL3\SDL_cpuinfo.h" />
<ClInclude Include="..\..\include\SDL3\SDL_egl.h" />
<ClInclude Include="..\..\include\SDL3\SDL_endian.h" />
<ClInclude Include="..\..\include\SDL3\SDL_error.h" />
<ClInclude Include="..\..\include\SDL3\SDL_events.h" />
<ClInclude Include="..\..\include\SDL3\SDL_filesystem.h" />
<ClInclude Include="..\..\include\SDL3\SDL_gamepad.h" />
<ClInclude Include="..\..\include\SDL3\SDL_gpu.h" />
<ClInclude Include="..\..\include\SDL3\SDL_guid.h" />
<ClInclude Include="..\..\include\SDL3\SDL_haptic.h" />
<ClInclude Include="..\..\include\SDL3\SDL_hints.h" />
<ClInclude Include="..\..\include\SDL3\SDL_hidapi.h" />
<ClInclude Include="..\..\include\SDL3\SDL_asyncio.h" />
<ClInclude Include="..\..\include\SDL3\SDL_joystick.h" />
<ClInclude Include="..\..\include\SDL3\SDL_keyboard.h" />
<ClInclude Include="..\..\include\SDL3\SDL_keycode.h" />
<ClInclude Include="..\..\include\SDL3\SDL_loadso.h" />
<ClInclude Include="..\..\include\SDL3\SDL_locale.h" />
<ClInclude Include="..\..\include\SDL3\SDL_log.h" />
<ClInclude Include="..\..\include\SDL3\SDL_main.h" />
<ClInclude Include="..\..\include\SDL3\SDL_messagebox.h" />
<ClInclude Include="..\..\include\SDL3\SDL_metal.h" />
<ClInclude Include="..\..\include\SDL3\SDL_misc.h" />
<ClInclude Include="..\..\include\SDL3\SDL_mouse.h" />
<ClInclude Include="..\..\include\SDL3\SDL_mutex.h" />
<ClInclude Include="..\..\include\SDL3\SDL_opengl.h" />
<ClInclude Include="..\..\include\SDL3\SDL_opengl_glext.h" />
<ClInclude Include="..\..\include\SDL3\SDL_opengles.h" />
<ClInclude Include="..\..\include\SDL3\SDL_opengles2.h" />
<ClInclude Include="..\..\include\SDL3\SDL_opengles2_gl2.h" />
<ClInclude Include="..\..\include\SDL3\SDL_opengles2_gl2ext.h" />
<ClInclude Include="..\..\include\SDL3\SDL_opengles2_gl2platform.h" />
<ClInclude Include="..\..\include\SDL3\SDL_opengles2_khrplatform.h" />
<ClInclude Include="..\..\include\SDL3\SDL_pen.h" />
<ClInclude Include="..\..\include\SDL3\SDL_pixels.h" />
<ClInclude Include="..\..\include\SDL3\SDL_platform.h" />
<ClInclude Include="..\..\include\SDL3\SDL_platform_defines.h" />
<ClInclude Include="..\..\include\SDL3\SDL_power.h" />
<ClInclude Include="..\..\include\SDL3\SDL_process.h" />
<ClInclude Include="..\..\include\SDL3\SDL_properties.h" />
<ClInclude Include="..\..\include\SDL3\SDL_rect.h" />
<ClInclude Include="..\..\include\SDL3\SDL_render.h" />
<ClInclude Include="..\..\include\SDL3\SDL_revision.h" />
<ClInclude Include="..\..\include\SDL3\SDL_iostream.h" />
<ClInclude Include="..\..\include\SDL3\SDL_scancode.h" />
<ClInclude Include="..\..\include\SDL3\SDL_sensor.h" />
<ClInclude Include="..\..\include\SDL3\SDL_stdinc.h" />
<ClInclude Include="..\..\include\SDL3\SDL_storage.h" />
<ClInclude Include="..\..\include\SDL3\SDL_surface.h" />
<ClInclude Include="..\..\include\SDL3\SDL_system.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test_assert.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test_common.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test_compare.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test_crc32.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test_font.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test_fuzzer.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test_harness.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test_log.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test_md5.h" />
<ClInclude Include="..\..\include\SDL3\SDL_test_memory.h" />
<ClInclude Include="..\..\include\SDL3\SDL_thread.h" />
<ClInclude Include="..\..\include\SDL3\SDL_time.h" />
<ClInclude Include="..\..\include\SDL3\SDL_timer.h" />
<ClInclude Include="..\..\include\SDL3\SDL_touch.h" />
<ClInclude Include="..\..\include\SDL3\SDL_version.h" />
<ClInclude Include="..\..\include\SDL3\SDL_video.h" />
<ClInclude Include="..\..\include\SDL3\SDL_vulkan.h" />
<ClInclude Include="..\..\src\audio\directsound\SDL_directsound.h" />
<ClInclude Include="..\..\src\audio\disk\SDL_diskaudio.h" />
<ClInclude Include="..\..\src\audio\dummy\SDL_dummyaudio.h" />
<ClInclude Include="..\..\src\audio\SDL_audio_c.h" />
<ClInclude Include="..\..\src\audio\SDL_audiodev_c.h" />
<ClInclude Include="..\..\src\audio\SDL_sysaudio.h" />
<ClInclude Include="..\..\src\audio\SDL_audioqueue.h" />
<ClInclude Include="..\..\src\audio\SDL_audioresample.h" />
<ClInclude Include="..\..\src\audio\SDL_wave.h" />
<ClInclude Include="..\..\src\audio\wasapi\SDL_wasapi.h" />
<ClInclude Include="..\..\src\audio\winmm\SDL_winmm.h" />
<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" />
<ClInclude Include="..\..\src\core\windows\SDL_xinput.h" />
<ClInclude Include="..\..\src\cpuinfo\SDL_cpuinfo_c.h" />
<ClInclude Include="..\..\src\dynapi\SDL_dynapi.h" />
<ClInclude Include="..\..\src\dynapi\SDL_dynapi_overrides.h" />
<ClInclude Include="..\..\src\dynapi\SDL_dynapi_procs.h" />
<ClInclude Include="..\..\src\dynapi\SDL_dynapi_unsupported.h" />
<ClInclude Include="..\..\src\events\blank_cursor.h" />
<ClInclude Include="..\..\src\events\default_cursor.h" />
<ClInclude Include="..\..\src\events\scancodes_windows.h" />
<ClInclude Include="..\..\src\events\SDL_categories_c.h" />
<ClInclude Include="..\..\src\events\SDL_clipboardevents_c.h" />
<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_gesture_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" />
<ClInclude Include="..\..\src\events\SDL_touch_c.h" />
<ClInclude Include="..\..\src\events\SDL_windowevents_c.h" />
<ClInclude Include="..\..\src\filesystem\SDL_sysfilesystem.h" />
<ClInclude Include="..\..\src\gpu\SDL_sysgpu.h" />
<ClInclude Include="..\..\src\gpu\vulkan\SDL_gpu_vulkan_vkfuncs.h" />
<ClInclude Include="..\..\src\io\SDL_asyncio_c.h" />
<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\windows\SDL_xinputhaptic_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" />
<ClInclude Include="..\..\src\joystick\hidapi\SDL_hidapijoystick_c.h" />
<ClInclude Include="..\..\src\joystick\hidapi\SDL_hidapi_rumble.h" />
<ClInclude Include="..\..\src\joystick\SDL_gamecontrollerdb.h" />
<ClInclude Include="..\..\src\joystick\SDL_gamepad_c.h" />
<ClInclude Include="..\..\src\joystick\SDL_gamepad_db.h" />
<ClInclude Include="..\..\src\joystick\SDL_joystick_c.h" />
<ClInclude Include="..\..\src\joystick\SDL_steam_virtual_gamepad.h" />
<ClInclude Include="..\..\src\joystick\SDL_sysjoystick.h" />
<ClInclude Include="..\..\src\joystick\usb_ids.h" />
<ClInclude Include="..\..\src\joystick\virtual\SDL_virtualjoystick_c.h" />
@@ -345,6 +389,7 @@
<ClInclude Include="..\..\src\libm\math_libm.h" />
<ClInclude Include="..\..\src\libm\math_private.h" />
<ClInclude Include="..\..\src\locale\SDL_syslocale.h" />
<ClInclude Include="..\..\src\main\SDL_main_callbacks.h" />
<ClInclude Include="..\..\src\misc\SDL_sysurl.h" />
<ClInclude Include="..\..\src\power\SDL_syspower.h" />
<ClInclude Include="..\..\src\render\direct3d11\SDL_shaders_d3d11.h" />
@@ -366,14 +411,51 @@
<ClInclude Include="..\..\src\render\software\SDL_render_sw_c.h" />
<ClInclude Include="..\..\src\render\software\SDL_rotate.h" />
<ClInclude Include="..\..\src\render\software\SDL_triangle.h" />
<ClInclude Include="..\..\src\render\vulkan\SDL_shaders_vulkan.h" />
<ClInclude Include="..\..\src\SDL_assert_c.h" />
<ClInclude Include="..\..\src\SDL_dataqueue.h" />
<ClInclude Include="..\..\src\SDL_error_c.h" />
<ClCompile Include="..\..\src\core\windows\pch.c">
<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>
</ClCompile>
<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" />
<ClCompile Include="..\..\src\filesystem\windows\SDL_sysfsops.c" />
<ClCompile Include="..\..\src\io\windows\SDL_asyncio_windows_ioring.c" />
<ClCompile Include="..\..\src\gpu\SDL_gpu.c" />
<ClCompile Include="..\..\src\gpu\d3d12\SDL_gpu_d3d12.c" />
<ClCompile Include="..\..\src\gpu\vulkan\SDL_gpu_vulkan.c" />
<ClCompile Include="..\..\src\io\generic\SDL_asyncio_generic.c" />
<ClCompile Include="..\..\src\io\SDL_asyncio.c" />
<ClCompile Include="..\..\src\main\generic\SDL_sysmain_callbacks.c" />
<ClCompile Include="..\..\src\main\SDL_main_callbacks.c" />
<ClCompile Include="..\..\src\main\SDL_runapp.c" />
<ClCompile Include="..\..\src\main\windows\SDL_sysmain_runapp.c" />
<ClCompile Include="..\..\src\render\vulkan\SDL_render_vulkan.c" />
<ClCompile Include="..\..\src\render\vulkan\SDL_shaders_vulkan.c" />
<ClCompile Include="..\..\src\SDL_guid.c" />
<ClInclude Include="..\..\src\SDL_hashtable.h" />
<ClInclude Include="..\..\src\SDL_hints_c.h" />
<ClInclude Include="..\..\src\SDL_internal.h" />
<ClInclude Include="..\..\src\SDL_list.h" />
<ClInclude Include="..\..\src\SDL_log_c.h" />
<ClInclude Include="..\..\src\SDL_properties_c.h" />
<ClInclude Include="..\..\src\sensor\dummy\SDL_dummysensor.h" />
<ClInclude Include="..\..\src\sensor\SDL_sensor_c.h" />
<ClInclude Include="..\..\src\sensor\SDL_syssensor.h" />
@@ -382,6 +464,7 @@
<ClInclude Include="..\..\src\thread\SDL_thread_c.h" />
<ClInclude Include="..\..\src\thread\generic\SDL_syscond_c.h" />
<ClInclude Include="..\..\src\thread\windows\SDL_sysmutex_c.h" />
<ClInclude Include="..\..\src\thread\generic\SDL_sysrwlock_c.h" />
<ClInclude Include="..\..\src\thread\windows\SDL_systhread_c.h" />
<ClInclude Include="..\..\src\timer\SDL_timer_c.h" />
<ClInclude Include="..\..\src\video\dummy\SDL_nullevents_c.h" />
@@ -392,7 +475,6 @@
<ClInclude Include="..\..\src\video\khronos\vulkan\vk_platform.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vk_sdk_platform.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan.hpp" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_android.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_beta.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_core.h" />
@@ -408,39 +490,53 @@
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_xcb.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_xlib.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_xlib_xrandr.h" />
<ClInclude Include="..\..\src\video\offscreen\SDL_offscreenevents_c.h" />
<ClInclude Include="..\..\src\video\offscreen\SDL_offscreenframebuffer_c.h" />
<ClInclude Include="..\..\src\video\offscreen\SDL_offscreenopengles.h" />
<ClInclude Include="..\..\src\video\offscreen\SDL_offscreenvideo.h" />
<ClInclude Include="..\..\src\video\offscreen\SDL_offscreenvulkan.h" />
<ClInclude Include="..\..\src\video\offscreen\SDL_offscreenwindow.h" />
<ClInclude Include="..\..\src\video\SDL_blit.h" />
<ClInclude Include="..\..\src\video\SDL_blit_auto.h" />
<ClInclude Include="..\..\src\video\SDL_blit_copy.h" />
<ClInclude Include="..\..\src\video\SDL_blit_slow.h" />
<ClInclude Include="..\..\src\video\SDL_clipboard_c.h" />
<ClInclude Include="..\..\src\video\SDL_egl_c.h" />
<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_shape_internals.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" />
<ClInclude Include="..\..\src\video\SDL_yuv_c.h" />
<ClInclude Include="..\..\src\video\windows\SDL_msctf.h" />
<ClInclude Include="..\..\src\video\windows\SDL_vkeys.h" />
<ClInclude Include="..\..\src\video\windows\SDL_surface_utils.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsclipboard.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsevents.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsframebuffer.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowskeyboard.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsgameinput.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsmessagebox.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsmodes.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsmouse.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsopengl.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsopengles.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsrawinput.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsshape.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsvideo.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsvulkan.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowswindow.h" />
<ClInclude Include="..\..\src\video\windows\wmmsg.h" />
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb.h" />
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_common.h" />
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_internal.h" />
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_lsx.h" />
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_lsx_func.h" />
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_sse.h" />
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_sse_func.h" />
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_std.h" />
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_std_func.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\atomic\SDL_atomic.c" />
<ClCompile Include="..\..\src\atomic\SDL_spinlock.c" />
<ClCompile Include="..\..\src\audio\directsound\SDL_directsound.c" />
@@ -450,100 +546,120 @@
<ClCompile Include="..\..\src\audio\SDL_audiocvt.c" />
<ClCompile Include="..\..\src\audio\SDL_audiodev.c" />
<ClCompile Include="..\..\src\audio\SDL_audiotypecvt.c" />
<ClCompile Include="..\..\src\audio\SDL_audioqueue.c" />
<ClCompile Include="..\..\src\audio\SDL_audioresample.c" />
<ClCompile Include="..\..\src\audio\SDL_mixer.c" />
<ClCompile Include="..\..\src\audio\SDL_wave.c" />
<ClCompile Include="..\..\src\audio\winmm\SDL_winmm.c" />
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi.c" />
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi_win32.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" />
<ClCompile Include="..\..\src\core\windows\SDL_xinput.c" />
<ClCompile Include="..\..\src\cpuinfo\SDL_cpuinfo.c" />
<ClCompile Include="..\..\src\dynapi\SDL_dynapi.c" />
<ClCompile Include="..\..\src\dialog\windows\SDL_windowsdialog.c" />
<ClCompile Include="..\..\src\dynapi\SDL_dynapi.c">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\..\src\events\SDL_categories.c" />
<ClCompile Include="..\..\src\events\SDL_clipboardevents.c" />
<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_gesture.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" />
<ClCompile Include="..\..\src\events\SDL_pen.c" />
<ClCompile Include="..\..\src\events\SDL_quit.c" />
<ClCompile Include="..\..\src\events\SDL_touch.c" />
<ClCompile Include="..\..\src\events\SDL_windowevents.c" />
<ClCompile Include="..\..\src\file\SDL_rwops.c" />
<ClCompile Include="..\..\src\io\SDL_iostream.c" />
<ClCompile Include="..\..\src\filesystem\windows\SDL_sysfilesystem.c" />
<ClCompile Include="..\..\src\haptic\dummy\SDL_syshaptic.c" />
<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\windows\SDL_xinputhaptic.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.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\SDL_gamecontroller.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" />
<ClCompile Include="..\..\src\joystick\virtual\SDL_virtualjoystick.c" />
<ClCompile Include="..\..\src\joystick\windows\SDL_dinputjoystick.c" />
<ClCompile Include="..\..\src\joystick\windows\SDL_rawinputjoystick.c" />
<ClCompile Include="..\..\src\joystick\windows\SDL_windowsjoystick.c" />
<ClCompile Include="..\..\src\joystick\windows\SDL_windows_gaming_input.c" />
<ClCompile Include="..\..\src\joystick\windows\SDL_xinputjoystick.c" />
<ClCompile Include="..\..\src\libm\e_atan2.c" />
<ClCompile Include="..\..\src\libm\e_exp.c" />
<ClCompile Include="..\..\src\libm\e_fmod.c" />
<ClCompile Include="..\..\src\libm\e_log.c" />
<ClCompile Include="..\..\src\libm\e_log10.c" />
<ClCompile Include="..\..\src\libm\e_pow.c" />
<ClCompile Include="..\..\src\libm\e_rem_pio2.c" />
<ClCompile Include="..\..\src\libm\e_sqrt.c" />
<ClCompile Include="..\..\src\libm\k_cos.c" />
<ClCompile Include="..\..\src\libm\k_rem_pio2.c" />
<ClCompile Include="..\..\src\libm\k_sin.c" />
<ClCompile Include="..\..\src\libm\k_tan.c" />
<ClCompile Include="..\..\src\libm\s_atan.c" />
<ClCompile Include="..\..\src\libm\s_copysign.c" />
<ClCompile Include="..\..\src\libm\s_cos.c" />
<ClCompile Include="..\..\src\libm\s_fabs.c" />
<ClCompile Include="..\..\src\libm\s_floor.c" />
<ClCompile Include="..\..\src\libm\s_scalbn.c" />
<ClCompile Include="..\..\src\libm\s_sin.c" />
<ClCompile Include="..\..\src\libm\s_tan.c" />
<ClCompile Include="..\..\src\libm\s_modf.c" />
<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" />
<ClCompile Include="..\..\src\power\windows\SDL_syspower.c" />
<ClCompile Include="..\..\src\process\SDL_process.c" />
<ClCompile Include="..\..\src\process\windows\SDL_windowsprocess.c" />
<ClCompile Include="..\..\src\render\direct3d11\SDL_shaders_d3d11.c" />
<ClCompile Include="..\..\src\render\direct3d12\SDL_render_d3d12.c" />
<ClCompile Include="..\..\src\render\direct3d12\SDL_shaders_d3d12.c" />
<ClCompile Include="..\..\src\render\direct3d\SDL_render_d3d.c" />
<ClCompile Include="..\..\src\render\direct3d11\SDL_render_d3d11.c" />
<ClCompile Include="..\..\src\render\direct3d\SDL_shaders_d3d.c" />
<ClCompile Include="..\..\src\render\gpu\SDL_pipeline_gpu.c" />
<ClCompile Include="..\..\src\render\gpu\SDL_render_gpu.c" />
<ClCompile Include="..\..\src\render\gpu\SDL_shaders_gpu.c" />
<ClCompile Include="..\..\src\render\opengl\SDL_render_gl.c" />
<ClCompile Include="..\..\src\render\opengl\SDL_shaders_gl.c" />
<ClCompile Include="..\..\src\render\opengles2\SDL_render_gles2.c" />
<ClCompile Include="..\..\src\render\opengles2\SDL_shaders_gles2.c" />
<ClCompile Include="..\..\src\render\SDL_d3dmath.c" />
<ClCompile Include="..\..\src\render\SDL_render.c" />
<ClCompile Include="..\..\src\render\SDL_render_unsupported.c" />
<ClCompile Include="..\..\src\render\SDL_yuv_sw.c" />
<ClCompile Include="..\..\src\render\software\SDL_blendfillrect.c" />
<ClCompile Include="..\..\src\render\software\SDL_blendline.c" />
@@ -555,11 +671,12 @@
<ClCompile Include="..\..\src\render\software\SDL_triangle.c" />
<ClCompile Include="..\..\src\SDL.c" />
<ClCompile Include="..\..\src\SDL_assert.c" />
<ClCompile Include="..\..\src\SDL_dataqueue.c" />
<ClCompile Include="..\..\src\SDL_list.c" />
<ClCompile Include="..\..\src\SDL_error.c" />
<ClCompile Include="..\..\src\SDL_hashtable.c" />
<ClCompile Include="..\..\src\SDL_hints.c" />
<ClCompile Include="..\..\src\SDL_list.c" />
<ClCompile Include="..\..\src\SDL_log.c" />
<ClCompile Include="..\..\src\SDL_properties.c" />
<ClCompile Include="..\..\src\SDL_utils.c" />
<ClCompile Include="..\..\src\sensor\dummy\SDL_dummysensor.c" />
<ClCompile Include="..\..\src\sensor\SDL_sensor.c" />
@@ -569,23 +686,43 @@
<ClCompile Include="..\..\src\stdlib\SDL_getenv.c" />
<ClCompile Include="..\..\src\stdlib\SDL_iconv.c" />
<ClCompile Include="..\..\src\stdlib\SDL_malloc.c" />
<ClCompile Include="..\..\src\stdlib\SDL_memcpy.c" />
<ClCompile Include="..\..\src\stdlib\SDL_memmove.c" />
<ClCompile Include="..\..\src\stdlib\SDL_memset.c" />
<ClCompile Include="..\..\src\stdlib\SDL_mslibc.c" />
<ClCompile Include="..\..\src\stdlib\SDL_murmur3.c" />
<ClCompile Include="..\..\src\stdlib\SDL_qsort.c" />
<ClCompile Include="..\..\src\stdlib\SDL_random.c" />
<ClCompile Include="..\..\src\stdlib\SDL_stdlib.c" />
<ClCompile Include="..\..\src\stdlib\SDL_string.c" />
<ClCompile Include="..\..\src\stdlib\SDL_strtokr.c" />
<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\thread\generic\SDL_syscond.c" />
<ClCompile Include="..\..\src\thread\generic\SDL_sysrwlock.c" />
<ClCompile Include="..\..\src\thread\SDL_thread.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_syscond_cv.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_sysmutex.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_sysrwlock_srw.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_syssem.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_systhread.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_systls.c" />
<ClCompile Include="..\..\src\timer\SDL_timer.c" />
<ClCompile Include="..\..\src\timer\windows\SDL_systimer.c" />
<ClCompile Include="..\..\src\time\SDL_time.c" />
<ClCompile Include="..\..\src\time\windows\SDL_systime.c" />
<ClCompile Include="..\..\src\tray\windows\SDL_tray.c" />
<ClCompile Include="..\..\src\tray\SDL_tray_utils.c" />
<ClCompile Include="..\..\src\video\dummy\SDL_nullevents.c" />
<ClCompile Include="..\..\src\video\dummy\SDL_nullframebuffer.c" />
<ClCompile Include="..\..\src\video\dummy\SDL_nullvideo.c" />
<ClCompile Include="..\..\src\video\offscreen\SDL_offscreenevents.c" />
<ClCompile Include="..\..\src\video\offscreen\SDL_offscreenframebuffer.c" />
<ClCompile Include="..\..\src\video\offscreen\SDL_offscreenopengles.c" />
<ClCompile Include="..\..\src\video\offscreen\SDL_offscreenvideo.c" />
<ClCompile Include="..\..\src\video\offscreen\SDL_offscreenvulkan.c" />
<ClCompile Include="..\..\src\video\offscreen\SDL_offscreenwindow.c" />
<ClCompile Include="..\..\src\video\SDL_blit.c" />
<ClCompile Include="..\..\src\video\SDL_blit_0.c" />
<ClCompile Include="..\..\src\video\SDL_blit_1.c" />
@@ -601,29 +738,39 @@
<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_shape.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_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.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" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsopengl.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsopengles.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsrawinput.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsshape.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsvideo.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsvulkan.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowswindow.c" />
<ClCompile Include="..\..\src\video\yuv2rgb\yuv_rgb.c" />
<ClCompile Include="..\..\src\video\yuv2rgb\yuv_rgb_lsx.c" />
<ClCompile Include="..\..\src\video\yuv2rgb\yuv_rgb_sse.c" />
<ClCompile Include="..\..\src\video\yuv2rgb\yuv_rgb_std.c" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\src\main\windows\version.rc" />
<ResourceCompile Include="..\..\src\core\windows\version.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

File diff suppressed because it is too large Load Diff

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

@@ -19,9 +19,9 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>SDL2test</ProjectName>
<ProjectName>SDL3_test</ProjectName>
<ProjectGuid>{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}</ProjectGuid>
<RootNamespace>SDLtest</RootNamespace>
<RootNamespace>SDL_test</RootNamespace>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -46,19 +46,15 @@
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
@@ -90,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>
@@ -100,6 +97,7 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<OmitDefaultLibName>true</OmitDefaultLibName>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -107,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>
@@ -116,6 +115,7 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<OmitDefaultLibName>true</OmitDefaultLibName>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
@@ -124,6 +124,7 @@
</Command>
</PreBuildEvent>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -134,6 +135,7 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<OmitDefaultLibName>true</OmitDefaultLibName>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -141,6 +143,7 @@
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
@@ -150,6 +153,12 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<OmitDefaultLibName>true</OmitDefaultLibName>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(TreatWarningsAsError)'!=''">
<ClCompile>
<TreatWarningAsError>$(TreatWarningsAsError)</TreatWarningAsError>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
@@ -160,15 +169,9 @@
<ClCompile Include="..\..\src\test\SDL_test_font.c" />
<ClCompile Include="..\..\src\test\SDL_test_fuzzer.c" />
<ClCompile Include="..\..\src\test\SDL_test_harness.c" />
<ClCompile Include="..\..\src\test\SDL_test_imageBlit.c" />
<ClCompile Include="..\..\src\test\SDL_test_imageBlitBlend.c" />
<ClCompile Include="..\..\src\test\SDL_test_imageFace.c" />
<ClCompile Include="..\..\src\test\SDL_test_imagePrimitives.c" />
<ClCompile Include="..\..\src\test\SDL_test_imagePrimitivesBlend.c" />
<ClCompile Include="..\..\src\test\SDL_test_log.c" />
<ClCompile Include="..\..\src\test\SDL_test_md5.c" />
<ClCompile Include="..\..\src\test\SDL_test_memory.c" />
<ClCompile Include="..\..\src\test\SDL_test_random.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View File

@@ -1,161 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>SDL2main</ProjectName>
<ProjectGuid>{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}</ProjectGuid>
<RootNamespace>SDLmain</RootNamespace>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<PreBuildEvent>
<Command>
</Command>
</PreBuildEvent>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<OmitDefaultLibName>true</OmitDefaultLibName>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<OmitDefaultLibName>true</OmitDefaultLibName>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<PreBuildEvent>
<Command>
</Command>
</PreBuildEvent>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<OmitDefaultLibName>true</OmitDefaultLibName>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<OmitDefaultLibName>true</OmitDefaultLibName>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\src\main\windows\SDL_windows_main.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</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>{D68EA64A-14ED-4DBF-B86C-9EC2DDC476FB}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ItemGroup>
<None Include="$(SolutionDir)\..\examples\audio\01-simple-playback\README.txt" />
<ClCompile Include="$(SolutionDir)\..\examples\audio\01-simple-playback\*.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>{8C80733B-1F90-4682-A999-91699127F182}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ItemGroup>
<None Include="$(SolutionDir)\..\examples\audio\02-simple-playback-callback\README.txt" />
<ClCompile Include="$(SolutionDir)\..\examples\audio\02-simple-playback-callback\*.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>{E941FE4D-964C-43C6-A486-B0966633BED6}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ItemGroup>
<None Include="$(SolutionDir)\..\examples\audio\03-load-wav\README.txt" />
<ClCompile Include="$(SolutionDir)\..\examples\audio\03-load-wav\*.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>{20B1B6AE-B282-4E65-863A-28301B6C5E9F}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ItemGroup>
<None Include="$(SolutionDir)\..\examples\camera\01-read-and-draw\README.txt" />
<ClCompile Include="$(SolutionDir)\..\examples\camera\01-read-and-draw\*.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>{7239E6E4-3C4E-45DE-81B4-3BC7635BE63F}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ItemGroup>
<None Include="$(SolutionDir)\..\examples\demo\01-snake\README.txt" />
<ClCompile Include="$(SolutionDir)\..\examples\demo\01-snake\*.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>{25BB7BA9-DCAB-4944-9F2A-E316D63AF356}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ItemGroup>
<None Include="$(SolutionDir)\..\examples\pen\01-drawing-lines\README.txt" />
<ClCompile Include="$(SolutionDir)\..\examples\pen\01-drawing-lines\*.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>{541DB2BF-7BE8-402C-8D7C-4BCC5A16DCDF}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ItemGroup>
<None Include="$(SolutionDir)\..\examples\renderer\01-clear\README.txt" />
<ClCompile Include="$(SolutionDir)\..\examples\renderer\01-clear\*.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>{1C512964-A1E4-4569-8EA4-1165D89A9FD9}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ItemGroup>
<None Include="$(SolutionDir)\..\examples\renderer\02-primitives\README.txt" />
<ClCompile Include="$(SolutionDir)\..\examples\renderer\02-primitives\*.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>{156986DD-710A-4627-8159-19FD1CE0C243}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ItemGroup>
<None Include="$(SolutionDir)\..\examples\renderer\03-lines\README.txt" />
<ClCompile Include="$(SolutionDir)\..\examples\renderer\03-lines\*.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>{3D355C93-8429-4226-82D5-F8A63BC02801}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ItemGroup>
<None Include="$(SolutionDir)\..\examples\renderer\04-points\README.txt" />
<ClCompile Include="$(SolutionDir)\..\examples\renderer\04-points\*.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>{03CFCE68-B607-4781-8348-4F5F93A09A63}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ItemGroup>
<None Include="$(SolutionDir)\..\examples\renderer\05-rectangles\README.txt" />
<ClCompile Include="$(SolutionDir)\..\examples\renderer\05-rectangles\*.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>{90118B89-7011-4BDA-AF6E-FAEF74BAD73C}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ItemGroup>
<None Include="$(SolutionDir)\..\examples\renderer\06-textures\README.txt" />
<ClCompile Include="$(SolutionDir)\..\examples\renderer\06-textures\*.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>{2FE0342B-DB71-42D9-918D-C48099167DB9}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ItemGroup>
<None Include="$(SolutionDir)\..\examples\renderer\07-streaming-textures\README.txt" />
<ClCompile Include="$(SolutionDir)\..\examples\renderer\07-streaming-textures\*.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>{E0D48833-9BD2-46EC-A1DA-BC06C521E3CB}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ItemGroup>
<None Include="$(SolutionDir)\..\examples\renderer\08-rotating-textures\README.txt" />
<ClCompile Include="$(SolutionDir)\..\examples\renderer\08-rotating-textures\*.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>{76D6D01E-79C3-4599-8920-DADDD5D8F8D0}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ItemGroup>
<None Include="$(SolutionDir)\..\examples\renderer\09-scaling-textures\README.txt" />
<ClCompile Include="$(SolutionDir)\..\examples\renderer\09-scaling-textures\*.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>{FA567681-211A-43AB-A9B2-6C1EC39CEBFF}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ItemGroup>
<None Include="$(SolutionDir)\..\examples\renderer\10-geometry\README.txt" />
<ClCompile Include="$(SolutionDir)\..\examples\renderer\10-geometry\*.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>{6539C356-F420-4EBF-937A-E03C1EDEF8D5}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ItemGroup>
<None Include="$(SolutionDir)\..\examples\renderer\11-color-mods\README.txt" />
<ClCompile Include="$(SolutionDir)\..\examples\renderer\11-color-mods\*.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>{42C0ABC6-6E99-4FE2-B4DB-8B1DFA9D2AEC}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ItemGroup>
<None Include="$(SolutionDir)\..\examples\renderer\14-viewport\README.txt" />
<ClCompile Include="$(SolutionDir)\..\examples\renderer\14-viewport\*.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>{2ED69519-A202-4B6E-870E-71FD43A5B883}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ItemGroup>
<None Include="$(SolutionDir)\..\examples\renderer\15-cliprect\README.txt" />
<ClCompile Include="$(SolutionDir)\..\examples\renderer\15-cliprect\*.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>{94DB4D43-D07D-4CD3-94FF-B6E96CC97C60}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ItemGroup>
<None Include="$(SolutionDir)\..\examples\renderer\17-read-pixels\README.txt" />
<ClCompile Include="$(SolutionDir)\..\examples\renderer\17-read-pixels\*.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>{72F39D57-7D82-4040-AE2B-CA7C922506E3}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ItemGroup>
<None Include="$(SolutionDir)\..\examples\renderer\18-debug-text\README.txt" />
<ClCompile Include="$(SolutionDir)\..\examples\renderer\18-debug-text\*.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@@ -0,0 +1,178 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<PropertyGroup>
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ProjectReference Include="$(SolutionDir)\SDL\SDL.vcxproj">
<Project>{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}</Project>
<Private>false</Private>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</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>{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>

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