Commit Graph

1836 Commits

Author SHA1 Message Date
Sam Lantinga
409f3ade88 Removed SDF test program
There's a much better example of SDF support in testgputext in SDL_ttf
2025-01-29 04:15:27 -08:00
Sam Lantinga
4176e188bf Enable testgles2 on all platforms
We use SDL's headers so we're not dependent on system OpenGL header availability.
2025-01-29 04:03:31 -08:00
Petar Popovic
a336b62d8b Remove newlines from error messages 2025-01-23 11:45:04 -08:00
Petar Popovic
983cfe8b1c Remove even more newlines from log messages 2025-01-23 09:32:50 -08:00
nightmareci
718034f5fa Remove newlines from log messages 2025-01-22 20:25:04 -08:00
Anonymous Maarten
cb3cc28809 emscripten: pass --no-sandbox to the chrome web driver
This fixes running the Emscripten tests on Ubuntu 24.04.
2025-01-22 02:48:32 +01:00
Anonymous Maarten
efa6e7aece android: add style to test apk's 2025-01-21 20:20:17 +01:00
Sam Lantinga
9b454a762c Revert "testautomation: don't validate alpha values on XRGB formats"
This reverts commit 759e01bd64.

It's better to return the expected format from SDL_RenderReadPixels() than skip alpha testing.
2025-01-20 12:57:48 -08:00
Frank Praznik
819628c6bf testautomation: Remove Win32 borderless resizable hint
This defaults to 'true' now, so setting it manually is no longer necessary.
2025-01-20 14:49:35 -05:00
Sam Lantinga
759e01bd64 testautomation: don't validate alpha values on XRGB formats
The results are not defined, and some renderers set 0xFF always and other renderers set the alpha to blend results, even though it won't be used when rendering.

Fixes --filter render_testBlendModes with D3D renderers
2025-01-20 11:29:41 -08:00
Sam Lantinga
362f96a6cf testcontroller: use SDL_MAIN_USE_CALLBACKS so updates happen during live resizing 2025-01-20 10:11:31 -08:00
Sam Lantinga
b716eeefef testtray: minor cleanup 2025-01-19 18:53:55 -08:00
Ryan C. Gordon
874c07f8de storage: Don't allow "." and ".." paths, enforce '/' dir separators.
Also clarify what characters are valid for Storage paths in the category docs.

