Commit Graph

7236 Commits

Author SHA1 Message Date
Sam Lantinga
859844eae3 Updated to version 2.30.0 for release 2024-02-01 16:02:20 -08:00
Sam Lantinga
5f98fcf00b Use the exact motion associated with the warp
When Windows DPI scaling is enabled, the warp coordinates will be modified, so make sure we send exactly the coordinates that the warp attempted.

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

(cherry picked from commit 8ce6fb25131912c7e83267bff03a5d1797545d5c)
2024-01-30 11:13:44 -08:00
Francisco Javier Trujillo Mata
5a492e8196 Fixing viewport
(cherry picked from commit d34a7c5ed2a2b3d4180a839d7534fc165af7d064)
2024-01-29 20:44:07 -08:00
Francisco Javier Trujillo Mata
80cb52c944 Fix scissor usage
(cherry picked from commit 36b843828062ee8488320d90591fd7d273f548b8)
2024-01-29 20:44:07 -08:00
Francisco Javier Trujillo Mata
4436c09c9d Fix color
(cherry picked from commit faa8fc2917e6c24bc3785facecf35ae29a3176b5)
2024-01-29 20:44:07 -08:00
Sam Lantinga
4a62e1c0ca Updated to version 2.29.3 for RC build 2024-01-27 22:50:08 -08:00
Ryan C. Gordon
f6b9ebb838
wasapi: If GetDeviceBuf can't get a full buffer, go back to waiting.
Reference Issue #8924.

(cherry picked from commit f931b25f4cd6180f98590b9697d3e6ad58b63bd0)
2024-01-28 00:23:40 -05:00
Ryan C. Gordon
f1b109005c
aaudio: Backport headphone hotplugging support from SDL3.
Fixes #4985.

(cherry picked from commit ec25d6b1e860e1689044c1d145cbbcbe1aa5011f)
2024-01-28 00:20:34 -05:00
Sam Lantinga
a6d5c1fe05 Added the environment variable SDL_LOGGING to control default log output
(cherry picked from commit 12bdb2b4d04a7338a4687755967a3eaad25696b0)
(cherry picked from commit f0b8fee88f4f37eecf0d16b146ff0171804298e7)
2024-01-27 19:46:59 -08:00
Sam Lantinga
fc5bd11dac Simplified the default log category logic
Now it's much clearer and easier to tweak the defaults

(cherry picked from commit 4fba6633687b53e714c3422b6a28fe7dace48674)
(cherry picked from commit 6ec3f5a28ea7194d57827d6bb34acc969db3b0a0)
2024-01-27 19:46:59 -08:00
Ozkan Sezer
fd08ca3823 SDL_rwops.c (SDL_IsRegularFile): fix WinRT build failure due to S_ISREG
(cherry picked from commit fcd1c155ccec7ac57b77cbc8571a321a5954c2cb)
2024-01-28 02:21:01 +03:00
Ozkan Sezer
3bf60755cb 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 230ae797a7406358b7fcf74701d39b5f342f9807)
2024-01-28 01:45:10 +03:00
Sam Lantinga
aac7d1c2ae Report out of memory instead of crashing in SDL_LoadFile_RW()
Fixes https://github.com/libsdl-org/SDL/issues/8935

(cherry picked from commit 52975961326797558d1c66a02cb32870ff7be6d4)
2024-01-27 12:17:04 -08:00
Sam Lantinga
55caed2011 Fixed N3DS build
(cherry picked from commit 332213163c395bb73ac3969d0a66ee19be1d90ff)
2024-01-27 11:56:51 -08:00
Sam Lantinga
53058af284 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 4ff3b28273a9b64892620435231539a1d2c98301)
2024-01-27 11:54:50 -08:00
Ryan C. Gordon
ad1a11164c
wasapi: Clamp device->spec.samples to the hardware buffer size.
Reference Issue #8924.
2024-01-26 13:58:38 -05:00
Sam Lantinga
c85ea238ca 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.

