Commit Graph

1898 Commits

Author SHA1 Message Date
nmlgc
8824eace93 testautomation: Test SDL_snprintf() for doubles >LLONG_MAX and <ULLONG_MAX
The uclibc version of SDL_snprintf() is currently limited to values
<ULLONG_MAX due to the `unsigned long long` cast in SDL_PrintFloat(),
but it makes sense to at least ensure that it does support the full
unsigned 64-bit range. This also covers the one defined case where a
32-bit MSVC build can't assume that _ftoul2_legacy() == _ftol2().
2025-10-03 07:21:20 -07:00
Sam Lantinga
a864dcac25 Added support for using the GPU renderer as an offscreen renderer
SDL_CreateGPURenderer() now allows passing in an existing GPU device and passing in a NULL window to create an offscreen renderer.

Also renamed SDL_SetRenderGPUState() to SDL_SetGPURenderState().
2025-10-01 23:32:18 -07:00
Sam Lantinga
fe3b399b7e Added support for P010 pixel format in SDL_UpdateNVTexture() 2025-10-01 07:17:55 -07:00
Sam Lantinga
224b4917a3 testpalette: added a --renderer command line option 2025-10-01 07:17:55 -07:00
Anonymous Maarten
fd4c2f8cfd ci: build testffmpeg on MinGW (msys2) build bots 2025-09-30 17:42:11 +02:00
Simon McVittie
c81b4e8493 test: Space-separate arguments in as-installed tests' .test files
The "as-installed" tests have metadata files in the .desktop-like format
used by gnome-desktop-testing, which uses a subset of shell syntax for
the Exec field. The list of arguments is represented as a
semicolon-separated list by CMake, but we need to convert that into a
space-separated list for the Exec field.

