Compare commits

...

13 Commits

Author SHA1 Message Date
Sam Lantinga
2be2fb4918 Fixed build 2025-10-04 10:28:57 -04:00
Anonymous Maarten
fec1dd4a8b release: don't cache ndk + verify arm64 alignment
(cherry picked from commit f4039d0132)
2025-10-03 23:55:13 +02:00
Sam Lantinga
2a3a8f736c Fixed destination coordinates when using scale with the software renderer
Fixes https://github.com/libsdl-org/SDL/issues/14051

(cherry picked from commit d333044462)
2025-10-03 13:58:57 -07:00
Anonymous Maarten
d3aff13aa3 cmake: use correct suffix in PkgConfigHelper
(cherry picked from commit 0bbfbf5b37)
2025-10-03 21:03:50 +02:00
Nintorch
54fb312a2c Add blacklist words for gamepad names
(cherry picked from commit 6e6dc500b5)
2025-10-03 09:45:31 -07:00
nmlgc
20aa0ad1c5 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().

(cherry picked from commit 8824eace93)
2025-10-03 07:22:59 -07:00
nmlgc
ff667d35f2 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.

(cherry picked from commit f39e49a3dd)
2025-10-03 07:22:59 -07:00
nmlgc
ff9599fb7e build: Fix typo in SDL_uclibc target name for 32-bit Windows
(cherry picked from commit 7916af9910)
2025-10-03 07:22:59 -07:00
mccakit
0448f20394 replace script with flags
(cherry picked from commit f6e711c377)
2025-10-02 16:01:17 -07:00
mccakit
db07924104 static release build fix
(cherry picked from commit 2e4bc73916)
2025-10-02 16:01:17 -07:00
mccakit
e60acdc477 android symbol export for release builds
(cherry picked from commit fe92d0a7bd)
2025-10-02 16:01:17 -07:00
Sam Lantinga
d69f658835 Make sure the current resolution is in the fullscreen mode list
Custom resolutions don't enumerate normally, but make sure the current resolution is in the mode list.

Fixes https://github.com/libsdl-org/SDL/issues/11551

(cherry picked from commit b1c2dd8433)
2025-10-02 16:01:17 -07:00
Sam Lantinga
3eb9328d3e Updated to version 3.2.25 for development 2025-10-02 11:36:07 -07:00
16 changed files with 153 additions and 47 deletions

View File

@@ -75,7 +75,7 @@ jobs:
if: ${{ matrix.platform.android-ndk }}
id: setup-ndk
with:
local-cache: true
local-cache: false
ndk-version: r28c
- name: 'Configure Android NDK variables'
if: ${{ matrix.platform.android-ndk }}

View File

@@ -534,7 +534,7 @@ jobs:
- name: 'Setup Android NDK'
uses: nttld/setup-ndk@v1
with:
local-cache: true
local-cache: false
ndk-version: r28c
- name: 'Setup Java JDK'
uses: actions/setup-java@v4
@@ -607,8 +607,14 @@ jobs:
python "${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}.aar" -o /tmp/SDL3-android
echo "prefix=/tmp/SDL3-android" >>$GITHUB_OUTPUT
echo "sdl3-aar=/tmp/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}.aar" >>$GITHUB_OUTPUT
- name: 'Verify alignment of libSDL3.so (arm64-v8a/x86_64)'
run: |
set -e
${{ steps.src.outputs.path }}/build-scripts/check_elf_alignment.sh ${{ steps.sdk.outputs.prefix }}/lib/arm64-v8a/libSDL3.so
${{ steps.src.outputs.path }}/build-scripts/check_elf_alignment.sh ${{ steps.sdk.outputs.prefix }}/lib/x86_64/libSDL3.so
- name: 'CMake (configure + build) x86, x64, arm32, arm64'
run: |
set -e
android_abis="x86 x86_64 armeabi-v7a arm64-v8a"
for android_abi in ${android_abis}; do
echo "Configuring ${android_abi}..."

View File

@@ -5,7 +5,7 @@ if(NOT DEFINED CMAKE_BUILD_TYPE)
endif()
# See docs/release_checklist.md
project(SDL3 LANGUAGES C VERSION "3.2.24")
project(SDL3 LANGUAGES C VERSION "3.2.25")
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
set(SDL3_MAINPROJECT ON)
@@ -1489,6 +1489,9 @@ if(ANDROID)
endif()
endif()
endif()
if(TARGET SDL3-static)
target_link_options(SDL3-static INTERFACE "-Wl,-u,JNI_OnLoad")
endif()
elseif(EMSCRIPTEN)
# Hide noisy warnings that intend to aid mostly during initial stages of porting a new
@@ -1914,7 +1917,7 @@ elseif(WINDOWS)
target_compile_options(SDL_uclibc PRIVATE $<$<COMPILE_LANGUAGE:C,CXX>:/GS-> $<$<COMPILE_LANGUAGE:C,CXX>:/Gs1048576>)
if(SDL_CPU_X86)
target_compile_options(SDL3-shared PRIVATE "/arch:SSE")
target_compile_options(SDL3-SDL_uclibc PRIVATE "/arch:SSE")
target_compile_options(SDL_uclibc PRIVATE "/arch:SSE")
endif()
endif()

