Commit Graph

1932 Commits

Author SHA1 Message Date
Sam Lantinga
b3612f6462 testautomation: fixed RLE operation test on big endian systems
Fixes https://github.com/libsdl-org/SDL/issues/14348
2025-10-29 16:26:31 +00:00
Sam Lantinga
84fac6ca44 testautomation: verify that RLE operation output is correct 2025-10-29 09:07:56 -07:00
Sam Lantinga
1fa6475c90 Added support for saving indexed PNG images
Fixes https://github.com/libsdl-org/SDL/issues/14303
2025-10-23 12:40:41 -07:00
Vicki Pfau
4037c258a1 testcontroller: Fix crash when unplugging a controller while calibrating gyro 2025-10-22 20:10:21 -07:00
Sam Lantinga
e18d63a4e2 Added SDL_RotateSurface()
Fixes https://github.com/libsdl-org/SDL/issues/14269
2025-10-22 17:55:02 -07:00
Sam Lantinga
0e351efbbc testcustomcursor: set the hotspot to the middle of the cross 2025-10-20 09:48:03 -07:00
Eddy Jansson
aaee09d6ed Don't do NULL-checks before SDL_free()
Replaces the pattern

  if (ptr) {
    SDL_free(ptr);
  }

with

  SDL_free(ptr);
2025-10-20 00:13:09 -07:00
Frank Praznik
dcb8a6521c Add animated cursor support
Adds support for animated cursors on Cocoa, Wayland, Win32, and X11.

testcursor can take a semicolon separated list of filenames and load an animated cursor from them.
2025-10-15 14:41:15 -04:00
Sam Lantinga
d819106c65 Try matching gamepad mappings with CRC first
Fixes https://github.com/libsdl-org/SDL/issues/13874
2025-10-14 10:30:03 -07:00
Sam Lantinga
57cd131b7a testpalette: use SDL_SCALEMODE_NEAREST for single pixel copies 2025-10-13 14:25:09 -07:00
Sam Lantinga
a58ae3a94f Added WASAPI support for SDL_HINT_AUDIO_DEVICE_STREAM_ROLE
Also added SDL_HINT_AUDIO_DEVICE_RAW_STREAM