Fixes #11079.
Fixes #11370.
Fixes #11369.
2025-01-16 08:19:28 -05:00
Ryan C. Gordon
67664a0427 testfilesystem: test some Storage APIs, too. 2025-01-16 08:19:28 -05:00
Ryan C. Gordon
87e1b0eb89 filesystem: SDL_EnumerateDirectory() gives dirs with path seperators appended.
Fixes #11065.
Fixes #11427.
2025-01-16 08:19:28 -05:00
Ramez Ragaa
e98ee9bb04 Adjust testgl.c to test gl_release_behavior 2025-01-16 08:19:05 -05:00
Evan Hemsley
fb6df93384 GPU: Add name properties to resources (#11946) 2025-01-13 17:29:08 -08:00
Ozkan Sezer
307dac97ac testcontroller.c: fix build errors due to -Wformat after commit b524af1 2025-01-12 22:00:02 +03:00
Sam Lantinga
b524af1b43 testcontroller: log the ID of gamepads as they are added and removed 2025-01-12 10:02:39 -08:00
Frank Praznik
6b776a9989 keyboard: Add some SDL keycodes for common Xkb keys
Add SDL keycodes for keys found commonly found in the default Xkb layout, such as left tab and compose, and keys frequently used for custom modifiers such as Meta, Hyper, and Level5 Shift.

As these keys aren't Unicode code points and don't have associated scancodes (at least on modern keyboards), they are placed in the new extended key code space, with bit 30 set as a flag.
2025-01-09 17:26:41 -05:00
Ryan C. Gordon
3f7f632e14 audio: Added SDL_AudioDeviceStreamPaused.
We had the other two wrapper functions to pause and resume, and forgot query.
2025-01-09 01:36:57 -05:00
Ryan C. Gordon
f61860fa93 testautomation: fixed incorrect test.
The test was doing this:

- The output size is 80x60
- The logical size is 40x30
- The viewport is { 10, 7, 40, 30 }
- Draw to fill this whole viewport.

This would offset the filled rectangle a little, as before, but then the
viewport was the size of the entire logical space, so it wasn't a rectangle
centered in the middle of the output, as was expected.

This used to produce the expected output before the fix in
fa7a529912. But it appears the test was
incorrect, so this tweaks the viewport to produce the expected result.
2025-01-08 23:33:39 -05:00
Frank Praznik
f2f04e825d tests: Fix get/set window size test being skipped
A return check conversion was missed when the SDL_* functions were converted to return boolean values instead of int, which caused this test to be skipped.
2025-01-08 11:02:45 -05:00
Ryan C. Gordon
b674b715f5 fix integer overflow ub in testautomation_sdltest
(cherry-picked from commit f804293a27)
2025-01-06 13:18:03 -05:00
Ryan C. Gordon
6a0405b933 testautomation: Added a test to stdlib_swprintf that previously would fail. 2025-01-05 02:45:15 -05:00
Anonymous Maarten
efba42a67b tests: avoid undefined signed overflow 2025-01-04 01:06:29 +01:00
Anonymous Maarten
53aaf8c26b cmake: custom generate-XXX targets must depend on outputs 2025-01-04 00:19:45 +01:00
Sam Lantinga
a8c41135aa Enable themed Windows dialogs when building with Visual Studio 2025-01-03 09:25:10 -08:00
Ryan C. Gordon
e484182765 testcamera: Log the camera backend in use. 2025-01-03 03:46:22 -05:00
Sam Lantinga
9f7b2c3595 Fixed incorrect error message when a joystick can't be opened 2025-01-02 17:18:09 -08:00
Erik Soma
c6b5c21aaf clipboard: Ensure SDL_ClearClipboardData clears data even when no data has been set 2025-01-02 07:23:27 -08:00
Anonymous Maarten
b713e7581b stdlib: fix SDL_strtol of "0" with base 0
SDL_strtol("0") skipped the "0" octal prefix
and returned a failure because the remainder of the string was empty.
2025-01-02 01:15:28 +01:00
Sam Lantinga
e43aa12b49 Updated copyright for 2025 2025-01-01 08:01:29 -08:00
Sam Lantinga
f2074d7af3 Updated copyright for 2025 2025-01-01 07:45:52 -08:00
Sam Lantinga
3197e27b59 testcamera: fixed return codes 2024-12-31 19:27:11 -08:00
Sam Lantinga
f18e023317 Added testclipboard 2024-12-31 19:27:11 -08:00
Sam Lantinga
1c04ebe423 Renamed SDL_ASYNCIO_CANCELLED to SDL_ASYNCIO_CANCELED 2024-12-30 19:13:02 -08:00
Anonymous Maarten
543f244965 tests: include SDL_build_config.h when HAVE_BUILD_CONFIG is defined 2024-12-29 20:08:06 +01:00
Ozkan Sezer
c2121dd9a2 testcamera: fix MSVC build failure due to C4244 warning. 2024-12-29 21:28:02 +03:00
Sam Lantinga
5c84d38822 testcamera: don't pick a frame size larger than the maximum texture size
Ran into this on a Huawei Y6 phone, where the back facing camera can generate 4160x2000 frames, but the maximum texture size was 4096x4096
2024-12-29 09:41:00 -08:00
Anonymous Maarten
f1232de3d2 cmake: add_dependencies must have at least 2 arguments 2024-12-28 02:43:12 +01:00
Anonymous Maarten
2664d36faf cmake: avoid parallel generation of headers through intermediate target
See
https://cmake.org/cmake/help/latest/command/add_custom_command.html#example-generating-files-for-multiple-targets
2024-12-28 02:39:12 +01:00
Sam Lantinga
75a24116b5 testcontroller: show gamepad connection state 2024-12-27 13:58:49 -08:00
Semphris
0461180e25 SDL_EVENT_QUIT when no window nor tray
SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE will not fire if there are active tray icons. This impacts only applications that create tray icons, and that at least one icon outlives the last visible top-level window. SDL_EVENT_QUIT will fire when the last active tray is destroyed if there are no active windows.
2024-12-27 09:22:27 -08:00
Sam Lantinga
948b16533c testcamera: use the first available cameras 2024-12-26 19:23:43 -08:00
Semphriss
01b9b0edb7 Add system tray support (#10873) 2024-12-24 10:36:39 -08:00
capehill
80c1b1e1a0 Fix testautomation pixels_saveLoadBMP big endian issue
It seems created surfaces are ARGB8888 format on both BE and LE,
therefore BGRA32 failed.
2024-12-22 12:08:54 -08:00
Sam Lantinga
cadeec9cc9 SDL_SoftStretch() doesn't handle large pixel formats
Fixes https://github.com/libsdl-org/SDL/issues/11534
2024-12-21 09:19:03 -08:00
Sam Lantinga
f37eef948c Removed raw mouse events
It's too close the 3.2.0 release for an API change like this.

If/when we re-add these, some things for consideration:
* What use cases does this enable that aren't currently possible?
* What cross-platform API guarantees do we make about the availability of these events? e.g. do we try to simulate them where raw input isn't actually available?
* How is this different from the existing relative mode, and how do we clearly explain when you want these events vs wanting relative mode?

Notes from @expikr:
First observation: the reason I originally passed denominators instead of multipliers was because some rational values cannot be exactly represented by floats (e.g 1/120) so instead let the end-developer decide how to do the dividing themselves. It was the reason why it was using split values with an integer numerator to begin with, instead of having both as floats or even just normalize it in advance.

On the other hand, passing them as multipliers might have hypothetical uses for dynamically passing end-user controlled scaling in a transparent manner without coupling? (Though in that case why not just do that as additional fields appended to `motion` structs in an API-compatible layout?)

So it’s somewhat of a philosophical judgement of what this API of optional availability do we intend for it to present itself as:
- should it be a bit-perfect escape hatch with the absolute minimally-denominal abstraction over platform details just enough to be able to serve the full information (á la HIDPIAPI),
- or a renewed ergonomic API for splitting relative motion from cursor motion (in light of The Great Warping Purge) so that it is unburdened by legacy RelativeMode state machines, in which case it would be more appropriate to just call it `RELATIVE` instead of `RAW` and should be added alongside another new event purely for cursor events?

This alternate API stream was conceived in the context of preserving compatibility of the existing RelativeMode state machine by adding an escape hatch. So given the same context, my taste leans towards the former designation.

However, as The Great Warping Purge has made it potentially viable to do so, if I were allowed to break ABI by nuking the RelativeMode state machine entirely, I would prefer the latter designation unified as one of three separate components split from the old state machine, each independently controlled by platform-dependent availability without any state switching of a leaky melting pot:
- cursor visibility controls (if platform has cursor)
- cursor motion events (if platform has cursor)
- relative motion events (if the platform reports hardware motion)
2024-12-21 05:18:42 -08:00
Sam Lantinga
c44fa5bb07 Updated raw input events to match SDL style
Also added raw keyboard events, and implemented raw input events on iOS, OpenBSD console, Linux console, and X11
2024-12-21 05:18:42 -08:00