View File

@@ -19,10 +19,10 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>3.2.24</string>
<string>3.2.25</string>
<key>CFBundleSignature</key>
<string>SDLX</string>
<key>CFBundleVersion</key>
<string>3.2.24</string>
<string>3.2.25</string>
</dict>
</plist>

View File

@@ -3086,7 +3086,7 @@
CLANG_ENABLE_OBJC_ARC = YES;
DEPLOYMENT_POSTPROCESSING = YES;
DYLIB_COMPATIBILITY_VERSION = 201.0.0;
DYLIB_CURRENT_VERSION = 201.24.0;
DYLIB_CURRENT_VERSION = 201.25.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_ALTIVEC_EXTENSIONS = YES;
@@ -3121,7 +3121,7 @@
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 3.2.24;
MARKETING_VERSION = 3.2.25;
OTHER_LDFLAGS = "$(CONFIG_FRAMEWORK_LDFLAGS)";
PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL3;
PRODUCT_NAME = SDL3;
@@ -3150,7 +3150,7 @@
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
DYLIB_COMPATIBILITY_VERSION = 201.0.0;
DYLIB_CURRENT_VERSION = 201.24.0;
DYLIB_CURRENT_VERSION = 201.25.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
@@ -3182,7 +3182,7 @@
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 3.2.24;
MARKETING_VERSION = 3.2.25;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = "$(CONFIG_FRAMEWORK_LDFLAGS)";
PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL3;

View File