(cherry picked from commit 2670eb44afec9311ee8fbec447703c427db1e1c8)
(cherry picked from commit 08caafe2f1044ae9baaf77507bba24c29adf551f)
2024-01-25 06:37:34 -08:00
Ningyuan Li
5c0b2d04f4 mayflash adapter PS4 support
(cherry picked from commit d6ebbc2fa4abdbe0bd53d0ce8804a492ecb042b9)
(cherry picked from commit 138fe3d43d4ee760cb2afc4f4d767abf20ca8e75)
2024-01-24 19:26:44 -08:00
Sam Lantinga
76e64053c3 Make sure we include the matching copy of vk_video headers
(cherry picked from commit 1ac960290920d424b7d2016a29f137b0b85ae2a6)
(cherry picked from commit b16ef14c7c935d3d39b7c925d5266b5193d343c4)
2024-01-24 09:42:22 -08:00
Sam Lantinga
ddfa59a52b Update to the latest version of the Khronos headers
(cherry picked from commit fc74bf8455fe30fd577783ce67376f18ca3b488c)
(cherry picked from commit 0f5a815657c858822e9f7f66dc2d5a997635b94e)
2024-01-24 09:42:22 -08:00
Sam Lantinga
e3fb974fc7 Fixed ambiguity between std::byte and byte in rpcndr.h
Fixes https://github.com/libsdl-org/SDL/issues/8911

(cherry picked from commit a71f99c71f785e88db0b48599bb52ebe76e2b78e)
(cherry picked from commit 9196584773219f43d0294623322ffe2af358690e)
2024-01-23 09:05:29 -08:00
Ozkan Sezer
9120fbd501 make video/pandora to actually compile somehow.
no one ever maintained it for years..
(cherry picked from commit 48b62e2e57e3eea2b84ed3147f5ea9223a8f63bd)
2024-01-23 17:50:20 +03:00
Ozkan Sezer
52181848da fixes after ShowMessageBox changes:
- SDL_video.c (SDL_ShowMessageBox): remove C99'ism.
- SDL_os2video.c (OS2DIVE_bootstrap): add OS2_ShowMessageBox
- SDL_os2video.c (OS2VMAN_bootstrap): add OS2_ShowMessageBox
- SDL_DirectFB_video.c (DirectFB_bootstrap): NULL ShowMessageBox
- SDL_naclvideo.c (NACL_bootstrap): NULL ShowMessageBox
(cherry picked from commit 9e352e61db6836e85e24e9f2497dee5a62d8e212)
2024-01-23 04:12:32 +03:00
Ryan C. Gordon
10cbe04fc5
SDL_ShowMessageBox: Remove #ifdefs and respect SDL_VIDEO_DRIVER hint.
Fixes #8892.

(cherry picked from commit c5c0b2cb3447a9aecbb7c47622baa945ab43227b)
2024-01-22 19:46:23 -05:00
Ryan C. Gordon
8367b00e8c aaudio: Set low-latency audio mode.
Note that apparently this has caused some weird-sounding audio
on some Android devices, so we might wrap this in a hint later,
or try to check for specific devices.

Fixes #8888.

(cherry picked from commit 1e016fd5eaa3b78248fc9e14a5958c0a884b76b8)
2024-01-22 18:28:10 -05:00
Frank Praznik
467f1d52e4 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.

Manual backport of 84e47b4

(cherry picked from commit a8eeb181b68b2ee214e9c5f239278147ae0f5fbc)
2024-01-22 13:02:58 -05:00
Sam Lantinga
ef7261bc41 Updated to version 2.29.2 for RC build 2024-01-22 08:43:05 -08:00
Sam Lantinga
12bab1c981 Fixed warning C4244: '=': conversion from 'Sint64' to 'int', possible loss of data 2024-01-22 08:39:22 -08:00
pionere
61821bd876 fix audio conversion from S16 to F32 using SSE2 2024-01-22 10:45:58 -05:00
Simon McVittie
0f9422a6a5 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>
(cherry picked from commit eebd5d18a2af0f3505791d7d40c2ec2bb5c08bb6)
2024-01-22 06:34:12 -08:00
Sylvain
237535b23a
Fixed bug #8897 - SDL_BlitSurface segfault when dest_rect is null 2024-01-22 09:22:41 +01:00
yuanhecai
ed5d3d9f82 Fix compilation on loongarch 2024-01-21 19:27:59 -08:00
Frank Praznik
06dd70bc8b video: Use string comparison instead of #ifdefs for driver detection
The dummy driver can be in use on these platforms, so check the actual driver name string.

