mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-19 18:02:54 +00:00
Compare commits
58 Commits
release-3.
...
release-3.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
badbf8da4e | ||
|
|
b140291cd0 | ||
|
|
70b12c1b1b | ||
|
|
2bbd74b4b6 | ||
|
|
add176e538 | ||
|
|
86384afbcf | ||
|
|
328f833d51 | ||
|
|
a002a6313e | ||
|
|
4fc5405f16 | ||
|
|
16d9f7316f | ||
|
|
95977f41b7 | ||
|
|
3302162ede | ||
|
|
29f857fed6 | ||
|
|
492ed877ea | ||
|
|
b1959ecf23 | ||
|
|
928454cbfe | ||
|
|
36b306a36c | ||
|
|
92570af7d3 | ||
|
|
5a9050aea3 | ||
|
|
3d9f4c3328 | ||
|
|
04ceb2d4a0 | ||
|
|
e6987e2452 | ||
|
|
4cd6df1997 | ||
|
|
9163913305 | ||
|
|
b3f4ba0725 | ||
|
|
354bda8dde | ||
|
|
8ccbfdf368 | ||
|
|
19b646849c | ||
|
|
48a83d69cc | ||
|
|
ec682cc794 | ||
|
|
d2d655b41f | ||
|
|
d6021b7d89 | ||
|
|
8dcb6db823 | ||
|
|
d0cfcf10bb | ||
|
|
dd791f6838 | ||
|
|
988714beb9 | ||
|
|
78756540cb | ||
|
|
205b5c9f44 | ||
|
|
bca30aafed | ||
|
|
840d5c16d2 | ||
|
|
25b9a686b0 | ||
|
|
54c2f2c3f7 | ||
|
|
b9cf5f08db | ||
|
|
c7a36fa3c9 | ||
|
|
73ca5f53e7 | ||
|
|
2be2fb4918 | ||
|
|
fec1dd4a8b | ||
|
|
2a3a8f736c | ||
|
|
d3aff13aa3 | ||
|
|
54fb312a2c | ||
|
|
20aa0ad1c5 | ||
|
|
ff667d35f2 | ||
|
|
ff9599fb7e | ||
|
|
0448f20394 | ||
|
|
db07924104 | ||
|
|
e60acdc477 | ||
|
|
d69f658835 | ||
|
|
3eb9328d3e |
6
.github/workflows/create-test-plan.py
vendored
6
.github/workflows/create-test-plan.py
vendored
@@ -733,7 +733,7 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
|
||||
match spec.platform:
|
||||
case SdlPlatform.FreeBSD:
|
||||
job.cpactions_os = "freebsd"
|
||||
job.cpactions_version = "14.2"
|
||||
job.cpactions_version = "14.3"
|
||||
job.cpactions_arch = "x86-64"
|
||||
job.cpactions_setup_cmd = "sudo pkg update"
|
||||
job.cpactions_install_cmd = "sudo pkg install -y cmake ninja pkgconf libXcursor libXext libXinerama libXi libXfixes libXrandr libXScrnSaver libXxf86vm wayland wayland-protocols libxkbcommon mesa-libs libglvnd evdev-proto libinotify alsa-lib jackit pipewire pulseaudio sndio dbus zh-fcitx ibus libudev-devd"
|
||||
@@ -749,10 +749,10 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
|
||||
job.cpactions_install_cmd = "sudo -E pkgin -y install cmake dbus pkgconf ninja-build pulseaudio libxkbcommon wayland wayland-protocols libinotify libusb1"
|
||||
case SdlPlatform.OpenBSD:
|
||||
job.cpactions_os = "openbsd"
|
||||
job.cpactions_version = "7.4"
|
||||
job.cpactions_version = "7.7"
|
||||
job.cpactions_arch = "x86-64"
|
||||
job.cpactions_setup_cmd = "sudo pkg_add -u"
|
||||
job.cpactions_install_cmd = "sudo pkg_add cmake ninja pkgconf wayland wayland-protocols xwayland libxkbcommon libinotify pulseaudio dbus ibus"
|
||||
job.cpactions_install_cmd = "sudo pkg_add cmake ninja pkgconf wayland wayland-protocols libxkbcommon libinotify pulseaudio dbus ibus"
|
||||
case _:
|
||||
raise ValueError(f"Unsupported platform={spec.platform}")
|
||||
|
||||
|
||||
4
.github/workflows/generic.yml
vendored
4
.github/workflows/generic.yml
vendored
@@ -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 }}
|
||||
@@ -321,7 +321,7 @@ jobs:
|
||||
- name: 'Build (cross-platform-actions, BSD)'
|
||||
id: cpactions
|
||||
if: ${{ matrix.platform.cpactions }}
|
||||
uses: cross-platform-actions/action@v0.27.0
|
||||
uses: cross-platform-actions/action@v0.29.0
|
||||
with:
|
||||
operating_system: '${{ matrix.platform.cpactions-os }}'
|
||||
architecture: '${{ matrix.platform.cpactions-arch }}'
|
||||
|
||||
11
.github/workflows/release.yml
vendored
11
.github/workflows/release.yml
vendored
@@ -532,9 +532,10 @@ jobs:
|
||||
with:
|
||||
sparse-checkout: 'build-scripts/build-release.py'
|
||||
- name: 'Setup Android NDK'
|
||||
id: setup-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
|
||||
@@ -561,6 +562,8 @@ jobs:
|
||||
run: |
|
||||
python build-scripts/build-release.py \
|
||||
--actions android \
|
||||
--android-api 21 \
|
||||
--android-ndk-home "${{ steps.setup-ndk.outputs.ndk-path }}" \
|
||||
--commit ${{ inputs.commit }} \
|
||||
--root "${{ steps.tar.outputs.path }}" \
|
||||
--github \
|
||||
@@ -607,8 +610,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}..."
|
||||
|
||||
@@ -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.26")
|
||||
|
||||
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()
|
||||
|
||||
|
||||
@@ -781,7 +781,6 @@
|
||||
<ClCompile Include="..\..\src\render\opengl\SDL_shaders_gl.c" />
|
||||
<ClCompile Include="..\..\src\render\opengles2\SDL_render_gles2.c" />
|
||||
<ClCompile Include="..\..\src\render\opengles2\SDL_shaders_gles2.c" />
|
||||
<ClCompile Include="..\..\src\render\SDL_d3dmath.c" />
|
||||
<ClCompile Include="..\..\src\render\SDL_render.c" />
|
||||
<ClCompile Include="..\..\src\render\SDL_render_unsupported.c" />
|
||||
<ClCompile Include="..\..\src\render\SDL_yuv_sw.c" />
|
||||
|
||||
@@ -108,7 +108,6 @@
|
||||
<ClCompile Include="..\..\src\render\opengl\SDL_shaders_gl.c" />
|
||||
<ClCompile Include="..\..\src\render\opengles2\SDL_render_gles2.c" />
|
||||
<ClCompile Include="..\..\src\render\opengles2\SDL_shaders_gles2.c" />
|
||||
<ClCompile Include="..\..\src\render\SDL_d3dmath.c" />
|
||||
<ClCompile Include="..\..\src\render\SDL_render.c" />
|
||||
<ClCompile Include="..\..\src\render\SDL_render_unsupported.c" />
|
||||
<ClCompile Include="..\..\src\render\SDL_yuv_sw.c" />
|
||||
|
||||
@@ -627,7 +627,6 @@
|
||||
<ClCompile Include="..\..\src\render\opengl\SDL_shaders_gl.c" />
|
||||
<ClCompile Include="..\..\src\render\opengles2\SDL_render_gles2.c" />
|
||||
<ClCompile Include="..\..\src\render\opengles2\SDL_shaders_gles2.c" />
|
||||
<ClCompile Include="..\..\src\render\SDL_d3dmath.c" />
|
||||
<ClCompile Include="..\..\src\render\SDL_render.c" />
|
||||
<ClCompile Include="..\..\src\render\SDL_render_unsupported.c" />
|
||||
<ClCompile Include="..\..\src\render\SDL_yuv_sw.c" />
|
||||
|
||||
@@ -1460,7 +1460,6 @@
|
||||
<ClCompile Include="..\..\src\sensor\windows\SDL_windowssensor.c">
|
||||
<Filter>sensor\windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\render\SDL_d3dmath.c">
|
||||
<Filter>render</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\render\SDL_render.c">
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>3.2.24</string>
|
||||
<string>3.2.26</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>SDLX</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>3.2.24</string>
|
||||
<string>3.2.26</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -292,7 +292,6 @@
|
||||
A7D8BA2523E2514400DCD162 /* SDL_drawpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A8FC23E2514000DCD162 /* SDL_drawpoint.c */; };
|
||||
A7D8BA2B23E2514400DCD162 /* SDL_blendfillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A8FD23E2514000DCD162 /* SDL_blendfillrect.c */; };
|
||||
A7D8BA3123E2514400DCD162 /* SDL_rotate.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A8FE23E2514000DCD162 /* SDL_rotate.h */; };
|
||||
A7D8BA3723E2514400DCD162 /* SDL_d3dmath.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A8FF23E2514000DCD162 /* SDL_d3dmath.c */; };
|
||||
A7D8BA4923E2514400DCD162 /* SDL_render_gles2.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A90423E2514000DCD162 /* SDL_render_gles2.c */; };
|
||||
A7D8BA4F23E2514400DCD162 /* SDL_shaders_gles2.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A90523E2514000DCD162 /* SDL_shaders_gles2.h */; };
|
||||
A7D8BA5523E2514400DCD162 /* SDL_gles2funcs.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A90623E2514000DCD162 /* SDL_gles2funcs.h */; };
|
||||
@@ -869,7 +868,6 @@
|
||||
A7D8A8FC23E2514000DCD162 /* SDL_drawpoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawpoint.c; sourceTree = "<group>"; };
|
||||
A7D8A8FD23E2514000DCD162 /* SDL_blendfillrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendfillrect.c; sourceTree = "<group>"; };
|
||||
A7D8A8FE23E2514000DCD162 /* SDL_rotate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rotate.h; sourceTree = "<group>"; };
|
||||
A7D8A8FF23E2514000DCD162 /* SDL_d3dmath.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_d3dmath.c; sourceTree = "<group>"; };
|
||||
A7D8A90423E2514000DCD162 /* SDL_render_gles2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_render_gles2.c; sourceTree = "<group>"; };
|
||||
A7D8A90523E2514000DCD162 /* SDL_shaders_gles2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_shaders_gles2.h; sourceTree = "<group>"; };
|
||||
A7D8A90623E2514000DCD162 /* SDL_gles2funcs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_gles2funcs.h; sourceTree = "<group>"; };
|
||||
@@ -2135,7 +2133,6 @@
|
||||
A7D8A90C23E2514000DCD162 /* opengl */,
|
||||
A7D8A90323E2514000DCD162 /* opengles2 */,
|
||||
A7D8A8EF23E2514000DCD162 /* software */,
|
||||
A7D8A8FF23E2514000DCD162 /* SDL_d3dmath.c */,
|
||||
A7D8A8DC23E2514000DCD162 /* SDL_d3dmath.h */,
|
||||
A7D8A8DB23E2514000DCD162 /* SDL_render.c */,
|
||||
E4F7981D2AD8D86A00669F54 /* SDL_render_unsupported.c */,
|
||||
@@ -2833,7 +2830,7 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "# Build an xcframework with both device and simulator files for all platforms.\n# Adapted from an answer in\n# https://developer.apple.com/forums/thread/666335?answerId=685927022#685927022\n\nif [ \"$XCODE_VERSION_ACTUAL\" -lt 1100 ]\nthen\n echo \"error: Building an xcframework requires Xcode 11 minimum.\"\n exit 1\nfi\n\nFRAMEWORK_NAME=\"SDL3\"\nPROJECT_NAME=\"SDL\"\nSCHEME=\"SDL3\"\n\nMACOS_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-macosx.xcarchive\"\nIOS_SIMULATOR_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-iphonesimulator.xcarchive\"\nIOS_DEVICE_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-iphoneos.xcarchive\"\nTVOS_SIMULATOR_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-appletvsimulator.xcarchive\"\nTVOS_DEVICE_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-appletvos.xcarchive\"\n\nOUTPUT_DIR=\"./build/\"\n\n# macOS\nxcodebuild archive \\\n ONLY_ACTIVE_ARCH=NO \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${MACOS_ARCHIVE_PATH} \\\n -destination 'generic/platform=macOS,name=Any Mac' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n \n# iOS simulator\nxcodebuild archive \\\n ONLY_ACTIVE_ARCH=NO \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${IOS_SIMULATOR_ARCHIVE_PATH} \\\n -destination 'generic/platform=iOS Simulator' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# iOS device\nxcodebuild archive \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${IOS_DEVICE_ARCHIVE_PATH} \\\n -destination 'generic/platform=iOS' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# tvOS simulator\nxcodebuild archive \\\n ONLY_ACTIVE_ARCH=NO \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${TVOS_SIMULATOR_ARCHIVE_PATH} \\\n -destination 'generic/platform=tvOS Simulator' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# tvOS device\nxcodebuild archive \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${TVOS_DEVICE_ARCHIVE_PATH} \\\n -destination 'generic/platform=tvOS' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# Clean-up any existing instance of this xcframework from the Products directory\nrm -rf \"${OUTPUT_DIR}${FRAMEWORK_NAME}.xcframework\"\n\n# Create final xcframework\nxcodebuild -create-xcframework \\\n -framework \"${MACOS_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -framework \"${IOS_DEVICE_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -framework \"${IOS_SIMULATOR_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -framework \"${TVOS_DEVICE_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -framework \"${TVOS_SIMULATOR_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -output ${OUTPUT_DIR}/${FRAMEWORK_NAME}.xcframework\n\n# Ensure git doesn't pick up on our Products folder. \nrm -rf ${OUTPUT_DIR}/.gitignore\necho \"*\" >> ${OUTPUT_DIR}/.gitignore\n";
|
||||
shellScript = "# Build an xcframework with both device and simulator files for all platforms.\n# Adapted from an answer in\n# https://developer.apple.com/forums/thread/666335?answerId=685927022#685927022\n\nif [ \"$XCODE_VERSION_ACTUAL\" -lt 1100 ]\nthen\n echo \"error: Building an xcframework requires Xcode 11 minimum.\"\n exit 1\nfi\n\nFRAMEWORK_NAME=\"SDL3\"\nPROJECT_NAME=\"SDL\"\nSCHEME=\"SDL3\"\n\nMACOS_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-macosx.xcarchive\"\nIOS_SIMULATOR_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-iphonesimulator.xcarchive\"\nIOS_DEVICE_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-iphoneos.xcarchive\"\nTVOS_SIMULATOR_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-appletvsimulator.xcarchive\"\nTVOS_DEVICE_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-appletvos.xcarchive\"\n\nOUTPUT_DIR=\"./build/\"\n\n# macOS\nxcodebuild archive \\\n ONLY_ACTIVE_ARCH=NO \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${MACOS_ARCHIVE_PATH} \\\n -destination 'generic/platform=macOS,name=Any Mac' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n \n# iOS simulator\nxcodebuild archive \\\n ONLY_ACTIVE_ARCH=NO \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${IOS_SIMULATOR_ARCHIVE_PATH} \\\n -destination 'generic/platform=iOS Simulator' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# iOS device\nxcodebuild archive \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${IOS_DEVICE_ARCHIVE_PATH} \\\n -destination 'generic/platform=iOS' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# tvOS simulator\nxcodebuild archive \\\n ONLY_ACTIVE_ARCH=NO \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${TVOS_SIMULATOR_ARCHIVE_PATH} \\\n -destination 'generic/platform=tvOS Simulator' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# tvOS device\nxcodebuild archive \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${TVOS_DEVICE_ARCHIVE_PATH} \\\n -destination 'generic/platform=tvOS' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# Clean-up any existing instance of this xcframework from the Products directory\nrm -rf \"${OUTPUT_DIR}${FRAMEWORK_NAME}.xcframework\"\n\n# Create final xcframework\nxcodebuild -create-xcframework \\\n -framework \"${MACOS_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -debug-symbols \"${MACOS_ARCHIVE_PATH}\"/dSYMs/$FRAMEWORK_NAME.framework.dSYM \\\n -framework \"${IOS_DEVICE_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -debug-symbols \"${IOS_DEVICE_ARCHIVE_PATH}\"/dSYMs/$FRAMEWORK_NAME.framework.dSYM \\\n -framework \"${IOS_SIMULATOR_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -debug-symbols \"${IOS_SIMULATOR_ARCHIVE_PATH}\"/dSYMs/$FRAMEWORK_NAME.framework.dSYM \\\n -framework \"${TVOS_DEVICE_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -debug-symbols \"${TVOS_DEVICE_ARCHIVE_PATH}\"/dSYMs/$FRAMEWORK_NAME.framework.dSYM \\\n -framework \"${TVOS_SIMULATOR_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -debug-symbols \"${TVOS_SIMULATOR_ARCHIVE_PATH}\"/dSYMs/$FRAMEWORK_NAME.framework.dSYM \\\n -output ${OUTPUT_DIR}/${FRAMEWORK_NAME}.xcframework\n\n# Ensure git doesn't pick up on our Products folder. \nrm -rf ${OUTPUT_DIR}/.gitignore\necho \"*\" >> ${OUTPUT_DIR}/.gitignore\n";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
@@ -2903,7 +2900,6 @@
|
||||
A7D8BBE723E2574800DCD162 /* SDL_uikitviewcontroller.m in Sources */,
|
||||
A7D8ADF223E2514100DCD162 /* SDL_blit_A.c in Sources */,
|
||||
A7D8BBDD23E2574800DCD162 /* SDL_uikitmodes.m in Sources */,
|
||||
A7D8BA3723E2514400DCD162 /* SDL_d3dmath.c in Sources */,
|
||||
F3A9AE9C2C8A13C100AAC390 /* SDL_pipeline_gpu.c in Sources */,
|
||||
75E0915A241EA924004729E1 /* SDL_virtualjoystick.c in Sources */,
|
||||
F338A11A2D1B37E4007CDFDF /* SDL_tray.c in Sources */,
|
||||
@@ -3086,7 +3082,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.26.0;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_ALTIVEC_EXTENSIONS = YES;
|
||||
@@ -3121,7 +3117,7 @@
|
||||
"@loader_path/Frameworks",
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.13;
|
||||
MARKETING_VERSION = 3.2.24;
|
||||
MARKETING_VERSION = 3.2.26;
|
||||
OTHER_LDFLAGS = "$(CONFIG_FRAMEWORK_LDFLAGS)";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL3;
|
||||
PRODUCT_NAME = SDL3;
|
||||
@@ -3138,6 +3134,8 @@
|
||||
baseConfigurationReference = F3F7BE3B2CBD79D200C984AF /* config.xcconfig */;
|
||||
buildSettings = {
|
||||
CLANG_LINK_OBJC_RUNTIME = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
|
||||
OTHER_LDFLAGS = "-liconv";
|
||||
SUPPORTS_MACCATALYST = YES;
|
||||
};
|
||||
@@ -3150,7 +3148,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.26.0;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
@@ -3182,7 +3180,7 @@
|
||||
"@loader_path/Frameworks",
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.13;
|
||||
MARKETING_VERSION = 3.2.24;
|
||||
MARKETING_VERSION = 3.2.26;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
OTHER_LDFLAGS = "$(CONFIG_FRAMEWORK_LDFLAGS)";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL3;
|
||||
@@ -3200,6 +3198,8 @@
|
||||
baseConfigurationReference = F3F7BE3B2CBD79D200C984AF /* config.xcconfig */;
|
||||
buildSettings = {
|
||||
CLANG_LINK_OBJC_RUNTIME = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
|
||||
OTHER_LDFLAGS = "-liconv";
|
||||
SUPPORTS_MACCATALYST = YES;
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Title SDL 3.2.24
|
||||
Title SDL 3.2.26
|
||||
Version 1
|
||||
Description SDL Library for macOS (http://www.libsdl.org)
|
||||
DefaultLocation /Library/Frameworks
|
||||
|
||||
@@ -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 = 26;
|
||||
/*
|
||||
// Display InputType.SOURCE/CLASS of events and devices
|
||||
//
|
||||
@@ -1128,6 +1128,11 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
int orientation_landscape = -1;
|
||||
int orientation_portrait = -1;
|
||||
|
||||
if (w <= 1 || h <= 1) {
|
||||
// Invalid width/height, ignore this request
|
||||
return;
|
||||
}
|
||||
|
||||
/* If set, hint "explicitly controls which UI orientations are allowed". */
|
||||
if (hint.contains("LandscapeRight") && hint.contains("LandscapeLeft")) {
|
||||
orientation_landscape = ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE;
|
||||
|
||||
@@ -15,6 +15,7 @@ import android.view.Display;
|
||||
import android.view.InputDevice;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.PointerIcon;
|
||||
import android.view.Surface;
|
||||
import android.view.SurfaceHolder;
|
||||
import android.view.SurfaceView;
|
||||
@@ -362,6 +363,16 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
|
||||
}
|
||||
}
|
||||
|
||||
// Prevent android internal NullPointerException (https://github.com/libsdl-org/SDL/issues/13306)
|
||||
@Override
|
||||
public PointerIcon onResolvePointerIcon(MotionEvent event, int pointerIndex) {
|
||||
try {
|
||||
return super.onResolvePointerIcon(event, pointerIndex);
|
||||
} catch (NullPointerException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Captured pointer events for API 26.
|
||||
public boolean onCapturedPointerEvent(MotionEvent event)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -131,7 +131,7 @@ function(sdl_compile_options)
|
||||
target_compile_options(SDL3-static ${visibility} ${escaped_opts})
|
||||
endif()
|
||||
if(NOT ARGS_NO_EXPORT AND (ARGS_PUBLIC OR ARGS_INTERFACE))
|
||||
set_property(TARGET SDL3-collector APPEND PROPERTY INTERFACE_COMPILE_COMPILE_OPTIONS "${ARGS_UNPARSED_ARGUMENTS}")
|
||||
set_property(TARGET SDL3-collector APPEND PROPERTY INTERFACE_COMPILE_OPTIONS "${ARGS_UNPARSED_ARGUMENTS}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
@@ -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.26
|
||||
*
|
||||
* It is almost always best to include just this one header instead of
|
||||
* picking out individual headers included here. There are exceptions to
|
||||
|
||||
@@ -198,11 +198,10 @@ extern SDL_DECLSPEC bool SDLCALL SDL_HasPrimarySelectionText(void);
|
||||
* \param mime_type the requested mime-type.
|
||||
* \param size a pointer filled in with the length of the returned data.
|
||||
* \returns a pointer to the data for the provided mime-type. Returning NULL
|
||||
* or setting the length to 0 will cause no data to be sent to the
|
||||
* "receiver". It is up to the receiver to handle this. Essentially
|
||||
* returning no data is more or less undefined behavior and may cause
|
||||
* breakage in receiving applications. The returned data will not be
|
||||
* freed, so it needs to be retained and dealt with internally.
|
||||
* or setting the length to 0 will cause zero length data to be sent
|
||||
* to the "receiver", which should be able to handle this. The
|
||||
* returned data will not be freed, so it needs to be retained and
|
||||
* dealt with internally.
|
||||
*
|
||||
* \since This function is available since SDL 3.2.0.
|
||||
*
|
||||
|
||||
@@ -1043,7 +1043,7 @@ typedef union SDL_Event
|
||||
} SDL_Event;
|
||||
|
||||
/* Make sure we haven't broken binary compatibility */
|
||||
SDL_COMPILE_TIME_ASSERT(SDL_Event, sizeof(SDL_Event) == sizeof(((SDL_Event *)NULL)->padding));
|
||||
SDL_COMPILE_TIME_ASSERT(SDL_Event, sizeof(SDL_Event) == sizeof((SDL_static_cast(SDL_Event *, NULL))->padding));
|
||||
|
||||
|
||||
/* Function prototypes */
|
||||
|
||||
@@ -360,7 +360,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_LockMutex(SDL_Mutex *mutex) SDL_ACQUIRE(mut
|
||||
* \sa SDL_LockMutex
|
||||
* \sa SDL_UnlockMutex
|
||||
*/
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_TryLockMutex(SDL_Mutex *mutex) SDL_TRY_ACQUIRE(0, mutex);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_TryLockMutex(SDL_Mutex *mutex) SDL_TRY_ACQUIRE(true, mutex);
|
||||
|
||||
/**
|
||||
* Unlock the mutex.
|
||||
@@ -559,7 +559,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_LockRWLockForWriting(SDL_RWLock *rwlock) SD
|
||||
* \sa SDL_TryLockRWLockForWriting
|
||||
* \sa SDL_UnlockRWLock
|
||||
*/
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_TryLockRWLockForReading(SDL_RWLock *rwlock) SDL_TRY_ACQUIRE_SHARED(0, rwlock);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_TryLockRWLockForReading(SDL_RWLock *rwlock) SDL_TRY_ACQUIRE_SHARED(true, rwlock);
|
||||
|
||||
/**
|
||||
* Try to lock a read/write lock _for writing_ without blocking.
|
||||
@@ -589,7 +589,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_TryLockRWLockForReading(SDL_RWLock *rwlock)
|
||||
* \sa SDL_TryLockRWLockForReading
|
||||
* \sa SDL_UnlockRWLock
|
||||
*/
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock) SDL_TRY_ACQUIRE(0, rwlock);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock) SDL_TRY_ACQUIRE(true, rwlock);
|
||||
|
||||
/**
|
||||
* Unlock the read/write lock.
|
||||
|
||||
@@ -125,10 +125,10 @@ typedef struct SDL_FRect
|
||||
*/
|
||||
SDL_FORCE_INLINE void SDL_RectToFRect(const SDL_Rect *rect, SDL_FRect *frect)
|
||||
{
|
||||
frect->x = (float)rect->x;
|
||||
frect->y = (float)rect->y;
|
||||
frect->w = (float)rect->w;
|
||||
frect->h = (float)rect->h;
|
||||
frect->x = SDL_static_cast(float, rect->x);
|
||||
frect->y = SDL_static_cast(float, rect->y);
|
||||
frect->w = SDL_static_cast(float, rect->w);
|
||||
frect->h = SDL_static_cast(float, rect->h);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1164,7 +1164,7 @@ typedef struct SDL_alignment_test
|
||||
void *b;
|
||||
} SDL_alignment_test;
|
||||
SDL_COMPILE_TIME_ASSERT(struct_alignment, sizeof(SDL_alignment_test) == (2 * sizeof(void *)));
|
||||
SDL_COMPILE_TIME_ASSERT(two_s_complement, (int)~(int)0 == (int)(-1));
|
||||
SDL_COMPILE_TIME_ASSERT(two_s_complement, SDL_static_cast(int, ~SDL_static_cast(int, 0)) == SDL_static_cast(int, -1));
|
||||
#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
|
||||
/** \endcond */
|
||||
|
||||
@@ -5921,7 +5921,7 @@ extern SDL_DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode,
|
||||
*
|
||||
* \since This macro is available since SDL 3.2.0.
|
||||
*/
|
||||
#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1)
|
||||
#define SDL_iconv_utf8_ucs2(S) SDL_reinterpret_cast(Uint16 *, SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1))
|
||||
|
||||
/**
|
||||
* Convert a UTF-8 string to UCS-4.
|
||||
@@ -5935,7 +5935,7 @@ extern SDL_DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode,
|
||||
*
|
||||
* \since This macro is available since SDL 3.2.0.
|
||||
*/
|
||||
#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1)
|
||||
#define SDL_iconv_utf8_ucs4(S) SDL_reinterpret_cast(Uint32 *, SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1))
|
||||
|
||||
/**
|
||||
* Convert a wchar_t string to UTF-8.
|
||||
@@ -5949,7 +5949,7 @@ extern SDL_DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode,
|
||||
*
|
||||
* \since This macro is available since SDL 3.2.0.
|
||||
*/
|
||||
#define SDL_iconv_wchar_utf8(S) SDL_iconv_string("UTF-8", "WCHAR_T", (char *)S, (SDL_wcslen(S)+1)*sizeof(wchar_t))
|
||||
#define SDL_iconv_wchar_utf8(S) SDL_iconv_string("UTF-8", "WCHAR_T", SDL_reinterpret_cast(const char *, S), (SDL_wcslen(S)+1)*sizeof(wchar_t))
|
||||
|
||||
|
||||
/* force builds using Clang's static analysis tools to use literal C runtime
|
||||
|
||||
@@ -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 26
|
||||
|
||||
/**
|
||||
* This macro turns the version numbers into a numeric value.
|
||||
|
||||
@@ -1729,18 +1729,24 @@ static bool Android_JNI_ExceptionOccurred(bool silent)
|
||||
exceptionName = (jstring)(*env)->CallObjectMethod(env, exceptionClass, mid);
|
||||
exceptionNameUTF8 = (*env)->GetStringUTFChars(env, exceptionName, 0);
|
||||
|
||||
(*env)->DeleteLocalRef(env, classClass);
|
||||
|
||||
mid = (*env)->GetMethodID(env, exceptionClass, "getMessage", "()Ljava/lang/String;");
|
||||
exceptionMessage = (jstring)(*env)->CallObjectMethod(env, exception, mid);
|
||||
|
||||
(*env)->DeleteLocalRef(env, exceptionClass);
|
||||
|
||||
if (exceptionMessage != NULL) {
|
||||
const char *exceptionMessageUTF8 = (*env)->GetStringUTFChars(env, exceptionMessage, 0);
|
||||
SDL_SetError("%s: %s", exceptionNameUTF8, exceptionMessageUTF8);
|
||||
(*env)->ReleaseStringUTFChars(env, exceptionMessage, exceptionMessageUTF8);
|
||||
(*env)->DeleteLocalRef(env, exceptionMessage);
|
||||
} else {
|
||||
SDL_SetError("%s", exceptionNameUTF8);
|
||||
}
|
||||
|
||||
(*env)->ReleaseStringUTFChars(env, exceptionName, exceptionNameUTF8);
|
||||
(*env)->DeleteLocalRef(env, exceptionName);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -2768,6 +2774,7 @@ bool Android_JNI_OpenFileDialog(
|
||||
if (filters) {
|
||||
jclass stringClass = (*env)->FindClass(env, "java/lang/String");
|
||||
filtersArray = (*env)->NewObjectArray(env, nfilters, stringClass, NULL);
|
||||
(*env)->DeleteLocalRef(env, stringClass);
|
||||
|
||||
// Convert to string
|
||||
for (int i = 0; i < nfilters; i++) {
|
||||
|
||||
@@ -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,26,0
|
||||
PRODUCTVERSION 3,2,26,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, 26, 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, 26, 0\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
||||
@@ -333,6 +333,18 @@ bool SDL_SetKeyboardFocus(SDL_Window *window)
|
||||
}
|
||||
}
|
||||
|
||||
// See if the current window has lost focus
|
||||
if (keyboard->focus && keyboard->focus != window) {
|
||||
SDL_SendWindowEvent(keyboard->focus, SDL_EVENT_WINDOW_FOCUS_LOST, 0, 0);
|
||||
|
||||
// Ensures IME compositions are committed
|
||||
if (SDL_TextInputActive(keyboard->focus)) {
|
||||
if (video && video->StopTextInput) {
|
||||
video->StopTextInput(video, keyboard->focus);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (keyboard->focus && !window) {
|
||||
// We won't get anymore keyboard messages, so reset keyboard state
|
||||
SDL_ResetKeyboard();
|
||||
@@ -351,18 +363,6 @@ bool SDL_SetKeyboardFocus(SDL_Window *window)
|
||||
}
|
||||
}
|
||||
|
||||
// See if the current window has lost focus
|
||||
if (keyboard->focus && keyboard->focus != window) {
|
||||
SDL_SendWindowEvent(keyboard->focus, SDL_EVENT_WINDOW_FOCUS_LOST, 0, 0);
|
||||
|
||||
// Ensures IME compositions are committed
|
||||
if (SDL_TextInputActive(keyboard->focus)) {
|
||||
if (video && video->StopTextInput) {
|
||||
video->StopTextInput(video, keyboard->focus);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
keyboard->focus = window;
|
||||
|
||||
if (keyboard->focus) {
|
||||
|
||||
@@ -77,9 +77,6 @@ bool SDL_SendWindowEvent(SDL_Window *window, SDL_EventType windowevent, int data
|
||||
}
|
||||
SDL_assert(SDL_ObjectValid(window, SDL_OBJECT_TYPE_WINDOW));
|
||||
|
||||
if (window->is_destroying && windowevent != SDL_EVENT_WINDOW_DESTROYED) {
|
||||
return false;
|
||||
}
|
||||
switch (windowevent) {
|
||||
case SDL_EVENT_WINDOW_SHOWN:
|
||||
if (!(window->flags & SDL_WINDOW_HIDDEN)) {
|
||||
@@ -212,6 +209,10 @@ bool SDL_SendWindowEvent(SDL_Window *window, SDL_EventType windowevent, int data
|
||||
break;
|
||||
}
|
||||
|
||||
if (window->is_destroying && windowevent != SDL_EVENT_WINDOW_DESTROYED) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Post the event, if desired
|
||||
SDL_Event event;
|
||||
event.type = windowevent;
|
||||
|
||||
@@ -61,6 +61,10 @@
|
||||
return; \
|
||||
}
|
||||
|
||||
#if 0
|
||||
// The below validation is too aggressive, since there are advanced situations
|
||||
// where this is legal. This is being temporarily disabled for further review.
|
||||
// See: https://github.com/libsdl-org/SDL/issues/13871
|
||||
#define CHECK_SAMPLER_TEXTURES \
|
||||
RenderPass *rp = (RenderPass *)render_pass; \
|
||||
for (Uint32 color_target_index = 0; color_target_index < rp->num_color_targets; color_target_index += 1) { \
|
||||
@@ -92,6 +96,10 @@
|
||||
SDL_assert_release(!"Texture cannot be simultaneously bound as a depth stencil target and a storage texture!"); \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define CHECK_SAMPLER_TEXTURES
|
||||
#define CHECK_STORAGE_TEXTURES
|
||||
#endif
|
||||
|
||||
#define CHECK_GRAPHICS_PIPELINE_BOUND \
|
||||
if (!((RenderPass *)render_pass)->graphics_pipeline) { \
|
||||
@@ -1312,6 +1320,12 @@ SDL_GPUBuffer *SDL_CreateGPUBuffer(
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (device->debug_mode) {
|
||||
if (createinfo->size < 4) {
|
||||
SDL_assert_release(!"Cannot create a buffer with size less than 4 bytes!");
|
||||
}
|
||||
}
|
||||
|
||||
const char *debugName = SDL_GetStringProperty(createinfo->props, SDL_PROP_GPU_BUFFER_CREATE_NAME_STRING, NULL);
|
||||
|
||||
return device->CreateBuffer(
|
||||
|
||||
@@ -991,6 +991,10 @@ struct D3D12CommandBuffer
|
||||
// Set at acquire time
|
||||
D3D12DescriptorHeap *gpuDescriptorHeaps[D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER + 1];
|
||||
|
||||
D3D12DescriptorHeap **usedDescriptorHeaps;
|
||||
Uint32 usedDescriptorHeapCount;
|
||||
Uint32 usedDescriptorHeapCapacity;
|
||||
|
||||
D3D12UniformBuffer **usedUniformBuffers;
|
||||
Uint32 usedUniformBufferCount;
|
||||
Uint32 usedUniformBufferCapacity;
|
||||
@@ -1588,6 +1592,7 @@ static void D3D12_INTERNAL_DestroyCommandBuffer(D3D12CommandBuffer *commandBuffe
|
||||
SDL_free(commandBuffer->usedSamplers);
|
||||
SDL_free(commandBuffer->usedGraphicsPipelines);
|
||||
SDL_free(commandBuffer->usedComputePipelines);
|
||||
SDL_free(commandBuffer->usedDescriptorHeaps);
|
||||
SDL_free(commandBuffer->usedUniformBuffers);
|
||||
SDL_free(commandBuffer->textureDownloads);
|
||||
SDL_free(commandBuffer);
|
||||
@@ -2284,6 +2289,28 @@ static bool D3D12_INTERNAL_ExpandStagingDescriptorPool(
|
||||
return true;
|
||||
}
|
||||
|
||||
static void D3D12_INTERNAL_TrackGPUDescriptorHeap(
|
||||
D3D12CommandBuffer *commandBuffer,
|
||||
D3D12DescriptorHeap *descriptorHeap)
|
||||
{
|
||||
Uint32 i;
|
||||
for (i = 0; i < commandBuffer->usedDescriptorHeapCount; i += 1) {
|
||||
if (commandBuffer->usedDescriptorHeaps[i] == descriptorHeap) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (commandBuffer->usedDescriptorHeapCount == commandBuffer->usedDescriptorHeapCapacity) {
|
||||
commandBuffer->usedDescriptorHeapCapacity += 1;
|
||||
commandBuffer->usedDescriptorHeaps = (D3D12DescriptorHeap **)SDL_realloc(
|
||||
commandBuffer->usedDescriptorHeaps,
|
||||
commandBuffer->usedDescriptorHeapCapacity * sizeof(D3D12DescriptorHeap *));
|
||||
}
|
||||
|
||||
commandBuffer->usedDescriptorHeaps[commandBuffer->usedDescriptorHeapCount] = descriptorHeap;
|
||||
commandBuffer->usedDescriptorHeapCount += 1;
|
||||
}
|
||||
|
||||
static D3D12DescriptorHeap *D3D12_INTERNAL_AcquireGPUDescriptorHeapFromPool(
|
||||
D3D12CommandBuffer *commandBuffer,
|
||||
D3D12_DESCRIPTOR_HEAP_TYPE descriptorHeapType)
|
||||
@@ -2305,6 +2332,7 @@ static D3D12DescriptorHeap *D3D12_INTERNAL_AcquireGPUDescriptorHeapFromPool(
|
||||
}
|
||||
SDL_UnlockMutex(pool->lock);
|
||||
|
||||
D3D12_INTERNAL_TrackGPUDescriptorHeap(commandBuffer, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -7280,6 +7308,11 @@ static bool D3D12_INTERNAL_AllocateCommandBuffer(
|
||||
commandBuffer->usedComputePipelines = (D3D12ComputePipeline **)SDL_calloc(
|
||||
commandBuffer->usedComputePipelineCapacity, sizeof(D3D12ComputePipeline *));
|
||||
|
||||
commandBuffer->usedDescriptorHeapCapacity = 4;
|
||||
commandBuffer->usedDescriptorHeapCount = 0;
|
||||
commandBuffer->usedDescriptorHeaps = (D3D12DescriptorHeap **)SDL_calloc(
|
||||
commandBuffer->usedDescriptorHeapCapacity, sizeof(D3D12DescriptorHeap *));
|
||||
|
||||
commandBuffer->usedUniformBufferCapacity = 4;
|
||||
commandBuffer->usedUniformBufferCount = 0;
|
||||
commandBuffer->usedUniformBuffers = (D3D12UniformBuffer **)SDL_calloc(
|
||||
@@ -7701,13 +7734,13 @@ static bool D3D12_INTERNAL_CleanCommandBuffer(
|
||||
NULL);
|
||||
CHECK_D3D12_ERROR_AND_RETURN("Could not reset command list", false);
|
||||
|
||||
// Return descriptor heaps to pool
|
||||
D3D12_INTERNAL_ReturnGPUDescriptorHeapToPool(
|
||||
renderer,
|
||||
commandBuffer->gpuDescriptorHeaps[D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV]);
|
||||
D3D12_INTERNAL_ReturnGPUDescriptorHeapToPool(
|
||||
renderer,
|
||||
commandBuffer->gpuDescriptorHeaps[D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER]);
|
||||
// Return descriptor heaps to pool, pools own their own locks
|
||||
for (i = 0; i < commandBuffer->usedDescriptorHeapCount; i += 1) {
|
||||
D3D12_INTERNAL_ReturnGPUDescriptorHeapToPool(
|
||||
renderer,
|
||||
commandBuffer->usedDescriptorHeaps[i]);
|
||||
}
|
||||
commandBuffer->usedDescriptorHeapCount = 0;
|
||||
|
||||
commandBuffer->gpuDescriptorHeaps[D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV] = NULL;
|
||||
commandBuffer->gpuDescriptorHeaps[D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER] = NULL;
|
||||
|
||||
@@ -5893,7 +5893,10 @@ static VulkanTexture *VULKAN_INTERNAL_CreateTexture(
|
||||
VULKAN_TEXTURE_USAGE_MODE_UNINITIALIZED,
|
||||
texture);
|
||||
VULKAN_INTERNAL_TrackTexture(barrierCommandBuffer, texture);
|
||||
VULKAN_Submit((SDL_GPUCommandBuffer *)barrierCommandBuffer);
|
||||
if (!VULKAN_Submit((SDL_GPUCommandBuffer *)barrierCommandBuffer)) {
|
||||
VULKAN_INTERNAL_DestroyTexture(renderer, texture);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return texture;
|
||||
@@ -9685,6 +9688,13 @@ static bool VULKAN_INTERNAL_OnWindowResize(void *userdata, SDL_Event *e)
|
||||
data->swapchainCreateHeight = e->window.data2;
|
||||
}
|
||||
|
||||
#ifdef SDL_PLATFORM_ANDROID
|
||||
if (e->type == SDL_EVENT_DID_ENTER_BACKGROUND) {
|
||||
data = VULKAN_INTERNAL_FetchWindowData(w);
|
||||
data->needsSwapchainRecreate = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -10664,7 +10674,13 @@ static bool VULKAN_Submit(
|
||||
presentData->windowData->inFlightFences[presentData->windowData->frameCounter] = (SDL_GPUFence*)vulkanCommandBuffer->inFlightFence;
|
||||
(void)SDL_AtomicIncRef(&vulkanCommandBuffer->inFlightFence->referenceCount);
|
||||
|
||||
if (presentResult == VK_SUBOPTIMAL_KHR || presentResult == VK_ERROR_OUT_OF_DATE_KHR) {
|
||||
// On the Android platform, VK_SUBOPTIMAL_KHR is returned whenever the device is rotated. We'll just ignore this for now.
|
||||
#ifndef SDL_PLATFORM_ANDROID
|
||||
if (presentResult == VK_SUBOPTIMAL_KHR) {
|
||||
presentData->windowData->needsSwapchainRecreate = true;
|
||||
}
|
||||
#endif
|
||||
if (presentResult == VK_ERROR_OUT_OF_DATE_KHR) {
|
||||
presentData->windowData->needsSwapchainRecreate = true;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -149,6 +149,51 @@ 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
|
||||
{" Touchpad", GAMEPAD_BLACKLIST_END}, // "Sony Interactive Entertainment DualSense Wireless Controller Touchpad"
|
||||
|
||||
// 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},
|
||||
|
||||
{"Synaptics ", GAMEPAD_BLACKLIST_ANYWHERE}, // "Synaptics TM2768-001", "SynPS/2 Synaptics TouchPad"
|
||||
{"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,27 +2710,29 @@ 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
|
||||
return true;
|
||||
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
|
||||
|
||||
@@ -339,6 +339,7 @@ static const char *s_GamepadMappings[] = {
|
||||
"03000000172700004431000000000000,XiaoMi Game Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b20,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a7,rightx:a2,righty:a5,start:b11,x:b3,y:b4,",
|
||||
"03000000c0160000e105000000000000,Xin-Mo Dual Arcade,crc:2246,a:b1,b:b2,back:b9,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,rightshoulder:b4,righttrigger:b5,start:b8,x:b0,y:b3,", /* Ultimate Atari Fight Stick */
|
||||
"03000000790000004f18000000000000,ZD-T Android,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,",
|
||||
"03000000073500000400000000000000,ZENAIM ARCADE CONTROLLER,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,rightstick:b11,righttrigger:b7,start:b9,x:b0,y:b3,",
|
||||
"03000000120c0000101e000000000000,ZEROPLUS P4 Wired Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
|
||||
"03000000d81d00000f00000000000000,iBUFFALO BSGP1204 Series,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,",
|
||||
"03000000d81d00001000000000000000,iBUFFALO BSGP1204P Series,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,",
|
||||
@@ -481,6 +482,7 @@ static const char *s_GamepadMappings[] = {
|
||||
"030000005e040000fd02000003090000,Xbox Wireless Controller,a:b0,b:b1,back:b16,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,",
|
||||
"03000000172700004431000029010000,XiaoMi Game Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a6,rightx:a2,righty:a5,start:b11,x:b3,y:b4,",
|
||||
"03000000c0160000e105000000040000,Xin-Mo Dual Arcade,crc:82d5,a:b2,b:b4,back:b18,dpdown:+a2,dpleft:-a0,dpright:+a0,dpup:-a2,rightshoulder:b8,righttrigger:b10,start:b16,x:b0,y:b6,", /* Ultimate Atari Fight Stick */
|
||||
"03000000073500000400000000010000,ZENAIM ARCADE CONTROLLER,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,rightstick:b11,righttrigger:b7,start:b9,x:b0,y:b3,",
|
||||
"03000000120c0000100e000000010000,ZEROPLUS P4 Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
|
||||
"03000000120c0000101e000000010000,ZEROPLUS P4 Wired Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
|
||||
"03000000830500006020000000010000,iBuffalo SNES Controller,a:b1,b:b0,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b3,y:b2,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,",
|
||||
@@ -502,6 +504,7 @@ static const char *s_GamepadMappings[] = {
|
||||
"06000000c82d00000020000006010000,8BitDo Pro 2 Wired Controller for Xbox,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
|
||||
"03000000c82d00000660000011010000,8BitDo Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,",
|
||||
"05000000c82d00000660000000010000,8BitDo Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,",
|
||||
"03000000c82d00000960000011010000,8BitDo Pro 3,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,paddle1:b17,paddle2:b16,paddle3:b2,paddle4:b5,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,",
|
||||
"05000000c82d00000061000000010000,8BitDo SF30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,",
|
||||
"05000000102800000900000000010000,8BitDo SFC30 Gamepad,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,",
|
||||
"05000000c82d00003028000000010000,8BitDo SFC30 Gamepad,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,",
|
||||
@@ -795,6 +798,7 @@ static const char *s_GamepadMappings[] = {
|
||||
"050000005e040000fd02000003090000,Xbox One Wireless Controller,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,guide:b16,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,",
|
||||
"05000000172700004431000029010000,XiaoMi Game Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b20,leftshoulder:b6,leftstick:b13,lefttrigger:a7,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a6,rightx:a2,righty:a5,start:b11,x:b3,y:b4,",
|
||||
"03000000c0160000e105000010010000,Xin-Mo Dual Arcade,crc:82d5,a:b1,b:b2,back:b9,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,rightshoulder:b4,righttrigger:b5,start:b8,x:b0,y:b3,", /* Ultimate Atari Fight Stick */
|
||||
"03000000073500000400000011010000,ZENAIM ARCADE CONTROLLER,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,rightstick:b11,righttrigger:b7,start:b9,x:b0,y:b3,",
|
||||
"03000000120c0000100e000011010000,ZEROPLUS P4 Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
|
||||
"03000000120c0000101e000011010000,ZEROPLUS P4 Wired Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
|
||||
"03000000120c0000182e000011010000,ZEROPLUS P4 Wired Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
|
||||
|
||||
@@ -277,6 +277,8 @@ static Uint32 initial_blacklist_devices[] = {
|
||||
MAKE_VIDPID(0x1532, 0x0282), // Razer Huntsman Mini Analog, non-functional DInput device
|
||||
MAKE_VIDPID(0x26ce, 0x01a2), // ASRock LED Controller
|
||||
MAKE_VIDPID(0x20d6, 0x0002), // PowerA Enhanced Wireless Controller for Nintendo Switch (charging port only)
|
||||
MAKE_VIDPID(0x31e3, 0x1310), // Wooting 60HE (ARM)
|
||||
MAKE_VIDPID(0x3297, 0x1969), // Moonlander MK1 Keyboard
|
||||
MAKE_VIDPID(0x3434, 0x0211), // Keychron K1 Pro System Control
|
||||
MAKE_VIDPID(0x04f2, 0xa13c), // HP Deluxe Webcam KQ246AA
|
||||
};
|
||||
@@ -2500,7 +2502,7 @@ void SDL_UpdateJoysticks(void)
|
||||
Uint64 now;
|
||||
SDL_Joystick *joystick;
|
||||
|
||||
if (!SDL_WasInit(SDL_INIT_JOYSTICK)) {
|
||||
if (!SDL_joysticks_initialized) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -435,7 +435,8 @@ static const ControllerDescription_t arrControllers[] = {
|
||||
{ MAKE_CONTROLLER_ID( 0x24c6, 0x592a ), k_eControllerType_XBoxOneController, NULL }, // BDA XB1 Spectra Pro
|
||||
{ MAKE_CONTROLLER_ID( 0x24c6, 0x791a ), k_eControllerType_XBoxOneController, NULL }, // PowerA Fusion Fight Pad
|
||||
{ MAKE_CONTROLLER_ID( 0x2dc8, 0x2002 ), k_eControllerType_XBoxOneController, NULL }, // 8BitDo Ultimate Wired Controller for Xbox
|
||||
{ MAKE_CONTROLLER_ID( 0x2dc8, 0x3106 ), k_eControllerType_XBoxOneController, NULL }, // 8Bitdo Ultimate Wired Controller. Windows, Android, Switch.
|
||||
{ MAKE_CONTROLLER_ID( 0x2dc8, 0x3106 ), k_eControllerType_XBoxOneController, NULL }, // 8BitDo Ultimate Wired Controller. Windows, Android, Switch.
|
||||
{ MAKE_CONTROLLER_ID( 0x2dc8, 0x310a ), k_eControllerType_XBoxOneController, NULL }, // 8BitDo Ultimate 2C Wireless Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x2e24, 0x0652 ), k_eControllerType_XBoxOneController, NULL }, // Hyperkin Duke
|
||||
{ MAKE_CONTROLLER_ID( 0x2e24, 0x1618 ), k_eControllerType_XBoxOneController, NULL }, // Hyperkin Duke
|
||||
{ MAKE_CONTROLLER_ID( 0x2e24, 0x1688 ), k_eControllerType_XBoxOneController, NULL }, // Hyperkin X91
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#ifdef SDL_THREAD_SAFETY_ANALYSIS
|
||||
extern SDL_Mutex *SDL_HIDAPI_rumble_lock;
|
||||
#endif
|
||||
bool SDL_HIDAPI_LockRumble(void) SDL_TRY_ACQUIRE(0, SDL_HIDAPI_rumble_lock);
|
||||
bool SDL_HIDAPI_LockRumble(void) SDL_TRY_ACQUIRE(true, SDL_HIDAPI_rumble_lock);
|
||||
bool SDL_HIDAPI_GetPendingRumbleLocked(SDL_HIDAPI_Device *device, Uint8 **data, int **size, int *maximum_size);
|
||||
int SDL_HIDAPI_SendRumbleAndUnlock(SDL_HIDAPI_Device *device, const Uint8 *data, int size) SDL_RELEASE(SDL_HIDAPI_rumble_lock);
|
||||
typedef void (*SDL_HIDAPI_RumbleSentCallback)(void *userdata);
|
||||
|
||||
@@ -69,6 +69,7 @@ typedef PCWSTR(WINAPI *WindowsGetStringRawBuffer_t)(HSTRING string, UINT32 *leng
|
||||
|
||||
static struct
|
||||
{
|
||||
bool ro_initialized;
|
||||
CoIncrementMTAUsage_t CoIncrementMTAUsage;
|
||||
RoGetActivationFactory_t RoGetActivationFactory;
|
||||
WindowsCreateStringReference_t WindowsCreateStringReference;
|
||||
@@ -592,6 +593,7 @@ static bool WGI_JoystickInit(void)
|
||||
if (FAILED(WIN_RoInitialize())) {
|
||||
return SDL_SetError("RoInitialize() failed");
|
||||
}
|
||||
wgi.ro_initialized = true;
|
||||
|
||||
#define RESOLVE(x) wgi.x = (x##_t)WIN_LoadComBaseFunction(#x); if (!wgi.x) return WIN_SetError("GetProcAddress failed for " #x);
|
||||
RESOLVE(CoIncrementMTAUsage);
|
||||
@@ -1002,7 +1004,9 @@ static void WGI_JoystickQuit(void)
|
||||
__x_ABI_CWindows_CGaming_CInput_CIRawGameControllerStatics_Release(wgi.controller_statics);
|
||||
}
|
||||
|
||||
WIN_RoUninitialize();
|
||||
if (wgi.ro_initialized) {
|
||||
WIN_RoUninitialize();
|
||||
}
|
||||
|
||||
SDL_zero(wgi);
|
||||
}
|
||||
|
||||
@@ -1,135 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
#include "SDL_internal.h"
|
||||
|
||||
#if defined(SDL_VIDEO_RENDER_D3D) || \
|
||||
defined(SDL_VIDEO_RENDER_D3D11) || \
|
||||
defined(SDL_VIDEO_RENDER_D3D12) || \
|
||||
defined(SDL_VIDEO_RENDER_VULKAN)
|
||||
|
||||
#include "SDL_d3dmath.h"
|
||||
|
||||
// Direct3D matrix math functions
|
||||
|
||||
Float4X4 MatrixIdentity(void)
|
||||
{
|
||||
Float4X4 m;
|
||||
SDL_zero(m);
|
||||
m.v._11 = 1.0f;
|
||||
m.v._22 = 1.0f;
|
||||
m.v._33 = 1.0f;
|
||||
m.v._44 = 1.0f;
|
||||
return m;
|
||||
}
|
||||
|
||||
Float4X4 MatrixMultiply(Float4X4 M1, Float4X4 M2)
|
||||
{
|
||||
Float4X4 m;
|
||||
m.v._11 = M1.v._11 * M2.v._11 + M1.v._12 * M2.v._21 + M1.v._13 * M2.v._31 + M1.v._14 * M2.v._41;
|
||||
m.v._12 = M1.v._11 * M2.v._12 + M1.v._12 * M2.v._22 + M1.v._13 * M2.v._32 + M1.v._14 * M2.v._42;
|
||||
m.v._13 = M1.v._11 * M2.v._13 + M1.v._12 * M2.v._23 + M1.v._13 * M2.v._33 + M1.v._14 * M2.v._43;
|
||||
m.v._14 = M1.v._11 * M2.v._14 + M1.v._12 * M2.v._24 + M1.v._13 * M2.v._34 + M1.v._14 * M2.v._44;
|
||||
m.v._21 = M1.v._21 * M2.v._11 + M1.v._22 * M2.v._21 + M1.v._23 * M2.v._31 + M1.v._24 * M2.v._41;
|
||||
m.v._22 = M1.v._21 * M2.v._12 + M1.v._22 * M2.v._22 + M1.v._23 * M2.v._32 + M1.v._24 * M2.v._42;
|
||||
m.v._23 = M1.v._21 * M2.v._13 + M1.v._22 * M2.v._23 + M1.v._23 * M2.v._33 + M1.v._24 * M2.v._43;
|
||||
m.v._24 = M1.v._21 * M2.v._14 + M1.v._22 * M2.v._24 + M1.v._23 * M2.v._34 + M1.v._24 * M2.v._44;
|
||||
m.v._31 = M1.v._31 * M2.v._11 + M1.v._32 * M2.v._21 + M1.v._33 * M2.v._31 + M1.v._34 * M2.v._41;
|
||||
m.v._32 = M1.v._31 * M2.v._12 + M1.v._32 * M2.v._22 + M1.v._33 * M2.v._32 + M1.v._34 * M2.v._42;
|
||||
m.v._33 = M1.v._31 * M2.v._13 + M1.v._32 * M2.v._23 + M1.v._33 * M2.v._33 + M1.v._34 * M2.v._43;
|
||||
m.v._34 = M1.v._31 * M2.v._14 + M1.v._32 * M2.v._24 + M1.v._33 * M2.v._34 + M1.v._34 * M2.v._44;
|
||||
m.v._41 = M1.v._41 * M2.v._11 + M1.v._42 * M2.v._21 + M1.v._43 * M2.v._31 + M1.v._44 * M2.v._41;
|
||||
m.v._42 = M1.v._41 * M2.v._12 + M1.v._42 * M2.v._22 + M1.v._43 * M2.v._32 + M1.v._44 * M2.v._42;
|
||||
m.v._43 = M1.v._41 * M2.v._13 + M1.v._42 * M2.v._23 + M1.v._43 * M2.v._33 + M1.v._44 * M2.v._43;
|
||||
m.v._44 = M1.v._41 * M2.v._14 + M1.v._42 * M2.v._24 + M1.v._43 * M2.v._34 + M1.v._44 * M2.v._44;
|
||||
return m;
|
||||
}
|
||||
|
||||
Float4X4 MatrixScaling(float x, float y, float z)
|
||||
{
|
||||
Float4X4 m;
|
||||
SDL_zero(m);
|
||||
m.v._11 = x;
|
||||
m.v._22 = y;
|
||||
m.v._33 = z;
|
||||
m.v._44 = 1.0f;
|
||||
return m;
|
||||
}
|
||||
|
||||
Float4X4 MatrixTranslation(float x, float y, float z)
|
||||
{
|
||||
Float4X4 m;
|
||||
SDL_zero(m);
|
||||
m.v._11 = 1.0f;
|
||||
m.v._22 = 1.0f;
|
||||
m.v._33 = 1.0f;
|
||||
m.v._44 = 1.0f;
|
||||
m.v._41 = x;
|
||||
m.v._42 = y;
|
||||
m.v._43 = z;
|
||||
return m;
|
||||
}
|
||||
|
||||
Float4X4 MatrixRotationX(float r)
|
||||
{
|
||||
float sinR = SDL_sinf(r);
|
||||
float cosR = SDL_cosf(r);
|
||||
Float4X4 m;
|
||||
SDL_zero(m);
|
||||
m.v._11 = 1.0f;
|
||||
m.v._22 = cosR;
|
||||
m.v._23 = sinR;
|
||||
m.v._32 = -sinR;
|
||||
m.v._33 = cosR;
|
||||
m.v._44 = 1.0f;
|
||||
return m;
|
||||
}
|
||||
|
||||
Float4X4 MatrixRotationY(float r)
|
||||
{
|
||||
float sinR = SDL_sinf(r);
|
||||
float cosR = SDL_cosf(r);
|
||||
Float4X4 m;
|
||||
SDL_zero(m);
|
||||
m.v._11 = cosR;
|
||||
m.v._13 = -sinR;
|
||||
m.v._22 = 1.0f;
|
||||
m.v._31 = sinR;
|
||||
m.v._33 = cosR;
|
||||
m.v._44 = 1.0f;
|
||||
return m;
|
||||
}
|
||||
|
||||
Float4X4 MatrixRotationZ(float r)
|
||||
{
|
||||
float sinR = SDL_sinf(r);
|
||||
float cosR = SDL_cosf(r);
|
||||
Float4X4 m;
|
||||
SDL_zero(m);
|
||||
m.v._11 = cosR;
|
||||
m.v._12 = sinR;
|
||||
m.v._21 = -sinR;
|
||||
m.v._22 = cosR;
|
||||
m.v._33 = 1.0f;
|
||||
m.v._44 = 1.0f;
|
||||
return m;
|
||||
}
|
||||
|
||||
#endif // SDL_VIDEO_RENDER_D3D || SDL_VIDEO_RENDER_D3D11 || SDL_VIDEO_RENDER_D3D12 || SDL_VIDEO_RENDER_VULKAN
|
||||
@@ -69,13 +69,108 @@ typedef struct
|
||||
};
|
||||
} Float4X4;
|
||||
|
||||
extern Float4X4 MatrixIdentity(void);
|
||||
extern Float4X4 MatrixMultiply(Float4X4 M1, Float4X4 M2);
|
||||
extern Float4X4 MatrixScaling(float x, float y, float z);
|
||||
extern Float4X4 MatrixTranslation(float x, float y, float z);
|
||||
extern Float4X4 MatrixRotationX(float r);
|
||||
extern Float4X4 MatrixRotationY(float r);
|
||||
extern Float4X4 MatrixRotationZ(float r);
|
||||
static inline Float4X4 MatrixIdentity(void)
|
||||
{
|
||||
Float4X4 m;
|
||||
SDL_zero(m);
|
||||
m.v._11 = 1.0f;
|
||||
m.v._22 = 1.0f;
|
||||
m.v._33 = 1.0f;
|
||||
m.v._44 = 1.0f;
|
||||
return m;
|
||||
}
|
||||
|
||||
static inline Float4X4 MatrixMultiply(Float4X4 M1, Float4X4 M2)
|
||||
{
|
||||
Float4X4 m;
|
||||
m.v._11 = M1.v._11 * M2.v._11 + M1.v._12 * M2.v._21 + M1.v._13 * M2.v._31 + M1.v._14 * M2.v._41;
|
||||
m.v._12 = M1.v._11 * M2.v._12 + M1.v._12 * M2.v._22 + M1.v._13 * M2.v._32 + M1.v._14 * M2.v._42;
|
||||
m.v._13 = M1.v._11 * M2.v._13 + M1.v._12 * M2.v._23 + M1.v._13 * M2.v._33 + M1.v._14 * M2.v._43;
|
||||
m.v._14 = M1.v._11 * M2.v._14 + M1.v._12 * M2.v._24 + M1.v._13 * M2.v._34 + M1.v._14 * M2.v._44;
|
||||
m.v._21 = M1.v._21 * M2.v._11 + M1.v._22 * M2.v._21 + M1.v._23 * M2.v._31 + M1.v._24 * M2.v._41;
|
||||
m.v._22 = M1.v._21 * M2.v._12 + M1.v._22 * M2.v._22 + M1.v._23 * M2.v._32 + M1.v._24 * M2.v._42;
|
||||
m.v._23 = M1.v._21 * M2.v._13 + M1.v._22 * M2.v._23 + M1.v._23 * M2.v._33 + M1.v._24 * M2.v._43;
|
||||
m.v._24 = M1.v._21 * M2.v._14 + M1.v._22 * M2.v._24 + M1.v._23 * M2.v._34 + M1.v._24 * M2.v._44;
|
||||
m.v._31 = M1.v._31 * M2.v._11 + M1.v._32 * M2.v._21 + M1.v._33 * M2.v._31 + M1.v._34 * M2.v._41;
|
||||
m.v._32 = M1.v._31 * M2.v._12 + M1.v._32 * M2.v._22 + M1.v._33 * M2.v._32 + M1.v._34 * M2.v._42;
|
||||
m.v._33 = M1.v._31 * M2.v._13 + M1.v._32 * M2.v._23 + M1.v._33 * M2.v._33 + M1.v._34 * M2.v._43;
|
||||
m.v._34 = M1.v._31 * M2.v._14 + M1.v._32 * M2.v._24 + M1.v._33 * M2.v._34 + M1.v._34 * M2.v._44;
|
||||
m.v._41 = M1.v._41 * M2.v._11 + M1.v._42 * M2.v._21 + M1.v._43 * M2.v._31 + M1.v._44 * M2.v._41;
|
||||
m.v._42 = M1.v._41 * M2.v._12 + M1.v._42 * M2.v._22 + M1.v._43 * M2.v._32 + M1.v._44 * M2.v._42;
|
||||
m.v._43 = M1.v._41 * M2.v._13 + M1.v._42 * M2.v._23 + M1.v._43 * M2.v._33 + M1.v._44 * M2.v._43;
|
||||
m.v._44 = M1.v._41 * M2.v._14 + M1.v._42 * M2.v._24 + M1.v._43 * M2.v._34 + M1.v._44 * M2.v._44;
|
||||
return m;
|
||||
}
|
||||
|
||||
static inline Float4X4 MatrixScaling(float x, float y, float z)
|
||||
{
|
||||
Float4X4 m;
|
||||
SDL_zero(m);
|
||||
m.v._11 = x;
|
||||
m.v._22 = y;
|
||||
m.v._33 = z;
|
||||
m.v._44 = 1.0f;
|
||||
return m;
|
||||
}
|
||||
|
||||
static inline Float4X4 MatrixTranslation(float x, float y, float z)
|
||||
{
|
||||
Float4X4 m;
|
||||
SDL_zero(m);
|
||||
m.v._11 = 1.0f;
|
||||
m.v._22 = 1.0f;
|
||||
m.v._33 = 1.0f;
|
||||
m.v._44 = 1.0f;
|
||||
m.v._41 = x;
|
||||
m.v._42 = y;
|
||||
m.v._43 = z;
|
||||
return m;
|
||||
}
|
||||
|
||||
static inline Float4X4 MatrixRotationX(float r)
|
||||
{
|
||||
float sinR = SDL_sinf(r);
|
||||
float cosR = SDL_cosf(r);
|
||||
Float4X4 m;
|
||||
SDL_zero(m);
|
||||
m.v._11 = 1.0f;
|
||||
m.v._22 = cosR;
|
||||
m.v._23 = sinR;
|
||||
m.v._32 = -sinR;
|
||||
m.v._33 = cosR;
|
||||
m.v._44 = 1.0f;
|
||||
return m;
|
||||
}
|
||||
|
||||
static inline Float4X4 MatrixRotationY(float r)
|
||||
{
|
||||
float sinR = SDL_sinf(r);
|
||||
float cosR = SDL_cosf(r);
|
||||
Float4X4 m;
|
||||
SDL_zero(m);
|
||||
m.v._11 = cosR;
|
||||
m.v._13 = -sinR;
|
||||
m.v._22 = 1.0f;
|
||||
m.v._31 = sinR;
|
||||
m.v._33 = cosR;
|
||||
m.v._44 = 1.0f;
|
||||
return m;
|
||||
}
|
||||
|
||||
static inline Float4X4 MatrixRotationZ(float r)
|
||||
{
|
||||
float sinR = SDL_sinf(r);
|
||||
float cosR = SDL_cosf(r);
|
||||
Float4X4 m;
|
||||
SDL_zero(m);
|
||||
m.v._11 = cosR;
|
||||
m.v._12 = sinR;
|
||||
m.v._21 = -sinR;
|
||||
m.v._22 = cosR;
|
||||
m.v._33 = 1.0f;
|
||||
m.v._44 = 1.0f;
|
||||
return m;
|
||||
}
|
||||
|
||||
// Ends C function definitions when using C++
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -234,7 +234,7 @@ static bool GL_CheckAllErrors(const char *prefix, SDL_Renderer *renderer, const
|
||||
#if 0
|
||||
#define GL_CheckError(prefix, renderer)
|
||||
#else
|
||||
#define GL_CheckError(prefix, renderer) GL_CheckAllErrors(prefix, renderer, SDL_FILE, SDL_LINE, SDL_FUNCTION)
|
||||
#define GL_CheckError(prefix, renderer) GL_CheckAllErrors(prefix, renderer, "SDL_render_gl.c", SDL_LINE, SDL_FUNCTION)
|
||||
#endif
|
||||
|
||||
static bool GL_LoadFunctions(GL_RenderData *data)
|
||||
|
||||
@@ -252,7 +252,7 @@ static bool GL_CheckAllErrors(const char *prefix, SDL_Renderer *renderer, const
|
||||
#if 0
|
||||
#define GL_CheckError(prefix, renderer)
|
||||
#else
|
||||
#define GL_CheckError(prefix, renderer) GL_CheckAllErrors(prefix, renderer, SDL_FILE, SDL_LINE, SDL_FUNCTION)
|
||||
#define GL_CheckError(prefix, renderer) GL_CheckAllErrors(prefix, renderer, "SDL_render_gles2.c", SDL_LINE, SDL_FUNCTION)
|
||||
#endif
|
||||
|
||||
/*************************************************************************************************
|
||||
|
||||
@@ -113,6 +113,16 @@ static gs_rgbaq float_color_to_RGBAQ(const SDL_FColor *color, float color_scale)
|
||||
return color_to_RGBAQ(colorR, colorG, colorB, colorA, 0x00);
|
||||
}
|
||||
|
||||
static gs_rgbaq float_color_to_RGBAQ_tex(const SDL_FColor *color, float color_scale)
|
||||
{
|
||||
uint8_t colorR = (uint8_t)SDL_roundf(SDL_clamp(color->r * color_scale, 0.0f, 1.0f) * 127.0f);
|
||||
uint8_t colorG = (uint8_t)SDL_roundf(SDL_clamp(color->g * color_scale, 0.0f, 1.0f) * 127.0f);
|
||||
uint8_t colorB = (uint8_t)SDL_roundf(SDL_clamp(color->b * color_scale, 0.0f, 1.0f) * 127.0f);
|
||||
uint8_t colorA = (uint8_t)SDL_roundf(SDL_clamp(color->a, 0.0f, 1.0f) * 63.0f);
|
||||
|
||||
return color_to_RGBAQ(colorR, colorG, colorB, colorA, 0x00);
|
||||
}
|
||||
|
||||
static uint64_t float_GS_SETREG_RGBAQ(const SDL_FColor *color, float color_scale)
|
||||
{
|
||||
uint8_t colorR = (uint8_t)SDL_roundf(SDL_clamp(color->r * color_scale, 0.0f, 1.0f) * 255.0f);
|
||||
@@ -281,7 +291,7 @@ static bool PS2_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SD
|
||||
uv_ = (float *)((char *)uv + j * uv_stride);
|
||||
|
||||
vertices->xyz2 = vertex_to_XYZ2(data->gsGlobal, xy_[0] * scale_x, xy_[1] * scale_y, 0);
|
||||
vertices->rgbaq = float_color_to_RGBAQ(col_, color_scale);
|
||||
vertices->rgbaq = float_color_to_RGBAQ_tex(col_, color_scale);
|
||||
vertices->uv = vertex_to_UV(ps2_tex, uv_[0] * ps2_tex->Width, uv_[1] * ps2_tex->Height);
|
||||
|
||||
vertices++;
|
||||
|
||||
@@ -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, ©data->srcrect,
|
||||
|
||||
@@ -2503,7 +2503,7 @@ static VkResult VULKAN_CreateWindowSizeDependentResources(SDL_Renderer *renderer
|
||||
|
||||
result = VULKAN_CreateSwapChain(renderer, w, h);
|
||||
if (result != VK_SUCCESS) {
|
||||
rendererData->recreateSwapchain = VK_TRUE;
|
||||
rendererData->recreateSwapchain = true;
|
||||
}
|
||||
|
||||
rendererData->viewportDirty = true;
|
||||
@@ -2553,6 +2553,13 @@ static void VULKAN_WindowEvent(SDL_Renderer *renderer, const SDL_WindowEvent *ev
|
||||
if (event->type == SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED) {
|
||||
rendererData->recreateSwapchain = true;
|
||||
}
|
||||
|
||||
#ifdef SDL_PLATFORM_ANDROID
|
||||
// Prevent black screen when app returns from background
|
||||
if (event->type == SDL_EVENT_WINDOW_RESTORED) {
|
||||
VULKAN_HandleDeviceLost(renderer);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static bool VULKAN_SupportsBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode)
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
@@ -80,6 +80,15 @@ bool SDL_SetTLS(SDL_TLSID *id, const void *value, SDL_TLSDestructorCallback dest
|
||||
* will have the same storage index for this id.
|
||||
*/
|
||||
storage_index = SDL_GetAtomicInt(id) - 1;
|
||||
} else {
|
||||
// Make sure we don't allocate an ID clobbering this one
|
||||
int tls_id = SDL_GetAtomicInt(&SDL_tls_id);
|
||||
while (storage_index >= tls_id) {
|
||||
if (SDL_CompareAndSwapAtomicInt(&SDL_tls_id, tls_id, storage_index + 1)) {
|
||||
break;
|
||||
}
|
||||
tls_id = SDL_GetAtomicInt(&SDL_tls_id);
|
||||
}
|
||||
}
|
||||
|
||||
// Get the storage for the current thread
|
||||
|
||||
@@ -173,6 +173,11 @@ void *SDL_GetInternalClipboardData(SDL_VideoDevice *_this, const char *mime_type
|
||||
void *data = NULL;
|
||||
|
||||
if (_this->clipboard_callback) {
|
||||
if (!SDL_HasInternalClipboardData(_this, mime_type)) {
|
||||
// The callback hasn't advertised that it can handle this mime type
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const void *provided_data = _this->clipboard_callback(_this->clipboard_userdata, mime_type, size);
|
||||
if (provided_data) {
|
||||
// Make a copy of it for the caller and guarantee null termination
|
||||
@@ -180,6 +185,8 @@ void *SDL_GetInternalClipboardData(SDL_VideoDevice *_this, const char *mime_type
|
||||
if (data) {
|
||||
SDL_memcpy(data, provided_data, *size);
|
||||
SDL_memset((Uint8 *)data + *size, 0, sizeof(Uint32));
|
||||
} else {
|
||||
*size = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,8 +48,6 @@ bool SDL_HASINTERSECTION(const RECTTYPE *A, const RECTTYPE *B)
|
||||
SDL_RECT_CAN_OVERFLOW(B)) {
|
||||
SDL_SetError("Potential rect math overflow");
|
||||
return false;
|
||||
} else if (SDL_RECTEMPTY(A) || SDL_RECTEMPTY(B)) {
|
||||
return false; // Special cases for empty rects
|
||||
}
|
||||
|
||||
// Horizontal intersection
|
||||
@@ -100,10 +98,6 @@ bool SDL_INTERSECTRECT(const RECTTYPE *A, const RECTTYPE *B, RECTTYPE *result)
|
||||
} else if (!result) {
|
||||
SDL_InvalidParamError("result");
|
||||
return false;
|
||||
} else if (SDL_RECTEMPTY(A) || SDL_RECTEMPTY(B)) { // Special cases for empty rects
|
||||
result->w = 0;
|
||||
result->h = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Horizontal intersection
|
||||
|
||||
@@ -248,6 +248,12 @@ void Android_PumpEvents(Sint64 timeoutNS)
|
||||
|
||||
bool Android_WaitActiveAndLockActivity(void)
|
||||
{
|
||||
/* Make sure we have pumped all events so that Android_Paused state is correct */
|
||||
SDL_AndroidLifecycleEvent event;
|
||||
while (!Android_Destroyed && Android_WaitLifecycleEvent(&event, 0)) {
|
||||
Android_HandleLifecycleEvent(event);
|
||||
}
|
||||
|
||||
while (Android_Paused && !Android_Destroyed) {
|
||||
Android_PumpEvents(-1);
|
||||
}
|
||||
|
||||
@@ -57,8 +57,8 @@ SDL_TouchID Android_ConvertJavaTouchID(int touchID)
|
||||
// adb shell input mouse tap 100 100
|
||||
// adb shell input touchscreen tap 100 100
|
||||
//
|
||||
// Prevent to be -1, since it's used in SDL internal for synthetic events:
|
||||
retval -= 1;
|
||||
// Prevent the values -1 and -2, since they're used in SDL internal for synthetic events:
|
||||
retval -= 2;
|
||||
} else {
|
||||
// Touch ID 0 is invalid
|
||||
retval += 1;
|
||||
@@ -81,7 +81,7 @@ void Android_OnTouch(SDL_Window *window, int touch_device_id_in, int pointer_fin
|
||||
fingerId = (SDL_FingerID)(pointer_finger_id_in + 1);
|
||||
|
||||
if (SDL_AddTouch(touchDeviceId, SDL_TOUCH_DEVICE_DIRECT, "") < 0) {
|
||||
SDL_Log("error: can't add touch %s, %d", __FILE__, __LINE__);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (action) {
|
||||
|
||||
@@ -265,7 +265,7 @@ bool HAIKU_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL
|
||||
// Get the current screen
|
||||
BScreen bscreen;
|
||||
if (!bscreen.IsValid()) {
|
||||
printf(__FILE__": %d - ERROR: BAD SCREEN\n", __LINE__);
|
||||
return SDL_SetError("Invalid screen");
|
||||
}
|
||||
|
||||
// Set the mode using the driver data
|
||||
|
||||
@@ -240,16 +240,18 @@ static bool HAIKU_SetRelativeMouseMode(bool enabled)
|
||||
}
|
||||
|
||||
SDL_BWin *bewin = _ToBeWin(window);
|
||||
BGLView *_SDL_GLView = bewin->GetGLView();
|
||||
if (!_SDL_GLView) {
|
||||
return false;
|
||||
}
|
||||
BView *_SDL_View = bewin->GetGLView();
|
||||
if (!_SDL_View) {
|
||||
_SDL_View = bewin->GetView();
|
||||
if (!_SDL_View)
|
||||
return false;
|
||||
}
|
||||
|
||||
bewin->Lock();
|
||||
if (enabled)
|
||||
_SDL_GLView->SetEventMask(B_POINTER_EVENTS, B_NO_POINTER_HISTORY);
|
||||
_SDL_View->SetEventMask(B_POINTER_EVENTS, B_NO_POINTER_HISTORY);
|
||||
else
|
||||
_SDL_GLView->SetEventMask(0, 0);
|
||||
_SDL_View->SetEventMask(0, 0);
|
||||
bewin->Unlock();
|
||||
|
||||
return true;
|
||||
|
||||
@@ -55,7 +55,6 @@ static bool _InitWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Properti
|
||||
|
||||
if (window->flags & SDL_WINDOW_FULLSCREEN) {
|
||||
// TODO: Add support for this flag
|
||||
printf(__FILE__": %d!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n",__LINE__);
|
||||
}
|
||||
if (window->flags & SDL_WINDOW_OPENGL) {
|
||||
// TODO: Add support for this flag
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "../../events/SDL_mouse_c.h"
|
||||
#include "../../events/SDL_touch_c.h"
|
||||
#include "../../events/SDL_events_c.h"
|
||||
#include "../../joystick/SDL_joystick_c.h"
|
||||
|
||||
#include "SDL_uikitappdelegate.h"
|
||||
#include "SDL_uikitevents.h"
|
||||
@@ -38,9 +39,7 @@
|
||||
#define MAX_MOUSE_BUTTONS 5
|
||||
|
||||
// This is defined in SDL_sysjoystick.m
|
||||
#ifndef SDL_JOYSTICK_DISABLED
|
||||
extern int SDL_AppleTVRemoteOpenedAsJoystick;
|
||||
#endif
|
||||
|
||||
@implementation SDL_uikitview
|
||||
{
|
||||
@@ -476,9 +475,18 @@ extern int SDL_AppleTVRemoteOpenedAsJoystick;
|
||||
return (SDL_Scancode)press.key.keyCode;
|
||||
}
|
||||
|
||||
#ifndef SDL_JOYSTICK_DISABLED
|
||||
// Presses from Apple TV remote
|
||||
if (!SDL_AppleTVRemoteOpenedAsJoystick) {
|
||||
// Presses from Apple TV remote or game controller
|
||||
bool controller_opened = false;
|
||||
#ifdef SDL_PLATFORM_TVOS
|
||||
// tvOS doesn't send these for game controllers, but does for the Siri remote
|
||||
controller_opened = (SDL_AppleTVRemoteOpenedAsJoystick > 0);
|
||||
#else
|
||||
// iOS doesn't have a Siri remote, but does send these for game controllers as of iOS 26
|
||||
// We don't currently have any way of telling what controller sent this, so assume if any
|
||||
// controllers are opened, that the application is handling the controller as a gamepad
|
||||
controller_opened = SDL_JoysticksOpened();
|
||||
#endif
|
||||
if (!controller_opened) {
|
||||
switch (press.type) {
|
||||
case UIPressTypeUpArrow:
|
||||
return SDL_SCANCODE_UP;
|
||||
@@ -501,7 +509,6 @@ extern int SDL_AppleTVRemoteOpenedAsJoystick;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif // !SDL_JOYSTICK_DISABLED
|
||||
|
||||
return SDL_SCANCODE_UNKNOWN;
|
||||
}
|
||||
@@ -558,8 +565,9 @@ extern int SDL_AppleTVRemoteOpenedAsJoystick;
|
||||
{
|
||||
// Swipe gestures don't trigger begin states.
|
||||
if (gesture.state == UIGestureRecognizerStateEnded) {
|
||||
#ifndef SDL_JOYSTICK_DISABLED
|
||||
if (!SDL_AppleTVRemoteOpenedAsJoystick) {
|
||||
// tvOS doesn't send these for game controllers, but does for the Siri remote
|
||||
bool controller_opened = (SDL_AppleTVRemoteOpenedAsJoystick > 0);
|
||||
if (!controller_opened) {
|
||||
/* Send arrow key presses for now, as we don't have an external API
|
||||
* which better maps to swipe gestures. */
|
||||
switch (gesture.direction) {
|
||||
@@ -577,7 +585,6 @@ extern int SDL_AppleTVRemoteOpenedAsJoystick;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif // !SDL_JOYSTICK_DISABLED
|
||||
}
|
||||
}
|
||||
#endif // SDL_PLATFORM_TVOS
|
||||
|
||||
@@ -162,11 +162,19 @@ SDL_WAYLAND_SYM(const char *, xkb_keymap_layout_get_name, (struct xkb_keymap*, x
|
||||
|
||||
#ifdef HAVE_LIBDECOR_H
|
||||
SDL_WAYLAND_MODULE(WAYLAND_LIBDECOR)
|
||||
|
||||
#if defined(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR) || SDL_LIBDECOR_CHECK_VERSION(0, 3, 0)
|
||||
#define SDL_libdecor_constsince03 const
|
||||
#else
|
||||
#define SDL_libdecor_constsince03 /* nothing */
|
||||
#endif
|
||||
|
||||
SDL_WAYLAND_SYM(void, libdecor_unref, (struct libdecor *))
|
||||
SDL_WAYLAND_SYM(struct libdecor *, libdecor_new, (struct wl_display *, struct libdecor_interface *))
|
||||
SDL_WAYLAND_SYM(struct libdecor *, libdecor_new, (struct wl_display *,\
|
||||
SDL_libdecor_constsince03 struct libdecor_interface *))
|
||||
SDL_WAYLAND_SYM(struct libdecor_frame *, libdecor_decorate, (struct libdecor *,\
|
||||
struct wl_surface *,\
|
||||
struct libdecor_frame_interface *,\
|
||||
SDL_libdecor_constsince03 struct libdecor_frame_interface *,\
|
||||
void *))
|
||||
SDL_WAYLAND_SYM(void, libdecor_frame_unref, (struct libdecor_frame *))
|
||||
SDL_WAYLAND_SYM(void, libdecor_frame_set_title, (struct libdecor_frame *, const char *))
|
||||
@@ -232,6 +240,8 @@ SDL_WAYLAND_SYM_OPT(void, libdecor_frame_get_max_content_size, (const struct lib
|
||||
SDL_WAYLAND_SYM_OPT(enum libdecor_wm_capabilities, libdecor_frame_get_wm_capabilities, (struct libdecor_frame *))
|
||||
#endif
|
||||
|
||||
#undef SDL_libdecor_constsince03
|
||||
|
||||
#endif
|
||||
|
||||
#undef SDL_WAYLAND_MODULE
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ static bool WaitForSelection(SDL_VideoDevice *_this, Atom selection_type, bool *
|
||||
waitStart = SDL_GetTicks();
|
||||
*flag = true;
|
||||
while (*flag) {
|
||||
SDL_PumpEvents();
|
||||
X11_PumpEvents(_this);
|
||||
waitElapsed = SDL_GetTicks() - waitStart;
|
||||
// Wait one second for a selection response.
|
||||
if (waitElapsed > 1000) {
|
||||
@@ -273,6 +273,14 @@ bool X11_SetClipboardData(SDL_VideoDevice *_this)
|
||||
void *X11_GetClipboardData(SDL_VideoDevice *_this, const char *mime_type, size_t *length)
|
||||
{
|
||||
SDL_VideoData *videodata = _this->internal;
|
||||
|
||||
*length = 0;
|
||||
|
||||
if (!SDL_HasInternalClipboardData(_this, mime_type)) {
|
||||
// This mime type wasn't advertised by the last selection owner.
|
||||
// The atom might still have data, but it's stale, so ignore it.
|
||||
return NULL;
|
||||
}
|
||||
return GetSelectionData(_this, videodata->atoms.CLIPBOARD, mime_type, length);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -34,6 +34,7 @@ static const void *ClipboardDataCallback(void *userdata, const char *mime_type,
|
||||
*size = icon_bmp_len;
|
||||
return icon_bmp;
|
||||
} else {
|
||||
SDL_Log("Called with unexpected mime type: %s", mime_type);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user