Strictly speaking we should be quoting the arguments with the equivalent
of Python's shlex.quote, but I couldn't find a way to do that in CMake,
and currently none of the tests have arguments that need quoting.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-09-30 15:58:49 +02:00
Sam Lantinga
7dcc09986d Test changing the palette for a single texture 2025-09-28 22:10:06 -07:00
Sam Lantinga
264b436dba Fixed changing palettes while rendering is in flight 2025-09-28 22:10:06 -07:00
Sam Lantinga
0b4b254a53 Added support for textures with palettes
Closes https://github.com/libsdl-org/SDL/pull/6192
2025-09-28 22:10:06 -07:00
ProgramGamer
2c8c2d72b5 Allow in-memory IOStreams to be of length 0 (#13840) 2025-09-27 09:36:30 -07:00
Anonymous Maarten
9f721e8a9c Add test that verifies all SDL3 symbols are available 2025-09-26 21:42:04 +02:00
Sam Lantinga
1d2a482dde testgpurender_effects: use the grayscale algorithm from BT.709 2025-09-26 10:27:10 -07:00
eafton
f3a9f66292 Add more Unicode tests to testmessage, improve fallback fonts in X11TK (#14042) 2025-09-24 14:23:27 -07:00
Sam Lantinga
fe8c080713 testime: allow enabling/disabling text input on individual windows 2025-09-23 09:59:11 -07:00
Sam Lantinga
6f3ef22d19 Fixed build warning 2025-09-22 11:27:23 -07:00
Sam Lantinga
8a67a8a319 testautomation: fixed video tests on iOS 2025-09-22 10:09:30 -07:00
Sam Lantinga
5d9b9673b9 testautomation: use SDL functions for iostream test setup
This fixes the IOStream tests on iOS, since the current directory isn't writable
2025-09-22 10:09:30 -07:00
Sam Lantinga
c8f32b67ae testautomation: use the correct return type for clipboard APIs 2025-09-21 23:27:59 -07:00
Sam Lantinga
a5b070ba2d Skip render_testLogicalSize() if we didn't get a window of the expected size
We rely on that to validate the results of SDL_GetRenderLogicalPresentationRect()
2025-09-21 20:25:10 -07:00
Sam Lantinga
26dd4e3abb Fixed filesystem operations on Android
Full paths are used as-is, relative paths are prepended with SDL_GetAndroidInternalStoragePath(), and operations fall back to the asset system as appropriate.

This is consistent with the behavior of opening files on Android.
2025-09-21 18:23:34 -07:00
Sam Lantinga
005f10bd97 testautomation: fix video tests on Android
Like emscripten, window positioning and sizing is not supported on Android.
2025-09-21 16:25:51 -07:00
Sam Lantinga
400489c157 testcontroller: fixed memory leak 2025-09-20 18:21:26 -07:00
Frank Praznik
ac82534375 tests: Flush events after an SDL_WaitEvent() call
SDL_WaitEvent() will pump OS events if no poll sentinel is pending, so flush events before inserting a user event to ensure that the user event will be next in the queue.
2025-09-19 12:36:59 -04:00
Anonymous Maarten
7501f7194b testsprite: zero initialize textures
LoadSprite destroys current textures before allocating new ones.
So make sure the previous (=first) textures are valid.
2025-09-19 15:37:21 +02:00
Anonymous Maarten
b1b98b10d8 cmake: also install wasm debug map (optional) 2025-09-18 17:18:25 +02:00
Anonymous Maarten
447df411e6 cmake: install javascript and wasm of Emscripten tests 2025-09-18 05:28:22 +02:00
Sam Lantinga
937b7e6aea Fixed testprocess on 32-bit Windows
Previously the test would kill the child process while it was in the process of initializing (loading DLLs, etc) and this would cause the test to fail.
2025-09-14 15:09:07 -07:00
nightmareci
2f5bc17ea6 Fix support for Windows XP and up (#13904) 2025-09-08 13:00:26 -07:00
Sam Lantinga
9ccdaa49f4 Removed reference to icon-alpha.bmp
This file was never added, and I believe this just had a 50% alpha channel added to the standard icon.bmp

Fixes https://github.com/libsdl-org/SDL/issues/13394
2025-09-07 12:54:14 -07:00
Sam Lantinga
cd6b68a9fb Define the behavior of a negative width or height passed to SDL_RenderFillRect()
The software renderer now matches the 3D renderer behavior by rendering a reversed rectangle (extending width or height in the opposite direction) when width or height is negative. It also now renders no rectangle if the width and height are 0.

Fixes https://github.com/libsdl-org/SDL/issues/13400
2025-09-07 12:28:37 -07:00
Sam Lantinga
2304047c95 testyuv: enable testing planar YUV texture update functions 2025-09-07 10:19:00 -07:00
Sam Lantinga
a9b5a1e785 Simplified the transparent software renderer test 2025-09-04 10:31:22 -07:00
Sam Lantinga
f48c20f481 Added testsoftwaretransparent to the CMake build system 2025-09-04 09:25:05 -07:00
Qiang
f2d2cd8152 fix: Blending rendering anomaly when using the software renderer with SDL_WINDOW_TRANSPARENT on Windows. (#13866) 2025-09-04 07:41:45 -07:00
Sam Lantinga
ea1a769322 Fixed the perspective matrix calculation (thanks @KonkolyTamas!)
Fixes https://github.com/libsdl-org/SDL/issues/13867
2025-09-04 06:04:01 -07:00
Sylvain
b084999d40 testautomation_events: initialize variable to prevent undefined read 2025-09-03 10:15:01 +02:00
Sam Lantinga
285df94623 Renamed SDL_GPURenderStateDesc to SDL_GPURenderStateCreateInfo for consistency with GPU API conventions
Fixes https://github.com/libsdl-org/SDL/issues/12817
2025-08-27 09:14:19 -07:00
Sylvain
26d6352500 Fixed bug #13794: prevent to use the onBackPressed callback API that is enabled on API36 2025-08-27 11:39:00 +02:00
Colin Kinloch
c79a18d0fa dialog: Fix save file chooser with xdg portal
This correctly sets the xdg portal fields for targeting a specific
new filename or existing file.

"current_name" sets the dialogs placeholder name.
"current_file" targets an existing file.
"current_folder" for when the target is a folder.
2025-08-25 11:35:47 -07:00
Colin Kinloch
81920b5db7 testffmpeg: avutil queue family version check
The `AVVulkanDeviceQueueFamily` struct was introduced by libavutil
59.34.100
2025-08-25 11:10:15 -07:00
Petar Popovic
45feacf608 emscripten tests: fix warning: uninitialized variable 2025-08-13 17:00:45 -07:00
Pino Toscano
171885010d Add GNU/Hurd as platform
SDL has been building on GNU/Hurd for a long time, using either drivers
based on external libraries (e.g. X11, pulseaudio, sndio, etc) or dummy
drivers. This commit introduces it explicitly as platform, so it can be
recognized, and tweaked as needed. In particular:
- introduce the SDL_PLATFORM_HURD define
- tighten/improve the platform detection in cmake, and use "Hurd" as
  identifier
- return the platform name in SDL_GetPlatform()
- tweak the CFLAGS/LDFLAGS so pthreads can be used properly
- implement SDL_GetExeName(), using /proc/self/exe as provided by the
  basic Linux-like procfs
- enable GLES 2 in tests (mostly for consistency with Linux)
2025-08-08 12:47:09 -07:00
capehill
1c5c3b1479 Fix SDL_BlitSurfaceScaled crash
SDL_BlitSurfaceScaled could crash when passed large coordinates, due
to final_dst.w or final_dst.h getting negative values.
2025-08-01 09:22:20 -07:00
Ozkan Sezer
83818eeb95 tests: c90 fixes (#endif comments) for consistency after commit 9e37839 2025-08-01 06:28:02 +03:00
Anonymous Maarten
9e3783996b Fix testnative C90 compatibility 2025-08-01 02:27:54 +02:00
Anonymous Maarten
7b501ae71f Add a few include guards to private headers 2025-08-01 02:00:08 +02:00
eafton
d983a89241 Restyle message boxes and add icon support to them on X11. (#13267) 2025-07-28 09:23:38 -07:00
Petar Popovic
2c2c2c5a48 Fixed a few "-Wstrict-prototypes" warnings 2025-07-26 11:12:40 -07:00
Aubrey Hesselgren
34616d1b00 A little more tidying. Better notes around how the absolute maximum threshold was arrived at. 2025-07-22 12:59:47 -07:00
Aubrey Hesselgren
8863e5ee67 Made the maximum noise during accelerometer noise profiling a define, in terms of "G"
Also removed a // comment which was causing the build to error.
2025-07-22 12:59:47 -07:00