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
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
c298d2024a
Include SDL_build_config.h without a 'build_config/' prefix
2024-08-23 00:51:35 +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
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
Anonymous Maarten
29ca5b5dcd
SDLTest_CompareMemory: print header
2024-08-20 16:04:58 +00: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
405693175d
camera: Fixed Emscripten support.
2024-08-19 14:15:47 -04: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
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
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
Kaktus514
3586df3151
Prefer downscaling in SDL_GetSurfaceImage.
...
This implements the ideas described in #10536
2024-08-15 07:28:31 -07:00
Anonymous Maarten
612b41c451
camera: use cdevice SDL_Event union member
2024-08-15 09:20:34 -04: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
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
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
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
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
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
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
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