Fixes the automated video tests with the dummy driver on Win32.
2024-01-21 23:44:53 +01:00
Ethan Lee
b5aec14d43 gdk: Backport SDL3 MR #8844
Co-authored-by: chalonverse <sanjay12@gmail.com>
2024-01-21 13:55:17 -05:00
Sylvain
f1bc5f305c
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`

(cherry picked from commit 2cd583ee13ec4660d7fbe6e6d8293744d3343071)
2024-01-20 11:26:37 +01:00
Sylvain
5d6eb4a5a5
Fixed overflow in SDL_SoftStretch() (see #8878)
(cherry picked from commit 7b02d328fa691a18583fdc762541c7fb8c1ba09b)
2024-01-20 06:39:21 +01:00
Sam Lantinga
b4f99deb9e Updated to version 2.29.1 for RC build 2024-01-19 19:58:24 -08:00
Ryan C. Gordon
1e13aa2c98
androidaudio: same fix as AAudio for pausing thread when backgrounding app.
Reference Issue #8748.
2024-01-19 22:15:27 -05:00
Sam Lantinga
109bb2f17e Make sure the render target isn't bound as a resource
Fixes https://github.com/libsdl-org/SDL/issues/3380

(cherry picked from commit a73132177d3311e70196f8de4e8a2e3b0b70cbcf)
2024-01-19 15:18:14 -08:00
Sam Lantinga
f7ab765b84 Fixed crash scaling very large surfaces
Fixes https://github.com/libsdl-org/SDL/issues/8878

(cherry picked from commit 09ba55b462b826070482a586b72906fae4a66b32)
2024-01-19 13:06:57 -08:00
Ryan C. Gordon
910e040e9e
aaudio: Block the audio device thread when in the background.
Fixes #8748.
2024-01-19 15:10:43 -05:00
Sylvain Becker
bb969ac747 Fixed bug #7614: Segmentation Fault in SDL_BlitSurface (#7808)
Update SDL_BlitSurface to use Intersect functions

(cherry picked from commit 3639743d8909406557663af0854dc7bd97956b24)
2024-01-19 08:53:16 -08:00
Sam Lantinga
87b5bb5840 Fixed potential overflow in software triangle rendering
(cherry picked from commit bd5d4d61edc95f1f003ec91597418fc416ff8315)
2024-01-19 08:33:39 -08:00
Anonymous Maarten
472a415c8f video: move standard c, sse and lsx implementations of yuv2rgb to its own source 2024-01-18 17:06:27 -08:00
Ryan C. Gordon
cc7fe8c255
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.
2024-01-18 15:10:16 -05:00
Ozkan Sezer
f52a12a8fe remove several instances of unnecessary emptry str "" after SDL_PRI??? 2024-01-18 17:25:56 +03:00
Sylvain
9db80adfba Fixed bug #7614: Segmentation Fault in SDL_BlitSurface
(cherry picked from commit e6c8872fdc8d9b8aa5e208c9b55c6f230674a13d)
2024-01-16 07:11:19 -08:00
Sylvain
f3b0dc5007 Fixed bug #8301 - Software renderer draws long lines incorrectly / SDL_RENDERLINEMETHOD_GEOMETRY
(cherry picked from commit ce0e0675de02411f0aafa526cd704f7fff1f1376)
2024-01-16 07:08:15 -08:00
Ryan C. Gordon
c69e858e7a
audio: Patched to compile (mixed declarations and code). 2024-01-16 10:07:14 -05:00
Ryan C. Gordon
1e2f311811
audio: backport SDL3's audio datatype converters.
These are faster and more precise.

This did not change the Uint16 versions (as SDL3 dropped them, and honestly
no one should be using them in SDL2), nor the NEON converters (as this was
not changed in SDL3, so far).

Fixes #8786.
2024-01-16 10:04:09 -05:00