Commit graph

11867 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 857b9848d2 Don't use the system iconv on Apple mobile platforms
Fixes https://github.com/libsdl-org/SDL/issues/8964

(cherry picked from commit d6a48e4958e48e797c946ba231a6d025e636f77c)
(cherry picked from commit 8eed915dfab11fd8055a45d24e943313cca249c9)
2024-02-01 15:55: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
Ozkan Sezer 23cf7a2e0d autotools: a few libtool updates from mainstream
(cherry picked from commit 971508c0d770f564353c7976c8b1df895d2b0dcc)
2024-01-28 21:50:42 +03:00
Sam Lantinga 4a62e1c0ca Updated to version 2.29.3 for RC build 2024-01-27 22:50:08 -08:00
Sam Lantinga 173afd8564 Fixed testautomation log callback calling convention
(cherry picked from commit 9f7eb6c4c11b445da0fcadb357e1c7ed053b0084)
(cherry picked from commit c55bd24827398be6a2ef3fc48aae05d9f68ebb86)
2024-01-27 22:45:13 -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 0bd58cd727 Fixed Watcom build
(cherry picked from commit bb30a353648e5a9c2bb6d5835636b42e52cc6eec)
2024-01-27 20:29:06 -08:00
Sam Lantinga de1292f8ac Fixed build
(cherry picked from commit 11c932bf1dbef431eaae918e5d14163669e2e90e)
2024-01-27 20:18:59 -08: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
Sam Lantinga e767840874 Document that the default log priority is error, not critical
(cherry picked from commit a7a98d8bbb8976a7c55a734f1ac420c5d43763a8)
(cherry picked from commit 2c110685698b45e51527a9b0fc8b4406e13ee102)
2024-01-27 19:46:58 -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
Ryan C. Gordon 5f6a4fe643
blendmode: Corrected docs for SDL_BLENDOPERATION_[REV_]SUBTRACT.
They were documented backwards.

Fixes #8910.

(cherry picked from commit ecbbef8b8df954da96829c06bac4ad208f83dddd)
2024-01-25 17:49:55 -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
Ozkan Sezer 4a4f289adc testhaptic.c: include stdlib.h for exit()
(cherry picked from commit aaf426e280f8bbfbae3111fd5d8b6d68fbcf6404)
2024-01-23 01:20:40 +03: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
Simon McVittie 55ba686530 test: Run testautomation under Autotools too, not just CMake
The CMake build system runs this since #8313, so we already have to make
sure it doesn't regress.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-01-22 06:33:27 -08:00
Simon McVittie 4cb43db1a9 test: Don't distinguish between different categories of tests
It's reasonable to assume that any of them might need a display and an
audio backend. We run them with SDL_VIDEODRIVER and SDL_AUDIODRIVER
set to dummy anyway.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-01-22 06:33:27 -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 f569cc56a9 tests: Fix automated audio tests on Windows and Linux
If a specific audio driver was requested for testing, don't loop over all drivers in the init, open/close, and pause/unpause tests.

Additionally, drivers can fail if attempting to open an audio device when no underlying output is present, which is a valid case if the system has no audio hardware available. Check for the presence of audio output devices before attempting to open them.

Fixes automated tests with various drivers on Windows and Linux.
2024-01-21 23:44:53 +01: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
Anonymous Maarten a420eb79bb cmake: run testautomation with CTest on ci 2024-01-21 23:44:53 +01:00
Anonymous Maarten 41fc398114 Move check for SDL_Delay upper bounds to testtimer
(cherry picked from commit f45761908aa88c61cf7f2b7cb2e663abee06eed0)
2024-01-21 23:44:53 +01:00
Anonymous Maarten 1737340978 Use helper_ddtod function to compare atan2 infinity cases
This fixes a test failure when building on mingw32 in Release mode.
2024-01-21 23:44:53 +01:00
Anonymous Maarten 69a6efcd1b Avoid using higher precision floating point numbers by using it in a function 2024-01-21 23:44:53 +01:00
Anonymous Maarten fbee0b86bf video: verify SDL_GetNumVideoDisplays is succesful 2024-01-21 23:44:53 +01:00
Anonymous Maarten 880c69392a testautomation_math: do relative comparison + more precise correct trigonometric values 2024-01-21 23:44:53 +01:00