Commit Graph

1958 Commits

Author SHA1 Message Date
Simon McVittie
65ef4df6d4 testver: Assert that SDL_GetRevision() starts with SDL-
https://github.com/libsdl-org/SDL/issues/14575

Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-12-03 08:48:48 -08:00
Ryan C. Gordon
505cd6cd22 testautomation_video: Don't do fullscreen toggling tests on Emscripten.
SDL_SetWindowFullscreen now reports failure while a fullscreen transition is
already in progress on Emscripten, upsetting the test when it tries to come
back to windowed mode, but testautomation will never give correct results here
even when we fix the backend to queue pending reversal requests, because
you'll have to return to the Emscripten mainloop before these state changes
will occur.

It's just sort of luck this specific test passed before on this target.
2025-12-02 14:36:27 -05:00
Sam Lantinga
ea1514ab63 testthread: verify that child threads aren't SDL_IsMainThread() 2025-11-30 12:15:48 -08:00
Sam Lantinga
955698c635 testthread: SDL performs thread initialization automatically 2025-11-30 12:15:48 -08:00
Anonymous Maarten
e221905195 Fix check_stdlib_usage.py libc call matching
It now matches libc usage inside statements,
and skips libc-like usage in strings or as struct members.
2025-11-25 01:07:10 +01:00
Sam Lantinga
ebd3aa5289 testgpu_spinning_cube: fixed error handling if texture creation fails 2025-11-24 08:31:38 -08:00
Sam Lantinga
ba919832e4 testgpu_spinning_cube: removed duplicate calls to clear and present 2025-11-24 08:24:43 -08:00
Anonymous Maarten
ce5e46c37d Add SDL_(Get|Set)iSurfaceClipRect automation test
Co-authored-by: Sam Lantinga <slouken@libsdl.org>
(cherry picked from commit a65111bd2d)
2025-11-24 00:02:36 +01:00
Ryan C. Gordon
99d7dad7e6 pen: Dramatic improvements to proximity information.
Now everything will attempt to track pens through proximity changes (instead
of removing the pen entirely). testpen.c has been updated to reflect this.

Some platforms and devices are better at this than others, but this seems like
a significant usability improvement across the board.

Fixes #12992.
2025-11-21 08:13:16 -05:00
eafton
36976ecb43 X11TK: Introduce Thai support and rewrite/cleanup messagebox positioning code (#14474) 2025-11-20 15:26:46 -08:00
Sam Lantinga
1e5cbbc1d0 checkkeys: clarify that SDL_HINT_WINDOWS_RAW_KEYBOARD isn't needed 2025-11-19 08:54:43 -08:00
Anonymous Maarten
8f21fe4994 testmouse: avoid use-after-free
Bug was introduced in 17a891daa8
2025-11-18 08:35:56 +01:00
Anonymous Maarten
8920736df0 cmake: add testrwlock to CTest test suite 2025-11-17 20:00:02 +01:00
Anonymous Maarten
17a891daa8 test: plug leaks of testmouse and testrwlock 2025-11-17 20:00:02 +01:00
Anonymous Maarten
3ba9bdfc01 test: use SDL_test to parse arguments of tests 2025-11-17 20:00:02 +01:00
Ozkan Sezer
a882afafe5 fixed several -Wzero-as-null-pointer-constant warnings from gcc-15 2025-11-17 17:55:10 +03:00
Sam Lantinga
770b38b4f1 Loosened epsilon for color matching
Fixed https://github.com/libsdl-org/SDL/issues/14473
2025-11-15 16:51:19 -08:00
Sam Lantinga
ed6d41f55b testcontroller: demonstrate multiple sensors on the virtual controller 2025-11-14 08:18:04 -08:00
Sam Lantinga
cc3b5766fa testsprite: changed return type of LoadSprite() to bool 2025-11-14 08:05:49 -08:00
Maia
a01d6f109d Add SDL_LoadSurface and SDL_LoadSurface_IO (#14374) 2025-11-13 14:50:37 -08:00
Sam Lantinga
fffaf122df Added temporary workaround for failing Emscripten test 2025-11-10 18:30:02 -08:00
Sam Lantinga
eccd5c03c3 testautomation: added tests to cover linear <-> sRGB colorspace conversion 2025-11-10 18:30:02 -08:00
Anonymous Maarten
2bc886d0bd testqsort: add custom macro to allow comparing with qsort 2025-11-09 11:24:03 +00:00
Anonymous Maarten
2be18f340f testqsort: use SDLTest_TestSuite 2025-11-09 11:24:03 +00:00
Sam Lantinga
a2ed1a4197 Fixed blitting bitmaps with a non-zero x offset
Also added basic testautomation coverage of bitmap blits

Fixes https://github.com/libsdl-org/sdl2-compat/issues/546
2025-11-06 22:47:50 -08:00
Sam Lantinga
09f00e397c testsymbols: include SDL_main.h 2025-10-31 10:34:42 -07:00
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