Commit Graph

1874 Commits

Author SHA1 Message Date
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
Aubrey Hesselgren
6bfc54508c Accelerometer Tolerance is now calibrated before Gyro Drift. 2025-07-22 12:59:47 -07:00
Thomas Stehle
0eaf28ed4d Added test and test image for clamped texture address mode to render testautomation 2025-07-21 10:21:31 -07:00
Maia
08fd165dd2 Add POINTER suffix to SDL_PROP_IOSTREAM_MEMORY_FREE_FUNC 2025-07-21 10:15:46 -07:00
Sam Lantinga
ada44eaa10 testcontroller: reverted GameInput test code 2025-07-17 18:41:43 -07:00
Sam Lantinga
3b9db3dd62 Added support for Windows GameInput 2.0 2025-07-17 15:38:39 -07:00
Marcin Serwin
8451ce86c1 iostream: Add optional free_func pointer property to memory streams
Fixes https://github.com/libsdl-org/SDL/issues/13368

Signed-off-by: Marcin Serwin <marcin@serwin.dev>
2025-07-17 08:59:42 -07:00
Sam Lantinga
1b65f25465 testcontroller: use the correct label for face buttons 2025-07-15 15:52:40 -07:00
Anonymous Maarten
f3bf387caf testhotplug+testmouse: exit when pressing ESC key 2025-07-03 02:21:51 +02:00
Aubrey Hesselgren
e960bf6904 Gyro instrumentation for test controller (#13287)
This adds several minor changes to the gyro instruments.

* The HID Sensor Time display is now throttled to 10hz.
* Calibration for the gyro is now time based, not sample count based. Different polling rates will have drift calibrated over the same space of time.
* Pitch/Yaw/Roll readout: Yaw is prioritized, and then pitch, and then roll. This gives a more human-readable pitch/yaw/roll display, closely matching game engines.
* Pitch/Yaw/Roll text is colorized to match the axes in the 3D gizmo.
* Added set of axes to the 3D gizmo to show the "Left Hand Space" positive axis directions.
2025-06-26 19:56:06 -07:00
Marcin Serwin
bbc674b9e7 test: Fix resource paths in testtray
Signed-off-by: Marcin Serwin <marcin@serwin.dev>
2025-06-22 21:03:37 -07:00
Sam Lantinga
e6c2649afc Updated testffmpeg for ffmpeg 7.1 2025-06-21 08:48:40 -07:00
Frank Praznik
390fe65323 test: Fix a window parenting bug in testmodal 2025-06-18 09:26:09 -04:00
Sam Lantinga
f62c982bcf Reverted Accelerometer and Gyro displays to throttled display (10hz)
Also made accelerometer threshold for drift calibration more lenient for very noisy accelerometers.

The testcontroller tool could eventually be used to come up with a better way to profile an IMU's "stationary" noise so that this threshold can be as tight as necessary for the sake of automatic drift calibration.

(thanks @HilariousCow!)
2025-06-16 11:14:22 -07:00
Aubrey Hesselgren
913b611ccd Added tools for evaluating gyroscope accuracy and IMU polling rates. (#13209)
* Added tools to Test Controller for evaluating gyroscope accuracy and IMU polling rates.

This adds a visual suite to the testcontroller tool to help validate IMU data from new gamepad drivers and HID implementations.

The 3D gizmo renders accumulated rotation using quaternion integration of gyroscope packets. If a controller is rotated 90° in real space, the gizmo should reflect a 90° change, allowing quick detection of incorrect sensitivity or misaligned axes.

Also includes:
- Euler angle readout (pitch, yaw, roll)
- Real-time drift calibration display with noise gating and progress
- Accelerometer vector overlay
- Live polling rate estimation to verify update frequency

Intended for developers working on controller firmware or SDL backend support to confirm correctness of IMU data processing.
2025-06-13 14:01:52 -07:00
Michael Fitzmayer
7ae64592c9 Restore support for the Nokia N-Gage (#12148) 2025-05-22 11:07:22 -07:00
Takase
f6c1e81394 [Process API] Quoting enhancements (#12946) 2025-05-12 09:17:21 -07:00
Ryan C. Gordon
795d1ae1fb testmessage: Don't push the event if "Retry" was chosen.
Otherwise, the message box thread goes back to blocking, but the app's main
thread progresses to SDL_WaitThread and won't pump the event queue anymore.

On iOS, this means the messagebox won't pop back up (because it uses
SDL_RunOnMainThread, which needs the event loop to pump), but it's just bad
practice on any platform to stop pumping the event queue for indefinite
lengths of time.
2025-05-02 21:42:47 -04:00
Ryan C. Gordon
691cc5bb5e dialog: Cocoa shouldn't crash if there's a '.' in the filters.
So something like "index.pb" will now accept any file with a ".pb" extension,
to make macOS happy. This seems like a reasonable tradeoff.

Other minor cleanups.

Fixes #12778.
2025-05-01 18:11:36 -04:00
Sam Lantinga
48dfc03a87 Added the gamepad hint SDL_GAMECONTROLLER_USE_GAMECUBE_LABELS
This is for internal use to signal that a mapping uses positional GameCube buttons. It's set so we know whether a mapping uses the older style labeled buttons or the newer style positional buttons. If a positional mapping is used with SDL2, then it will be ignored, since the hint is marked as defaulting true and the mapping conditional is that the hint is false.
2025-05-01 10:54:16 -07:00
Sam Lantinga
21a7bbbf14 Restore compatibility with older GameCube mappings
Restore the original button values for GameCube controllers, but swap labeled mappings to positional while loading mappings

Fixes https://github.com/libsdl-org/SDL/issues/12847
2025-05-01 10:54:16 -07:00
Frank Praznik
b871ac0d97 Add support for non-constrained and non-grabbing popups
By default, popups are automatically constrained to be completely within display bounds, so as not to cut off information and result in an unusable menu, or unreadable tooltip. In some cases, however, this is not wanted, so a property to toggle this behavior is added.

There are also cases where the client may not want a popup menu to implicitly grab the keyboard focus, as is the default behavior, so popup menus now respect the focusable flag/property, as well as being able to toggle focus grabbing via SDL_SetWindowFocusable().
2025-04-29 12:02:14 -04:00
Sam Lantinga
31650d566c Added SDL_GAMEPAD_TYPE_GAMECUBE
The GameCube controller has a different face button layout than the Xbox or Nintendo Switch style controllers. It has the B button on the left and the X button on the right, so we should map those to SDL_GAMEPAD_BUTTON_WEST with SDL_GAMEPAD_BUTTON_LABEL_B and SDL_GAMEPAD_BUTTON_EAST with SDL_GAMEPAD_BUTTON_LABEL_X respectively.

Fixes https://github.com/libsdl-org/SDL/issues/12847
2025-04-27 11:01:50 -07:00
Ozkan Sezer
360cc2791f test/msdf_font.bmp: mark as non-executable. 2025-04-26 02:39:20 +03:00
Sam Lantinga
c2ed58db7b windows: Fix stale zoom/iconic state in WM_WINDOWPOSCHANGED handler
- IsIconic/IsZoomed must be checked after sending SDL_EVENT_WINDOW_SHOWN as that may trigger window operations if any are pending from when
  the window was hidden. e.g. the window may be shown, which triggers SDL_MaximizeWindow and a new WM_WINDOWPOSCHANGED where
  SDL_EVENT_WINDOW_MAXIMIZED is sent, then control returns to the original WM_WINDOWPOSCHANGED which would not think the window is zoomed
  and send SDL_EVENT_WINDOW_RESTORED.
2025-04-25 16:21:44 -07:00