Commit Graph

20627 Commits

Author SHA1 Message Date
Sam Lantinga
7454302cd0 Fixed 16-bit -> 32-bit blit lookup tables
The lookup tables weren't correct, e.g. 0xFFFF was being translated into 0xFFFFFFEF
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
SDL Wiki Bot
8d81ee3f5d Sync SDL3 wiki -> header
[ci skip]
2025-10-06 20:25:05 +00: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
87e3250518 Add a note that OpenVR overlays assume unpremultiplied alpha by default 2025-10-06 11:58:21 -07:00
Frank Praznik
ce1175724a win32: Don't overwrite a programmatically set window size with old data
While in a modal loop, the size in WM_WINDOWPOSCHANGING/WM_WINDOWPOSCHANGED may only be updated if the window is being resized interactively. Set the SWP_NOSIZE flag if the size hasn't changed from the last move/size event, or a size set programmatically may end up being overwritten by old size data.
2025-10-06 14:44:41 -04:00
Cameron Cawley
d40b887775 Support loading BytePusher files from the command line 2025-10-06 11:19:46 -07:00
Cameron Cawley
2f9f939446 Use texture palettes for the BytePusher example 2025-10-06 09:50:06 -07:00
Sam Lantinga
b92557c0b7 Made error message consistent between SDL_SetSurfacePalette() and SDL_SetTexturePalette() 2025-10-06 09:22:34 -07:00
Cameron Cawley
ab06784318 Check the availability of GL_BGRA before use 2025-10-06 08:58:45 -07:00
Cameron Cawley
12cee1cf46 Use the correct pixel formats for OpenGL on big endian 2025-10-06 08:58:45 -07:00
SDL Wiki Bot
f90c179c5d Sync SDL3 wiki -> header
[ci skip]
2025-10-06 14:32:26 +00:00
Sam Lantinga
941b0a8ea4 Added support for external GPU textures to the GPU renderer 2025-10-06 07:31:00 -07:00
definability
4d9295ef1e Fixed building with SDL_LEAN_AND_MEAN
Fixes https://github.com/libsdl-org/SDL/issues/14151
2025-10-05 17:36:11 -07:00
Adrian
6d47d8dff1 Always convert window to Vulkan window on SDL_Vulkan_CreateSurface (#14143) 2025-10-05 09:59:24 -07:00
Ozkan Sezer
3723913969 SDL_zenitymessagebox.c: Add exit code checking.
Fixes https://github.com/libsdl-org/SDL/issues/14140
Closes https://github.com/libsdl-org/SDL/pull/14146

Co-authored-by: eafton <blox2000@protonmail.com>
2025-10-05 12:28:39 +03:00
Ozkan Sezer
6c3cc3587d zenity dialog: make sure that --modal --attach switches are supported.
Reference issue: https://github.com/libsdl-org/SDL/issues/14140
2025-10-05 12:21:14 +03:00
eafton
87f9a0e106 X11TK: Add more checks to the Xrandr code path to avoid errors 2025-10-05 03:10:25 +03:00
HTuanPhong
2638537f92 Fix vulkan gpu resize lag on windows 2025-10-04 15:22:28 -07:00
Sam Lantinga
134b47730b Added support for linear and pixel art scaling for palettized textures 2025-10-04 15:12:08 -07:00
Anonymous Maarten
e1fde46a6a Include SDL_internal.h before checking HAVE_FRIBIDI_H
This happened to work because of precompiled headers
2025-10-04 21:25:45 +02:00
Anonymous Maarten
f69981cbfb Use space indendation in SDL_fribidi sources 2025-10-04 21:25:45 +02:00
Anonymous Maarten
0f9d032885 ci+docs: add fribidi dependency 2025-10-04 21:25:45 +02:00
Sam Lantinga
d832ac5d6f SDL_RenderDebugText() is no longer blurry when scaled 2025-10-04 12:04:07 -07:00
Michael Fitzmayer
dc1cc98e2b N-Gage: Add SDL_TimeToDateTime() implementation (#14141)
Add simple but working SDL_TimeToDateTime() implementation.

Fixes https://github.com/libsdl-org/SDL/issues/14047
2025-10-04 20:00:27 +03:00
Frank Praznik
bcf3afb6f3 wayland: Suppress initial keymap changed events during initialization 2025-10-04 10:54:32 -04:00
Frank Praznik
8fda4231cf wayland: Optimize the legacy key level fallback function
When iterating over the keymap entries, a valid xkb state object has already been allocated, so use that instead of allocating/destroying a new state object for every lookup, which avoids a calloc/free operation inside libxkbcommon. Any state set by the level lookup function will be overwritten with valid state after keymap iteration has completed.
2025-10-04 10:54:32 -04:00
Frank Praznik
2c02e6f8bb wayland: Restore valid state information when building keymaps
The spec doesn't guarantee that a modifier event won't arrive before a keymap event, or that it will always be sent after a keymap change if the modifiers and layout index haven't changed, so restore any valid state after allocation when building a new keymap.
2025-10-04 10:54:32 -04:00
Simon McVittie
1c1f7082ab Only emit dlopen note for SDL_FRIBIDI_DYNAMIC if not a hard dependency
Fixes: 65b36721 "unix: Mark SDL_FRIBIDI_DYNAMIC as a weak dependency"
Thanks: Anonymous Maarten
2025-10-04 17:21:49 +03:00
Simon McVittie
65b367216e unix: Mark SDL_FRIBIDI_DYNAMIC as a weak dependency
Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-10-04 14:15:19 +03:00
Simon McVittie
f7f33cbd36 x11: Clean up trailing whitespace in SDL_x11toolkit.[ch]
Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-10-04 14:10:00 +03:00
Simon McVittie
2a96bddebf unix: Clean up trailing whitespace in SDL_fribidi.c
Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-10-04 14:10:00 +03:00
Sam Lantinga
f3815ede24 Rebuilt GPU renderer shaders 2025-10-03 19:35:45 -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
Sam Lantinga
ac2c834021 Fixed build 2025-10-03 16:04:45 -07:00
Sam Lantinga
1cda789a37 render: Default to primary display in SDL_CalculateSimulatedVSyncInterval if window is not set
- Fixes previous change to SDL_CreateRendererWithProperties which skipped SDL_CalculateSimulatedVSyncInterval if window was not set.
2025-10-03 16:00:44 -07:00
Sam Lantinga
0cab3521f1 render: Fix asserts from null window usage in SDL_CreateRendererWithProperties 2025-10-03 16:00:41 -07:00
Anonymous Maarten
f4039d0132 release: don't cache ndk + verify arm64 alignment 2025-10-03 23:54:53 +02:00
Sam Lantinga
32668c4ddd Palettized textures will always use SDL_SCALEMODE_NEAREST.
Our algorithm for pixel art doesn't work on 8-bit images, needs further investigation.

Fixes https://github.com/libsdl-org/SDL/issues/14129
2025-10-03 14:29:47 -07:00
Sam Lantinga
d333044462 Fixed destination coordinates when using scale with the software renderer
Fixes https://github.com/libsdl-org/SDL/issues/14051
2025-10-03 13:58:45 -07:00
Sam Lantinga
b7b2e8bc31 Don't change the display of a window until it is mostly on the new one
Fixes https://github.com/libsdl-org/SDL/issues/12665
2025-10-03 12:38:47 -07:00
Sam Lantinga
baae2a628d Store the current window display ID on the window 2025-10-03 12:38:47 -07:00
Anonymous Maarten
541dc6ba20 android: don't promote custom SDL3::SDL3 targets 2025-10-03 21:08:14 +02:00
Anonymous Maarten
fe17e49116 ci: build testffmpeg on ubuntu and mac 2025-10-03 20:59:05 +02:00
Anonymous Maarten
0bbfbf5b37 cmake: use correct suffix in PkgConfigHelper 2025-10-03 20:58:45 +02:00
Anonymous Maarten
23646aed53 cmake: quietly look for SDL3-static and SDL3_test framework in SDL3Config.cmake 2025-10-03 19:14:40 +02:00
Nintorch
6e6dc500b5 Add blacklist words for gamepad names 2025-10-03 09:44:56 -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
nmlgc
f39e49a3dd SDL_mslibc: Implement _ftoul2_legacy()
cl.exe versions ≥v19.41 call this builtin for double → uint64_t
conversions on x86. SDL currently needs such conversions in:

* MainCallbackRateHintChanged()
* SDL_PrintFloat()
* WIN_ApplyWindowProgress()

This seems enough to justify implementing this function rather than
trying to work around it, as it was done in sdl12-compat:

	https://github.com/libsdl-org/sdl12-compat/issues/352

This implementation was taken from ReactOS:

	https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f637e6b809adb5e0ae420ef4f80c73b19172a2e7

Passes the stdlib testautomation, and also matches the behavior of
Microsoft's 64-bit libc for the currently implementation-defined case
of calling SDL_PrintFloat() with values >SDL_MAX_UINT64.
2025-10-03 07:21:20 -07:00