Commit Graph

16509 Commits

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