Fixes https://github.com/libsdl-org/SDL/issues/14091
2025-10-13 14:20:19 -07:00
Ryan C. Gordon
72a3e4084a testsymbols: Use the existing symbol list in SDL_dynapi_procs.h 2025-10-13 10:58:03 -04:00
Anonymous Maarten
281ac6c3bb Add elf-dlopen-note test 2025-10-12 15:46:35 -07:00
Sylvain Becker
71bf56c9e4 Add SDL Pinch events (#9445) 2025-10-12 14:44:23 -07:00
Ryan C. Gordon
f7d5bb3c7a cpuinfo: Added SDL_GetSystemPageSize.
Fixes #14201.
2025-10-10 21:16:10 -04:00
Sam Lantinga
9d3dd8f001 testclipboard: make the window resizable
This is handy to see multiple image formats on the clipboard
2025-10-10 17:42:27 -07:00
Sam Lantinga
5441d33c0e testime: toggle text input with a mouse click 2025-10-10 10:14:07 -07:00
Sam Lantinga
17989940f2 Fixed SDL_BlitSurfaceTiledWithScale() with very small scale (thanks @bleeqer!) 2025-10-10 08:59:27 -07:00
Sam Lantinga
d92079f2b7 testsprite: only use transparent alpha on transparent windows
Fixes https://github.com/libsdl-org/SDL/issues/14105
2025-10-09 14:32:08 -07:00
Sam Lantinga
23e3cbec20 Only call clipboard callbacks with mime types they expect
Also clarified that returning NULL from a callback sends zero length data to the receiver, which should be able to handle that.

Fixes https://github.com/libsdl-org/SDL/issues/9586
2025-10-09 12:20:19 -07:00
Sam Lantinga
0e7d5620c2 testclipboard: added support for UCS-2 and UCS-4 text
Chrome uses UCS-2 text for text/x-moz-url content
2025-10-09 12:20:19 -07:00
Sam Lantinga
ec0e84fc0a testclipboard: support both BMP and PNG clipboard images 2025-10-09 12:20:19 -07:00
Sam Lantinga
8830b466d0 Improve handling of surfaces with NULL pixels
Fixes https://github.com/libsdl-org/SDL/issues/14059
2025-10-08 12:40:29 -07:00
Sam Lantinga
244ae39b30 Optimized the 16-bit -> 32-bit SSE pixel conversion
Test code:
---
int main( int argc, char *argv[] )
{
    SDL_Surface *orig = SDL_LoadPNG("testyuv.png");
    SDL_Surface *surf16 = SDL_ConvertSurface(orig, SDL_PIXELFORMAT_RGB565);
    SDL_Surface *surf32 = SDL_ConvertSurface(surf16, SDL_PIXELFORMAT_ARGB8888);

    Uint64 then = SDL_GetTicks();
    for (int i = 0; i < 100000; ++i) {
        SDL_BlitSurface(surf16, NULL, surf32, NULL);
    }
    Uint64 now = SDL_GetTicks();
    SDL_Log("Blit took %d ms\n", (int)(now - then));
    return 0;
}
---

Results on my system:
BlitNtoN: Blit took 34522 ms
Blit_RGB565_32 (3 LUT): Blit took 9316 ms
Blit_RGB565_32 (1 LUT): Blit took 5268 ms
Blit_RGB565_32_SSE41: Blit took 1619 ms
2025-10-07 16:31:14 -07:00
Sam Lantinga
dbd5dd8c75 Ensure 16-bit -> 32-bit conversion is consistent between blitters
The SSE, LUT, and other blitters should have the same results for 16-bit -> 32-bit conversion
2025-10-07 16:31:14 -07:00
Cameron Cawley
2c79ecfb8a Use texture palettes with testoverlay 2025-10-07 11:12:31 -07:00
Cameron Cawley
0f62b7c3b4 Remove teststreaming 2025-10-07 11:12:31 -07:00
Sam Lantinga
9f9be1425d Fixed permissions 2025-10-06 17:24:56 -07:00
Sam Lantinga
bb0d6221c1 Use PNG files for tests and examples
These are much smaller than the previous BMP files

Fixes https://github.com/libsdl-org/SDL/issues/14159
2025-10-06 16:45:53 -07:00
Sam Lantinga
73334b6bb4 Added support for loading and saving PNG images using stb_image 2025-10-06 16:45:53 -07:00
nmlgc
8df057fafc iostream: Properly support the "x" mode for SDL_IOFromFile()
The "x" mode for `fopen()` (open file only if it doesn't exist) used to
be a glibc-exclusive extension, but was later standardized in C11, and
is now also implemented as part of every other widely-used libc:

	* musl: https://git.musl-libc.org/cgit/musl/tree/src/stdio/__fmodeflags.c?id=0ccaf0572e9cccda2cced0f7ee659af4c1c6679a
	* Android Bionic / OpenBSD: 731631f300/libc/upstream-openbsd/lib/libc/stdio/flags.c (86)
	* Apple / FreeBSD: 63976b830a/stdio/FreeBSD/flags.c (L91-L92)

As a result, "x" has already been working on all our automatically
tested platforms that implement `SDL_IOFromFile()` via `fopen()`. So
all we'd be missing for proper support is a Windows implementation
using `CREATE_NEW`, and the documentation that this mode exists and is
intended to work.
2025-10-06 13:23:42 -07:00
Sam Lantinga
134b47730b Added support for linear and pixel art scaling for palettized textures 2025-10-04 15:12:08 -07:00
eafton
c2429e85ec X11TK: Add Arabic/Hebrew/Farsi support by increasing font size slightly and using FriBidi. (#14134) 2025-10-03 19:08:24 -07:00
Sam Lantinga
49d51a0d3c Removed TEXTURETYPE_PALETTE_PIXELART
This doesn't make any sense since the pixel art algorithm uses a box filter to get an average pixel value which isn't possible with indexed textures.
2025-10-03 18:54:07 -07:00
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