@@ -1,4 +1,4 @@
Title SDL 3.2.24
Title SDL 3.2.25
Version 1
Description SDL Library for macOS (http://www.libsdl.org)
DefaultLocation /Library/Frameworks

View File

@@ -61,7 +61,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
private static final String TAG = "SDL";
private static final int SDL_MAJOR_VERSION = 3;
private static final int SDL_MINOR_VERSION = 2;
private static final int SDL_MICRO_VERSION = 24;
private static final int SDL_MICRO_VERSION = 25;
/*
// Display InputType.SOURCE/CLASS of events and devices
//

View File

@@ -1,16 +1,21 @@
# Helper for Find modules
function(get_flags_from_pkg_config _library _pc_prefix _out_prefix)
if("${_library}" MATCHES "${CMAKE_STATIC_LIBRARY_SUFFIX}$")
set(_cflags ${_pc_prefix}_STATIC_CFLAGS_OTHER)
set(_link_libraries ${_pc_prefix}_STATIC_LIBRARIES)
set(_link_options ${_pc_prefix}_STATIC_LDFLAGS_OTHER)
set(_library_dirs ${_pc_prefix}_STATIC_LIBRARY_DIRS)
if(MINGW)
set(re_shared_suffix ".dll.a$")
else()
set(re_shared_suffix "${CMAKE_SHARED_LIBRARY_SUFFIX}$")
endif()
if("${_library}" MATCHES "${re_shared_suffix}")
set(_cflags ${_pc_prefix}_CFLAGS_OTHER)
set(_link_libraries ${_pc_prefix}_LIBRARIES)
set(_link_options ${_pc_prefix}_LDFLAGS_OTHER)
set(_library_dirs ${_pc_prefix}_LIBRARY_DIRS)
else()
set(_cflags ${_pc_prefix}_STATIC_CFLAGS_OTHER)
set(_link_libraries ${_pc_prefix}_STATIC_LIBRARIES)
set(_link_options ${_pc_prefix}_STATIC_LDFLAGS_OTHER)
set(_library_dirs ${_pc_prefix}_STATIC_LIBRARY_DIRS)
endif()
# The *_LIBRARIES lists always start with the library itself

View File

@@ -20,7 +20,7 @@
*/
/**
* Main include header for the SDL library, version 3.2.24
* Main include header for the SDL library, version 3.2.25
*
* It is almost always best to include just this one header instead of
* picking out individual headers included here. There are exceptions to

View File

@@ -62,7 +62,7 @@ extern "C" {
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_MICRO_VERSION 24
#define SDL_MICRO_VERSION 25
/**
* This macro turns the version numbers into a numeric value.

View File

@@ -9,8 +9,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,2,24,0
PRODUCTVERSION 3,2,24,0
FILEVERSION 3,2,25,0
PRODUCTVERSION 3,2,25,0
FILEFLAGSMASK 0x3fL
FILEFLAGS 0x0L
FILEOS 0x40004L
@@ -23,12 +23,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "\0"
VALUE "FileDescription", "SDL\0"
VALUE "FileVersion", "3, 2, 24, 0\0"
VALUE "FileVersion", "3, 2, 25, 0\0"
VALUE "InternalName", "SDL\0"
VALUE "LegalCopyright", "Copyright (C) 2025 Sam Lantinga\0"
VALUE "OriginalFilename", "SDL3.dll\0"
VALUE "ProductName", "Simple DirectMedia Layer\0"
VALUE "ProductVersion", "3, 2, 24, 0\0"
VALUE "ProductVersion", "3, 2, 25, 0\0"
END
END
BLOCK "VarFileInfo"

View File

@@ -149,6 +149,52 @@ static SDL_vidpid_list SDL_ignored_gamepads = {
false
};
/*
List of words in gamepad names that indicate that the gamepad should not be detected.
See also `initial_blacklist_devices` in SDL_joystick.c
*/
enum SDL_GamepadBlacklistWordsPosition {
GAMEPAD_BLACKLIST_BEGIN,
GAMEPAD_BLACKLIST_END,
GAMEPAD_BLACKLIST_ANYWHERE,
};
struct SDL_GamepadBlacklistWords {
const char* str;
enum SDL_GamepadBlacklistWordsPosition pos;
};
static const struct SDL_GamepadBlacklistWords SDL_gamepad_blacklist_words[] = {
#ifdef SDL_PLATFORM_LINUX
{" Motion Sensors", GAMEPAD_BLACKLIST_END}, // Don't treat the PS3 and PS4 motion controls as a separate gamepad
{" IMU", GAMEPAD_BLACKLIST_END}, // Don't treat the Nintendo IMU as a separate gamepad
// Don't treat the Wii extension controls as a separate gamepad
{" Accelerometer", GAMEPAD_BLACKLIST_END},
{" IR", GAMEPAD_BLACKLIST_END},
{" Motion Plus", GAMEPAD_BLACKLIST_END},
{" Nunchuk", GAMEPAD_BLACKLIST_END},
#endif
// The Google Pixel fingerprint sensor, as well as other fingerprint sensors, reports itself as a joystick
{"uinput-", GAMEPAD_BLACKLIST_BEGIN},
{" TouchPad", GAMEPAD_BLACKLIST_END}, // "SynPS/2 Synaptics TouchPad"
{" Touchpad", GAMEPAD_BLACKLIST_END}, // "Sony Interactive Entertainment DualSense Wireless Controller Touchpad"
{"Synaptics ", GAMEPAD_BLACKLIST_BEGIN}, // "Synaptics TM2768-001"
{"Trackpad", GAMEPAD_BLACKLIST_ANYWHERE},
{"Clickpad", GAMEPAD_BLACKLIST_ANYWHERE},
// "PG-90215 Keyboard", "Usb Keyboard Usb Keyboard Consumer Control", "Framework Laptop 16 Keyboard Module - ISO System Control"
{" Keyboard", GAMEPAD_BLACKLIST_ANYWHERE},
{" Laptop ", GAMEPAD_BLACKLIST_ANYWHERE}, // "Framework Laptop 16 Numpad Module System Control"
{"Mouse ", GAMEPAD_BLACKLIST_BEGIN}, // "Mouse passthrough"
{" Pen", GAMEPAD_BLACKLIST_END}, // "Wacom One by Wacom S Pen"
{" Finger", GAMEPAD_BLACKLIST_END}, // "Wacom HID 495F Finger"
{" LED ", GAMEPAD_BLACKLIST_ANYWHERE}, // "ASRock LED Controller"
{" Thelio ", GAMEPAD_BLACKLIST_ANYWHERE}, // "System76 Thelio Io 2"
};
static GamepadMapping_t *SDL_PrivateAddMappingForGUID(SDL_GUID jGUID, const char *mappingString, bool *existing, SDL_GamepadMappingPriority priority);
static void SDL_PrivateLoadButtonMapping(SDL_Gamepad *gamepad, GamepadMapping_t *pGamepadMapping);
static GamepadMapping_t *SDL_PrivateGetGamepadMapping(SDL_JoystickID instance_id, bool create_mapping);
@@ -2665,28 +2711,30 @@ bool SDL_IsGamepad(SDL_JoystickID instance_id)
*/
bool SDL_ShouldIgnoreGamepad(Uint16 vendor_id, Uint16 product_id, Uint16 version, const char *name)
{
#ifdef SDL_PLATFORM_LINUX
if (SDL_endswith(name, " Motion Sensors")) {
// Don't treat the PS3 and PS4 motion controls as a separate gamepad
return true;
}
if (SDL_strncmp(name, "Nintendo ", 9) == 0 && SDL_strstr(name, " IMU") != NULL) {
// Don't treat the Nintendo IMU as a separate gamepad
return true;
}
if (SDL_endswith(name, " Accelerometer") ||
SDL_endswith(name, " IR") ||
SDL_endswith(name, " Motion Plus") ||
SDL_endswith(name, " Nunchuk")) {
// Don't treat the Wii extension controls as a separate gamepad
return true;
}
#endif
int i;
for (i = 0; i < SDL_arraysize(SDL_gamepad_blacklist_words); i++) {
const struct SDL_GamepadBlacklistWords *blacklist_word = &SDL_gamepad_blacklist_words[i];
if (name && SDL_startswith(name, "uinput-")) {
// The Google Pixel fingerprint sensor, as well as other fingerprint sensors, reports itself as a joystick
switch (blacklist_word->pos) {
case GAMEPAD_BLACKLIST_BEGIN:
if (SDL_startswith(name, blacklist_word->str)) {
return true;
}
break;
case GAMEPAD_BLACKLIST_END:
if (SDL_endswith(name, blacklist_word->str)) {
return true;
}
break;
case GAMEPAD_BLACKLIST_ANYWHERE:
if (SDL_strstr(name, blacklist_word->str) != NULL) {
return true;
}
break;
}
}
#ifdef SDL_PLATFORM_WIN32
if (SDL_GetHintBoolean("SDL_GAMECONTROLLER_ALLOW_STEAM_VIRTUAL_GAMEPAD", false) &&

View File

@@ -878,9 +878,11 @@ static bool SW_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, v
PrepTextureForCopy(cmd, &drawstate);
// Apply viewport
if (drawstate.viewport && (drawstate.viewport->x || drawstate.viewport->y)) {
copydata->dstrect.x += drawstate.viewport->x;
copydata->dstrect.y += drawstate.viewport->y;
if (drawstate.viewport &&
(drawstate.viewport->x || drawstate.viewport->y) &&
(copydata->scale_x > 0.0f && copydata->scale_y > 0.0f)) {
copydata->dstrect.x += (int)(drawstate.viewport->x / copydata->scale_x);
copydata->dstrect.y += (int)(drawstate.viewport->y / copydata->scale_y);
}
SW_RenderCopyEx(renderer, surface, cmd->data.draw.texture, &copydata->srcrect,

View File

@@ -95,6 +95,39 @@ void _ftol2()
_ftol();
}
void __declspec(naked) _ftoul2_legacy()
{
static const Uint64 LLONG_MAX_PLUS_ONE = 0x43e0000000000000ULL;
/* *INDENT-OFF* */
__asm {
fld qword ptr [LLONG_MAX_PLUS_ONE]
fcom
fnstsw ax
test ah, 41h
jnp greater_than_int64
fstp st(0)
jmp _ftol
greater_than_int64:
fsub st(1), st(0)
fcomp
fnstsw ax
test ah, 41h
jnz greater_than_uint64
call _ftol
add edx, 80000000h
ret
greater_than_uint64:
xor eax, eax
mov edx, 80000000h
ret
}
/* *INDENT-ON* */
}
// 64-bit math operators for 32-bit systems
void __declspec(naked) _allmul()
{

View File

@@ -770,7 +770,8 @@ bool WIN_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display)
dxgi_output = WIN_GetDXGIOutput(_this, data->DeviceName);
for (i = 0;; ++i) {
// Make sure we add the current mode to the list in case it's a custom mode that doesn't enumerate
for (i = ENUM_CURRENT_SETTINGS; ; ++i) {
if (!WIN_GetDisplayMode(_this, dxgi_output, data->MonitorHandle, data->DeviceName, i, &mode, NULL, NULL)) {
break;
}

View File

@@ -265,6 +265,14 @@ static int SDLCALL stdlib_snprintf(void *arg)
SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: '%s', got: '%s'", expected, text);
SDLTest_AssertCheck(result == 6, "Check result value, expected: 6, got: %d", result);
result = SDL_snprintf(text, sizeof(text), "%06.0f", ((double)SDL_MAX_SINT64) * 1.5);
predicted = SDL_snprintf(NULL, 0, "%06.0f", ((double)SDL_MAX_SINT64) * 1.5);
expected = "13835058055282163712";
SDLTest_AssertPass("Call to SDL_snprintf(\"%%06.2f\", SDL_MAX_SINT64 * 1.5)");
SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: '%s', got: '%s'", expected, text);
SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", (int)SDL_strlen(text), result);
SDLTest_AssertCheck(predicted == result, "Check predicted value, expected: %d, got: %d", result, predicted);
{
static struct
{