Commit Graph

16557 Commits

Author SHA1 Message Date
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