Compare commits

..

No commits in common. "master" and "2025.620.0" have entirely different histories.

155 changed files with 451 additions and 2326 deletions

4
.gitattributes vendored
View File

@ -23,7 +23,3 @@ App.config text eol=crlf
.gitattributes text eol=lf .gitattributes text eol=lf
*.md text eol=lf *.md text eol=lf
.travis.yml text eol=lf .travis.yml text eol=lf
# Use lf for files used by ClangSharpPInvokeGenerator
*-license-header.txt text eol=lf
*.g.cs text eol=lf

View File

@ -5,8 +5,6 @@ on:
# - cron: '0 0 * * *' # - cron: '0 0 * * *'
env: env:
BUILD_TYPE: Release BUILD_TYPE: Release
NDK_VER: 28.2.13676358
PLATFORM_VER: 35
jobs: jobs:
build: build:
@ -17,41 +15,20 @@ jobs:
matrix: matrix:
platform: platform:
- { name: win-x64, os: windows-latest, flags: -A x64 } - { name: win-x64, os: windows-latest, flags: -A x64 }
- { name: win-x86, os: windows-2022, flags: -A Win32 } - { name: win-x86, os: windows-latest, flags: -A Win32 }
- { name: win-arm64, os: windows-latest, flags: -A ARM64 } - { name: win-arm64, os: windows-latest, flags: -A ARM64 }
- { name: linux-x64, os: ubuntu-22.04, flags: -GNinja, target_apt_arch: ":amd64" } - { name: linux-x64, os: ubuntu-22.04, flags: -GNinja, target_apt_arch: ":amd64" }
- { name: linux-x86, os: ubuntu-22.04, flags: -GNinja -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32 -DWAVPACK_ENABLE_ASM=OFF, target_apt_arch: ":i386" } - { name: linux-x86, os: ubuntu-22.04, flags: -GNinja -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32", target_apt_arch: ":i386" }
- { name: linux-arm64, os: ubuntu-22.04-arm, flags: -GNinja, target_apt_arch: ":arm64", container: "arm64v8/ubuntu:22.04" } - { name: linux-arm64, os: ubuntu-22.04-arm, flags: -GNinja, target_apt_arch: ":arm64", container: "arm64v8/ubuntu:22.04" }
- { name: linux-arm, os: ubuntu-22.04-arm, flags: -GNinja -DCMAKE_C_FLAGS=-mfpu=neon -DCMAKE_CXX_FLAGS=-mfpu=neon, target_apt_arch: ":armhf", container: "arm32v7/ubuntu:22.04" } - { name: linux-arm, os: ubuntu-22.04-arm, flags: -GNinja, target_apt_arch: ":armhf", container: "arm32v7/ubuntu:22.04" }
- { name: osx-x64, os: macos-13, flags: -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 } - { name: osx-x64, os: macos-13, flags: -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 }
# NOTE: macOS 11.0 is the first released supported by Apple Silicon. # NOTE: macOS 11.0 is the first released supported by Apple Silicon.
- { name: osx-arm64, os: macos-latest, flags: -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 } - { name: osx-arm64, os: macos-latest, flags: -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 }
- { name: android-arm64, os: ubuntu-22.04, flags: -GNinja, abi: arm64-v8a }
- { name: android-arm, os: ubuntu-22.04, flags: -GNinja, abi: armeabi-v7a }
- { name: android-x64, os: ubuntu-22.04, flags: -GNinja, abi: x86_64 }
- { name: android-x86, os: ubuntu-22.04, flags: -GNinja, abi: x86 }
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
submodules: recursive submodules: recursive
- name: Setup JDK
if: contains(matrix.platform.name, 'android')
uses: actions/setup-java@v4
with:
distribution: microsoft
java-version: 17
- name: Install Android SDK Manager
if: contains(matrix.platform.name, 'android')
uses: android-actions/setup-android@v3
- name: Install Android SDK
if: contains(matrix.platform.name, 'android')
run: |
sdkmanager --install "platforms;android-$PLATFORM_VER"
sdkmanager --install "ndk;$NDK_VER"
- name: Build (Linux ARM) - name: Build (Linux ARM)
if: contains(matrix.platform.container, 'arm') if: contains(matrix.platform.container, 'arm')
uses: addnab/docker-run-action@v3 uses: addnab/docker-run-action@v3
@ -62,10 +39,11 @@ jobs:
-e NAME=${{ matrix.platform.name }} -e NAME=${{ matrix.platform.name }}
-e TARGET_APT_ARCH=${{ matrix.platform.target_apt_arch }} -e TARGET_APT_ARCH=${{ matrix.platform.target_apt_arch }}
-e RUNNER_OS=${{ runner.os }} -e RUNNER_OS=${{ runner.os }}
-e FLAGS=${{ matrix.platform.flags }}
-e BUILD_TYPE=${{ env.BUILD_TYPE }} -e BUILD_TYPE=${{ env.BUILD_TYPE }}
run: | run: |
cd /workspace cd /workspace
FLAGS="${{ matrix.platform.flags }}" ./External/build.sh ./External/build.sh
- name: Build - name: Build
if: ${{ !contains(matrix.platform.container, 'arm') }} if: ${{ !contains(matrix.platform.container, 'arm') }}
@ -75,7 +53,6 @@ jobs:
TARGET_APT_ARCH: ${{ matrix.platform.target_apt_arch }} TARGET_APT_ARCH: ${{ matrix.platform.target_apt_arch }}
RUNNER_OS: ${{ runner.os }} RUNNER_OS: ${{ runner.os }}
FLAGS: ${{ matrix.platform.flags }} FLAGS: ${{ matrix.platform.flags }}
ANDROID_ABI: ${{ matrix.platform.abi }}
run: ./External/build.sh run: ./External/build.sh
- name: Get Actions user id - name: Get Actions user id
@ -90,12 +67,7 @@ jobs:
user_id: ${{ steps.get_uid.outputs.uid }} user_id: ${{ steps.get_uid.outputs.uid }}
- name: Compress native directory - name: Compress native directory
if: ${{ !contains(matrix.platform.name, 'android') }} run: tar -cf native-${{ matrix.platform.name }}.tar native/${{ matrix.platform.name }}
run: tar -cvf native-${{ matrix.platform.name }}.tar native/${{ matrix.platform.name }}
- name: Compress native directory (Android)
if: contains(matrix.platform.name, 'android')
run: tar -cvf native-${{ matrix.platform.name }}.tar native/android/${{ matrix.platform.abi }}
- name: Upload native artifact - name: Upload native artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
@ -106,46 +78,30 @@ jobs:
build-ios: build-ios:
name: ios name: ios
runs-on: macos-15 runs-on: macos-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
submodules: recursive submodules: true
# https://github.com/dotnet/macios/issues/19157
# https://github.com/actions/runner-images/issues/12758
- name: Use Xcode 16.4
run: sudo xcode-select -switch /Applications/Xcode_16.4.app
- name: Build (iOS) - name: Build (iOS)
run: xcodebuild -project External/SDL/Xcode/SDL/SDL.xcodeproj -target SDL3.xcframework -configuration Release
- name: Prepare release directory (iOS)
run: mkdir -p native/ios
- name: Prepare release (iOS)
run: | run: |
modules=("SDL3" "SDL3_image" "SDL3_ttf" "SDL3_mixer") mkdir -p native/ios/SDL3.xcframework/ios-arm64/SDL3.framework;
architectures=("ios-arm64" "ios-arm64_x86_64-simulator") mkdir -p native/ios/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework;
cp External/SDL/Xcode/SDL/build/SDL3.xcframework/Info.plist native/ios/SDL3.xcframework/Info.plist;
for module in "${modules[@]}"; do cp External/SDL/Xcode/SDL/build/SDL3.xcframework/ios-arm64/SDL3.framework/SDL3 native/ios/SDL3.xcframework/ios-arm64/SDL3.framework/SDL3;
module0="${module/SDL3/SDL}" cp External/SDL/Xcode/SDL/build/SDL3.xcframework/ios-arm64/SDL3.framework/Info.plist native/ios/SDL3.xcframework/ios-arm64/SDL3.framework/Info.plist;
directory="External/${module0}/Xcode" cp External/SDL/Xcode/SDL/build/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/SDL3 native/ios/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/SDL3;
if [ "$module" == "SDL3" ]; then cp External/SDL/Xcode/SDL/build/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Info.plist native/ios/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Info.plist;
directory+="/SDL"
fi
target="${module}.xcframework"
framework="${module}.framework"
output_dir="native/ios/${target}"
xcodebuild -project "${directory}/${module0}.xcodeproj" -target "${target}" -configuration Release
build_dir="${directory}/build/${target}"
for arch in "${architectures[@]}"; do
mkdir -p "${output_dir}/${arch}/${framework}"
cp "${build_dir}/${arch}/${framework}/${module}" "${output_dir}/${arch}/${framework}/${module}"
cp "${build_dir}/${arch}/${framework}/Info.plist" "${output_dir}/${arch}/${framework}/Info.plist"
done
cp "${build_dir}/Info.plist" "${output_dir}/Info.plist"
done
- name: Compress native directory - name: Compress native directory
run: tar -cvf native-ios.tar native/ios run: tar -cf native-ios.tar native/ios
- name: Upload native artifact - name: Upload native artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
@ -154,9 +110,12 @@ jobs:
path: native-ios.tar path: native-ios.tar
if-no-files-found: error if-no-files-found: error
build-android-jar: build-android:
name: android-jar name: android
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
env:
NDK_VER: 23.1.7779620
PLATFORM_VER: android-34
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
@ -172,10 +131,22 @@ jobs:
- name: Install Android SDK Manager - name: Install Android SDK Manager
uses: android-actions/setup-android@v3 uses: android-actions/setup-android@v3
with:
packages: ''
- name: Install Android SDK - name: Install Android SDK
run: | run: |
sdkmanager --install "platforms;android-$PLATFORM_VER" sdkmanager --install "platform-tools" "platforms;$PLATFORM_VER"
sdkmanager --install "ndk;$NDK_VER" --channel=3
- name: Build (Android)
run: |
export PATH=$ANDROID_HOME/ndk/$NDK_VER:$PATH
export OUTPUT=$PWD/native/android
rm -rf $OUTPUT && mkdir -p $OUTPUT
# Build SDL3
./External/SDL/build-scripts/androidbuildlibs.sh APP_ABI="armeabi-v7a arm64-v8a x86 x86_64" NDK_LIBS_OUT="$OUTPUT"
- name: Build SDL3 Android Java - name: Build SDL3 Android Java
run: | run: |
@ -186,9 +157,19 @@ jobs:
# Build SDL3 Android Java part # Build SDL3 Android Java part
cd ./External/SDL/android-project/app/src/main/java cd ./External/SDL/android-project/app/src/main/java
javac -cp $ANDROID_HOME/platforms/android-$PLATFORM_VER/android.jar -encoding utf8 org/libsdl/app/*.java javac -cp $ANDROID_HOME/platforms/$PLATFORM_VER/android.jar -encoding utf8 org/libsdl/app/*.java
jar cvf $OUTPUT/SDL3AndroidBridge.jar org/libsdl/app/*.class jar cvf $OUTPUT/SDL3AndroidBridge.jar org/libsdl/app/*.class
- name: Compress native directory
run: tar -cf native-android.tar native/android
- name: Upload native artifact
uses: actions/upload-artifact@v4
with:
name: native-android
path: native-android.tar
if-no-files-found: error
- name: Upload JAR artifact - name: Upload JAR artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
@ -199,7 +180,7 @@ jobs:
make-pr: make-pr:
name: Submit pull request name: Submit pull request
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [ build, build-ios, build-android-jar ] needs: [ build, build-ios, build-android ]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4

View File

@ -1,79 +0,0 @@
name: Continuous Integration
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
build-only-desktop:
name: Build only (Desktop)
runs-on: ubuntu-latest
timeout-minutes: 60
env:
CI_DONT_TARGET_ANDROID: 1
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install .NET 8.0.x
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
- name: Build
run: dotnet build -c Debug SDL3-CS.Desktop.slnf
build-only-android:
name: Build only (Android)
runs-on: windows-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup JDK 11
uses: actions/setup-java@v4
with:
distribution: microsoft
java-version: 11
- name: Install .NET 8.0.x
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
- name: Install .NET workloads
run: dotnet workload install android
- name: Build
run: dotnet build -c Debug SDL3-CS.Android.slnf
build-only-ios:
name: Build only (iOS)
runs-on: macos-15
timeout-minutes: 60
env:
CI_DONT_TARGET_ANDROID: 1
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install .NET 8.0.x
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
- name: Install .NET Workloads
run: dotnet workload install ios
# https://github.com/dotnet/macios/issues/19157
# https://github.com/actions/runner-images/issues/12758
- name: Use Xcode 16.4
run: sudo xcode-select -switch /Applications/Xcode_16.4.app
- name: Build
run: dotnet build -c Debug SDL3-CS.iOS.slnf

View File

@ -33,7 +33,6 @@ jobs:
dotnet pack SDL3-CS/SDL3-CS.csproj -c Release /p:Version=$(git describe --exact-match --tags HEAD) -o artifacts dotnet pack SDL3-CS/SDL3-CS.csproj -c Release /p:Version=$(git describe --exact-match --tags HEAD) -o artifacts
dotnet pack SDL3_image-CS/SDL3_image-CS.csproj -c Release /p:Version=$(git describe --exact-match --tags HEAD) -o artifacts dotnet pack SDL3_image-CS/SDL3_image-CS.csproj -c Release /p:Version=$(git describe --exact-match --tags HEAD) -o artifacts
dotnet pack SDL3_ttf-CS/SDL3_ttf-CS.csproj -c Release /p:Version=$(git describe --exact-match --tags HEAD) -o artifacts dotnet pack SDL3_ttf-CS/SDL3_ttf-CS.csproj -c Release /p:Version=$(git describe --exact-match --tags HEAD) -o artifacts
dotnet pack SDL3_mixer-CS/SDL3_mixer-CS.csproj -c Release /p:Version=$(git describe --exact-match --tags HEAD) -o artifacts
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4

2
.gitignore vendored
View File

@ -338,5 +338,3 @@ inspectcodereport.xml
inspectcode inspectcode
sdl.json sdl.json
install_output/

4
.gitmodules vendored
View File

@ -9,7 +9,3 @@
path = External/SDL_ttf path = External/SDL_ttf
url = https://github.com/libsdl-org/SDL_ttf.git url = https://github.com/libsdl-org/SDL_ttf.git
branch = main branch = main
[submodule "SDL_mixer"]
path = External/SDL_mixer
url = https://github.com/libsdl-org/SDL_mixer.git
branch = main

2
External/SDL vendored

@ -1 +1 @@
Subproject commit 8e644111c2220e654f53de4ea0aa3afdfc7813c5 Subproject commit 7dd5e765df239986f78c9b0016e3f3023d885084

2
External/SDL_image vendored

@ -1 +1 @@
Subproject commit 13ec6e9be1d69d2a989ec1fc4f09e8743ef3932d Subproject commit 0d418a2a2dc562699854d9c2fc264304ec404e2c

1
External/SDL_mixer vendored

@ -1 +0,0 @@
Subproject commit 7d6e46ad28cc33ad1e87a46df739a7cba47f57fa

2
External/SDL_ttf vendored

@ -1 +1 @@
Subproject commit d929bc0d84bfaf3a71ec7f6be27aeb466380c1a0 Subproject commit 582c6957161d6cc4d3b09cae37744bdfe3700368

161
External/build.sh vendored
View File

@ -5,7 +5,7 @@ set -e
pushd "$(dirname "$0")" pushd "$(dirname "$0")"
# Check if environment variables are defined # Check if environment variables are defined
if [[ -z $NAME || -z $RUNNER_OS || -z $FLAGS || -z $BUILD_TYPE ]]; then if [[ -z $NAME || -z $RUNNER_OS || -z $FLAGS ]]; then
echo "One or more required environment variables are not defined." echo "One or more required environment variables are not defined."
exit 1 exit 1
fi fi
@ -16,18 +16,9 @@ else
SUDO=$(which sudo || exit 0) SUDO=$(which sudo || exit 0)
fi fi
if [[ -n $ANDROID_ABI ]]; then
BUILD_PLATFORM="Android"
else
BUILD_PLATFORM="$RUNNER_OS"
fi
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
if [[ $BUILD_PLATFORM != 'Android' ]]; then if [[ $RUNNER_OS == 'Linux' ]]; then
NATIVE_PATH="$NAME"
if [[ $BUILD_PLATFORM == 'Linux' ]]; then
# Setup Linux dependencies # Setup Linux dependencies
if [[ $TARGET_APT_ARCH == :i386 ]]; then if [[ $TARGET_APT_ARCH == :i386 ]]; then
$SUDO dpkg --add-architecture i386 $SUDO dpkg --add-architecture i386
@ -82,105 +73,83 @@ if [[ $BUILD_PLATFORM != 'Android' ]]; then
libpulse-dev$TARGET_APT_ARCH \ libpulse-dev$TARGET_APT_ARCH \
libpipewire-0.3-dev$TARGET_APT_ARCH \ libpipewire-0.3-dev$TARGET_APT_ARCH \
libdecor-0-dev$TARGET_APT_ARCH libdecor-0-dev$TARGET_APT_ARCH
fi
else git config --global --add safe.directory /workspace/External/SDL
if [[ -z $ANDROID_HOME || -z $NDK_VER || -z $ANDROID_ABI ]]; then git config --global --add safe.directory /workspace/External/SDL_image
echo "One or more required environment variables are not defined." git config --global --add safe.directory /workspace/External/SDL_ttf
exit 1
fi fi
NATIVE_PATH="android/$ANDROID_ABI" # Build SDL
pushd SDL
export ANDROID_NDK_HOME="$ANDROID_HOME/ndk/$NDK_VER"
export FLAGS="$FLAGS -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \
-DANDROID_HOME=$ANDROID_HOME \
-DANDROID_PLATFORM=21 \
-DANDROID_ABI=$ANDROID_ABI \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH \
-DCMAKE_INSTALL_INCLUDEDIR=include \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_INSTALL_DATAROOTDIR=share \
-DSDL_ANDROID_JAR=OFF"
$SUDO apt-get install -y \
git \
cmake \
ninja-build \
meson
fi
if [[ $RUNNER_OS == 'Linux' ]]; then
git config --global --add safe.directory $PWD/SDL
git config --global --add safe.directory $PWD/SDL_image
git config --global --add safe.directory $PWD/SDL_ttf
git config --global --add safe.directory $PWD/SDL_mixer
fi
CMAKE_INSTALL_PREFIX="$PWD/install_output"
rm -rf $CMAKE_INSTALL_PREFIX
if [[ $BUILD_PLATFORM == 'Android' ]]; then
OUTPUT_LIB="lib/libSDL3variant.so"
elif [[ $BUILD_PLATFORM == 'Windows' ]]; then
OUTPUT_LIB="bin/SDL3variant.dll"
elif [[ $BUILD_PLATFORM == 'Linux' ]]; then
OUTPUT_LIB="lib/libSDL3variant.so"
elif [[ $BUILD_PLATFORM == 'macOS' ]]; then
OUTPUT_LIB="lib/libSDL3variant.dylib"
fi
# Use the correct CMAKE_PREFIX_PATH for SDL_image and SDL_ttf, probably due differences in Cmake versions.
if [[ $BUILD_PLATFORM == 'Android' ]]; then
CMAKE_PREFIX_PATH="$CMAKE_INSTALL_PREFIX"
elif [[ $BUILD_PLATFORM == 'Windows' ]]; then
CMAKE_PREFIX_PATH="$CMAKE_INSTALL_PREFIX/cmake/"
elif [[ $BUILD_PLATFORM == 'Linux' ]]; then
CMAKE_PREFIX_PATH="$CMAKE_INSTALL_PREFIX/lib/cmake/"
elif [[ $BUILD_PLATFORM == 'macOS' ]]; then
CMAKE_PREFIX_PATH="$CMAKE_INSTALL_PREFIX/lib/cmake/"
fi
run_cmake() {
LIB_NAME=$1
LIB_OUTPUT=$2
pushd $LIB_NAME
git reset --hard HEAD || echo "Failed to clean up the repository" git reset --hard HEAD || echo "Failed to clean up the repository"
if [[ $BUILD_PLATFORM == 'Windows' && $LIB_NAME == 'SDL' ]]; then if [[ $RUNNER_OS == 'Windows' ]]; then
echo "Patching SDL to not include gameinput.h" echo "Patching SDL to not include gameinput.h"
sed -i 's/#include <gameinput.h>/#_include <gameinput.h>/g' CMakeLists.txt sed -i 's/#include <gameinput.h>/#_include <gameinput.h>/g' CMakeLists.txt
fi fi
# Change the minumum Android API level for SDL_mixer to API 24 as opusfile and libflac fail to build on lower versions. cmake -B build $FLAGS -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSDL_SHARED_ENABLED_BY_DEFAULT=ON -DSDL_STATIC_ENABLED_BY_DEFAULT=ON
if [[ $BUILD_PLATFORM == 'Android' && $LIB_NAME == 'SDL_mixer' ]]; then cmake --build build/ --config Release
export FLAGS="${FLAGS/-DANDROID_PLATFORM=21/-DANDROID_PLATFORM=24}" $SUDO cmake --install build/ --prefix install_output --config Release
fi popd
rm -rf build
cmake -B build $FLAGS -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSDL_SHARED=ON -DSDL_STATIC=OFF "${@:3}"
cmake --build build/ --config $BUILD_TYPE --verbose
cmake --install build/ --prefix $CMAKE_INSTALL_PREFIX --config $BUILD_TYPE
# Move build lib into correct folders # Move build lib into correct folders
cp $CMAKE_INSTALL_PREFIX/$LIB_OUTPUT ../../native/$NATIVE_PATH if [[ $RUNNER_OS == 'Windows' ]]; then
cp SDL/install_output/bin/SDL3.dll ../native/$NAME/SDL3.dll
elif [[ $RUNNER_OS == 'Linux' ]]; then
cp SDL/install_output/lib/libSDL3.so ../native/$NAME/libSDL3.so
elif [[ $RUNNER_OS == 'macOS' ]]; then
cp SDL/install_output/lib/libSDL3.dylib ../native/$NAME/libSDL3.dylib
fi
popd # Use the correct CMAKE_PREFIX_PATH for SDL_image and SDL_ttf, probably due differences in Cmake versions
} if [[ $RUNNER_OS == 'Windows' ]]; then
CMAKE_PREFIX_PATH="../SDL/install_output/cmake/"
run_cmake SDL ${OUTPUT_LIB/variant/} elif [[ $RUNNER_OS == 'Linux' ]]; then
CMAKE_PREFIX_PATH="../SDL/install_output/lib/cmake/"
run_cmake SDL_ttf ${OUTPUT_LIB/variant/_ttf} -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DSDLTTF_VENDORED=ON elif [[ $RUNNER_OS == 'macOS' ]]; then
CMAKE_PREFIX_PATH="../SDL/install_output/lib/cmake/"
fi
# Build SDL_image
pushd SDL_image
git reset --hard HEAD
# -DSDLIMAGE_AVIF=OFF is used because windows requires special setup to build avif support (nasm) # -DSDLIMAGE_AVIF=OFF is used because windows requires special setup to build avif support (nasm)
# TODO: Add support for avif on windows (VisualC script uses dynamic imports) # TODO: Add support for avif on windows (VisualC script uses dynamic imports)
run_cmake SDL_image ${OUTPUT_LIB/variant/_image} -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH -DSDLIMAGE_AVIF=OFF -DSDLIMAGE_DEPS_SHARED=OFF -DSDLIMAGE_VENDORED=ON cmake -B build $FLAGS -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSDL_SHARED_ENABLED_BY_DEFAULT=ON -DSDL_STATIC_ENABLED_BY_DEFAULT=ON -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH -DSDLIMAGE_AVIF=OFF
cmake --build build/ --config Release
$SUDO cmake --install build/ --prefix install_output --config Release
popd
# -DSDLMIXER_MP3_MPG123=OFF is used because upstream build is broken. Fallback to dr_mp3. # Move build lib into correct folders
# See: https://github.com/libsdl-org/SDL_mixer/pull/744#issuecomment-3180682130 if [[ $RUNNER_OS == 'Windows' ]]; then
# Fixing using the proposed solution causes more issues. cp SDL_image/install_output/bin/SDL3_image.dll ../native/$NAME/SDL3_image.dll
run_cmake SDL_mixer ${OUTPUT_LIB/variant/_mixer} -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH -DSDLMIXER_MP3_MPG123=OFF -DSDLMIXER_DEPS_SHARED=OFF -DSDLMIXER_VENDORED=ON cp SDL_image/install_output/bin/libwebp.dll ../native/$NAME/libwebp.dll
cp SDL_image/install_output/bin/libwebpdemux.dll ../native/$NAME/libwebpdemux.dll
cp SDL_image/install_output/bin/tiff.dll ../native/$NAME/tiff.dll
elif [[ $RUNNER_OS == 'Linux' ]]; then
cp SDL_image/install_output/lib/libSDL3_image.so ../native/$NAME/libSDL3_image.so
# TODO: find out if webp, etc. are also needed on linux here
elif [[ $RUNNER_OS == 'macOS' ]]; then
cp SDL_image/install_output/lib/libSDL3_image.dylib ../native/$NAME/libSDL3_image.dylib
# TODO: find out if webp, etc. are also needed on macOS here
fi
# Build SDL_ttf
pushd SDL_ttf
git reset --hard HEAD
cmake -B build $FLAGS -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSDL_SHARED_ENABLED_BY_DEFAULT=ON -DSDL_STATIC_ENABLED_BY_DEFAULT=ON -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH -DCMAKE_POLICY_VERSION_MINIMUM=3.5
cmake --build build/ --config Release
$SUDO cmake --install build/ --prefix install_output --config Release
popd
# Move build lib into correct folders
if [[ $RUNNER_OS == 'Windows' ]]; then
cp SDL_ttf/install_output/bin/SDL3_ttf.dll ../native/$NAME/SDL3_ttf.dll
elif [[ $RUNNER_OS == 'Linux' ]]; then
cp SDL_ttf/install_output/lib/libSDL3_ttf.so ../native/$NAME/libSDL3_ttf.so
elif [[ $RUNNER_OS == 'macOS' ]]; then
cp SDL_ttf/install_output/lib/libSDL3_ttf.dylib ../native/$NAME/libSDL3_ttf.dylib
fi
popd popd

View File

@ -1,28 +1,16 @@
# SDL3-CS # SDL3-CS
C# bindings for the [SDL3](https://github.com/libsdl-org/SDL) family of libraries. SDL3-CS is [SDL3](https://github.com/libsdl-org/SDL) bindings, developed for internal use and available publicly on [NuGet.org](https://www.nuget.org/packages/ppy.SDL3-CS).
| Product | Usage | Package | ## About
|------------------------------------------------------------------|----------------------------------------|----------------------------------------------------------------------------------------------------------------------------|
| [`SDL`](https://github.com/libsdl-org/SDL/tree/main) | `dotnet add package ppy.SDL3-CS` | [![NuGet](https://img.shields.io/nuget/v/ppy.SDL3-CS?label=nuget)](https://www.nuget.org/packages/ppy.SDL3-CS) |
| [`SDL_image`](https://github.com/libsdl-org/SDL_image/tree/main) | `dotnet add package ppy.SDL3_image-CS` | [![NuGet](https://img.shields.io/nuget/v/ppy.SDL3_image-CS?label=nuget)](https://www.nuget.org/packages/ppy.SDL3_image-CS) |
| [`SDL_ttf`](https://github.com/libsdl-org/SDL_ttf/tree/main) | `dotnet add package ppy.SDL3_ttf-CS` | [![NuGet](https://img.shields.io/nuget/v/ppy.SDL3_ttf-CS?label=nuget)](https://www.nuget.org/packages/ppy.SDL3_ttf-CS) |
| [`SDL_mixer`](https://github.com/libsdl-org/SDL_mixer/tree/main) | `dotnet add package ppy.SDL3_mixer-CS` | [![NuGet](https://img.shields.io/nuget/v/ppy.SDL3_mixer-CS?label=nuget)](https://www.nuget.org/packages/ppy.SDL3_mixer-CS) |
Contributions to keep the bindings up-to-date with upstream changes are welcome. If you have improvements or updates, feel free to submit a pull request. The library is functional and available for public use. While it is actively maintained, updates are primarily driven by our internal needs. Please set your expectations accordingly when using or adapting SDL3-CS in your own projects.
## Platform support Contributions to keep the bindings up-to-date with upstream SDL3 changes are welcome. If you have improvements or updates, feel free to submit a pull request.
| Product | `win-x64` | `win-x86` | `win-arm64` | `osx-arm64` | `osx-x64` | `linux-x64` | `linux-x86` | `linux-arm64` | `linux-arm` | `ios` | `android` | ## Generating Bindings
|-----------------|-----------|-----------|-------------|-------------|-----------|-------------|-------------|---------------|-------------|---------|-----------|
| `SDL3-CS` | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; |
| `SDL3_image-CS` | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; |
| `SDL3_ttf-CS` | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; |
| `SDL3_mixer-CS` | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | API 24+ |
## Generating bindings Bindings should be generated via the provided Dockerfile:
Bindings are generated via the provided Dockerfile:
```sh ```sh
docker build -t 'sdl-gen' . docker build -t 'sdl-gen' .

View File

@ -1,19 +0,0 @@
C# bindings for the [SDL3](https://github.com/libsdl-org/SDL) family of libraries.
| Product | Usage | Package |
|------------------------------------------------------------------|----------------------------------------|----------------------------------------------------------------------------------------------------------------------------|
| [`SDL`](https://github.com/libsdl-org/SDL/tree/main) | `dotnet add package ppy.SDL3-CS` | [![NuGet](https://img.shields.io/nuget/v/ppy.SDL3-CS?label=nuget)](https://www.nuget.org/packages/ppy.SDL3-CS) |
| [`SDL_image`](https://github.com/libsdl-org/SDL_image/tree/main) | `dotnet add package ppy.SDL3_image-CS` | [![NuGet](https://img.shields.io/nuget/v/ppy.SDL3_image-CS?label=nuget)](https://www.nuget.org/packages/ppy.SDL3_image-CS) |
| [`SDL_ttf`](https://github.com/libsdl-org/SDL_ttf/tree/main) | `dotnet add package ppy.SDL3_ttf-CS` | [![NuGet](https://img.shields.io/nuget/v/ppy.SDL3_ttf-CS?label=nuget)](https://www.nuget.org/packages/ppy.SDL3_ttf-CS) |
| [`SDL_mixer`](https://github.com/libsdl-org/SDL_mixer/tree/main) | `dotnet add package ppy.SDL3_mixer-CS` | [![NuGet](https://img.shields.io/nuget/v/ppy.SDL3_mixer-CS?label=nuget)](https://www.nuget.org/packages/ppy.SDL3_mixer-CS) |
Contributions to keep the bindings up-to-date with upstream changes are welcome. If you have improvements or updates, feel free to submit a pull request.
## Platform support
| Product | `win-x64` | `win-x86` | `win-arm64` | `osx-arm64` | `osx-x64` | `linux-x64` | `linux-x86` | `linux-arm64` | `linux-arm` | `ios` | `android` |
|-----------------|-----------|-----------|-------------|-------------|-----------|-------------|-------------|---------------|-------------|---------|-----------|
| `SDL3-CS` | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; |
| `SDL3_image-CS` | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; |
| `SDL3_ttf-CS` | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; |
| `SDL3_mixer-CS` | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | API 24+ |

View File

@ -2,13 +2,12 @@
"solution": { "solution": {
"path": "SDL3-CS.sln", "path": "SDL3-CS.sln",
"projects": [ "projects": [
"SDL3-CS.SourceGeneration\\SDL3-CS.SourceGeneration.csproj",
"SDL3-CS.Tests.Android\\SDL3-CS.Tests.Android.csproj",
"SDL3-CS.Tests\\SDL3-CS.Tests.csproj",
"SDL3-CS\\SDL3-CS.csproj", "SDL3-CS\\SDL3-CS.csproj",
"SDL3_ttf-CS\\SDL3_ttf-CS.csproj",
"SDL3_image-CS\\SDL3_image-CS.csproj", "SDL3_image-CS\\SDL3_image-CS.csproj",
"SDL3_mixer-CS\\SDL3_mixer-CS.csproj", "SDL3-CS.SourceGeneration\\SDL3-CS.SourceGeneration.csproj",
"SDL3_ttf-CS\\SDL3_ttf-CS.csproj" "SDL3-CS.Tests\\SDL3-CS.Tests.csproj",
"SDL3-CS.Tests.Android\\SDL3-CS.Tests.Android.csproj"
] ]
} }
} }

View File

@ -2,13 +2,12 @@
"solution": { "solution": {
"path": "SDL3-CS.sln", "path": "SDL3-CS.sln",
"projects": [ "projects": [
"SDL3-CS.SourceGeneration\\SDL3-CS.SourceGeneration.csproj",
"SDL3-CS.Tests.Desktop\\SDL3-CS.Tests.Desktop.csproj",
"SDL3-CS.Tests\\SDL3-CS.Tests.csproj",
"SDL3-CS\\SDL3-CS.csproj", "SDL3-CS\\SDL3-CS.csproj",
"SDL3_ttf-CS\\SDL3_ttf-CS.csproj",
"SDL3_image-CS\\SDL3_image-CS.csproj", "SDL3_image-CS\\SDL3_image-CS.csproj",
"SDL3_mixer-CS\\SDL3_mixer-CS.csproj", "SDL3-CS.SourceGeneration\\SDL3-CS.SourceGeneration.csproj",
"SDL3_ttf-CS\\SDL3_ttf-CS.csproj" "SDL3-CS.Tests\\SDL3-CS.Tests.csproj",
"SDL3-CS.Tests.Desktop\\SDL3-CS.Tests.Desktop.csproj"
] ]
} }
} }

View File

@ -5,6 +5,7 @@ using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Syntax;
@ -141,10 +142,7 @@ using System;
if (gm.RequiredChanges.HasFlag(Changes.ChangeReturnTypeToString)) if (gm.RequiredChanges.HasFlag(Changes.ChangeReturnTypeToString))
{ {
expr = SyntaxFactory.InvocationExpression( expr = SyntaxFactory.InvocationExpression(
SyntaxFactory.MemberAccessExpression( SyntaxFactory.IdentifierName("PtrToStringUTF8"))
SyntaxKind.SimpleMemberAccessExpression,
SyntaxFactory.IdentifierName("SDL3"),
SyntaxFactory.IdentifierName("PtrToStringUTF8")))
.WithArguments(new[] .WithArguments(new[]
{ {
SyntaxFactory.Argument(makeFunctionCall(gm)), SyntaxFactory.Argument(makeFunctionCall(gm)),

View File

@ -15,7 +15,7 @@ namespace SDL.SourceGeneration
{ {
public readonly Dictionary<string, List<GeneratedMethod>> Methods = new Dictionary<string, List<GeneratedMethod>>(); public readonly Dictionary<string, List<GeneratedMethod>> Methods = new Dictionary<string, List<GeneratedMethod>>();
private static readonly string[] sdlPrefixes = ["SDL_", "TTF_", "IMG_", "MIX_"]; private static readonly string[] sdlPrefixes = ["SDL_", "TTF_", "IMG_"];
/// <summary> /// <summary>
/// Checks whether the method is from any SDL library. /// Checks whether the method is from any SDL library.

View File

@ -5,7 +5,7 @@ namespace SDL.Tests.Android
[Activity(Label = "SDL3-CS Android Tests", MainLauncher = true)] [Activity(Label = "SDL3-CS Android Tests", MainLauncher = true)]
public class MainActivity : SDLActivity public class MainActivity : SDLActivity
{ {
protected override string[] GetLibraries() => ["SDL3", "SDL3_image", "SDL3_ttf", "SDL3_mixer"]; protected override string[] GetLibraries() => ["SDL3"];
protected override void Main() => Program.Main(); protected override void Main() => Program.Main();
} }

View File

@ -9,7 +9,6 @@
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ApplicationId>SDL.Tests.Android</ApplicationId> <ApplicationId>SDL.Tests.Android</ApplicationId>
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Label="NuGet"> <PropertyGroup Label="NuGet">
@ -21,16 +20,16 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<AndroidNativeLibrary Include="$(MSBuildThisFileDirectory)..\native\android\armeabi-v7a\*.so"> <AndroidNativeLibrary Include="$(MSBuildThisFileDirectory)..\native\android\armeabi-v7a\libSDL3.so">
<Abi>armeabi-v7a</Abi> <Abi>armeabi-v7a</Abi>
</AndroidNativeLibrary> </AndroidNativeLibrary>
<AndroidNativeLibrary Include="$(MSBuildThisFileDirectory)..\native\android\arm64-v8a\*.so"> <AndroidNativeLibrary Include="$(MSBuildThisFileDirectory)..\native\android\arm64-v8a\libSDL3.so">
<Abi>arm64-v8a</Abi> <Abi>arm64-v8a</Abi>
</AndroidNativeLibrary> </AndroidNativeLibrary>
<AndroidNativeLibrary Include="$(MSBuildThisFileDirectory)..\native\android\x86\*.so"> <AndroidNativeLibrary Include="$(MSBuildThisFileDirectory)..\native\android\x86\libSDL3.so">
<Abi>x86</Abi> <Abi>x86</Abi>
</AndroidNativeLibrary> </AndroidNativeLibrary>
<AndroidNativeLibrary Include="$(MSBuildThisFileDirectory)..\native\android\x86_64\*.so"> <AndroidNativeLibrary Include="$(MSBuildThisFileDirectory)..\native\android\x86_64\libSDL3.so">
<Abi>x86_64</Abi> <Abi>x86_64</Abi>
</AndroidNativeLibrary> </AndroidNativeLibrary>
</ItemGroup> </ItemGroup>

View File

@ -17,12 +17,21 @@
</ItemGroup> </ItemGroup>
<PropertyGroup> <PropertyGroup>
<SDLArch Condition="'$(RuntimeIdentifier)' == ''">$(NETCoreSdkRuntimeIdentifier)</SDLArch> <SDLArch>$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)</SDLArch>
<SDLArch Condition="'$(RuntimeIdentifier)' != ''">$(RuntimeIdentifier)</SDLArch>
<!-- If RID is specified -->
<SDLNativeLib Condition=" $(RuntimeIdentifier.StartsWith('win')) ">$(RuntimeIdentifier)\SDL3.dll</SDLNativeLib>
<SDLNativeLib Condition=" $(RuntimeIdentifier.StartsWith('linux')) ">$(RuntimeIdentifier)\libSDL3.so</SDLNativeLib>
<SDLNativeLib Condition=" $(RuntimeIdentifier.StartsWith('osx')) ">$(RuntimeIdentifier)\libSDL3.dylib</SDLNativeLib>
<!-- If RID is not specified -->
<SDLNativeLib Condition=" '$(SDLNativeLib)' == '' And '$([MSBuild]::IsOSPlatform(Windows))' ">win-$(SDLArch.ToLower())\SDL3.dll</SDLNativeLib>
<SDLNativeLib Condition=" '$(SDLNativeLib)' == '' And '$([MSBuild]::IsOSPlatform(Linux))' ">linux-$(SDLArch.ToLower())\libSDL3.so</SDLNativeLib>
<SDLNativeLib Condition=" '$(SDLNativeLib)' == '' And '$([MSBuild]::IsOSPlatform(OSX))' ">osx-$(SDLArch.ToLower())\libSDL3.dylib</SDLNativeLib>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Content Include="$(MSBuildThisFileDirectory)..\native\$(SDLArch)\*"> <Content Include="$(MSBuildThisFileDirectory)..\native\$(SDLNativeLib)">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
</ItemGroup> </ItemGroup>

View File

@ -7,9 +7,6 @@ public class Program
public static unsafe void Main(string[] args) public static unsafe void Main(string[] args)
{ {
NativeLibrary.SetDllImportResolver(typeof(SDL3).Assembly, (_, assembly, path) => NativeLibrary.Load("@rpath/SDL3.framework/SDL3", assembly, path)); NativeLibrary.SetDllImportResolver(typeof(SDL3).Assembly, (_, assembly, path) => NativeLibrary.Load("@rpath/SDL3.framework/SDL3", assembly, path));
NativeLibrary.SetDllImportResolver(typeof(SDL3_image).Assembly, (_, assembly, path) => NativeLibrary.Load("@rpath/SDL3_image.framework/SDL3_image", assembly, path));
NativeLibrary.SetDllImportResolver(typeof(SDL3_ttf).Assembly, (_, assembly, path) => NativeLibrary.Load("@rpath/SDL3_ttf.framework/SDL3_ttf", assembly, path));
NativeLibrary.SetDllImportResolver(typeof(SDL3_mixer).Assembly, (_, assembly, path) => NativeLibrary.Load("@rpath/SDL3_mixer.framework/SDL3_mixer", assembly, path));
SDL3.SDL_RunApp(0, null, &main, IntPtr.Zero); SDL3.SDL_RunApp(0, null, &main, IntPtr.Zero);
} }

View File

@ -21,9 +21,6 @@
<ItemGroup> <ItemGroup>
<NativeReference Include="$(MSBuildThisFileDirectory)..\native\ios\SDL3.xcframework"/> <NativeReference Include="$(MSBuildThisFileDirectory)..\native\ios\SDL3.xcframework"/>
<NativeReference Include="$(MSBuildThisFileDirectory)..\native\ios\SDL3_image.xcframework"/>
<NativeReference Include="$(MSBuildThisFileDirectory)..\native\ios\SDL3_ttf.xcframework"/>
<NativeReference Include="$(MSBuildThisFileDirectory)..\native\ios\SDL3_mixer.xcframework"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -3,9 +3,6 @@
using System.Diagnostics; using System.Diagnostics;
using System.Text; using System.Text;
using static SDL.SDL3_image;
using static SDL.SDL3_ttf;
using static SDL.SDL3_mixer;
using static SDL.SDL3; using static SDL.SDL3;
namespace SDL.Tests namespace SDL.Tests
@ -28,8 +25,7 @@ namespace SDL.Tests
using (var window = new MyWindow()) using (var window = new MyWindow())
{ {
// Check if satellite libraries exist. Console.WriteLine($"SDL revision: {SDL_GetRevision()}");
Console.WriteLine($"SDL revision: {SDL_GetRevision()}, IMG {IMG_Version()}, TTF {TTF_Version()}, Mixer {MIX_Version()}");
printDisplays(); printDisplays();

View File

@ -22,16 +22,6 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\SDL3-CS\SDL3-CS.csproj"/> <ProjectReference Include="..\SDL3-CS\SDL3-CS.csproj"/>
<ProjectReference Include="..\SDL3_image-CS\SDL3_image-CS.csproj"/>
<ProjectReference Include="..\SDL3_ttf-CS\SDL3_ttf-CS.csproj"/>
<ProjectReference Include="..\SDL3_mixer-CS\SDL3_mixer-CS.csproj"/>
</ItemGroup>
<ItemGroup>
<None Include="..\External\SDL_image\test\sample.png" Condition="Exists('..\External\SDL_image\test\sample.png')">
<Link>sample.png</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,25 +0,0 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using NUnit.Framework;
namespace SDL.Tests
{
[TestFixture]
public class TestError
{
[Test]
public void TestUnsupported()
{
Assert.That((bool)SDL3.SDL_Unsupported(), Is.False);
Assert.That(SDL3.SDL_GetError(), Is.EqualTo("That operation is not supported"));
}
[Test]
public void TestInvalidParam()
{
Assert.That((bool)SDL3.SDL_InvalidParamError("test"), Is.False);
Assert.That(SDL3.SDL_GetError(), Is.EqualTo("Parameter 'test' is invalid"));
}
}
}

View File

@ -1,41 +0,0 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using NUnit.Framework;
using static SDL.SDL3_image;
using static SDL.SDL3;
namespace SDL.Tests
{
public unsafe class TestImage
{
[Test]
public void TestBasic()
{
SDL_Init(0);
try
{
Assert.That(IMG_Version(), Is.EqualTo(SDL_IMAGE_VERSION));
Assume.That("sample.png", Does.Exist);
var image = IMG_Load("sample.png");
try
{
Assert.That(image != null, SDL_GetError);
Assert.That(image->w, Is.EqualTo(23));
Assert.That(image->h, Is.EqualTo(42));
}
finally
{
SDL_DestroySurface(image);
}
}
finally
{
SDL_Quit();
}
}
}
}

View File

@ -1,41 +0,0 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using NUnit.Framework;
using static SDL.SDL3_mixer;
using static SDL.SDL3;
namespace SDL.Tests
{
[TestFixture]
public class TestMixer
{
[Test]
public unsafe void TestBasic()
{
SDL_Init(0);
bool init = MIX_Init();
try
{
Assert.That(init, Is.True, SDL_GetError);
Assert.That(MIX_Version(), Is.EqualTo(SDL_MIXER_VERSION));
Assume.That(MIX_GetNumAudioDecoders() > 0);
string? name = MIX_GetAudioDecoder(0);
Assert.That(name, Is.Not.Null, SDL_GetError);
Assume.That(@"C:\Windows\Media\Windows Logon.wav", Does.Exist);
var decoder = MIX_CreateAudioDecoder(@"C:\Windows\Media\Windows Logon.wav", 0);
Assert.That(decoder != null, SDL_GetError);
MIX_DestroyAudioDecoder(decoder);
}
finally
{
MIX_Quit();
SDL_Quit();
}
}
}
}

View File

@ -1,44 +0,0 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using NUnit.Framework;
using static SDL.SDL3_ttf;
using static SDL.SDL3;
namespace SDL.Tests
{
public unsafe class TestTTF
{
[Test]
public void TestBasic()
{
SDL_Init(0);
bool init = TTF_Init();
try
{
Assert.That(init, Is.True, SDL_GetError);
Assert.That(TTF_Version(), Is.EqualTo(SDL_TTF_VERSION));
Assume.That(@"C:\Windows\Fonts\times.ttf", Does.Exist);
var font = TTF_OpenFont(@"C:\Windows\Fonts\times.ttf", 12f);
try
{
Assert.That(font != null, SDL_GetError);
Assert.That(TTF_GetFontFamilyName(font), Is.EqualTo("Times New Roman"));
}
finally
{
TTF_CloseFont(font);
}
}
finally
{
TTF_Quit();
SDL_Quit();
}
}
}
}

View File

@ -2,13 +2,12 @@
"solution": { "solution": {
"path": "SDL3-CS.sln", "path": "SDL3-CS.sln",
"projects": [ "projects": [
"SDL3-CS.SourceGeneration\\SDL3-CS.SourceGeneration.csproj",
"SDL3-CS.Tests.iOS\\SDL3-CS.Tests.iOS.csproj",
"SDL3-CS.Tests\\SDL3-CS.Tests.csproj",
"SDL3-CS\\SDL3-CS.csproj", "SDL3-CS\\SDL3-CS.csproj",
"SDL3_ttf-CS\\SDL3_ttf-CS.csproj",
"SDL3_image-CS\\SDL3_image-CS.csproj", "SDL3_image-CS\\SDL3_image-CS.csproj",
"SDL3_mixer-CS\\SDL3_mixer-CS.csproj", "SDL3-CS.SourceGeneration\\SDL3-CS.SourceGeneration.csproj",
"SDL3_ttf-CS\\SDL3_ttf-CS.csproj" "SDL3-CS.Tests\\SDL3-CS.Tests.csproj",
"SDL3-CS.Tests.iOS\\SDL3-CS.Tests.iOS.csproj"
] ]
} }
} }

View File

@ -29,8 +29,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SDL3_ttf-CS", "SDL3_ttf-CS\
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SDL3_image-CS", "SDL3_image-CS\SDL3_image-CS.csproj", "{A0D6FC5F-BA26-4298-ABF0-234D2481E323}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SDL3_image-CS", "SDL3_image-CS\SDL3_image-CS.csproj", "{A0D6FC5F-BA26-4298-ABF0-234D2481E323}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SDL3_mixer-CS", "SDL3_mixer-CS\SDL3_mixer-CS.csproj", "{421748C4-B51F-4B00-9637-566DBFD96E02}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -69,10 +67,6 @@ Global
{A0D6FC5F-BA26-4298-ABF0-234D2481E323}.Debug|Any CPU.Build.0 = Debug|Any CPU {A0D6FC5F-BA26-4298-ABF0-234D2481E323}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A0D6FC5F-BA26-4298-ABF0-234D2481E323}.Release|Any CPU.ActiveCfg = Release|Any CPU {A0D6FC5F-BA26-4298-ABF0-234D2481E323}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A0D6FC5F-BA26-4298-ABF0-234D2481E323}.Release|Any CPU.Build.0 = Release|Any CPU {A0D6FC5F-BA26-4298-ABF0-234D2481E323}.Release|Any CPU.Build.0 = Release|Any CPU
{421748C4-B51F-4B00-9637-566DBFD96E02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{421748C4-B51F-4B00-9637-566DBFD96E02}.Debug|Any CPU.Build.0 = Debug|Any CPU
{421748C4-B51F-4B00-9637-566DBFD96E02}.Release|Any CPU.ActiveCfg = Release|Any CPU
{421748C4-B51F-4B00-9637-566DBFD96E02}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

Binary file not shown.

View File

@ -1,29 +0,0 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
// https://github.com/JetBrains/JetBrains.Annotations/blob/988289d09aad925b22a5321c075a735cb9597e59/src/Annotations.cs
namespace JetBrains.Annotations
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Parameter)]
internal sealed class MustDisposeResourceAttribute : Attribute
{
public MustDisposeResourceAttribute()
{
Value = true;
}
public MustDisposeResourceAttribute(bool value)
{
Value = value;
}
/// <summary>
/// When set to <c>false</c>, disposing of the resource is not obligatory.
/// The main use-case for explicit <c>[MustDisposeResource(false)]</c> annotation
/// is to loosen the annotation for inheritors.
/// </summary>
public bool Value { get; }
}
}

View File

@ -8,4 +8,3 @@ using System.Runtime.CompilerServices;
// Allow access to internal CodeGen members (e.g. NativeTypeNameAttribute, etc.) for SDL sister projects: // Allow access to internal CodeGen members (e.g. NativeTypeNameAttribute, etc.) for SDL sister projects:
[assembly: InternalsVisibleTo("SDL3_ttf-CS")] [assembly: InternalsVisibleTo("SDL3_ttf-CS")]
[assembly: InternalsVisibleTo("SDL3_image-CS")] [assembly: InternalsVisibleTo("SDL3_image-CS")]
[assembly: InternalsVisibleTo("SDL3_mixer-CS")]

View File

@ -2,8 +2,7 @@
<PropertyGroup> <PropertyGroup>
<RootNamespace>SDL</RootNamespace> <RootNamespace>SDL</RootNamespace>
<TargetFrameworks Condition=" '$(CI_DONT_TARGET_ANDROID)' != '1' ">net8.0;net8.0-android</TargetFrameworks> <TargetFrameworks>net8.0;net8.0-android</TargetFrameworks>
<TargetFramework Condition=" '$(CI_DONT_TARGET_ANDROID)' == '1' ">net8.0</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion> <SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
@ -17,23 +16,19 @@
<Copyright>Copyright (c) 2024 ppy Pty Ltd</Copyright> <Copyright>Copyright (c) 2024 ppy Pty Ltd</Copyright>
<Product>ppy.SDL3-CS</Product> <Product>ppy.SDL3-CS</Product>
<PackageId>ppy.SDL3-CS</PackageId> <PackageId>ppy.SDL3-CS</PackageId>
<PackageTags>SDL;SDL3;SDL3-CS</PackageTags>
<PackageReleaseNotes>Automated release.</PackageReleaseNotes> <PackageReleaseNotes>Automated release.</PackageReleaseNotes>
<PackageLicenseExpression>MIT</PackageLicenseExpression> <PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/ppy/SDL3-CS</PackageProjectUrl> <PackageProjectUrl>https://github.com/ppy/SDL3-CS</PackageProjectUrl>
<PackageReadmeFile>README_nuget.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/ppy/SDL3-CS</RepositoryUrl> <RepositoryUrl>https://github.com/ppy/SDL3-CS</RepositoryUrl>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)..\README_nuget.md" Pack="true" PackagePath="\"/>
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\SDL3-CS.SourceGeneration\SDL3-CS.SourceGeneration.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/> <ProjectReference Include="..\SDL3-CS.SourceGeneration\SDL3-CS.SourceGeneration.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0"/>
<PackageReference Include="libclang" Version="17.0.4"> <PackageReference Include="libclang" Version="17.0.4">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>

View File

@ -82,10 +82,6 @@ namespace SDL
[return: NativeTypeName("Uint32")] [return: NativeTypeName("Uint32")]
public static extern uint SDL_GetAtomicU32(SDL_AtomicU32* a); public static extern uint SDL_GetAtomicU32(SDL_AtomicU32* a);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]
public static extern uint SDL_AddAtomicU32(SDL_AtomicU32* a, int v);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
public static extern SDLBool SDL_CompareAndSwapAtomicPointer([NativeTypeName("void **")] IntPtr* a, [NativeTypeName("void*")] IntPtr oldval, [NativeTypeName("void*")] IntPtr newval); public static extern SDLBool SDL_CompareAndSwapAtomicPointer([NativeTypeName("void **")] IntPtr* a, [NativeTypeName("void*")] IntPtr oldval, [NativeTypeName("void*")] IntPtr newval);

View File

@ -239,6 +239,10 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_AudioStream* SDL_OpenAudioDeviceStream(SDL_AudioDeviceID devid, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* spec, [NativeTypeName("SDL_AudioStreamCallback")] delegate* unmanaged[Cdecl]<IntPtr, SDL_AudioStream*, int, int, void> callback, [NativeTypeName("void*")] IntPtr userdata); public static extern SDL_AudioStream* SDL_OpenAudioDeviceStream(SDL_AudioDeviceID devid, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* spec, [NativeTypeName("SDL_AudioStreamCallback")] delegate* unmanaged[Cdecl]<IntPtr, SDL_AudioStream*, int, int, void> callback, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetAudioIterationCallbacks(SDL_AudioDeviceID devid, [NativeTypeName("SDL_AudioIterationCallback")] delegate* unmanaged[Cdecl]<IntPtr, SDL_AudioDeviceID, SDLBool, void> start, [NativeTypeName("SDL_AudioIterationCallback")] delegate* unmanaged[Cdecl]<IntPtr, SDL_AudioDeviceID, SDLBool, void> end, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, [NativeTypeName("SDL_AudioPostmixCallback")] delegate* unmanaged[Cdecl]<IntPtr, SDL_AudioSpec*, float*, int, void> callback, [NativeTypeName("void*")] IntPtr userdata); public static extern SDLBool SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, [NativeTypeName("SDL_AudioPostmixCallback")] delegate* unmanaged[Cdecl]<IntPtr, SDL_AudioSpec*, float*, int, void> callback, [NativeTypeName("void*")] IntPtr userdata);
@ -283,8 +287,5 @@ namespace SDL
[NativeTypeName("#define SDL_AUDIO_DEVICE_DEFAULT_RECORDING ((SDL_AudioDeviceID) 0xFFFFFFFEu)")] [NativeTypeName("#define SDL_AUDIO_DEVICE_DEFAULT_RECORDING ((SDL_AudioDeviceID) 0xFFFFFFFEu)")]
public const SDL_AudioDeviceID SDL_AUDIO_DEVICE_DEFAULT_RECORDING = ((SDL_AudioDeviceID)(0xFFFFFFFEU)); public const SDL_AudioDeviceID SDL_AUDIO_DEVICE_DEFAULT_RECORDING = ((SDL_AudioDeviceID)(0xFFFFFFFEU));
[NativeTypeName("#define SDL_PROP_AUDIOSTREAM_AUTO_CLEANUP_BOOLEAN \"SDL.audiostream.auto_cleanup\"")]
public static ReadOnlySpan<byte> SDL_PROP_AUDIOSTREAM_AUTO_CLEANUP_BOOLEAN => "SDL.audiostream.auto_cleanup"u8;
} }
} }

View File

@ -53,13 +53,6 @@ namespace SDL
SDL_CAMERA_POSITION_BACK_FACING, SDL_CAMERA_POSITION_BACK_FACING,
} }
public enum SDL_CameraPermissionState
{
SDL_CAMERA_PERMISSION_STATE_DENIED = -1,
SDL_CAMERA_PERMISSION_STATE_PENDING,
SDL_CAMERA_PERMISSION_STATE_APPROVED,
}
public static unsafe partial class SDL3 public static unsafe partial class SDL3
{ {
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
@ -90,7 +83,7 @@ namespace SDL
public static extern SDL_Camera* SDL_OpenCamera(SDL_CameraID instance_id, [NativeTypeName("const SDL_CameraSpec *")] SDL_CameraSpec* spec); public static extern SDL_Camera* SDL_OpenCamera(SDL_CameraID instance_id, [NativeTypeName("const SDL_CameraSpec *")] SDL_CameraSpec* spec);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_CameraPermissionState SDL_GetCameraPermissionState(SDL_Camera* camera); public static extern int SDL_GetCameraPermissionState(SDL_Camera* camera);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_CameraID SDL_GetCameraID(SDL_Camera* camera); public static extern SDL_CameraID SDL_GetCameraID(SDL_Camera* camera);

View File

@ -98,9 +98,6 @@ namespace SDL
[return: NativeTypeName("size_t")] [return: NativeTypeName("size_t")]
public static extern nuint SDL_GetSIMDAlignment(); public static extern nuint SDL_GetSIMDAlignment();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetSystemPageSize();
[NativeTypeName("#define SDL_CACHELINE_SIZE 128")] [NativeTypeName("#define SDL_CACHELINE_SIZE 128")]
public const int SDL_CACHELINE_SIZE = 128; public const int SDL_CACHELINE_SIZE = 128;
} }

View File

@ -48,9 +48,8 @@ namespace SDL
SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED, SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED,
SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED, SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED,
SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED, SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED,
SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED,
SDL_EVENT_DISPLAY_FIRST = SDL_EVENT_DISPLAY_ORIENTATION, SDL_EVENT_DISPLAY_FIRST = SDL_EVENT_DISPLAY_ORIENTATION,
SDL_EVENT_DISPLAY_LAST = SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED, SDL_EVENT_DISPLAY_LAST = SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED,
SDL_EVENT_WINDOW_SHOWN = 0x202, SDL_EVENT_WINDOW_SHOWN = 0x202,
SDL_EVENT_WINDOW_HIDDEN, SDL_EVENT_WINDOW_HIDDEN,
SDL_EVENT_WINDOW_EXPOSED, SDL_EVENT_WINDOW_EXPOSED,
@ -86,8 +85,6 @@ namespace SDL
SDL_EVENT_KEYBOARD_ADDED, SDL_EVENT_KEYBOARD_ADDED,
SDL_EVENT_KEYBOARD_REMOVED, SDL_EVENT_KEYBOARD_REMOVED,
SDL_EVENT_TEXT_EDITING_CANDIDATES, SDL_EVENT_TEXT_EDITING_CANDIDATES,
SDL_EVENT_SCREEN_KEYBOARD_SHOWN,
SDL_EVENT_SCREEN_KEYBOARD_HIDDEN,
SDL_EVENT_MOUSE_MOTION = 0x400, SDL_EVENT_MOUSE_MOTION = 0x400,
SDL_EVENT_MOUSE_BUTTON_DOWN, SDL_EVENT_MOUSE_BUTTON_DOWN,
SDL_EVENT_MOUSE_BUTTON_UP, SDL_EVENT_MOUSE_BUTTON_UP,
@ -119,9 +116,6 @@ namespace SDL
SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_UP,
SDL_EVENT_FINGER_MOTION, SDL_EVENT_FINGER_MOTION,
SDL_EVENT_FINGER_CANCELED, SDL_EVENT_FINGER_CANCELED,
SDL_EVENT_PINCH_BEGIN = 0x710,
SDL_EVENT_PINCH_UPDATE,
SDL_EVENT_PINCH_END,
SDL_EVENT_CLIPBOARD_UPDATE = 0x900, SDL_EVENT_CLIPBOARD_UPDATE = 0x900,
SDL_EVENT_DROP_FILE = 0x1000, SDL_EVENT_DROP_FILE = 0x1000,
SDL_EVENT_DROP_TEXT, SDL_EVENT_DROP_TEXT,
@ -764,21 +758,6 @@ namespace SDL
public SDL_WindowID windowID; public SDL_WindowID windowID;
} }
public partial struct SDL_PinchFingerEvent
{
public SDL_EventType type;
[NativeTypeName("Uint32")]
public uint reserved;
[NativeTypeName("Uint64")]
public ulong timestamp;
public float scale;
public SDL_WindowID windowID;
}
public partial struct SDL_PenProximityEvent public partial struct SDL_PenProximityEvent
{ {
public SDL_EventType type; public SDL_EventType type;
@ -1090,9 +1069,6 @@ namespace SDL
[FieldOffset(0)] [FieldOffset(0)]
public SDL_TouchFingerEvent tfinger; public SDL_TouchFingerEvent tfinger;
[FieldOffset(0)]
public SDL_PinchFingerEvent pinch;
[FieldOffset(0)] [FieldOffset(0)]
public SDL_PenProximityEvent pproximity; public SDL_PenProximityEvent pproximity;

View File

@ -1008,10 +1008,10 @@ namespace SDL
public byte clear_stencil; public byte clear_stencil;
[NativeTypeName("Uint8")] [NativeTypeName("Uint8")]
public byte mip_level; public byte padding1;
[NativeTypeName("Uint8")] [NativeTypeName("Uint8")]
public byte layer; public byte padding2;
} }
public partial struct SDL_GPUBlitInfo public partial struct SDL_GPUBlitInfo
@ -1096,30 +1096,6 @@ namespace SDL
public byte padding3; public byte padding3;
} }
public unsafe partial struct SDL_GPUVulkanOptions
{
[NativeTypeName("Uint32")]
public uint vulkan_api_version;
[NativeTypeName("void*")]
public IntPtr feature_list;
[NativeTypeName("void*")]
public IntPtr vulkan_10_physical_device_features;
[NativeTypeName("Uint32")]
public uint device_extension_count;
[NativeTypeName("const char **")]
public byte** device_extension_names;
[NativeTypeName("Uint32")]
public uint instance_extension_count;
[NativeTypeName("const char **")]
public byte** instance_extension_names;
}
public static unsafe partial class SDL3 public static unsafe partial class SDL3
{ {
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
@ -1423,12 +1399,6 @@ namespace SDL
[return: NativeTypeName("Uint32")] [return: NativeTypeName("Uint32")]
public static extern uint SDL_CalculateGPUTextureFormatSize(SDL_GPUTextureFormat format, [NativeTypeName("Uint32")] uint width, [NativeTypeName("Uint32")] uint height, [NativeTypeName("Uint32")] uint depth_or_layer_count); public static extern uint SDL_CalculateGPUTextureFormatSize(SDL_GPUTextureFormat format, [NativeTypeName("Uint32")] uint width, [NativeTypeName("Uint32")] uint height, [NativeTypeName("Uint32")] uint depth_or_layer_count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_PixelFormat SDL_GetPixelFormatFromGPUTextureFormat(SDL_GPUTextureFormat format);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_GPUTextureFormat SDL_GetGPUTextureFormatFromPixelFormat(SDL_PixelFormat format);
[NativeTypeName("#define SDL_GPU_TEXTUREUSAGE_SAMPLER (1u << 0)")] [NativeTypeName("#define SDL_GPU_TEXTUREUSAGE_SAMPLER (1u << 0)")]
public const uint SDL_GPU_TEXTUREUSAGE_SAMPLER = (1U << 0); public const uint SDL_GPU_TEXTUREUSAGE_SAMPLER = (1U << 0);
@ -1513,18 +1483,6 @@ namespace SDL
[NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING \"SDL.gpu.device.create.name\"")] [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING \"SDL.gpu.device.create.name\"")]
public static ReadOnlySpan<byte> SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING => "SDL.gpu.device.create.name"u8; public static ReadOnlySpan<byte> SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING => "SDL.gpu.device.create.name"u8;
[NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_FEATURE_CLIP_DISTANCE_BOOLEAN \"SDL.gpu.device.create.feature.clip_distance\"")]
public static ReadOnlySpan<byte> SDL_PROP_GPU_DEVICE_CREATE_FEATURE_CLIP_DISTANCE_BOOLEAN => "SDL.gpu.device.create.feature.clip_distance"u8;
[NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_FEATURE_DEPTH_CLAMPING_BOOLEAN \"SDL.gpu.device.create.feature.depth_clamping\"")]
public static ReadOnlySpan<byte> SDL_PROP_GPU_DEVICE_CREATE_FEATURE_DEPTH_CLAMPING_BOOLEAN => "SDL.gpu.device.create.feature.depth_clamping"u8;
[NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_FEATURE_INDIRECT_DRAW_FIRST_INSTANCE_BOOLEAN \"SDL.gpu.device.create.feature.indirect_draw_first_instance\"")]
public static ReadOnlySpan<byte> SDL_PROP_GPU_DEVICE_CREATE_FEATURE_INDIRECT_DRAW_FIRST_INSTANCE_BOOLEAN => "SDL.gpu.device.create.feature.indirect_draw_first_instance"u8;
[NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_FEATURE_ANISOTROPY_BOOLEAN \"SDL.gpu.device.create.feature.anisotropy\"")]
public static ReadOnlySpan<byte> SDL_PROP_GPU_DEVICE_CREATE_FEATURE_ANISOTROPY_BOOLEAN => "SDL.gpu.device.create.feature.anisotropy"u8;
[NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_PRIVATE_BOOLEAN \"SDL.gpu.device.create.shaders.private\"")] [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_PRIVATE_BOOLEAN \"SDL.gpu.device.create.shaders.private\"")]
public static ReadOnlySpan<byte> SDL_PROP_GPU_DEVICE_CREATE_SHADERS_PRIVATE_BOOLEAN => "SDL.gpu.device.create.shaders.private"u8; public static ReadOnlySpan<byte> SDL_PROP_GPU_DEVICE_CREATE_SHADERS_PRIVATE_BOOLEAN => "SDL.gpu.device.create.shaders.private"u8;
@ -1543,17 +1501,20 @@ namespace SDL
[NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOLEAN \"SDL.gpu.device.create.shaders.metallib\"")] [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOLEAN \"SDL.gpu.device.create.shaders.metallib\"")]
public static ReadOnlySpan<byte> SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOLEAN => "SDL.gpu.device.create.shaders.metallib"u8; public static ReadOnlySpan<byte> SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOLEAN => "SDL.gpu.device.create.shaders.metallib"u8;
[NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_D3D12_ALLOW_FEWER_RESOURCE_SLOTS_BOOLEAN \"SDL.gpu.device.create.d3d12.allowtier1resourcebinding\"")]
public static ReadOnlySpan<byte> SDL_PROP_GPU_DEVICE_CREATE_D3D12_ALLOW_FEWER_RESOURCE_SLOTS_BOOLEAN => "SDL.gpu.device.create.d3d12.allowtier1resourcebinding"u8;
[NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING \"SDL.gpu.device.create.d3d12.semantic\"")] [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING \"SDL.gpu.device.create.d3d12.semantic\"")]
public static ReadOnlySpan<byte> SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING => "SDL.gpu.device.create.d3d12.semantic"u8; public static ReadOnlySpan<byte> SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING => "SDL.gpu.device.create.d3d12.semantic"u8;
[NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_VULKAN_REQUIRE_HARDWARE_ACCELERATION_BOOLEAN \"SDL.gpu.device.create.vulkan.requirehardwareacceleration\"")] [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_VULKAN_SHADERCLIPDISTANCE_BOOLEAN \"SDL.gpu.device.create.vulkan.shaderclipdistance\"")]
public static ReadOnlySpan<byte> SDL_PROP_GPU_DEVICE_CREATE_VULKAN_REQUIRE_HARDWARE_ACCELERATION_BOOLEAN => "SDL.gpu.device.create.vulkan.requirehardwareacceleration"u8; public static ReadOnlySpan<byte> SDL_PROP_GPU_DEVICE_CREATE_VULKAN_SHADERCLIPDISTANCE_BOOLEAN => "SDL.gpu.device.create.vulkan.shaderclipdistance"u8;
[NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_VULKAN_OPTIONS_POINTER \"SDL.gpu.device.create.vulkan.options\"")] [NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_VULKAN_DEPTHCLAMP_BOOLEAN \"SDL.gpu.device.create.vulkan.depthclamp\"")]
public static ReadOnlySpan<byte> SDL_PROP_GPU_DEVICE_CREATE_VULKAN_OPTIONS_POINTER => "SDL.gpu.device.create.vulkan.options"u8; public static ReadOnlySpan<byte> SDL_PROP_GPU_DEVICE_CREATE_VULKAN_DEPTHCLAMP_BOOLEAN => "SDL.gpu.device.create.vulkan.depthclamp"u8;
[NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_VULKAN_DRAWINDIRECTFIRST_BOOLEAN \"SDL.gpu.device.create.vulkan.drawindirectfirstinstance\"")]
public static ReadOnlySpan<byte> SDL_PROP_GPU_DEVICE_CREATE_VULKAN_DRAWINDIRECTFIRST_BOOLEAN => "SDL.gpu.device.create.vulkan.drawindirectfirstinstance"u8;
[NativeTypeName("#define SDL_PROP_GPU_DEVICE_CREATE_VULKAN_SAMPLERANISOTROPY_BOOLEAN \"SDL.gpu.device.create.vulkan.sampleranisotropy\"")]
public static ReadOnlySpan<byte> SDL_PROP_GPU_DEVICE_CREATE_VULKAN_SAMPLERANISOTROPY_BOOLEAN => "SDL.gpu.device.create.vulkan.sampleranisotropy"u8;
[NativeTypeName("#define SDL_PROP_GPU_DEVICE_NAME_STRING \"SDL.gpu.device.name\"")] [NativeTypeName("#define SDL_PROP_GPU_DEVICE_NAME_STRING \"SDL.gpu.device.name\"")]
public static ReadOnlySpan<byte> SDL_PROP_GPU_DEVICE_NAME_STRING => "SDL.gpu.device.name"u8; public static ReadOnlySpan<byte> SDL_PROP_GPU_DEVICE_NAME_STRING => "SDL.gpu.device.name"u8;

View File

@ -108,9 +108,6 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_hid_device* SDL_hid_open_path([NativeTypeName("const char *")] byte* path); public static extern SDL_hid_device* SDL_hid_open_path([NativeTypeName("const char *")] byte* path);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_PropertiesID SDL_hid_get_properties(SDL_hid_device* dev);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_hid_write(SDL_hid_device* dev, [NativeTypeName("const unsigned char *")] byte* data, [NativeTypeName("size_t")] nuint length); public static extern int SDL_hid_write(SDL_hid_device* dev, [NativeTypeName("const unsigned char *")] byte* data, [NativeTypeName("size_t")] nuint length);
@ -155,8 +152,5 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_hid_ble_scan([NativeTypeName("bool")] SDLBool active); public static extern void SDL_hid_ble_scan([NativeTypeName("bool")] SDLBool active);
[NativeTypeName("#define SDL_PROP_HIDAPI_LIBUSB_DEVICE_HANDLE_POINTER \"SDL.hidapi.libusb.device.handle\"")]
public static ReadOnlySpan<byte> SDL_PROP_HIDAPI_LIBUSB_DEVICE_HANDLE_POINTER => "SDL.hidapi.libusb.device.handle"u8;
} }
} }

View File

@ -121,9 +121,6 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_AUDIO_DEVICE_STREAM_ROLE \"SDL_AUDIO_DEVICE_STREAM_ROLE\"")] [NativeTypeName("#define SDL_HINT_AUDIO_DEVICE_STREAM_ROLE \"SDL_AUDIO_DEVICE_STREAM_ROLE\"")]
public static ReadOnlySpan<byte> SDL_HINT_AUDIO_DEVICE_STREAM_ROLE => "SDL_AUDIO_DEVICE_STREAM_ROLE"u8; public static ReadOnlySpan<byte> SDL_HINT_AUDIO_DEVICE_STREAM_ROLE => "SDL_AUDIO_DEVICE_STREAM_ROLE"u8;
[NativeTypeName("#define SDL_HINT_AUDIO_DEVICE_RAW_STREAM \"SDL_AUDIO_DEVICE_RAW_STREAM\"")]
public static ReadOnlySpan<byte> SDL_HINT_AUDIO_DEVICE_RAW_STREAM => "SDL_AUDIO_DEVICE_RAW_STREAM"u8;
[NativeTypeName("#define SDL_HINT_AUDIO_DISK_INPUT_FILE \"SDL_AUDIO_DISK_INPUT_FILE\"")] [NativeTypeName("#define SDL_HINT_AUDIO_DISK_INPUT_FILE \"SDL_AUDIO_DISK_INPUT_FILE\"")]
public static ReadOnlySpan<byte> SDL_HINT_AUDIO_DISK_INPUT_FILE => "SDL_AUDIO_DISK_INPUT_FILE"u8; public static ReadOnlySpan<byte> SDL_HINT_AUDIO_DISK_INPUT_FILE => "SDL_AUDIO_DISK_INPUT_FILE"u8;
@ -172,9 +169,6 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_DISPLAY_USABLE_BOUNDS \"SDL_DISPLAY_USABLE_BOUNDS\"")] [NativeTypeName("#define SDL_HINT_DISPLAY_USABLE_BOUNDS \"SDL_DISPLAY_USABLE_BOUNDS\"")]
public static ReadOnlySpan<byte> SDL_HINT_DISPLAY_USABLE_BOUNDS => "SDL_DISPLAY_USABLE_BOUNDS"u8; public static ReadOnlySpan<byte> SDL_HINT_DISPLAY_USABLE_BOUNDS => "SDL_DISPLAY_USABLE_BOUNDS"u8;
[NativeTypeName("#define SDL_HINT_INVALID_PARAM_CHECKS \"SDL_INVALID_PARAM_CHECKS\"")]
public static ReadOnlySpan<byte> SDL_HINT_INVALID_PARAM_CHECKS => "SDL_INVALID_PARAM_CHECKS"u8;
[NativeTypeName("#define SDL_HINT_EMSCRIPTEN_ASYNCIFY \"SDL_EMSCRIPTEN_ASYNCIFY\"")] [NativeTypeName("#define SDL_HINT_EMSCRIPTEN_ASYNCIFY \"SDL_EMSCRIPTEN_ASYNCIFY\"")]
public static ReadOnlySpan<byte> SDL_HINT_EMSCRIPTEN_ASYNCIFY => "SDL_EMSCRIPTEN_ASYNCIFY"u8; public static ReadOnlySpan<byte> SDL_HINT_EMSCRIPTEN_ASYNCIFY => "SDL_EMSCRIPTEN_ASYNCIFY"u8;
@ -184,9 +178,6 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT \"SDL_EMSCRIPTEN_KEYBOARD_ELEMENT\"")] [NativeTypeName("#define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT \"SDL_EMSCRIPTEN_KEYBOARD_ELEMENT\"")]
public static ReadOnlySpan<byte> SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT => "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT"u8; public static ReadOnlySpan<byte> SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT => "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT"u8;
[NativeTypeName("#define SDL_HINT_EMSCRIPTEN_FILL_DOCUMENT \"SDL_EMSCRIPTEN_FILL_DOCUMENT\"")]
public static ReadOnlySpan<byte> SDL_HINT_EMSCRIPTEN_FILL_DOCUMENT => "SDL_EMSCRIPTEN_FILL_DOCUMENT"u8;
[NativeTypeName("#define SDL_HINT_ENABLE_SCREEN_KEYBOARD \"SDL_ENABLE_SCREEN_KEYBOARD\"")] [NativeTypeName("#define SDL_HINT_ENABLE_SCREEN_KEYBOARD \"SDL_ENABLE_SCREEN_KEYBOARD\"")]
public static ReadOnlySpan<byte> SDL_HINT_ENABLE_SCREEN_KEYBOARD => "SDL_ENABLE_SCREEN_KEYBOARD"u8; public static ReadOnlySpan<byte> SDL_HINT_ENABLE_SCREEN_KEYBOARD => "SDL_ENABLE_SCREEN_KEYBOARD"u8;
@ -361,12 +352,6 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_8BITDO \"SDL_JOYSTICK_HIDAPI_8BITDO\"")] [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_8BITDO \"SDL_JOYSTICK_HIDAPI_8BITDO\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_8BITDO => "SDL_JOYSTICK_HIDAPI_8BITDO"u8; public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_8BITDO => "SDL_JOYSTICK_HIDAPI_8BITDO"u8;
[NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_SINPUT \"SDL_JOYSTICK_HIDAPI_SINPUT\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_SINPUT => "SDL_JOYSTICK_HIDAPI_SINPUT"u8;
[NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_ZUIKI \"SDL_JOYSTICK_HIDAPI_ZUIKI\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_ZUIKI => "SDL_JOYSTICK_HIDAPI_ZUIKI"u8;
[NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_FLYDIGI \"SDL_JOYSTICK_HIDAPI_FLYDIGI\"")] [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_FLYDIGI \"SDL_JOYSTICK_HIDAPI_FLYDIGI\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_FLYDIGI => "SDL_JOYSTICK_HIDAPI_FLYDIGI"u8; public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_FLYDIGI => "SDL_JOYSTICK_HIDAPI_FLYDIGI"u8;
@ -379,9 +364,6 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED \"SDL_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED\"")] [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED \"SDL_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED => "SDL_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED"u8; public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED => "SDL_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED"u8;
[NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH2 \"SDL_JOYSTICK_HIDAPI_SWITCH2\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_SWITCH2 => "SDL_JOYSTICK_HIDAPI_SWITCH2"u8;
[NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS \"SDL_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS\"")] [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS \"SDL_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS => "SDL_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS"u8; public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS => "SDL_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS"u8;
@ -475,9 +457,6 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER \"SDL_KMSDRM_REQUIRE_DRM_MASTER\"")] [NativeTypeName("#define SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER \"SDL_KMSDRM_REQUIRE_DRM_MASTER\"")]
public static ReadOnlySpan<byte> SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER => "SDL_KMSDRM_REQUIRE_DRM_MASTER"u8; public static ReadOnlySpan<byte> SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER => "SDL_KMSDRM_REQUIRE_DRM_MASTER"u8;
[NativeTypeName("#define SDL_HINT_KMSDRM_ATOMIC \"SDL_KMSDRM_ATOMIC\"")]
public static ReadOnlySpan<byte> SDL_HINT_KMSDRM_ATOMIC => "SDL_KMSDRM_ATOMIC"u8;
[NativeTypeName("#define SDL_HINT_LOGGING \"SDL_LOGGING\"")] [NativeTypeName("#define SDL_HINT_LOGGING \"SDL_LOGGING\"")]
public static ReadOnlySpan<byte> SDL_HINT_LOGGING => "SDL_LOGGING"u8; public static ReadOnlySpan<byte> SDL_HINT_LOGGING => "SDL_LOGGING"u8;
@ -496,9 +475,6 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_MAC_SCROLL_MOMENTUM \"SDL_MAC_SCROLL_MOMENTUM\"")] [NativeTypeName("#define SDL_HINT_MAC_SCROLL_MOMENTUM \"SDL_MAC_SCROLL_MOMENTUM\"")]
public static ReadOnlySpan<byte> SDL_HINT_MAC_SCROLL_MOMENTUM => "SDL_MAC_SCROLL_MOMENTUM"u8; public static ReadOnlySpan<byte> SDL_HINT_MAC_SCROLL_MOMENTUM => "SDL_MAC_SCROLL_MOMENTUM"u8;
[NativeTypeName("#define SDL_HINT_MAC_PRESS_AND_HOLD \"SDL_MAC_PRESS_AND_HOLD\"")]
public static ReadOnlySpan<byte> SDL_HINT_MAC_PRESS_AND_HOLD => "SDL_MAC_PRESS_AND_HOLD"u8;
[NativeTypeName("#define SDL_HINT_MAIN_CALLBACK_RATE \"SDL_MAIN_CALLBACK_RATE\"")] [NativeTypeName("#define SDL_HINT_MAIN_CALLBACK_RATE \"SDL_MAIN_CALLBACK_RATE\"")]
public static ReadOnlySpan<byte> SDL_HINT_MAIN_CALLBACK_RATE => "SDL_MAIN_CALLBACK_RATE"u8; public static ReadOnlySpan<byte> SDL_HINT_MAIN_CALLBACK_RATE => "SDL_MAIN_CALLBACK_RATE"u8;
@ -577,9 +553,6 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_RENDER_DIRECT3D11_DEBUG \"SDL_RENDER_DIRECT3D11_DEBUG\"")] [NativeTypeName("#define SDL_HINT_RENDER_DIRECT3D11_DEBUG \"SDL_RENDER_DIRECT3D11_DEBUG\"")]
public static ReadOnlySpan<byte> SDL_HINT_RENDER_DIRECT3D11_DEBUG => "SDL_RENDER_DIRECT3D11_DEBUG"u8; public static ReadOnlySpan<byte> SDL_HINT_RENDER_DIRECT3D11_DEBUG => "SDL_RENDER_DIRECT3D11_DEBUG"u8;
[NativeTypeName("#define SDL_HINT_RENDER_DIRECT3D11_WARP \"SDL_RENDER_DIRECT3D11_WARP\"")]
public static ReadOnlySpan<byte> SDL_HINT_RENDER_DIRECT3D11_WARP => "SDL_RENDER_DIRECT3D11_WARP"u8;
[NativeTypeName("#define SDL_HINT_RENDER_VULKAN_DEBUG \"SDL_RENDER_VULKAN_DEBUG\"")] [NativeTypeName("#define SDL_HINT_RENDER_VULKAN_DEBUG \"SDL_RENDER_VULKAN_DEBUG\"")]
public static ReadOnlySpan<byte> SDL_HINT_RENDER_VULKAN_DEBUG => "SDL_RENDER_VULKAN_DEBUG"u8; public static ReadOnlySpan<byte> SDL_HINT_RENDER_VULKAN_DEBUG => "SDL_RENDER_VULKAN_DEBUG"u8;
@ -610,18 +583,6 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_ROG_GAMEPAD_MICE_EXCLUDED \"SDL_ROG_GAMEPAD_MICE_EXCLUDED\"")] [NativeTypeName("#define SDL_HINT_ROG_GAMEPAD_MICE_EXCLUDED \"SDL_ROG_GAMEPAD_MICE_EXCLUDED\"")]
public static ReadOnlySpan<byte> SDL_HINT_ROG_GAMEPAD_MICE_EXCLUDED => "SDL_ROG_GAMEPAD_MICE_EXCLUDED"u8; public static ReadOnlySpan<byte> SDL_HINT_ROG_GAMEPAD_MICE_EXCLUDED => "SDL_ROG_GAMEPAD_MICE_EXCLUDED"u8;
[NativeTypeName("#define SDL_HINT_PS2_GS_WIDTH \"SDL_PS2_GS_WIDTH\"")]
public static ReadOnlySpan<byte> SDL_HINT_PS2_GS_WIDTH => "SDL_PS2_GS_WIDTH"u8;
[NativeTypeName("#define SDL_HINT_PS2_GS_HEIGHT \"SDL_PS2_GS_HEIGHT\"")]
public static ReadOnlySpan<byte> SDL_HINT_PS2_GS_HEIGHT => "SDL_PS2_GS_HEIGHT"u8;
[NativeTypeName("#define SDL_HINT_PS2_GS_PROGRESSIVE \"SDL_PS2_GS_PROGRESSIVE\"")]
public static ReadOnlySpan<byte> SDL_HINT_PS2_GS_PROGRESSIVE => "SDL_PS2_GS_PROGRESSIVE"u8;
[NativeTypeName("#define SDL_HINT_PS2_GS_MODE \"SDL_PS2_GS_MODE\"")]
public static ReadOnlySpan<byte> SDL_HINT_PS2_GS_MODE => "SDL_PS2_GS_MODE"u8;
[NativeTypeName("#define SDL_HINT_RPI_VIDEO_LAYER \"SDL_RPI_VIDEO_LAYER\"")] [NativeTypeName("#define SDL_HINT_RPI_VIDEO_LAYER \"SDL_RPI_VIDEO_LAYER\"")]
public static ReadOnlySpan<byte> SDL_HINT_RPI_VIDEO_LAYER => "SDL_RPI_VIDEO_LAYER"u8; public static ReadOnlySpan<byte> SDL_HINT_RPI_VIDEO_LAYER => "SDL_RPI_VIDEO_LAYER"u8;
@ -682,9 +643,6 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_VIDEO_MAC_FULLSCREEN_MENU_VISIBILITY \"SDL_VIDEO_MAC_FULLSCREEN_MENU_VISIBILITY\"")] [NativeTypeName("#define SDL_HINT_VIDEO_MAC_FULLSCREEN_MENU_VISIBILITY \"SDL_VIDEO_MAC_FULLSCREEN_MENU_VISIBILITY\"")]
public static ReadOnlySpan<byte> SDL_HINT_VIDEO_MAC_FULLSCREEN_MENU_VISIBILITY => "SDL_VIDEO_MAC_FULLSCREEN_MENU_VISIBILITY"u8; public static ReadOnlySpan<byte> SDL_HINT_VIDEO_MAC_FULLSCREEN_MENU_VISIBILITY => "SDL_VIDEO_MAC_FULLSCREEN_MENU_VISIBILITY"u8;
[NativeTypeName("#define SDL_HINT_VIDEO_METAL_AUTO_RESIZE_DRAWABLE \"SDL_VIDEO_METAL_AUTO_RESIZE_DRAWABLE\"")]
public static ReadOnlySpan<byte> SDL_HINT_VIDEO_METAL_AUTO_RESIZE_DRAWABLE => "SDL_VIDEO_METAL_AUTO_RESIZE_DRAWABLE"u8;
[NativeTypeName("#define SDL_HINT_VIDEO_MATCH_EXCLUSIVE_MODE_ON_MOVE \"SDL_VIDEO_MATCH_EXCLUSIVE_MODE_ON_MOVE\"")] [NativeTypeName("#define SDL_HINT_VIDEO_MATCH_EXCLUSIVE_MODE_ON_MOVE \"SDL_VIDEO_MATCH_EXCLUSIVE_MODE_ON_MOVE\"")]
public static ReadOnlySpan<byte> SDL_HINT_VIDEO_MATCH_EXCLUSIVE_MODE_ON_MOVE => "SDL_VIDEO_MATCH_EXCLUSIVE_MODE_ON_MOVE"u8; public static ReadOnlySpan<byte> SDL_HINT_VIDEO_MATCH_EXCLUSIVE_MODE_ON_MOVE => "SDL_VIDEO_MATCH_EXCLUSIVE_MODE_ON_MOVE"u8;
@ -805,9 +763,6 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_WINDOWS_RAW_KEYBOARD \"SDL_WINDOWS_RAW_KEYBOARD\"")] [NativeTypeName("#define SDL_HINT_WINDOWS_RAW_KEYBOARD \"SDL_WINDOWS_RAW_KEYBOARD\"")]
public static ReadOnlySpan<byte> SDL_HINT_WINDOWS_RAW_KEYBOARD => "SDL_WINDOWS_RAW_KEYBOARD"u8; public static ReadOnlySpan<byte> SDL_HINT_WINDOWS_RAW_KEYBOARD => "SDL_WINDOWS_RAW_KEYBOARD"u8;
[NativeTypeName("#define SDL_HINT_WINDOWS_RAW_KEYBOARD_EXCLUDE_HOTKEYS \"SDL_WINDOWS_RAW_KEYBOARD_EXCLUDE_HOTKEYS\"")]
public static ReadOnlySpan<byte> SDL_HINT_WINDOWS_RAW_KEYBOARD_EXCLUDE_HOTKEYS => "SDL_WINDOWS_RAW_KEYBOARD_EXCLUDE_HOTKEYS"u8;
[NativeTypeName("#define SDL_HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL \"SDL_WINDOWS_FORCE_SEMAPHORE_KERNEL\"")] [NativeTypeName("#define SDL_HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL \"SDL_WINDOWS_FORCE_SEMAPHORE_KERNEL\"")]
public static ReadOnlySpan<byte> SDL_HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL => "SDL_WINDOWS_FORCE_SEMAPHORE_KERNEL"u8; public static ReadOnlySpan<byte> SDL_HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL => "SDL_WINDOWS_FORCE_SEMAPHORE_KERNEL"u8;

View File

@ -278,9 +278,6 @@ namespace SDL
[NativeTypeName("#define SDL_PROP_IOSTREAM_MEMORY_SIZE_NUMBER \"SDL.iostream.memory.size\"")] [NativeTypeName("#define SDL_PROP_IOSTREAM_MEMORY_SIZE_NUMBER \"SDL.iostream.memory.size\"")]
public static ReadOnlySpan<byte> SDL_PROP_IOSTREAM_MEMORY_SIZE_NUMBER => "SDL.iostream.memory.size"u8; public static ReadOnlySpan<byte> SDL_PROP_IOSTREAM_MEMORY_SIZE_NUMBER => "SDL.iostream.memory.size"u8;
[NativeTypeName("#define SDL_PROP_IOSTREAM_MEMORY_FREE_FUNC_POINTER \"SDL.iostream.memory.free\"")]
public static ReadOnlySpan<byte> SDL_PROP_IOSTREAM_MEMORY_FREE_FUNC_POINTER => "SDL.iostream.memory.free"u8;
[NativeTypeName("#define SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER \"SDL.iostream.dynamic.memory\"")] [NativeTypeName("#define SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER \"SDL.iostream.dynamic.memory\"")]
public static ReadOnlySpan<byte> SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER => "SDL.iostream.dynamic.memory"u8; public static ReadOnlySpan<byte> SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER => "SDL.iostream.dynamic.memory"u8;

View File

@ -63,14 +63,6 @@ namespace SDL
SDL_MOUSEWHEEL_FLIPPED, SDL_MOUSEWHEEL_FLIPPED,
} }
public unsafe partial struct SDL_CursorFrameInfo
{
public SDL_Surface* surface;
[NativeTypeName("Uint32")]
public uint duration;
}
public static unsafe partial class SDL3 public static unsafe partial class SDL3
{ {
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
@ -125,9 +117,6 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Cursor* SDL_CreateColorCursor(SDL_Surface* surface, int hot_x, int hot_y); public static extern SDL_Cursor* SDL_CreateColorCursor(SDL_Surface* surface, int hot_x, int hot_y);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Cursor* SDL_CreateAnimatedCursor(SDL_CursorFrameInfo* frames, int frame_count, int hot_x, int hot_y);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Cursor* SDL_CreateSystemCursor(SDL_SystemCursor id); public static extern SDL_Cursor* SDL_CreateSystemCursor(SDL_SystemCursor id);

View File

@ -23,8 +23,6 @@
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
*/ */
using System.Runtime.InteropServices;
namespace SDL namespace SDL
{ {
public enum SDL_PenAxis public enum SDL_PenAxis
@ -39,19 +37,8 @@ namespace SDL
SDL_PEN_AXIS_COUNT, SDL_PEN_AXIS_COUNT,
} }
public enum SDL_PenDeviceType
{
SDL_PEN_DEVICE_TYPE_INVALID = -1,
SDL_PEN_DEVICE_TYPE_UNKNOWN,
SDL_PEN_DEVICE_TYPE_DIRECT,
SDL_PEN_DEVICE_TYPE_INDIRECT,
}
public static partial class SDL3 public static partial class SDL3
{ {
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_PenDeviceType SDL_GetPenDeviceType(SDL_PenID instance_id);
[NativeTypeName("#define SDL_PEN_INPUT_DOWN (1u << 0)")] [NativeTypeName("#define SDL_PEN_INPUT_DOWN (1u << 0)")]
public const uint SDL_PEN_INPUT_DOWN = (1U << 0); public const uint SDL_PEN_INPUT_DOWN = (1U << 0);
@ -72,8 +59,5 @@ namespace SDL
[NativeTypeName("#define SDL_PEN_INPUT_ERASER_TIP (1u << 30)")] [NativeTypeName("#define SDL_PEN_INPUT_ERASER_TIP (1u << 30)")]
public const uint SDL_PEN_INPUT_ERASER_TIP = (1U << 30); public const uint SDL_PEN_INPUT_ERASER_TIP = (1U << 30);
[NativeTypeName("#define SDL_PEN_INPUT_IN_PROXIMITY (1u << 31)")]
public const uint SDL_PEN_INPUT_IN_PROXIMITY = (1U << 31);
} }
} }

View File

@ -254,7 +254,7 @@ namespace SDL
SDL_COLORSPACE_BT2020_LIMITED = 0x21102609U, SDL_COLORSPACE_BT2020_LIMITED = 0x21102609U,
SDL_COLORSPACE_BT2020_FULL = 0x22102609U, SDL_COLORSPACE_BT2020_FULL = 0x22102609U,
SDL_COLORSPACE_RGB_DEFAULT = SDL_COLORSPACE_SRGB, SDL_COLORSPACE_RGB_DEFAULT = SDL_COLORSPACE_SRGB,
SDL_COLORSPACE_YUV_DEFAULT = SDL_COLORSPACE_BT601_LIMITED, SDL_COLORSPACE_YUV_DEFAULT = SDL_COLORSPACE_JPEG,
} }
public partial struct SDL_Color public partial struct SDL_Color

View File

@ -117,8 +117,5 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_DestroyProperties(SDL_PropertiesID props); public static extern void SDL_DestroyProperties(SDL_PropertiesID props);
[NativeTypeName("#define SDL_PROP_NAME_STRING \"SDL.name\"")]
public static ReadOnlySpan<byte> SDL_PROP_NAME_STRING => "SDL.name"u8;
} }
} }

View File

@ -76,8 +76,11 @@ namespace SDL
public int refcount; public int refcount;
} }
public unsafe partial struct SDL_GPURenderStateCreateInfo public unsafe partial struct SDL_GPURenderStateDesc
{ {
[NativeTypeName("Uint32")]
public uint version;
public SDL_GPUShader* fragment_shader; public SDL_GPUShader* fragment_shader;
[NativeTypeName("Sint32")] [NativeTypeName("Sint32")]
@ -97,8 +100,6 @@ namespace SDL
[NativeTypeName("SDL_GPUBuffer *const *")] [NativeTypeName("SDL_GPUBuffer *const *")]
public SDL_GPUBuffer** storage_buffers; public SDL_GPUBuffer** storage_buffers;
public SDL_PropertiesID props;
} }
public partial struct SDL_GPURenderState public partial struct SDL_GPURenderState
@ -125,10 +126,7 @@ namespace SDL
public static extern SDL_Renderer* SDL_CreateRendererWithProperties(SDL_PropertiesID props); public static extern SDL_Renderer* SDL_CreateRendererWithProperties(SDL_PropertiesID props);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Renderer* SDL_CreateGPURenderer(SDL_GPUDevice* device, SDL_Window* window); public static extern SDL_Renderer* SDL_CreateGPURenderer(SDL_Window* window, SDL_GPUShaderFormat format_flags, SDL_GPUDevice** device);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_GPUDevice* SDL_GetGPURendererDevice(SDL_Renderer* renderer);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Renderer* SDL_CreateSoftwareRenderer(SDL_Surface* surface); public static extern SDL_Renderer* SDL_CreateSoftwareRenderer(SDL_Surface* surface);
@ -173,13 +171,6 @@ namespace SDL
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetTextureSize(SDL_Texture* texture, float* w, float* h); public static extern SDLBool SDL_GetTextureSize(SDL_Texture* texture, float* w, float* h);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetTexturePalette(SDL_Texture* texture, SDL_Palette* palette);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Palette* SDL_GetTexturePalette(SDL_Texture* texture);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetTextureColorMod(SDL_Texture* texture, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b); public static extern SDLBool SDL_SetTextureColorMod(SDL_Texture* texture, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b);
@ -480,7 +471,7 @@ namespace SDL
public static extern SDLBool SDL_GetDefaultTextureScaleMode(SDL_Renderer* renderer, SDL_ScaleMode* scale_mode); public static extern SDLBool SDL_GetDefaultTextureScaleMode(SDL_Renderer* renderer, SDL_ScaleMode* scale_mode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_GPURenderState* SDL_CreateGPURenderState(SDL_Renderer* renderer, SDL_GPURenderStateCreateInfo* createinfo); public static extern SDL_GPURenderState* SDL_CreateGPURenderState(SDL_Renderer* renderer, SDL_GPURenderStateDesc* desc);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
@ -488,7 +479,7 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetGPURenderState(SDL_Renderer* renderer, SDL_GPURenderState* state); public static extern SDLBool SDL_SetRenderGPUState(SDL_Renderer* renderer, SDL_GPURenderState* state);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_DestroyGPURenderState(SDL_GPURenderState* state); public static extern void SDL_DestroyGPURenderState(SDL_GPURenderState* state);
@ -496,9 +487,6 @@ namespace SDL
[NativeTypeName("#define SDL_SOFTWARE_RENDERER \"software\"")] [NativeTypeName("#define SDL_SOFTWARE_RENDERER \"software\"")]
public static ReadOnlySpan<byte> SDL_SOFTWARE_RENDERER => "software"u8; public static ReadOnlySpan<byte> SDL_SOFTWARE_RENDERER => "software"u8;
[NativeTypeName("#define SDL_GPU_RENDERER \"gpu\"")]
public static ReadOnlySpan<byte> SDL_GPU_RENDERER => "gpu"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_CREATE_NAME_STRING \"SDL.renderer.create.name\"")] [NativeTypeName("#define SDL_PROP_RENDERER_CREATE_NAME_STRING \"SDL.renderer.create.name\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_NAME_STRING => "SDL.renderer.create.name"u8; public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_NAME_STRING => "SDL.renderer.create.name"u8;
@ -514,9 +502,6 @@ namespace SDL
[NativeTypeName("#define SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER \"SDL.renderer.create.present_vsync\"")] [NativeTypeName("#define SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER \"SDL.renderer.create.present_vsync\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER => "SDL.renderer.create.present_vsync"u8; public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER => "SDL.renderer.create.present_vsync"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_CREATE_GPU_DEVICE_POINTER \"SDL.renderer.create.gpu.device\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_GPU_DEVICE_POINTER => "SDL.renderer.create.gpu.device"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_CREATE_GPU_SHADERS_SPIRV_BOOLEAN \"SDL.renderer.create.gpu.shaders_spirv\"")] [NativeTypeName("#define SDL_PROP_RENDERER_CREATE_GPU_SHADERS_SPIRV_BOOLEAN \"SDL.renderer.create.gpu.shaders_spirv\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_GPU_SHADERS_SPIRV_BOOLEAN => "SDL.renderer.create.gpu.shaders_spirv"u8; public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_GPU_SHADERS_SPIRV_BOOLEAN => "SDL.renderer.create.gpu.shaders_spirv"u8;
@ -562,9 +547,6 @@ namespace SDL
[NativeTypeName("#define SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER \"SDL.renderer.texture_formats\"")] [NativeTypeName("#define SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER \"SDL.renderer.texture_formats\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER => "SDL.renderer.texture_formats"u8; public static ReadOnlySpan<byte> SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER => "SDL.renderer.texture_formats"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_TEXTURE_WRAPPING_BOOLEAN \"SDL.renderer.texture_wrapping\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_TEXTURE_WRAPPING_BOOLEAN => "SDL.renderer.texture_wrapping"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_OUTPUT_COLORSPACE_NUMBER \"SDL.renderer.output_colorspace\"")] [NativeTypeName("#define SDL_PROP_RENDERER_OUTPUT_COLORSPACE_NUMBER \"SDL.renderer.output_colorspace\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_OUTPUT_COLORSPACE_NUMBER => "SDL.renderer.output_colorspace"u8; public static ReadOnlySpan<byte> SDL_PROP_RENDERER_OUTPUT_COLORSPACE_NUMBER => "SDL.renderer.output_colorspace"u8;
@ -634,9 +616,6 @@ namespace SDL
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER \"SDL.texture.create.height\"")] [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER \"SDL.texture.create.height\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER => "SDL.texture.create.height"u8; public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER => "SDL.texture.create.height"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_PALETTE_POINTER \"SDL.texture.create.palette\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_PALETTE_POINTER => "SDL.texture.create.palette"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_SDR_WHITE_POINT_FLOAT \"SDL.texture.create.SDR_white_point\"")] [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_SDR_WHITE_POINT_FLOAT \"SDL.texture.create.SDR_white_point\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_SDR_WHITE_POINT_FLOAT => "SDL.texture.create.SDR_white_point"u8; public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_SDR_WHITE_POINT_FLOAT => "SDL.texture.create.SDR_white_point"u8;
@ -691,18 +670,6 @@ namespace SDL
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_VULKAN_TEXTURE_NUMBER \"SDL.texture.create.vulkan.texture\"")] [NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_VULKAN_TEXTURE_NUMBER \"SDL.texture.create.vulkan.texture\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_VULKAN_TEXTURE_NUMBER => "SDL.texture.create.vulkan.texture"u8; public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_VULKAN_TEXTURE_NUMBER => "SDL.texture.create.vulkan.texture"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_GPU_TEXTURE_POINTER \"SDL.texture.create.gpu.texture\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_GPU_TEXTURE_POINTER => "SDL.texture.create.gpu.texture"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_GPU_TEXTURE_UV_POINTER \"SDL.texture.create.gpu.texture_uv\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_GPU_TEXTURE_UV_POINTER => "SDL.texture.create.gpu.texture_uv"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_GPU_TEXTURE_U_POINTER \"SDL.texture.create.gpu.texture_u\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_GPU_TEXTURE_U_POINTER => "SDL.texture.create.gpu.texture_u"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_GPU_TEXTURE_V_POINTER \"SDL.texture.create.gpu.texture_v\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_GPU_TEXTURE_V_POINTER => "SDL.texture.create.gpu.texture_v"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_COLORSPACE_NUMBER \"SDL.texture.colorspace\"")] [NativeTypeName("#define SDL_PROP_TEXTURE_COLORSPACE_NUMBER \"SDL.texture.colorspace\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_COLORSPACE_NUMBER => "SDL.texture.colorspace"u8; public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_COLORSPACE_NUMBER => "SDL.texture.colorspace"u8;
@ -781,18 +748,6 @@ namespace SDL
[NativeTypeName("#define SDL_PROP_TEXTURE_VULKAN_TEXTURE_NUMBER \"SDL.texture.vulkan.texture\"")] [NativeTypeName("#define SDL_PROP_TEXTURE_VULKAN_TEXTURE_NUMBER \"SDL.texture.vulkan.texture\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_VULKAN_TEXTURE_NUMBER => "SDL.texture.vulkan.texture"u8; public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_VULKAN_TEXTURE_NUMBER => "SDL.texture.vulkan.texture"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_GPU_TEXTURE_POINTER \"SDL.texture.gpu.texture\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_GPU_TEXTURE_POINTER => "SDL.texture.gpu.texture"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_GPU_TEXTURE_UV_POINTER \"SDL.texture.gpu.texture_uv\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_GPU_TEXTURE_UV_POINTER => "SDL.texture.gpu.texture_uv"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_GPU_TEXTURE_U_POINTER \"SDL.texture.gpu.texture_u\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_GPU_TEXTURE_U_POINTER => "SDL.texture.gpu.texture_u"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_GPU_TEXTURE_V_POINTER \"SDL.texture.gpu.texture_v\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_GPU_TEXTURE_V_POINTER => "SDL.texture.gpu.texture_v"u8;
[NativeTypeName("#define SDL_RENDERER_VSYNC_DISABLED 0")] [NativeTypeName("#define SDL_RENDERER_VSYNC_DISABLED 0")]
public const int SDL_RENDERER_VSYNC_DISABLED = 0; public const int SDL_RENDERER_VSYNC_DISABLED = 0;

View File

@ -41,7 +41,6 @@ namespace SDL
SDL_SENSOR_GYRO_L, SDL_SENSOR_GYRO_L,
SDL_SENSOR_ACCEL_R, SDL_SENSOR_ACCEL_R,
SDL_SENSOR_GYRO_R, SDL_SENSOR_GYRO_R,
SDL_SENSOR_COUNT,
} }
public static unsafe partial class SDL3 public static unsafe partial class SDL3

View File

@ -41,7 +41,6 @@ namespace SDL
SDL_FLIP_NONE, SDL_FLIP_NONE,
SDL_FLIP_HORIZONTAL, SDL_FLIP_HORIZONTAL,
SDL_FLIP_VERTICAL, SDL_FLIP_VERTICAL,
SDL_FLIP_HORIZONTAL_AND_VERTICAL = (SDL_FLIP_HORIZONTAL | SDL_FLIP_VERTICAL),
} }
public partial struct SDL_Surface public partial struct SDL_Surface
@ -117,12 +116,6 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_UnlockSurface(SDL_Surface* surface); public static extern void SDL_UnlockSurface(SDL_Surface* surface);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* SDL_LoadSurface_IO(SDL_IOStream* src, [NativeTypeName("bool")] SDLBool closeio);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* SDL_LoadSurface([NativeTypeName("const char *")] byte* file);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* SDL_LoadBMP_IO(SDL_IOStream* src, [NativeTypeName("bool")] SDLBool closeio); public static extern SDL_Surface* SDL_LoadBMP_IO(SDL_IOStream* src, [NativeTypeName("bool")] SDLBool closeio);
@ -137,20 +130,6 @@ namespace SDL
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
public static extern SDLBool SDL_SaveBMP(SDL_Surface* surface, [NativeTypeName("const char *")] byte* file); public static extern SDLBool SDL_SaveBMP(SDL_Surface* surface, [NativeTypeName("const char *")] byte* file);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* SDL_LoadPNG_IO(SDL_IOStream* src, [NativeTypeName("bool")] SDLBool closeio);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* SDL_LoadPNG([NativeTypeName("const char *")] byte* file);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SavePNG_IO(SDL_Surface* surface, SDL_IOStream* dst, [NativeTypeName("bool")] SDLBool closeio);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SavePNG(SDL_Surface* surface, [NativeTypeName("const char *")] byte* file);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetSurfaceRLE(SDL_Surface* surface, [NativeTypeName("bool")] SDLBool enabled); public static extern SDLBool SDL_SetSurfaceRLE(SDL_Surface* surface, [NativeTypeName("bool")] SDLBool enabled);
@ -207,9 +186,6 @@ namespace SDL
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
public static extern SDLBool SDL_FlipSurface(SDL_Surface* surface, SDL_FlipMode flip); public static extern SDLBool SDL_FlipSurface(SDL_Surface* surface, SDL_FlipMode flip);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* SDL_RotateSurface(SDL_Surface* surface, float angle);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* SDL_DuplicateSurface(SDL_Surface* surface); public static extern SDL_Surface* SDL_DuplicateSurface(SDL_Surface* surface);

View File

@ -42,10 +42,7 @@ namespace SDL
[NativeTypeName("#define SDL_MINOR_VERSION 3")] [NativeTypeName("#define SDL_MINOR_VERSION 3")]
public const int SDL_MINOR_VERSION = 3; public const int SDL_MINOR_VERSION = 3;
[NativeTypeName("#define SDL_MICRO_VERSION 3")] [NativeTypeName("#define SDL_MICRO_VERSION 0")]
public const int SDL_MICRO_VERSION = 3; public const int SDL_MICRO_VERSION = 0;
[NativeTypeName("#define SDL_VERSION SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_MICRO_VERSION)")]
public const int SDL_VERSION = ((3) * 1000000 + (3) * 1000 + (3));
} }
} }

View File

@ -692,9 +692,6 @@ namespace SDL
[NativeTypeName("#define SDL_PROP_DISPLAY_WAYLAND_WL_OUTPUT_POINTER \"SDL.display.wayland.wl_output\"")] [NativeTypeName("#define SDL_PROP_DISPLAY_WAYLAND_WL_OUTPUT_POINTER \"SDL.display.wayland.wl_output\"")]
public static ReadOnlySpan<byte> SDL_PROP_DISPLAY_WAYLAND_WL_OUTPUT_POINTER => "SDL.display.wayland.wl_output"u8; public static ReadOnlySpan<byte> SDL_PROP_DISPLAY_WAYLAND_WL_OUTPUT_POINTER => "SDL.display.wayland.wl_output"u8;
[NativeTypeName("#define SDL_PROP_DISPLAY_WINDOWS_HMONITOR_POINTER \"SDL.display.windows.hmonitor\"")]
public static ReadOnlySpan<byte> SDL_PROP_DISPLAY_WINDOWS_HMONITOR_POINTER => "SDL.display.windows.hmonitor"u8;
[NativeTypeName("#define SDL_PROP_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN \"SDL.window.create.always_on_top\"")] [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN \"SDL.window.create.always_on_top\"")]
public static ReadOnlySpan<byte> SDL_PROP_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN => "SDL.window.create.always_on_top"u8; public static ReadOnlySpan<byte> SDL_PROP_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN => "SDL.window.create.always_on_top"u8;
@ -782,9 +779,6 @@ namespace SDL
[NativeTypeName("#define SDL_PROP_WINDOW_CREATE_COCOA_VIEW_POINTER \"SDL.window.create.cocoa.view\"")] [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_COCOA_VIEW_POINTER \"SDL.window.create.cocoa.view\"")]
public static ReadOnlySpan<byte> SDL_PROP_WINDOW_CREATE_COCOA_VIEW_POINTER => "SDL.window.create.cocoa.view"u8; public static ReadOnlySpan<byte> SDL_PROP_WINDOW_CREATE_COCOA_VIEW_POINTER => "SDL.window.create.cocoa.view"u8;
[NativeTypeName("#define SDL_PROP_WINDOW_CREATE_WINDOWSCENE_POINTER \"SDL.window.create.uikit.windowscene\"")]
public static ReadOnlySpan<byte> SDL_PROP_WINDOW_CREATE_WINDOWSCENE_POINTER => "SDL.window.create.uikit.windowscene"u8;
[NativeTypeName("#define SDL_PROP_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN \"SDL.window.create.wayland.surface_role_custom\"")] [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN \"SDL.window.create.wayland.surface_role_custom\"")]
public static ReadOnlySpan<byte> SDL_PROP_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN => "SDL.window.create.wayland.surface_role_custom"u8; public static ReadOnlySpan<byte> SDL_PROP_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN => "SDL.window.create.wayland.surface_role_custom"u8;
@ -806,9 +800,6 @@ namespace SDL
[NativeTypeName("#define SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_CANVAS_ID_STRING \"SDL.window.create.emscripten.canvas_id\"")] [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_CANVAS_ID_STRING \"SDL.window.create.emscripten.canvas_id\"")]
public static ReadOnlySpan<byte> SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_CANVAS_ID_STRING => "SDL.window.create.emscripten.canvas_id"u8; public static ReadOnlySpan<byte> SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_CANVAS_ID_STRING => "SDL.window.create.emscripten.canvas_id"u8;
[NativeTypeName("#define SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_FILL_DOCUMENT_BOOLEAN \"SDL.window.create.emscripten.fill_document\"")]
public static ReadOnlySpan<byte> SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_FILL_DOCUMENT_BOOLEAN => "SDL.window.create.emscripten.fill_document"u8;
[NativeTypeName("#define SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_KEYBOARD_ELEMENT_STRING \"SDL.window.create.emscripten.keyboard_element\"")] [NativeTypeName("#define SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_KEYBOARD_ELEMENT_STRING \"SDL.window.create.emscripten.keyboard_element\"")]
public static ReadOnlySpan<byte> SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_KEYBOARD_ELEMENT_STRING => "SDL.window.create.emscripten.keyboard_element"u8; public static ReadOnlySpan<byte> SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_KEYBOARD_ELEMENT_STRING => "SDL.window.create.emscripten.keyboard_element"u8;
@ -920,9 +911,6 @@ namespace SDL
[NativeTypeName("#define SDL_PROP_WINDOW_EMSCRIPTEN_CANVAS_ID_STRING \"SDL.window.emscripten.canvas_id\"")] [NativeTypeName("#define SDL_PROP_WINDOW_EMSCRIPTEN_CANVAS_ID_STRING \"SDL.window.emscripten.canvas_id\"")]
public static ReadOnlySpan<byte> SDL_PROP_WINDOW_EMSCRIPTEN_CANVAS_ID_STRING => "SDL.window.emscripten.canvas_id"u8; public static ReadOnlySpan<byte> SDL_PROP_WINDOW_EMSCRIPTEN_CANVAS_ID_STRING => "SDL.window.emscripten.canvas_id"u8;
[NativeTypeName("#define SDL_PROP_WINDOW_EMSCRIPTEN_FILL_DOCUMENT_BOOLEAN \"SDL.window.emscripten.fill_document\"")]
public static ReadOnlySpan<byte> SDL_PROP_WINDOW_EMSCRIPTEN_FILL_DOCUMENT_BOOLEAN => "SDL.window.emscripten.fill_document"u8;
[NativeTypeName("#define SDL_PROP_WINDOW_EMSCRIPTEN_KEYBOARD_ELEMENT_STRING \"SDL.window.emscripten.keyboard_element\"")] [NativeTypeName("#define SDL_PROP_WINDOW_EMSCRIPTEN_KEYBOARD_ELEMENT_STRING \"SDL.window.emscripten.keyboard_element\"")]
public static ReadOnlySpan<byte> SDL_PROP_WINDOW_EMSCRIPTEN_KEYBOARD_ELEMENT_STRING => "SDL.window.emscripten.keyboard_element"u8; public static ReadOnlySpan<byte> SDL_PROP_WINDOW_EMSCRIPTEN_KEYBOARD_ELEMENT_STRING => "SDL.window.emscripten.keyboard_element"u8;

View File

@ -8,14 +8,14 @@ namespace SDL
[Macro] [Macro]
public static unsafe SDLBool SDL_Unsupported() public static unsafe SDLBool SDL_Unsupported()
{ {
fixed (byte* fmt = "That operation is not supported\0"u8) fixed (byte* fmt = "That operation is not supported"u8)
return SDL_SetError(fmt, __arglist()); return SDL_SetError(fmt, __arglist());
} }
[Macro] [Macro]
public static unsafe SDLBool SDL_InvalidParamError([NativeTypeName("const char *")] byte* param) public static unsafe SDLBool SDL_InvalidParamError([NativeTypeName("const char *")] byte* param)
{ {
fixed (byte* fmt = "Parameter '%s' is invalid\0"u8) fixed (byte* fmt = "Parameter '%s' is invalid"u8)
return SDL_SetError(fmt, __arglist(param)); return SDL_SetError(fmt, __arglist(param));
} }
} }

View File

@ -50,4 +50,8 @@ namespace SDL
SDL_GPU_COLORCOMPONENT_B = (byte)SDL3.SDL_GPU_COLORCOMPONENT_B, SDL_GPU_COLORCOMPONENT_B = (byte)SDL3.SDL_GPU_COLORCOMPONENT_B,
SDL_GPU_COLORCOMPONENT_A = (byte)SDL3.SDL_GPU_COLORCOMPONENT_A, SDL_GPU_COLORCOMPONENT_A = (byte)SDL3.SDL_GPU_COLORCOMPONENT_A,
} }
public static partial class SDL3
{
}
} }

View File

@ -1,12 +0,0 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
namespace SDL
{
#pragma warning disable CS0618 // Type or member is obsolete
public partial struct SDL_IOStreamInterface : SDL3.ISDLInterface
#pragma warning restore CS0618 // Type or member is obsolete
{
uint SDL3.ISDLInterface.version { set => version = value; }
}
}

View File

@ -19,11 +19,4 @@ namespace SDL
return SDLArray.Create(array, count); return SDLArray.Create(array, count);
} }
} }
#pragma warning disable CS0618 // Type or member is obsolete
public partial struct SDL_VirtualJoystickDesc : SDL3.ISDLInterface
#pragma warning restore CS0618 // Type or member is obsolete
{
uint SDL3.ISDLInterface.version { set => version = value; }
}
} }

View File

@ -19,7 +19,6 @@ namespace SDL
SDL_PEN_INPUT_BUTTON_4 = SDL3.SDL_PEN_INPUT_BUTTON_4, SDL_PEN_INPUT_BUTTON_4 = SDL3.SDL_PEN_INPUT_BUTTON_4,
SDL_PEN_INPUT_BUTTON_5 = SDL3.SDL_PEN_INPUT_BUTTON_5, SDL_PEN_INPUT_BUTTON_5 = SDL3.SDL_PEN_INPUT_BUTTON_5,
SDL_PEN_INPUT_ERASER_TIP = SDL3.SDL_PEN_INPUT_ERASER_TIP, SDL_PEN_INPUT_ERASER_TIP = SDL3.SDL_PEN_INPUT_ERASER_TIP,
SDL_PEN_INPUT_IN_PROXIMITY = SDL3.SDL_PEN_INPUT_IN_PROXIMITY,
} }
public static partial class SDL3 public static partial class SDL3

View File

@ -46,20 +46,18 @@ namespace SDL
[Macro] [Macro]
public static uint SDL_FOURCC(byte A, byte B, byte C, byte D) => (uint)((A << 0) | (B << 8) | (C << 16) | (D << 24)); public static uint SDL_FOURCC(byte A, byte B, byte C, byte D) => (uint)((A << 0) | (B << 8) | (C << 16) | (D << 24));
[Obsolete("Do not use.")] // used internally [Macro]
public interface ISDLInterface public static unsafe void SDL_INIT_INTERFACE(out SDL_IOStreamInterface iface)
{ {
internal uint version { set; } iface = default;
iface.version = (uint)sizeof(SDL_IOStreamInterface);
} }
[Macro] [Macro]
public static unsafe void SDL_INIT_INTERFACE<T>(out T iface) public static unsafe void SDL_INIT_INTERFACE(out SDL_StorageInterface iface)
#pragma warning disable CS0618 // Type or member is obsolete
where T : unmanaged, ISDLInterface
#pragma warning restore CS0618 // Type or member is obsolete
{ {
iface = default; iface = default;
iface.version = (uint)sizeof(T); iface.version = (uint)sizeof(SDL_StorageInterface);
} }
public static unsafe void SDL_free(void* mem) => SDL_free((IntPtr)mem); public static unsafe void SDL_free(void* mem) => SDL_free((IntPtr)mem);

View File

@ -7,13 +7,6 @@ using JetBrains.Annotations;
namespace SDL namespace SDL
{ {
#pragma warning disable CS0618 // Type or member is obsolete
public partial struct SDL_StorageInterface : SDL3.ISDLInterface
#pragma warning restore CS0618 // Type or member is obsolete
{
uint SDL3.ISDLInterface.version { set => version = value; }
}
public static partial class SDL3 public static partial class SDL3
{ {
/// <returns> /// <returns>

View File

@ -18,6 +18,9 @@ namespace SDL
[Macro] [Macro]
public static int SDL_VERSIONNUM_MICRO(int version) => ((version) % 1000); public static int SDL_VERSIONNUM_MICRO(int version) => ((version) % 1000);
[Constant]
public static readonly int SDL_VERSION = SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_MICRO_VERSION);
[Macro] [Macro]
public static bool SDL_VERSION_ATLEAST(int X, int Y, int Z) => SDL_VERSION >= SDL_VERSIONNUM(X, Y, Z); public static bool SDL_VERSION_ATLEAST(int X, int Y, int Z) => SDL_VERSION >= SDL_VERSIONNUM(X, Y, Z);
} }

View File

@ -28,10 +28,8 @@ namespace SDL
SDL_WINDOW_INPUT_FOCUS = SDL3.SDL_WINDOW_INPUT_FOCUS, SDL_WINDOW_INPUT_FOCUS = SDL3.SDL_WINDOW_INPUT_FOCUS,
SDL_WINDOW_MOUSE_FOCUS = SDL3.SDL_WINDOW_MOUSE_FOCUS, SDL_WINDOW_MOUSE_FOCUS = SDL3.SDL_WINDOW_MOUSE_FOCUS,
SDL_WINDOW_EXTERNAL = SDL3.SDL_WINDOW_EXTERNAL, SDL_WINDOW_EXTERNAL = SDL3.SDL_WINDOW_EXTERNAL,
SDL_WINDOW_MODAL = SDL3.SDL_WINDOW_MODAL,
SDL_WINDOW_HIGH_PIXEL_DENSITY = SDL3.SDL_WINDOW_HIGH_PIXEL_DENSITY, SDL_WINDOW_HIGH_PIXEL_DENSITY = SDL3.SDL_WINDOW_HIGH_PIXEL_DENSITY,
SDL_WINDOW_MOUSE_CAPTURE = SDL3.SDL_WINDOW_MOUSE_CAPTURE, SDL_WINDOW_MOUSE_CAPTURE = SDL3.SDL_WINDOW_MOUSE_CAPTURE,
SDL_WINDOW_MOUSE_RELATIVE_MODE = SDL3.SDL_WINDOW_MOUSE_RELATIVE_MODE,
SDL_WINDOW_ALWAYS_ON_TOP = SDL3.SDL_WINDOW_ALWAYS_ON_TOP, SDL_WINDOW_ALWAYS_ON_TOP = SDL3.SDL_WINDOW_ALWAYS_ON_TOP,
SDL_WINDOW_UTILITY = SDL3.SDL_WINDOW_UTILITY, SDL_WINDOW_UTILITY = SDL3.SDL_WINDOW_UTILITY,
SDL_WINDOW_TOOLTIP = SDL3.SDL_WINDOW_TOOLTIP, SDL_WINDOW_TOOLTIP = SDL3.SDL_WINDOW_TOOLTIP,

View File

@ -16,7 +16,6 @@ Usage:
Example: Example:
- python generate_bindings.py - python generate_bindings.py
- python generate_bindings.py SDL3/SDL_audio.h - python generate_bindings.py SDL3/SDL_audio.h
- python generate_bindings.py SDL3_ttf/SDL_ttf.h
- python generate_bindings.py SDL_audio.h - python generate_bindings.py SDL_audio.h
- python generate_bindings.py SDL_audio - python generate_bindings.py SDL_audio
- python generate_bindings.py audio - python generate_bindings.py audio
@ -36,12 +35,11 @@ unsafe_prefix = "Unsafe_"
repository_root = pathlib.Path(__file__).resolve().parents[1] repository_root = pathlib.Path(__file__).resolve().parents[1]
SDL_lib_root = "External" SDL_lib_root = "External"
SDL_libs = ["SDL", "SDL_image", "SDL_ttf", "SDL_mixer"] SDL_libs = ["SDL", "SDL_image", "SDL_ttf"]
SDL_lib_include_root = { SDL_lib_include_root = {
"SDL3": SDL_lib_root + "/SDL/include", "SDL3": SDL_lib_root + "/SDL/include",
"SDL3_image": SDL_lib_root + "/SDL_image/include", "SDL3_image": SDL_lib_root + "/SDL_image/include",
"SDL3_ttf": SDL_lib_root + "/SDL_ttf/include", "SDL3_ttf": SDL_lib_root + "/SDL_ttf/include"
"SDL3_mixer": SDL_lib_root + "/SDL_mixer/include",
} }
SDL3_header_base = "SDL3" # base folder of header files SDL3_header_base = "SDL3" # base folder of header files
@ -174,7 +172,6 @@ headers = [
add("SDL3_image/SDL_image.h"), add("SDL3_image/SDL_image.h"),
add("SDL3_ttf/SDL_ttf.h"), add("SDL3_ttf/SDL_ttf.h"),
add("SDL3_ttf/SDL_textengine.h"), add("SDL3_ttf/SDL_textengine.h"),
add("SDL3_mixer/SDL_mixer.h"),
] ]
@ -258,7 +255,7 @@ def typedef(t):
base_command = [ base_command = [
"dotnet", "tool", "run", "ClangSharpPInvokeGenerator", "dotnet", "tool", "run", "ClangSharpPInvokeGenerator",
"--headerFile", csproj_root / "SDL-license-header.txt", "--headerFile", csproj_root / "SDL.licenseheader",
"--config", "--config",
"latest-codegen", "latest-codegen",
@ -269,7 +266,6 @@ base_command = [
"--include-directory", repository_root / SDL_lib_include_root["SDL3"], "--include-directory", repository_root / SDL_lib_include_root["SDL3"],
"--include-directory", repository_root / SDL_lib_include_root["SDL3_image"], "--include-directory", repository_root / SDL_lib_include_root["SDL3_image"],
"--include-directory", repository_root / SDL_lib_include_root["SDL3_ttf"], "--include-directory", repository_root / SDL_lib_include_root["SDL3_ttf"],
"--include-directory", repository_root / SDL_lib_include_root["SDL3_mixer"],
"--namespace", "SDL", "--namespace", "SDL",
"--remap", "--remap",
@ -312,6 +308,7 @@ def run_clangsharp(command, header: Header):
"--file", header.input_file(), "--file", header.input_file(),
"--output", header.output_file(), "--output", header.output_file(),
"--libraryPath", header.base, "--libraryPath", header.base,
"--methodClassName", header.base, "--methodClassName", header.base,
] ]
@ -368,12 +365,7 @@ def generate_platform_specific_headers(sdl_api, header: Header, platforms):
def get_string_returning_functions(sdl_api): def get_string_returning_functions(sdl_api):
for f in sdl_api: for f in sdl_api:
if f["retval"] in ("const char*", "char*"): if f["retval"] in ("const char*", "char*"):
yield f["name"] yield f
yield "TTF_GetFontFamilyName"
yield "TTF_GetFontStyleName"
yield "MIX_GetAudioDecoder"
def should_skip(solo_headers: list[Header], header: Header): def should_skip(solo_headers: list[Header], header: Header):
@ -405,7 +397,8 @@ def main():
str_ret_funcs = list(get_string_returning_functions(sdl_api)) str_ret_funcs = list(get_string_returning_functions(sdl_api))
if str_ret_funcs: if str_ret_funcs:
base_command.append("--remap") base_command.append("--remap")
for name in str_ret_funcs: for func in str_ret_funcs:
name = func["name"]
# add unsafe prefix to `const char *` functions so that the source generator can make friendly overloads with the unprefixed name. # add unsafe prefix to `const char *` functions so that the source generator can make friendly overloads with the unprefixed name.
base_command.append(f"{name}={unsafe_prefix}{name}") base_command.append(f"{name}={unsafe_prefix}{name}")

View File

@ -1,9 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks Condition=" '$(CI_DONT_TARGET_ANDROID)' != '1' ">net8.0;net8.0-android</TargetFrameworks> <TargetFramework>net8.0</TargetFramework>
<TargetFramework Condition=" '$(CI_DONT_TARGET_ANDROID)' == '1' ">net8.0</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<RootNamespace>SDL</RootNamespace> <RootNamespace>SDL</RootNamespace>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
@ -19,14 +17,9 @@
<PackageReleaseNotes>Automated release.</PackageReleaseNotes> <PackageReleaseNotes>Automated release.</PackageReleaseNotes>
<PackageLicenseExpression>MIT</PackageLicenseExpression> <PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/ppy/SDL3-CS</PackageProjectUrl> <PackageProjectUrl>https://github.com/ppy/SDL3-CS</PackageProjectUrl>
<PackageReadmeFile>README_nuget.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/ppy/SDL3-CS</RepositoryUrl> <RepositoryUrl>https://github.com/ppy/SDL3-CS</RepositoryUrl>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)..\README_nuget.md" Pack="true" PackagePath="\"/>
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\SDL3-CS.SourceGeneration\SDL3-CS.SourceGeneration.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/> <ProjectReference Include="..\SDL3-CS.SourceGeneration\SDL3-CS.SourceGeneration.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
<ProjectReference Include="..\SDL3-CS\SDL3-CS.csproj"/> <ProjectReference Include="..\SDL3-CS\SDL3-CS.csproj"/>
@ -45,6 +38,42 @@
<PackagePath>runtimes/win-x86/native</PackagePath> <PackagePath>runtimes/win-x86/native</PackagePath>
<Pack>true</Pack> <Pack>true</Pack>
</None> </None>
<None Include="$(MSBuildThisFileDirectory)..\native\win-x64\libwebp.dll">
<PackagePath>runtimes/win-x64/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\win-arm64\libwebp.dll">
<PackagePath>runtimes/win-arm64/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\win-x86\libwebp.dll">
<PackagePath>runtimes/win-x86/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\win-x64\libwebpdemux.dll">
<PackagePath>runtimes/win-x64/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\win-arm64\libwebpdemux.dll">
<PackagePath>runtimes/win-arm64/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\win-x86\libwebpdemux.dll">
<PackagePath>runtimes/win-x86/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\win-x64\tiff.dll">
<PackagePath>runtimes/win-x64/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\win-arm64\tiff.dll">
<PackagePath>runtimes/win-arm64/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\win-x86\tiff.dll">
<PackagePath>runtimes/win-x86/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\osx-x64\libSDL3_image.dylib"> <None Include="$(MSBuildThisFileDirectory)..\native\osx-x64\libSDL3_image.dylib">
<PackagePath>runtimes/osx-x64/native</PackagePath> <PackagePath>runtimes/osx-x64/native</PackagePath>
<Pack>true</Pack> <Pack>true</Pack>
@ -69,8 +98,9 @@
<PackagePath>runtimes/linux-arm/native</PackagePath> <PackagePath>runtimes/linux-arm/native</PackagePath>
<Pack>true</Pack> <Pack>true</Pack>
</None> </None>
<!-- Todo: Build these platforms with the CI script:
<None Include="$(MSBuildThisFileDirectory)..\native\ios\SDL3_image.xcframework\**\*"> <None Include="$(MSBuildThisFileDirectory)..\native\ios\SDL3_image.xcframework\**\*">
<PackagePath>runtimes/ios/native/SDL3_image.xcframework</PackagePath> <PackagePath>runtimes/ios/native/SDL3.xcframework</PackagePath>
<Pack>true</Pack> <Pack>true</Pack>
</None> </None>
<None Include="$(MSBuildThisFileDirectory)..\native\android\armeabi-v7a\libSDL3_image.so"> <None Include="$(MSBuildThisFileDirectory)..\native\android\armeabi-v7a\libSDL3_image.so">
@ -89,6 +119,7 @@
<PackagePath>runtimes/android-x86/native</PackagePath> <PackagePath>runtimes/android-x86/native</PackagePath>
<Pack>true</Pack> <Pack>true</Pack>
</None> </None>
-->
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -23,7 +23,6 @@
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
*/ */
using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace SDL namespace SDL
@ -41,36 +40,26 @@ namespace SDL
public int* delays; public int* delays;
} }
public partial struct IMG_AnimationEncoder
{
}
public enum IMG_AnimationDecoderStatus
{
IMG_DECODER_STATUS_INVALID = -1,
IMG_DECODER_STATUS_OK,
IMG_DECODER_STATUS_FAILED,
IMG_DECODER_STATUS_COMPLETE,
}
public partial struct IMG_AnimationDecoder
{
}
public static unsafe partial class SDL3_image public static unsafe partial class SDL3_image
{ {
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int IMG_Version(); public static extern int IMG_Version();
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern IMG_InitFlags IMG_Init(IMG_InitFlags flags);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void IMG_Quit();
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* IMG_LoadTyped_IO(SDL_IOStream* src, [NativeTypeName("bool")] SDLBool closeio, [NativeTypeName("const char *")] byte* type);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* IMG_Load([NativeTypeName("const char *")] byte* file); public static extern SDL_Surface* IMG_Load([NativeTypeName("const char *")] byte* file);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* IMG_Load_IO(SDL_IOStream* src, [NativeTypeName("bool")] SDLBool closeio); public static extern SDL_Surface* IMG_Load_IO(SDL_IOStream* src, [NativeTypeName("bool")] SDLBool closeio);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* IMG_LoadTyped_IO(SDL_IOStream* src, [NativeTypeName("bool")] SDLBool closeio, [NativeTypeName("const char *")] byte* type);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Texture* IMG_LoadTexture(SDL_Renderer* renderer, [NativeTypeName("const char *")] byte* file); public static extern SDL_Texture* IMG_LoadTexture(SDL_Renderer* renderer, [NativeTypeName("const char *")] byte* file);
@ -80,17 +69,14 @@ namespace SDL
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Texture* IMG_LoadTextureTyped_IO(SDL_Renderer* renderer, SDL_IOStream* src, [NativeTypeName("bool")] SDLBool closeio, [NativeTypeName("const char *")] byte* type); public static extern SDL_Texture* IMG_LoadTextureTyped_IO(SDL_Renderer* renderer, SDL_IOStream* src, [NativeTypeName("bool")] SDLBool closeio, [NativeTypeName("const char *")] byte* type);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* IMG_GetClipboardImage();
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool IMG_isANI(SDL_IOStream* src);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
public static extern SDLBool IMG_isAVIF(SDL_IOStream* src); public static extern SDLBool IMG_isAVIF(SDL_IOStream* src);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool IMG_isICO(SDL_IOStream* src);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
public static extern SDLBool IMG_isCUR(SDL_IOStream* src); public static extern SDLBool IMG_isCUR(SDL_IOStream* src);
@ -103,10 +89,6 @@ namespace SDL
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
public static extern SDLBool IMG_isGIF(SDL_IOStream* src); public static extern SDLBool IMG_isGIF(SDL_IOStream* src);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool IMG_isICO(SDL_IOStream* src);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
public static extern SDLBool IMG_isJPG(SDL_IOStream* src); public static extern SDLBool IMG_isJPG(SDL_IOStream* src);
@ -131,21 +113,17 @@ namespace SDL
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
public static extern SDLBool IMG_isPNM(SDL_IOStream* src); public static extern SDLBool IMG_isPNM(SDL_IOStream* src);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool IMG_isQOI(SDL_IOStream* src);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
public static extern SDLBool IMG_isSVG(SDL_IOStream* src); public static extern SDLBool IMG_isSVG(SDL_IOStream* src);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
public static extern SDLBool IMG_isTIF(SDL_IOStream* src); public static extern SDLBool IMG_isQOI(SDL_IOStream* src);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
public static extern SDLBool IMG_isWEBP(SDL_IOStream* src); public static extern SDLBool IMG_isTIF(SDL_IOStream* src);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
@ -159,20 +137,24 @@ namespace SDL
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
public static extern SDLBool IMG_isXV(SDL_IOStream* src); public static extern SDLBool IMG_isXV(SDL_IOStream* src);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool IMG_isWEBP(SDL_IOStream* src);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* IMG_LoadAVIF_IO(SDL_IOStream* src); public static extern SDL_Surface* IMG_LoadAVIF_IO(SDL_IOStream* src);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* IMG_LoadBMP_IO(SDL_IOStream* src); public static extern SDL_Surface* IMG_LoadICO_IO(SDL_IOStream* src);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* IMG_LoadCUR_IO(SDL_IOStream* src); public static extern SDL_Surface* IMG_LoadCUR_IO(SDL_IOStream* src);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* IMG_LoadGIF_IO(SDL_IOStream* src); public static extern SDL_Surface* IMG_LoadBMP_IO(SDL_IOStream* src);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* IMG_LoadICO_IO(SDL_IOStream* src); public static extern SDL_Surface* IMG_LoadGIF_IO(SDL_IOStream* src);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* IMG_LoadJPG_IO(SDL_IOStream* src); public static extern SDL_Surface* IMG_LoadJPG_IO(SDL_IOStream* src);
@ -195,9 +177,6 @@ namespace SDL
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* IMG_LoadSVG_IO(SDL_IOStream* src); public static extern SDL_Surface* IMG_LoadSVG_IO(SDL_IOStream* src);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* IMG_LoadSizedSVG_IO(SDL_IOStream* src, int width, int height);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* IMG_LoadQOI_IO(SDL_IOStream* src); public static extern SDL_Surface* IMG_LoadQOI_IO(SDL_IOStream* src);
@ -207,9 +186,6 @@ namespace SDL
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* IMG_LoadTIF_IO(SDL_IOStream* src); public static extern SDL_Surface* IMG_LoadTIF_IO(SDL_IOStream* src);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* IMG_LoadWEBP_IO(SDL_IOStream* src);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* IMG_LoadXCF_IO(SDL_IOStream* src); public static extern SDL_Surface* IMG_LoadXCF_IO(SDL_IOStream* src);
@ -219,67 +195,25 @@ namespace SDL
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* IMG_LoadXV_IO(SDL_IOStream* src); public static extern SDL_Surface* IMG_LoadXV_IO(SDL_IOStream* src);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* IMG_LoadWEBP_IO(SDL_IOStream* src);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* IMG_LoadSizedSVG_IO(SDL_IOStream* src, int width, int height);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* IMG_ReadXPMFromArray([NativeTypeName("char **")] byte** xpm); public static extern SDL_Surface* IMG_ReadXPMFromArray([NativeTypeName("char **")] byte** xpm);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* IMG_ReadXPMFromArrayToRGB888([NativeTypeName("char **")] byte** xpm); public static extern SDL_Surface* IMG_ReadXPMFromArrayToRGB888([NativeTypeName("char **")] byte** xpm);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool IMG_Save(SDL_Surface* surface, [NativeTypeName("const char *")] byte* file);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool IMG_SaveTyped_IO(SDL_Surface* surface, SDL_IOStream* dst, [NativeTypeName("bool")] SDLBool closeio, [NativeTypeName("const char *")] byte* type);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
public static extern SDLBool IMG_SaveAVIF(SDL_Surface* surface, [NativeTypeName("const char *")] byte* file, int quality); public static extern SDLBool IMG_SaveAVIF(SDL_Surface* surface, [NativeTypeName("const char *")] byte* file, int quality);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
public static extern SDLBool IMG_SaveAVIF_IO(SDL_Surface* surface, SDL_IOStream* dst, [NativeTypeName("bool")] SDLBool closeio, int quality); public static extern SDLBool IMG_SaveAVIF_IO(SDL_Surface* surface, SDL_IOStream* dst, int closeio, int quality);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool IMG_SaveBMP(SDL_Surface* surface, [NativeTypeName("const char *")] byte* file);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool IMG_SaveBMP_IO(SDL_Surface* surface, SDL_IOStream* dst, [NativeTypeName("bool")] SDLBool closeio);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool IMG_SaveCUR(SDL_Surface* surface, [NativeTypeName("const char *")] byte* file);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool IMG_SaveCUR_IO(SDL_Surface* surface, SDL_IOStream* dst, [NativeTypeName("bool")] SDLBool closeio);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool IMG_SaveGIF(SDL_Surface* surface, [NativeTypeName("const char *")] byte* file);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool IMG_SaveGIF_IO(SDL_Surface* surface, SDL_IOStream* dst, [NativeTypeName("bool")] SDLBool closeio);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool IMG_SaveICO(SDL_Surface* surface, [NativeTypeName("const char *")] byte* file);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool IMG_SaveICO_IO(SDL_Surface* surface, SDL_IOStream* dst, [NativeTypeName("bool")] SDLBool closeio);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool IMG_SaveJPG(SDL_Surface* surface, [NativeTypeName("const char *")] byte* file, int quality);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool IMG_SaveJPG_IO(SDL_Surface* surface, SDL_IOStream* dst, [NativeTypeName("bool")] SDLBool closeio, int quality);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
@ -287,23 +221,15 @@ namespace SDL
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
public static extern SDLBool IMG_SavePNG_IO(SDL_Surface* surface, SDL_IOStream* dst, [NativeTypeName("bool")] SDLBool closeio); public static extern SDLBool IMG_SavePNG_IO(SDL_Surface* surface, SDL_IOStream* dst, int closeio);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
public static extern SDLBool IMG_SaveTGA(SDL_Surface* surface, [NativeTypeName("const char *")] byte* file); public static extern SDLBool IMG_SaveJPG(SDL_Surface* surface, [NativeTypeName("const char *")] byte* file, int quality);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
public static extern SDLBool IMG_SaveTGA_IO(SDL_Surface* surface, SDL_IOStream* dst, [NativeTypeName("bool")] SDLBool closeio); public static extern SDLBool IMG_SaveJPG_IO(SDL_Surface* surface, SDL_IOStream* dst, int closeio, int quality);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool IMG_SaveWEBP(SDL_Surface* surface, [NativeTypeName("const char *")] byte* file, float quality);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool IMG_SaveWEBP_IO(SDL_Surface* surface, SDL_IOStream* dst, [NativeTypeName("bool")] SDLBool closeio, float quality);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern IMG_Animation* IMG_LoadAnimation([NativeTypeName("const char *")] byte* file); public static extern IMG_Animation* IMG_LoadAnimation([NativeTypeName("const char *")] byte* file);
@ -315,13 +241,7 @@ namespace SDL
public static extern IMG_Animation* IMG_LoadAnimationTyped_IO(SDL_IOStream* src, [NativeTypeName("bool")] SDLBool closeio, [NativeTypeName("const char *")] byte* type); public static extern IMG_Animation* IMG_LoadAnimationTyped_IO(SDL_IOStream* src, [NativeTypeName("bool")] SDLBool closeio, [NativeTypeName("const char *")] byte* type);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern IMG_Animation* IMG_LoadANIAnimation_IO(SDL_IOStream* src); public static extern void IMG_FreeAnimation(IMG_Animation* anim);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern IMG_Animation* IMG_LoadAPNGAnimation_IO(SDL_IOStream* src);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern IMG_Animation* IMG_LoadAVIFAnimation_IO(SDL_IOStream* src);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern IMG_Animation* IMG_LoadGIFAnimation_IO(SDL_IOStream* src); public static extern IMG_Animation* IMG_LoadGIFAnimation_IO(SDL_IOStream* src);
@ -329,154 +249,31 @@ namespace SDL
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern IMG_Animation* IMG_LoadWEBPAnimation_IO(SDL_IOStream* src); public static extern IMG_Animation* IMG_LoadWEBPAnimation_IO(SDL_IOStream* src);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool IMG_SaveAnimation(IMG_Animation* anim, [NativeTypeName("const char *")] byte* file);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool IMG_SaveAnimationTyped_IO(IMG_Animation* anim, SDL_IOStream* dst, [NativeTypeName("bool")] SDLBool closeio, [NativeTypeName("const char *")] byte* type);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool IMG_SaveANIAnimation_IO(IMG_Animation* anim, SDL_IOStream* dst, [NativeTypeName("bool")] SDLBool closeio);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool IMG_SaveAPNGAnimation_IO(IMG_Animation* anim, SDL_IOStream* dst, [NativeTypeName("bool")] SDLBool closeio);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool IMG_SaveAVIFAnimation_IO(IMG_Animation* anim, SDL_IOStream* dst, [NativeTypeName("bool")] SDLBool closeio, int quality);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool IMG_SaveGIFAnimation_IO(IMG_Animation* anim, SDL_IOStream* dst, [NativeTypeName("bool")] SDLBool closeio);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool IMG_SaveWEBPAnimation_IO(IMG_Animation* anim, SDL_IOStream* dst, [NativeTypeName("bool")] SDLBool closeio, int quality);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Cursor* IMG_CreateAnimatedCursor(IMG_Animation* anim, int hot_x, int hot_y);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void IMG_FreeAnimation(IMG_Animation* anim);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern IMG_AnimationEncoder* IMG_CreateAnimationEncoder([NativeTypeName("const char *")] byte* file);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern IMG_AnimationEncoder* IMG_CreateAnimationEncoder_IO(SDL_IOStream* dst, [NativeTypeName("bool")] SDLBool closeio, [NativeTypeName("const char *")] byte* type);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern IMG_AnimationEncoder* IMG_CreateAnimationEncoderWithProperties(SDL_PropertiesID props);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool IMG_AddAnimationEncoderFrame(IMG_AnimationEncoder* encoder, SDL_Surface* surface, [NativeTypeName("Uint64")] ulong duration);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool IMG_CloseAnimationEncoder(IMG_AnimationEncoder* encoder);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern IMG_AnimationDecoder* IMG_CreateAnimationDecoder([NativeTypeName("const char *")] byte* file);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern IMG_AnimationDecoder* IMG_CreateAnimationDecoder_IO(SDL_IOStream* src, [NativeTypeName("bool")] SDLBool closeio, [NativeTypeName("const char *")] byte* type);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern IMG_AnimationDecoder* IMG_CreateAnimationDecoderWithProperties(SDL_PropertiesID props);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_PropertiesID IMG_GetAnimationDecoderProperties(IMG_AnimationDecoder* decoder);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool IMG_GetAnimationDecoderFrame(IMG_AnimationDecoder* decoder, SDL_Surface** frame, [NativeTypeName("Uint64 *")] ulong* duration);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern IMG_AnimationDecoderStatus IMG_GetAnimationDecoderStatus(IMG_AnimationDecoder* decoder);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool IMG_ResetAnimationDecoder(IMG_AnimationDecoder* decoder);
[DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool IMG_CloseAnimationDecoder(IMG_AnimationDecoder* decoder);
[NativeTypeName("#define SDL_IMAGE_MAJOR_VERSION 3")] [NativeTypeName("#define SDL_IMAGE_MAJOR_VERSION 3")]
public const int SDL_IMAGE_MAJOR_VERSION = 3; public const int SDL_IMAGE_MAJOR_VERSION = 3;
[NativeTypeName("#define SDL_IMAGE_MINOR_VERSION 3")] [NativeTypeName("#define SDL_IMAGE_MINOR_VERSION 1")]
public const int SDL_IMAGE_MINOR_VERSION = 3; public const int SDL_IMAGE_MINOR_VERSION = 1;
[NativeTypeName("#define SDL_IMAGE_MICRO_VERSION 0")] [NativeTypeName("#define SDL_IMAGE_MICRO_VERSION 0")]
public const int SDL_IMAGE_MICRO_VERSION = 0; public const int SDL_IMAGE_MICRO_VERSION = 0;
[NativeTypeName("#define SDL_IMAGE_VERSION SDL_VERSIONNUM(SDL_IMAGE_MAJOR_VERSION, SDL_IMAGE_MINOR_VERSION, SDL_IMAGE_MICRO_VERSION)")] [NativeTypeName("#define IMG_INIT_JPG 0x00000001")]
public const int SDL_IMAGE_VERSION = ((3) * 1000000 + (3) * 1000 + (0)); public const int IMG_INIT_JPG = 0x00000001;
[NativeTypeName("#define IMG_PROP_ANIMATION_ENCODER_CREATE_FILENAME_STRING \"SDL_image.animation_encoder.create.filename\"")] [NativeTypeName("#define IMG_INIT_PNG 0x00000002")]
public static ReadOnlySpan<byte> IMG_PROP_ANIMATION_ENCODER_CREATE_FILENAME_STRING => "SDL_image.animation_encoder.create.filename"u8; public const int IMG_INIT_PNG = 0x00000002;
[NativeTypeName("#define IMG_PROP_ANIMATION_ENCODER_CREATE_IOSTREAM_POINTER \"SDL_image.animation_encoder.create.iostream\"")] [NativeTypeName("#define IMG_INIT_TIF 0x00000004")]
public static ReadOnlySpan<byte> IMG_PROP_ANIMATION_ENCODER_CREATE_IOSTREAM_POINTER => "SDL_image.animation_encoder.create.iostream"u8; public const int IMG_INIT_TIF = 0x00000004;
[NativeTypeName("#define IMG_PROP_ANIMATION_ENCODER_CREATE_IOSTREAM_AUTOCLOSE_BOOLEAN \"SDL_image.animation_encoder.create.iostream.autoclose\"")] [NativeTypeName("#define IMG_INIT_WEBP 0x00000008")]
public static ReadOnlySpan<byte> IMG_PROP_ANIMATION_ENCODER_CREATE_IOSTREAM_AUTOCLOSE_BOOLEAN => "SDL_image.animation_encoder.create.iostream.autoclose"u8; public const int IMG_INIT_WEBP = 0x00000008;
[NativeTypeName("#define IMG_PROP_ANIMATION_ENCODER_CREATE_TYPE_STRING \"SDL_image.animation_encoder.create.type\"")] [NativeTypeName("#define IMG_INIT_JXL 0x00000010")]
public static ReadOnlySpan<byte> IMG_PROP_ANIMATION_ENCODER_CREATE_TYPE_STRING => "SDL_image.animation_encoder.create.type"u8; public const int IMG_INIT_JXL = 0x00000010;
[NativeTypeName("#define IMG_PROP_ANIMATION_ENCODER_CREATE_QUALITY_NUMBER \"SDL_image.animation_encoder.create.quality\"")] [NativeTypeName("#define IMG_INIT_AVIF 0x00000020")]
public static ReadOnlySpan<byte> IMG_PROP_ANIMATION_ENCODER_CREATE_QUALITY_NUMBER => "SDL_image.animation_encoder.create.quality"u8; public const int IMG_INIT_AVIF = 0x00000020;
[NativeTypeName("#define IMG_PROP_ANIMATION_ENCODER_CREATE_TIMEBASE_NUMERATOR_NUMBER \"SDL_image.animation_encoder.create.timebase.numerator\"")]
public static ReadOnlySpan<byte> IMG_PROP_ANIMATION_ENCODER_CREATE_TIMEBASE_NUMERATOR_NUMBER => "SDL_image.animation_encoder.create.timebase.numerator"u8;
[NativeTypeName("#define IMG_PROP_ANIMATION_ENCODER_CREATE_TIMEBASE_DENOMINATOR_NUMBER \"SDL_image.animation_encoder.create.timebase.denominator\"")]
public static ReadOnlySpan<byte> IMG_PROP_ANIMATION_ENCODER_CREATE_TIMEBASE_DENOMINATOR_NUMBER => "SDL_image.animation_encoder.create.timebase.denominator"u8;
[NativeTypeName("#define IMG_PROP_ANIMATION_DECODER_CREATE_FILENAME_STRING \"SDL_image.animation_decoder.create.filename\"")]
public static ReadOnlySpan<byte> IMG_PROP_ANIMATION_DECODER_CREATE_FILENAME_STRING => "SDL_image.animation_decoder.create.filename"u8;
[NativeTypeName("#define IMG_PROP_ANIMATION_DECODER_CREATE_IOSTREAM_POINTER \"SDL_image.animation_decoder.create.iostream\"")]
public static ReadOnlySpan<byte> IMG_PROP_ANIMATION_DECODER_CREATE_IOSTREAM_POINTER => "SDL_image.animation_decoder.create.iostream"u8;
[NativeTypeName("#define IMG_PROP_ANIMATION_DECODER_CREATE_IOSTREAM_AUTOCLOSE_BOOLEAN \"SDL_image.animation_decoder.create.iostream.autoclose\"")]
public static ReadOnlySpan<byte> IMG_PROP_ANIMATION_DECODER_CREATE_IOSTREAM_AUTOCLOSE_BOOLEAN => "SDL_image.animation_decoder.create.iostream.autoclose"u8;
[NativeTypeName("#define IMG_PROP_ANIMATION_DECODER_CREATE_TYPE_STRING \"SDL_image.animation_decoder.create.type\"")]
public static ReadOnlySpan<byte> IMG_PROP_ANIMATION_DECODER_CREATE_TYPE_STRING => "SDL_image.animation_decoder.create.type"u8;
[NativeTypeName("#define IMG_PROP_ANIMATION_DECODER_CREATE_TIMEBASE_NUMERATOR_NUMBER \"SDL_image.animation_decoder.create.timebase.numerator\"")]
public static ReadOnlySpan<byte> IMG_PROP_ANIMATION_DECODER_CREATE_TIMEBASE_NUMERATOR_NUMBER => "SDL_image.animation_decoder.create.timebase.numerator"u8;
[NativeTypeName("#define IMG_PROP_ANIMATION_DECODER_CREATE_TIMEBASE_DENOMINATOR_NUMBER \"SDL_image.animation_decoder.create.timebase.denominator\"")]
public static ReadOnlySpan<byte> IMG_PROP_ANIMATION_DECODER_CREATE_TIMEBASE_DENOMINATOR_NUMBER => "SDL_image.animation_decoder.create.timebase.denominator"u8;
[NativeTypeName("#define IMG_PROP_METADATA_IGNORE_PROPS_BOOLEAN \"SDL_image.metadata.ignore_props\"")]
public static ReadOnlySpan<byte> IMG_PROP_METADATA_IGNORE_PROPS_BOOLEAN => "SDL_image.metadata.ignore_props"u8;
[NativeTypeName("#define IMG_PROP_METADATA_DESCRIPTION_STRING \"SDL_image.metadata.description\"")]
public static ReadOnlySpan<byte> IMG_PROP_METADATA_DESCRIPTION_STRING => "SDL_image.metadata.description"u8;
[NativeTypeName("#define IMG_PROP_METADATA_COPYRIGHT_STRING \"SDL_image.metadata.copyright\"")]
public static ReadOnlySpan<byte> IMG_PROP_METADATA_COPYRIGHT_STRING => "SDL_image.metadata.copyright"u8;
[NativeTypeName("#define IMG_PROP_METADATA_TITLE_STRING \"SDL_image.metadata.title\"")]
public static ReadOnlySpan<byte> IMG_PROP_METADATA_TITLE_STRING => "SDL_image.metadata.title"u8;
[NativeTypeName("#define IMG_PROP_METADATA_AUTHOR_STRING \"SDL_image.metadata.author\"")]
public static ReadOnlySpan<byte> IMG_PROP_METADATA_AUTHOR_STRING => "SDL_image.metadata.author"u8;
[NativeTypeName("#define IMG_PROP_METADATA_CREATION_TIME_STRING \"SDL_image.metadata.creation_time\"")]
public static ReadOnlySpan<byte> IMG_PROP_METADATA_CREATION_TIME_STRING => "SDL_image.metadata.creation_time"u8;
[NativeTypeName("#define IMG_PROP_METADATA_LOOP_COUNT_NUMBER \"SDL_image.metadata.loop_count\"")]
public static ReadOnlySpan<byte> IMG_PROP_METADATA_LOOP_COUNT_NUMBER => "SDL_image.metadata.loop_count"u8;
} }
} }

View File

@ -1,14 +1,25 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System;
namespace SDL namespace SDL
{ {
[Flags]
[Typedef]
public enum IMG_InitFlags : int
{
IMG_INIT_JPG = SDL3_image.IMG_INIT_JPG,
IMG_INIT_PNG = SDL3_image.IMG_INIT_PNG,
IMG_INIT_TIF = SDL3_image.IMG_INIT_TIF,
IMG_INIT_WEBP = SDL3_image.IMG_INIT_WEBP,
IMG_INIT_JXL = SDL3_image.IMG_INIT_JXL,
IMG_INIT_AVIF = SDL3_image.IMG_INIT_AVIF,
}
public static unsafe partial class SDL3_image public static unsafe partial class SDL3_image
{ {
[Macro] [Constant]
public static bool SDL_IMAGE_VERSION_ATLEAST(int X, int Y, int Z) => public static readonly int SDL_IMAGE_VERSION = SDL3.SDL_VERSIONNUM(SDL_IMAGE_MAJOR_VERSION, SDL_IMAGE_MINOR_VERSION, SDL_IMAGE_MICRO_VERSION);
((SDL_IMAGE_MAJOR_VERSION >= X) &&
(SDL_IMAGE_MAJOR_VERSION > X || SDL_IMAGE_MINOR_VERSION >= Y) &&
(SDL_IMAGE_MAJOR_VERSION > X || SDL_IMAGE_MINOR_VERSION > Y || SDL_IMAGE_MICRO_VERSION >= Z));
} }
} }

View File

@ -1,94 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks Condition=" '$(CI_DONT_TARGET_ANDROID)' != '1' ">net8.0;net8.0-android</TargetFrameworks>
<TargetFramework Condition=" '$(CI_DONT_TARGET_ANDROID)' == '1' ">net8.0</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<RootNamespace>SDL</RootNamespace>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn>$(NoWarn);SYSLIB1054;CA1401</NoWarn>
</PropertyGroup>
<PropertyGroup Label="NuGet">
<Authors>ppy Pty Ltd</Authors>
<Company>ppy Pty Ltd</Company>
<Copyright>Copyright (c) 2024 ppy Pty Ltd</Copyright>
<Product>ppy.SDL3_mixer-CS</Product>
<PackageId>ppy.SDL3_mixer-CS</PackageId>
<PackageReleaseNotes>Automated release.</PackageReleaseNotes>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/ppy/SDL3-CS</PackageProjectUrl>
<PackageReadmeFile>README_nuget.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/ppy/SDL3-CS</RepositoryUrl>
</PropertyGroup>
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)..\README_nuget.md" Pack="true" PackagePath="\"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SDL3-CS.SourceGeneration\SDL3-CS.SourceGeneration.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
<ProjectReference Include="..\SDL3-CS\SDL3-CS.csproj"/>
</ItemGroup>
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)..\native\win-x64\SDL3_mixer.dll">
<PackagePath>runtimes/win-x64/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\win-arm64\SDL3_mixer.dll">
<PackagePath>runtimes/win-arm64/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\win-x86\SDL3_mixer.dll">
<PackagePath>runtimes/win-x86/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\osx-x64\libSDL3_mixer.dylib">
<PackagePath>runtimes/osx-x64/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\osx-arm64\libSDL3_mixer.dylib">
<PackagePath>runtimes/osx-arm64/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\linux-x64\libSDL3_mixer.so">
<PackagePath>runtimes/linux-x64/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\linux-x86\libSDL3_mixer.so">
<PackagePath>runtimes/linux-x86/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\linux-arm64\libSDL3_mixer.so">
<PackagePath>runtimes/linux-arm64/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\linux-arm\libSDL3_mixer.so">
<PackagePath>runtimes/linux-arm/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\ios\SDL3_mixer.xcframework\**\*">
<PackagePath>runtimes/ios/native/SDL3_mixer.xcframework</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\android\armeabi-v7a\libSDL3_mixer.so">
<PackagePath>runtimes/android-arm/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\android\arm64-v8a\libSDL3_mixer.so">
<PackagePath>runtimes/android-arm64/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\android\x86_64\libSDL3_mixer.so">
<PackagePath>runtimes/android-x64/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\android\x86\libSDL3_mixer.so">
<PackagePath>runtimes/android-x86/native</PackagePath>
<Pack>true</Pack>
</None>
</ItemGroup>
</Project>

View File

@ -1,470 +0,0 @@
/*
<auto-generated/>
C# bindings for Simple DirectMedia Layer.
Original copyright notice of input files:
Simple DirectMedia Layer
Copyright (C) 1997-2024 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.
*/
using System;
using System.Runtime.InteropServices;
namespace SDL
{
public partial struct MIX_Mixer
{
}
public partial struct MIX_Audio
{
}
public partial struct MIX_Track
{
}
public partial struct MIX_Group
{
}
public partial struct MIX_StereoGains
{
public float left;
public float right;
}
public partial struct MIX_Point3D
{
public float x;
public float y;
public float z;
}
public partial struct MIX_AudioDecoder
{
}
public static unsafe partial class SDL3_mixer
{
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int MIX_Version();
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_Init();
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void MIX_Quit();
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int MIX_GetNumAudioDecoders();
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, EntryPoint = "MIX_GetAudioDecoder", ExactSpelling = true)]
[return: NativeTypeName("const char *")]
public static extern byte* Unsafe_MIX_GetAudioDecoder(int index);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern MIX_Mixer* MIX_CreateMixerDevice(SDL_AudioDeviceID devid, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* spec);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern MIX_Mixer* MIX_CreateMixer([NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* spec);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void MIX_DestroyMixer(MIX_Mixer* mixer);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_PropertiesID MIX_GetMixerProperties(MIX_Mixer* mixer);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_GetMixerFormat(MIX_Mixer* mixer, SDL_AudioSpec* spec);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern MIX_Audio* MIX_LoadAudio_IO(MIX_Mixer* mixer, SDL_IOStream* io, [NativeTypeName("bool")] SDLBool predecode, [NativeTypeName("bool")] SDLBool closeio);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern MIX_Audio* MIX_LoadAudio(MIX_Mixer* mixer, [NativeTypeName("const char *")] byte* path, [NativeTypeName("bool")] SDLBool predecode);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern MIX_Audio* MIX_LoadAudioWithProperties(SDL_PropertiesID props);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern MIX_Audio* MIX_LoadRawAudio_IO(MIX_Mixer* mixer, SDL_IOStream* io, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* spec, [NativeTypeName("bool")] SDLBool closeio);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern MIX_Audio* MIX_LoadRawAudio(MIX_Mixer* mixer, [NativeTypeName("const void *")] IntPtr data, [NativeTypeName("size_t")] nuint datalen, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* spec);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern MIX_Audio* MIX_LoadRawAudioNoCopy(MIX_Mixer* mixer, [NativeTypeName("const void *")] IntPtr data, [NativeTypeName("size_t")] nuint datalen, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* spec, [NativeTypeName("bool")] SDLBool free_when_done);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern MIX_Audio* MIX_CreateSineWaveAudio(MIX_Mixer* mixer, int hz, float amplitude);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_PropertiesID MIX_GetAudioProperties(MIX_Audio* audio);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Sint64")]
public static extern long MIX_GetAudioDuration(MIX_Audio* audio);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_GetAudioFormat(MIX_Audio* audio, SDL_AudioSpec* spec);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void MIX_DestroyAudio(MIX_Audio* audio);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern MIX_Track* MIX_CreateTrack(MIX_Mixer* mixer);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void MIX_DestroyTrack(MIX_Track* track);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_PropertiesID MIX_GetTrackProperties(MIX_Track* track);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern MIX_Mixer* MIX_GetTrackMixer(MIX_Track* track);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_SetTrackAudio(MIX_Track* track, MIX_Audio* audio);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_SetTrackAudioStream(MIX_Track* track, SDL_AudioStream* stream);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_SetTrackIOStream(MIX_Track* track, SDL_IOStream* io, [NativeTypeName("bool")] SDLBool closeio);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_SetTrackRawIOStream(MIX_Track* track, SDL_IOStream* io, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* spec, [NativeTypeName("bool")] SDLBool closeio);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_TagTrack(MIX_Track* track, [NativeTypeName("const char *")] byte* tag);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void MIX_UntagTrack(MIX_Track* track, [NativeTypeName("const char *")] byte* tag);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_SetTrackPlaybackPosition(MIX_Track* track, [NativeTypeName("Sint64")] long frames);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Sint64")]
public static extern long MIX_GetTrackPlaybackPosition(MIX_Track* track);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_TrackLooping(MIX_Track* track);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern MIX_Audio* MIX_GetTrackAudio(MIX_Track* track);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_AudioStream* MIX_GetTrackAudioStream(MIX_Track* track);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Sint64")]
public static extern long MIX_GetTrackRemaining(MIX_Track* track);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Sint64")]
public static extern long MIX_TrackMSToFrames(MIX_Track* track, [NativeTypeName("Sint64")] long ms);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Sint64")]
public static extern long MIX_TrackFramesToMS(MIX_Track* track, [NativeTypeName("Sint64")] long frames);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Sint64")]
public static extern long MIX_AudioMSToFrames(MIX_Audio* audio, [NativeTypeName("Sint64")] long ms);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Sint64")]
public static extern long MIX_AudioFramesToMS(MIX_Audio* audio, [NativeTypeName("Sint64")] long frames);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Sint64")]
public static extern long MIX_MSToFrames(int sample_rate, [NativeTypeName("Sint64")] long ms);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Sint64")]
public static extern long MIX_FramesToMS(int sample_rate, [NativeTypeName("Sint64")] long frames);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_PlayTrack(MIX_Track* track, SDL_PropertiesID options);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_PlayTag(MIX_Mixer* mixer, [NativeTypeName("const char *")] byte* tag, SDL_PropertiesID options);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_PlayAudio(MIX_Mixer* mixer, MIX_Audio* audio);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_StopTrack(MIX_Track* track, [NativeTypeName("Sint64")] long fade_out_frames);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_StopAllTracks(MIX_Mixer* mixer, [NativeTypeName("Sint64")] long fade_out_ms);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_StopTag(MIX_Mixer* mixer, [NativeTypeName("const char *")] byte* tag, [NativeTypeName("Sint64")] long fade_out_ms);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_PauseTrack(MIX_Track* track);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_PauseAllTracks(MIX_Mixer* mixer);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_PauseTag(MIX_Mixer* mixer, [NativeTypeName("const char *")] byte* tag);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_ResumeTrack(MIX_Track* track);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_ResumeAllTracks(MIX_Mixer* mixer);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_ResumeTag(MIX_Mixer* mixer, [NativeTypeName("const char *")] byte* tag);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_TrackPlaying(MIX_Track* track);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_TrackPaused(MIX_Track* track);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_SetMasterGain(MIX_Mixer* mixer, float gain);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern float MIX_GetMasterGain(MIX_Mixer* mixer);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_SetTrackGain(MIX_Track* track, float gain);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern float MIX_GetTrackGain(MIX_Track* track);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_SetTagGain(MIX_Mixer* mixer, [NativeTypeName("const char *")] byte* tag, float gain);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_SetTrackFrequencyRatio(MIX_Track* track, float ratio);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern float MIX_GetTrackFrequencyRatio(MIX_Track* track);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_SetTrackOutputChannelMap(MIX_Track* track, [NativeTypeName("const int *")] int* chmap, int count);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_SetTrackStereo(MIX_Track* track, [NativeTypeName("const MIX_StereoGains *")] MIX_StereoGains* gains);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_SetTrack3DPosition(MIX_Track* track, [NativeTypeName("const MIX_Point3D *")] MIX_Point3D* position);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_GetTrack3DPosition(MIX_Track* track, MIX_Point3D* position);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern MIX_Group* MIX_CreateGroup(MIX_Mixer* mixer);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void MIX_DestroyGroup(MIX_Group* group);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_PropertiesID MIX_GetGroupProperties(MIX_Group* group);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern MIX_Mixer* MIX_GetGroupMixer(MIX_Group* group);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_SetTrackGroup(MIX_Track* track, MIX_Group* group);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_SetTrackStoppedCallback(MIX_Track* track, [NativeTypeName("MIX_TrackStoppedCallback")] delegate* unmanaged[Cdecl]<IntPtr, MIX_Track*, void> cb, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_SetTrackRawCallback(MIX_Track* track, [NativeTypeName("MIX_TrackMixCallback")] delegate* unmanaged[Cdecl]<IntPtr, MIX_Track*, SDL_AudioSpec*, float*, int, void> cb, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_SetTrackCookedCallback(MIX_Track* track, [NativeTypeName("MIX_TrackMixCallback")] delegate* unmanaged[Cdecl]<IntPtr, MIX_Track*, SDL_AudioSpec*, float*, int, void> cb, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_SetGroupPostMixCallback(MIX_Group* group, [NativeTypeName("MIX_GroupMixCallback")] delegate* unmanaged[Cdecl]<IntPtr, MIX_Group*, SDL_AudioSpec*, float*, int, void> cb, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_SetPostMixCallback(MIX_Mixer* mixer, [NativeTypeName("MIX_PostMixCallback")] delegate* unmanaged[Cdecl]<IntPtr, MIX_Mixer*, SDL_AudioSpec*, float*, int, void> cb, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_Generate(MIX_Mixer* mixer, [NativeTypeName("void*")] IntPtr buffer, int buflen);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern MIX_AudioDecoder* MIX_CreateAudioDecoder([NativeTypeName("const char *")] byte* path, SDL_PropertiesID props);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern MIX_AudioDecoder* MIX_CreateAudioDecoder_IO(SDL_IOStream* io, [NativeTypeName("bool")] SDLBool closeio, SDL_PropertiesID props);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void MIX_DestroyAudioDecoder(MIX_AudioDecoder* audiodecoder);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_PropertiesID MIX_GetAudioDecoderProperties(MIX_AudioDecoder* audiodecoder);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool MIX_GetAudioDecoderFormat(MIX_AudioDecoder* audiodecoder, SDL_AudioSpec* spec);
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int MIX_DecodeAudio(MIX_AudioDecoder* audiodecoder, [NativeTypeName("void*")] IntPtr buffer, int buflen, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* spec);
[NativeTypeName("#define SDL_MIXER_MAJOR_VERSION 3")]
public const int SDL_MIXER_MAJOR_VERSION = 3;
[NativeTypeName("#define SDL_MIXER_MINOR_VERSION 1")]
public const int SDL_MIXER_MINOR_VERSION = 1;
[NativeTypeName("#define SDL_MIXER_MICRO_VERSION 0")]
public const int SDL_MIXER_MICRO_VERSION = 0;
[NativeTypeName("#define SDL_MIXER_VERSION SDL_VERSIONNUM(SDL_MIXER_MAJOR_VERSION, SDL_MIXER_MINOR_VERSION, SDL_MIXER_MICRO_VERSION)")]
public const int SDL_MIXER_VERSION = ((3) * 1000000 + (1) * 1000 + (0));
[NativeTypeName("#define MIX_PROP_AUDIO_LOAD_IOSTREAM_POINTER \"SDL_mixer.audio.load.iostream\"")]
public static ReadOnlySpan<byte> MIX_PROP_AUDIO_LOAD_IOSTREAM_POINTER => "SDL_mixer.audio.load.iostream"u8;
[NativeTypeName("#define MIX_PROP_AUDIO_LOAD_CLOSEIO_BOOLEAN \"SDL_mixer.audio.load.closeio\"")]
public static ReadOnlySpan<byte> MIX_PROP_AUDIO_LOAD_CLOSEIO_BOOLEAN => "SDL_mixer.audio.load.closeio"u8;
[NativeTypeName("#define MIX_PROP_AUDIO_LOAD_PREDECODE_BOOLEAN \"SDL_mixer.audio.load.predecode\"")]
public static ReadOnlySpan<byte> MIX_PROP_AUDIO_LOAD_PREDECODE_BOOLEAN => "SDL_mixer.audio.load.predecode"u8;
[NativeTypeName("#define MIX_PROP_AUDIO_LOAD_PREFERRED_MIXER_POINTER \"SDL_mixer.audio.load.preferred_mixer\"")]
public static ReadOnlySpan<byte> MIX_PROP_AUDIO_LOAD_PREFERRED_MIXER_POINTER => "SDL_mixer.audio.load.preferred_mixer"u8;
[NativeTypeName("#define MIX_PROP_AUDIO_LOAD_SKIP_METADATA_TAGS_BOOLEAN \"SDL_mixer.audio.load.skip_metadata_tags\"")]
public static ReadOnlySpan<byte> MIX_PROP_AUDIO_LOAD_SKIP_METADATA_TAGS_BOOLEAN => "SDL_mixer.audio.load.skip_metadata_tags"u8;
[NativeTypeName("#define MIX_PROP_AUDIO_DECODER_STRING \"SDL_mixer.audio.decoder\"")]
public static ReadOnlySpan<byte> MIX_PROP_AUDIO_DECODER_STRING => "SDL_mixer.audio.decoder"u8;
[NativeTypeName("#define MIX_PROP_METADATA_TITLE_STRING \"SDL_mixer.metadata.title\"")]
public static ReadOnlySpan<byte> MIX_PROP_METADATA_TITLE_STRING => "SDL_mixer.metadata.title"u8;
[NativeTypeName("#define MIX_PROP_METADATA_ARTIST_STRING \"SDL_mixer.metadata.artist\"")]
public static ReadOnlySpan<byte> MIX_PROP_METADATA_ARTIST_STRING => "SDL_mixer.metadata.artist"u8;
[NativeTypeName("#define MIX_PROP_METADATA_ALBUM_STRING \"SDL_mixer.metadata.album\"")]
public static ReadOnlySpan<byte> MIX_PROP_METADATA_ALBUM_STRING => "SDL_mixer.metadata.album"u8;
[NativeTypeName("#define MIX_PROP_METADATA_COPYRIGHT_STRING \"SDL_mixer.metadata.copyright\"")]
public static ReadOnlySpan<byte> MIX_PROP_METADATA_COPYRIGHT_STRING => "SDL_mixer.metadata.copyright"u8;
[NativeTypeName("#define MIX_PROP_METADATA_TRACK_NUMBER \"SDL_mixer.metadata.track\"")]
public static ReadOnlySpan<byte> MIX_PROP_METADATA_TRACK_NUMBER => "SDL_mixer.metadata.track"u8;
[NativeTypeName("#define MIX_PROP_METADATA_TOTAL_TRACKS_NUMBER \"SDL_mixer.metadata.total_tracks\"")]
public static ReadOnlySpan<byte> MIX_PROP_METADATA_TOTAL_TRACKS_NUMBER => "SDL_mixer.metadata.total_tracks"u8;
[NativeTypeName("#define MIX_PROP_METADATA_YEAR_NUMBER \"SDL_mixer.metadata.year\"")]
public static ReadOnlySpan<byte> MIX_PROP_METADATA_YEAR_NUMBER => "SDL_mixer.metadata.year"u8;
[NativeTypeName("#define MIX_PROP_METADATA_DURATION_FRAMES_NUMBER \"SDL_mixer.metadata.duration_frames\"")]
public static ReadOnlySpan<byte> MIX_PROP_METADATA_DURATION_FRAMES_NUMBER => "SDL_mixer.metadata.duration_frames"u8;
[NativeTypeName("#define MIX_PROP_METADATA_DURATION_INFINITE_BOOLEAN \"SDL_mixer.metadata.duration_infinite\"")]
public static ReadOnlySpan<byte> MIX_PROP_METADATA_DURATION_INFINITE_BOOLEAN => "SDL_mixer.metadata.duration_infinite"u8;
[NativeTypeName("#define MIX_DURATION_UNKNOWN -1")]
public const int MIX_DURATION_UNKNOWN = -1;
[NativeTypeName("#define MIX_DURATION_INFINITE -2")]
public const int MIX_DURATION_INFINITE = -2;
[NativeTypeName("#define MIX_PROP_PLAY_LOOPS_NUMBER \"SDL_mixer.play.loops\"")]
public static ReadOnlySpan<byte> MIX_PROP_PLAY_LOOPS_NUMBER => "SDL_mixer.play.loops"u8;
[NativeTypeName("#define MIX_PROP_PLAY_MAX_FRAME_NUMBER \"SDL_mixer.play.max_frame\"")]
public static ReadOnlySpan<byte> MIX_PROP_PLAY_MAX_FRAME_NUMBER => "SDL_mixer.play.max_frame"u8;
[NativeTypeName("#define MIX_PROP_PLAY_MAX_MILLISECONDS_NUMBER \"SDL_mixer.play.max_milliseconds\"")]
public static ReadOnlySpan<byte> MIX_PROP_PLAY_MAX_MILLISECONDS_NUMBER => "SDL_mixer.play.max_milliseconds"u8;
[NativeTypeName("#define MIX_PROP_PLAY_START_FRAME_NUMBER \"SDL_mixer.play.start_frame\"")]
public static ReadOnlySpan<byte> MIX_PROP_PLAY_START_FRAME_NUMBER => "SDL_mixer.play.start_frame"u8;
[NativeTypeName("#define MIX_PROP_PLAY_START_MILLISECOND_NUMBER \"SDL_mixer.play.start_millisecond\"")]
public static ReadOnlySpan<byte> MIX_PROP_PLAY_START_MILLISECOND_NUMBER => "SDL_mixer.play.start_millisecond"u8;
[NativeTypeName("#define MIX_PROP_PLAY_LOOP_START_FRAME_NUMBER \"SDL_mixer.play.loop_start_frame\"")]
public static ReadOnlySpan<byte> MIX_PROP_PLAY_LOOP_START_FRAME_NUMBER => "SDL_mixer.play.loop_start_frame"u8;
[NativeTypeName("#define MIX_PROP_PLAY_LOOP_START_MILLISECOND_NUMBER \"SDL_mixer.play.loop_start_millisecond\"")]
public static ReadOnlySpan<byte> MIX_PROP_PLAY_LOOP_START_MILLISECOND_NUMBER => "SDL_mixer.play.loop_start_millisecond"u8;
[NativeTypeName("#define MIX_PROP_PLAY_FADE_IN_FRAMES_NUMBER \"SDL_mixer.play.fade_in_frames\"")]
public static ReadOnlySpan<byte> MIX_PROP_PLAY_FADE_IN_FRAMES_NUMBER => "SDL_mixer.play.fade_in_frames"u8;
[NativeTypeName("#define MIX_PROP_PLAY_FADE_IN_MILLISECONDS_NUMBER \"SDL_mixer.play.fade_in_milliseconds\"")]
public static ReadOnlySpan<byte> MIX_PROP_PLAY_FADE_IN_MILLISECONDS_NUMBER => "SDL_mixer.play.fade_in_milliseconds"u8;
[NativeTypeName("#define MIX_PROP_PLAY_APPEND_SILENCE_FRAMES_NUMBER \"SDL_mixer.play.append_silence_frames\"")]
public static ReadOnlySpan<byte> MIX_PROP_PLAY_APPEND_SILENCE_FRAMES_NUMBER => "SDL_mixer.play.append_silence_frames"u8;
[NativeTypeName("#define MIX_PROP_PLAY_APPEND_SILENCE_MILLISECONDS_NUMBER \"SDL_mixer.play.append_silence_milliseconds\"")]
public static ReadOnlySpan<byte> MIX_PROP_PLAY_APPEND_SILENCE_MILLISECONDS_NUMBER => "SDL_mixer.play.append_silence_milliseconds"u8;
}
}

View File

@ -1,19 +0,0 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using static SDL.SDL3;
namespace SDL
{
public static unsafe partial class SDL3_mixer
{
[Constant]
public static readonly SDL_AudioFormat MIX_DEFAULT_FORMAT = SDL_AUDIO_S16;
[Macro]
public static bool SDL_MIXER_VERSION_ATLEAST(int X, int Y, int Z) =>
((SDL_MIXER_MAJOR_VERSION >= X) &&
(SDL_MIXER_MAJOR_VERSION > X || SDL_MIXER_MINOR_VERSION >= Y) &&
(SDL_MIXER_MAJOR_VERSION > X || SDL_MIXER_MINOR_VERSION > Y || SDL_MIXER_MICRO_VERSION >= Z));
}
}

View File

@ -1,9 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks Condition=" '$(CI_DONT_TARGET_ANDROID)' != '1' ">net8.0;net8.0-android</TargetFrameworks> <TargetFramework>net8.0</TargetFramework>
<TargetFramework Condition=" '$(CI_DONT_TARGET_ANDROID)' == '1' ">net8.0</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<RootNamespace>SDL</RootNamespace> <RootNamespace>SDL</RootNamespace>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
@ -19,14 +17,9 @@
<PackageReleaseNotes>Automated release.</PackageReleaseNotes> <PackageReleaseNotes>Automated release.</PackageReleaseNotes>
<PackageLicenseExpression>MIT</PackageLicenseExpression> <PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/ppy/SDL3-CS</PackageProjectUrl> <PackageProjectUrl>https://github.com/ppy/SDL3-CS</PackageProjectUrl>
<PackageReadmeFile>README_nuget.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/ppy/SDL3-CS</RepositoryUrl> <RepositoryUrl>https://github.com/ppy/SDL3-CS</RepositoryUrl>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)..\README_nuget.md" Pack="true" PackagePath="\"/>
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\SDL3-CS.SourceGeneration\SDL3-CS.SourceGeneration.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/> <ProjectReference Include="..\SDL3-CS.SourceGeneration\SDL3-CS.SourceGeneration.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
<ProjectReference Include="..\SDL3-CS\SDL3-CS.csproj"/> <ProjectReference Include="..\SDL3-CS\SDL3-CS.csproj"/>
@ -69,8 +62,9 @@
<PackagePath>runtimes/linux-arm/native</PackagePath> <PackagePath>runtimes/linux-arm/native</PackagePath>
<Pack>true</Pack> <Pack>true</Pack>
</None> </None>
<!-- Todo: Build these platforms with the CI script:
<None Include="$(MSBuildThisFileDirectory)..\native\ios\SDL3_ttf.xcframework\**\*"> <None Include="$(MSBuildThisFileDirectory)..\native\ios\SDL3_ttf.xcframework\**\*">
<PackagePath>runtimes/ios/native/SDL3_ttf.xcframework</PackagePath> <PackagePath>runtimes/ios/native/SDL3.xcframework</PackagePath>
<Pack>true</Pack> <Pack>true</Pack>
</None> </None>
<None Include="$(MSBuildThisFileDirectory)..\native\android\armeabi-v7a\libSDL3_ttf.so"> <None Include="$(MSBuildThisFileDirectory)..\native\android\armeabi-v7a\libSDL3_ttf.so">
@ -89,6 +83,7 @@
<PackagePath>runtimes/android-x86/native</PackagePath> <PackagePath>runtimes/android-x86/native</PackagePath>
<Pack>true</Pack> <Pack>true</Pack>
</None> </None>
-->
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -42,14 +42,12 @@ namespace SDL
public SDL_Rect rect; public SDL_Rect rect;
} }
public unsafe partial struct TTF_CopyOperation public partial struct TTF_CopyOperation
{ {
public TTF_DrawCommand cmd; public TTF_DrawCommand cmd;
public int text_offset; public int text_offset;
public TTF_Font* glyph_font;
[NativeTypeName("Uint32")] [NativeTypeName("Uint32")]
public uint glyph_index; public uint glyph_index;

View File

@ -32,16 +32,6 @@ namespace SDL
{ {
} }
public enum TTF_HintingFlags
{
TTF_HINTING_INVALID = -1,
TTF_HINTING_NORMAL,
TTF_HINTING_LIGHT,
TTF_HINTING_MONO,
TTF_HINTING_NONE,
TTF_HINTING_LIGHT_SUBPIXEL,
}
public enum TTF_HorizontalAlignment public enum TTF_HorizontalAlignment
{ {
TTF_HORIZONTAL_ALIGN_INVALID = -1, TTF_HORIZONTAL_ALIGN_INVALID = -1,
@ -52,21 +42,12 @@ namespace SDL
public enum TTF_Direction public enum TTF_Direction
{ {
TTF_DIRECTION_INVALID = 0, TTF_DIRECTION_LTR = 0,
TTF_DIRECTION_LTR = 4,
TTF_DIRECTION_RTL, TTF_DIRECTION_RTL,
TTF_DIRECTION_TTB, TTF_DIRECTION_TTB,
TTF_DIRECTION_BTT, TTF_DIRECTION_BTT,
} }
public enum TTF_ImageType
{
TTF_IMAGE_INVALID,
TTF_IMAGE_ALPHA,
TTF_IMAGE_COLOR,
TTF_IMAGE_SDF,
}
public partial struct TTF_TextEngine public partial struct TTF_TextEngine
{ {
} }
@ -87,33 +68,6 @@ namespace SDL
public TTF_TextData* @internal; public TTF_TextData* @internal;
} }
public unsafe partial struct TTF_GPUAtlasDrawSequence
{
public SDL_GPUTexture* atlas_texture;
public SDL_FPoint* xy;
public SDL_FPoint* uv;
public int num_vertices;
public int* indices;
public int num_indices;
public TTF_ImageType image_type;
[NativeTypeName("struct TTF_GPUAtlasDrawSequence *")]
public TTF_GPUAtlasDrawSequence* next;
}
public enum TTF_GPUTextEngineWinding
{
TTF_GPU_TEXTENGINE_WINDING_INVALID = -1,
TTF_GPU_TEXTENGINE_WINDING_CLOCKWISE,
TTF_GPU_TEXTENGINE_WINDING_COUNTER_CLOCKWISE,
}
public partial struct TTF_SubString public partial struct TTF_SubString
{ {
public TTF_SubStringFlags flags; public TTF_SubStringFlags flags;
@ -153,9 +107,6 @@ namespace SDL
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern TTF_Font* TTF_OpenFontWithProperties(SDL_PropertiesID props); public static extern TTF_Font* TTF_OpenFontWithProperties(SDL_PropertiesID props);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern TTF_Font* TTF_CopyFont(TTF_Font* existing_font);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_PropertiesID TTF_GetFontProperties(TTF_Font* font); public static extern SDL_PropertiesID TTF_GetFontProperties(TTF_Font* font);
@ -163,16 +114,6 @@ namespace SDL
[return: NativeTypeName("Uint32")] [return: NativeTypeName("Uint32")]
public static extern uint TTF_GetFontGeneration(TTF_Font* font); public static extern uint TTF_GetFontGeneration(TTF_Font* font);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool TTF_AddFallbackFont(TTF_Font* font, TTF_Font* fallback);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void TTF_RemoveFallbackFont(TTF_Font* font, TTF_Font* fallback);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void TTF_ClearFallbackFonts(TTF_Font* font);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
public static extern SDLBool TTF_SetFontSize(TTF_Font* font, float ptsize); public static extern SDLBool TTF_SetFontSize(TTF_Font* font, float ptsize);
@ -189,10 +130,10 @@ namespace SDL
public static extern SDLBool TTF_GetFontDPI(TTF_Font* font, int* hdpi, int* vdpi); public static extern SDLBool TTF_GetFontDPI(TTF_Font* font, int* hdpi, int* vdpi);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void TTF_SetFontStyle(TTF_Font* font, TTF_FontStyleFlags style); public static extern void TTF_SetFontStyle(TTF_Font* font, int style);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern TTF_FontStyleFlags TTF_GetFontStyle([NativeTypeName("const TTF_Font *")] TTF_Font* font); public static extern int TTF_GetFontStyle([NativeTypeName("const TTF_Font *")] TTF_Font* font);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
@ -202,13 +143,10 @@ namespace SDL
public static extern int TTF_GetFontOutline([NativeTypeName("const TTF_Font *")] TTF_Font* font); public static extern int TTF_GetFontOutline([NativeTypeName("const TTF_Font *")] TTF_Font* font);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void TTF_SetFontHinting(TTF_Font* font, TTF_HintingFlags hinting); public static extern void TTF_SetFontHinting(TTF_Font* font, int hinting);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int TTF_GetNumFontFaces([NativeTypeName("const TTF_Font *")] TTF_Font* font); public static extern int TTF_GetFontHinting([NativeTypeName("const TTF_Font *")] TTF_Font* font);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern TTF_HintingFlags TTF_GetFontHinting([NativeTypeName("const TTF_Font *")] TTF_Font* font);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
@ -218,9 +156,6 @@ namespace SDL
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
public static extern SDLBool TTF_GetFontSDF([NativeTypeName("const TTF_Font *")] TTF_Font* font); public static extern SDLBool TTF_GetFontSDF([NativeTypeName("const TTF_Font *")] TTF_Font* font);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int TTF_GetFontWeight([NativeTypeName("const TTF_Font *")] TTF_Font* font);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void TTF_SetFontWrapAlignment(TTF_Font* font, TTF_HorizontalAlignment align); public static extern void TTF_SetFontWrapAlignment(TTF_Font* font, TTF_HorizontalAlignment align);
@ -257,13 +192,22 @@ namespace SDL
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
public static extern SDLBool TTF_FontIsScalable([NativeTypeName("const TTF_Font *")] TTF_Font* font); public static extern SDLBool TTF_FontIsScalable([NativeTypeName("const TTF_Font *")] TTF_Font* font);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontFamilyName", ExactSpelling = true)] [DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("const char *")] [return: NativeTypeName("const char *")]
public static extern byte* Unsafe_TTF_GetFontFamilyName([NativeTypeName("const TTF_Font *")] TTF_Font* font); public static extern byte* TTF_GetFontFamilyName([NativeTypeName("const TTF_Font *")] TTF_Font* font);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, EntryPoint = "TTF_GetFontStyleName", ExactSpelling = true)] [DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("const char *")] [return: NativeTypeName("const char *")]
public static extern byte* Unsafe_TTF_GetFontStyleName([NativeTypeName("const TTF_Font *")] TTF_Font* font); public static extern byte* TTF_GetFontStyleName([NativeTypeName("const TTF_Font *")] TTF_Font* font);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* TTF_RenderText_Solid(TTF_Font* font, [NativeTypeName("const char *")] byte* text, [NativeTypeName("size_t")] nuint length, SDL_Color fg);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* TTF_RenderText_Solid_Wrapped(TTF_Font* font, [NativeTypeName("const char *")] byte* text, [NativeTypeName("size_t")] nuint length, SDL_Color fg, int wrapLength);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* TTF_RenderGlyph_Solid(TTF_Font* font, [NativeTypeName("Uint32")] uint ch, SDL_Color fg);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
@ -274,29 +218,11 @@ namespace SDL
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
public static extern SDLBool TTF_SetFontCharSpacing(TTF_Font* font, int spacing); public static extern SDLBool TTF_SetFontScript(TTF_Font* font, [NativeTypeName("const char *")] byte* script);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int TTF_GetFontCharSpacing(TTF_Font* font);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]
public static extern uint TTF_StringToTag([NativeTypeName("const char *")] byte* @string);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void TTF_TagToString([NativeTypeName("Uint32")] uint tag, [NativeTypeName("char *")] byte* @string, [NativeTypeName("size_t")] nuint size);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
public static extern SDLBool TTF_SetFontScript(TTF_Font* font, [NativeTypeName("Uint32")] uint script); public static extern SDLBool TTF_GetGlyphScript([NativeTypeName("Uint32")] uint ch, [NativeTypeName("char *")] byte* script, [NativeTypeName("size_t")] nuint script_size);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]
public static extern uint TTF_GetFontScript(TTF_Font* font);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]
public static extern uint TTF_GetGlyphScript([NativeTypeName("Uint32")] uint ch);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
@ -307,10 +233,10 @@ namespace SDL
public static extern SDLBool TTF_FontHasGlyph(TTF_Font* font, [NativeTypeName("Uint32")] uint ch); public static extern SDLBool TTF_FontHasGlyph(TTF_Font* font, [NativeTypeName("Uint32")] uint ch);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* TTF_GetGlyphImage(TTF_Font* font, [NativeTypeName("Uint32")] uint ch, TTF_ImageType* image_type); public static extern SDL_Surface* TTF_GetGlyphImage(TTF_Font* font, [NativeTypeName("Uint32")] uint ch);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* TTF_GetGlyphImageForIndex(TTF_Font* font, [NativeTypeName("Uint32")] uint glyph_index, TTF_ImageType* image_type); public static extern SDL_Surface* TTF_GetGlyphImageForIndex(TTF_Font* font, [NativeTypeName("Uint32")] uint glyph_index);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
@ -332,15 +258,6 @@ namespace SDL
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
public static extern SDLBool TTF_MeasureString(TTF_Font* font, [NativeTypeName("const char *")] byte* text, [NativeTypeName("size_t")] nuint length, int max_width, int* measured_width, [NativeTypeName("size_t *")] nuint* measured_length); public static extern SDLBool TTF_MeasureString(TTF_Font* font, [NativeTypeName("const char *")] byte* text, [NativeTypeName("size_t")] nuint length, int max_width, int* measured_width, [NativeTypeName("size_t *")] nuint* measured_length);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* TTF_RenderText_Solid(TTF_Font* font, [NativeTypeName("const char *")] byte* text, [NativeTypeName("size_t")] nuint length, SDL_Color fg);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* TTF_RenderText_Solid_Wrapped(TTF_Font* font, [NativeTypeName("const char *")] byte* text, [NativeTypeName("size_t")] nuint length, SDL_Color fg, int wrapLength);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* TTF_RenderGlyph_Solid(TTF_Font* font, [NativeTypeName("Uint32")] uint ch, SDL_Color fg);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* TTF_RenderText_Shaded(TTF_Font* font, [NativeTypeName("const char *")] byte* text, [NativeTypeName("size_t")] nuint length, SDL_Color fg, SDL_Color bg); public static extern SDL_Surface* TTF_RenderText_Shaded(TTF_Font* font, [NativeTypeName("const char *")] byte* text, [NativeTypeName("size_t")] nuint length, SDL_Color fg, SDL_Color bg);
@ -381,9 +298,6 @@ namespace SDL
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern TTF_TextEngine* TTF_CreateRendererTextEngine(SDL_Renderer* renderer); public static extern TTF_TextEngine* TTF_CreateRendererTextEngine(SDL_Renderer* renderer);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern TTF_TextEngine* TTF_CreateRendererTextEngineWithProperties(SDL_PropertiesID props);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
public static extern SDLBool TTF_DrawRendererText(TTF_Text* text, float x, float y); public static extern SDLBool TTF_DrawRendererText(TTF_Text* text, float x, float y);
@ -391,24 +305,6 @@ namespace SDL
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void TTF_DestroyRendererTextEngine(TTF_TextEngine* engine); public static extern void TTF_DestroyRendererTextEngine(TTF_TextEngine* engine);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern TTF_TextEngine* TTF_CreateGPUTextEngine(SDL_GPUDevice* device);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern TTF_TextEngine* TTF_CreateGPUTextEngineWithProperties(SDL_PropertiesID props);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern TTF_GPUAtlasDrawSequence* TTF_GetGPUTextDrawData(TTF_Text* text);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void TTF_DestroyGPUTextEngine(TTF_TextEngine* engine);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void TTF_SetGPUTextEngineWinding(TTF_TextEngine* engine, TTF_GPUTextEngineWinding winding);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern TTF_GPUTextEngineWinding TTF_GetGPUTextEngineWinding([NativeTypeName("const TTF_TextEngine *")] TTF_TextEngine* engine);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern TTF_Text* TTF_CreateText(TTF_TextEngine* engine, TTF_Font* font, [NativeTypeName("const char *")] byte* text, [NativeTypeName("size_t")] nuint length); public static extern TTF_Text* TTF_CreateText(TTF_TextEngine* engine, TTF_Font* font, [NativeTypeName("const char *")] byte* text, [NativeTypeName("size_t")] nuint length);
@ -429,21 +325,6 @@ namespace SDL
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern TTF_Font* TTF_GetTextFont(TTF_Text* text); public static extern TTF_Font* TTF_GetTextFont(TTF_Text* text);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool TTF_SetTextDirection(TTF_Text* text, TTF_Direction direction);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern TTF_Direction TTF_GetTextDirection(TTF_Text* text);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool TTF_SetTextScript(TTF_Text* text, [NativeTypeName("Uint32")] uint script);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]
public static extern uint TTF_GetTextScript(TTF_Text* text);
[DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport("SDL3_ttf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")] [return: NativeTypeName("bool")]
public static extern SDLBool TTF_SetTextColor(TTF_Text* text, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b, [NativeTypeName("Uint8")] byte a); public static extern SDLBool TTF_SetTextColor(TTF_Text* text, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b, [NativeTypeName("Uint8")] byte a);
@ -546,15 +427,12 @@ namespace SDL
[NativeTypeName("#define SDL_TTF_MAJOR_VERSION 3")] [NativeTypeName("#define SDL_TTF_MAJOR_VERSION 3")]
public const int SDL_TTF_MAJOR_VERSION = 3; public const int SDL_TTF_MAJOR_VERSION = 3;
[NativeTypeName("#define SDL_TTF_MINOR_VERSION 3")] [NativeTypeName("#define SDL_TTF_MINOR_VERSION 0")]
public const int SDL_TTF_MINOR_VERSION = 3; public const int SDL_TTF_MINOR_VERSION = 0;
[NativeTypeName("#define SDL_TTF_MICRO_VERSION 0")] [NativeTypeName("#define SDL_TTF_MICRO_VERSION 0")]
public const int SDL_TTF_MICRO_VERSION = 0; public const int SDL_TTF_MICRO_VERSION = 0;
[NativeTypeName("#define SDL_TTF_VERSION SDL_VERSIONNUM(SDL_TTF_MAJOR_VERSION, SDL_TTF_MINOR_VERSION, SDL_TTF_MICRO_VERSION)")]
public const int SDL_TTF_VERSION = ((3) * 1000000 + (3) * 1000 + (0));
[NativeTypeName("#define TTF_PROP_FONT_CREATE_FILENAME_STRING \"SDL_ttf.font.create.filename\"")] [NativeTypeName("#define TTF_PROP_FONT_CREATE_FILENAME_STRING \"SDL_ttf.font.create.filename\"")]
public static ReadOnlySpan<byte> TTF_PROP_FONT_CREATE_FILENAME_STRING => "SDL_ttf.font.create.filename"u8; public static ReadOnlySpan<byte> TTF_PROP_FONT_CREATE_FILENAME_STRING => "SDL_ttf.font.create.filename"u8;
@ -579,18 +457,6 @@ namespace SDL
[NativeTypeName("#define TTF_PROP_FONT_CREATE_VERTICAL_DPI_NUMBER \"SDL_ttf.font.create.vdpi\"")] [NativeTypeName("#define TTF_PROP_FONT_CREATE_VERTICAL_DPI_NUMBER \"SDL_ttf.font.create.vdpi\"")]
public static ReadOnlySpan<byte> TTF_PROP_FONT_CREATE_VERTICAL_DPI_NUMBER => "SDL_ttf.font.create.vdpi"u8; public static ReadOnlySpan<byte> TTF_PROP_FONT_CREATE_VERTICAL_DPI_NUMBER => "SDL_ttf.font.create.vdpi"u8;
[NativeTypeName("#define TTF_PROP_FONT_CREATE_EXISTING_FONT_POINTER \"SDL_ttf.font.create.existing_font\"")]
public static ReadOnlySpan<byte> TTF_PROP_FONT_CREATE_EXISTING_FONT_POINTER => "SDL_ttf.font.create.existing_font"u8;
[NativeTypeName("#define TTF_PROP_FONT_OUTLINE_LINE_CAP_NUMBER \"SDL_ttf.font.outline.line_cap\"")]
public static ReadOnlySpan<byte> TTF_PROP_FONT_OUTLINE_LINE_CAP_NUMBER => "SDL_ttf.font.outline.line_cap"u8;
[NativeTypeName("#define TTF_PROP_FONT_OUTLINE_LINE_JOIN_NUMBER \"SDL_ttf.font.outline.line_join\"")]
public static ReadOnlySpan<byte> TTF_PROP_FONT_OUTLINE_LINE_JOIN_NUMBER => "SDL_ttf.font.outline.line_join"u8;
[NativeTypeName("#define TTF_PROP_FONT_OUTLINE_MITER_LIMIT_NUMBER \"SDL_ttf.font.outline.miter_limit\"")]
public static ReadOnlySpan<byte> TTF_PROP_FONT_OUTLINE_MITER_LIMIT_NUMBER => "SDL_ttf.font.outline.miter_limit"u8;
[NativeTypeName("#define TTF_STYLE_NORMAL 0x00")] [NativeTypeName("#define TTF_STYLE_NORMAL 0x00")]
public const int TTF_STYLE_NORMAL = 0x00; public const int TTF_STYLE_NORMAL = 0x00;
@ -606,61 +472,31 @@ namespace SDL
[NativeTypeName("#define TTF_STYLE_STRIKETHROUGH 0x08")] [NativeTypeName("#define TTF_STYLE_STRIKETHROUGH 0x08")]
public const int TTF_STYLE_STRIKETHROUGH = 0x08; public const int TTF_STYLE_STRIKETHROUGH = 0x08;
[NativeTypeName("#define TTF_FONT_WEIGHT_THIN 100")] [NativeTypeName("#define TTF_HINTING_NORMAL 0")]
public const int TTF_FONT_WEIGHT_THIN = 100; public const int TTF_HINTING_NORMAL = 0;
[NativeTypeName("#define TTF_FONT_WEIGHT_EXTRA_LIGHT 200")] [NativeTypeName("#define TTF_HINTING_LIGHT 1")]
public const int TTF_FONT_WEIGHT_EXTRA_LIGHT = 200; public const int TTF_HINTING_LIGHT = 1;
[NativeTypeName("#define TTF_FONT_WEIGHT_LIGHT 300")] [NativeTypeName("#define TTF_HINTING_MONO 2")]
public const int TTF_FONT_WEIGHT_LIGHT = 300; public const int TTF_HINTING_MONO = 2;
[NativeTypeName("#define TTF_FONT_WEIGHT_NORMAL 400")] [NativeTypeName("#define TTF_HINTING_NONE 3")]
public const int TTF_FONT_WEIGHT_NORMAL = 400; public const int TTF_HINTING_NONE = 3;
[NativeTypeName("#define TTF_FONT_WEIGHT_MEDIUM 500")] [NativeTypeName("#define TTF_HINTING_LIGHT_SUBPIXEL 4")]
public const int TTF_FONT_WEIGHT_MEDIUM = 500; public const int TTF_HINTING_LIGHT_SUBPIXEL = 4;
[NativeTypeName("#define TTF_FONT_WEIGHT_SEMI_BOLD 600")] [NativeTypeName("#define TTF_SUBSTRING_TEXT_START 0x00000001")]
public const int TTF_FONT_WEIGHT_SEMI_BOLD = 600; public const int TTF_SUBSTRING_TEXT_START = 0x00000001;
[NativeTypeName("#define TTF_FONT_WEIGHT_BOLD 700")] [NativeTypeName("#define TTF_SUBSTRING_LINE_START 0x00000002")]
public const int TTF_FONT_WEIGHT_BOLD = 700; public const int TTF_SUBSTRING_LINE_START = 0x00000002;
[NativeTypeName("#define TTF_FONT_WEIGHT_EXTRA_BOLD 800")] [NativeTypeName("#define TTF_SUBSTRING_LINE_END 0x00000004")]
public const int TTF_FONT_WEIGHT_EXTRA_BOLD = 800; public const int TTF_SUBSTRING_LINE_END = 0x00000004;
[NativeTypeName("#define TTF_FONT_WEIGHT_BLACK 900")] [NativeTypeName("#define TTF_SUBSTRING_TEXT_END 0x00000008")]
public const int TTF_FONT_WEIGHT_BLACK = 900; public const int TTF_SUBSTRING_TEXT_END = 0x00000008;
[NativeTypeName("#define TTF_FONT_WEIGHT_EXTRA_BLACK 950")]
public const int TTF_FONT_WEIGHT_EXTRA_BLACK = 950;
[NativeTypeName("#define TTF_PROP_RENDERER_TEXT_ENGINE_RENDERER_POINTER \"SDL_ttf.renderer_text_engine.create.renderer\"")]
public static ReadOnlySpan<byte> TTF_PROP_RENDERER_TEXT_ENGINE_RENDERER_POINTER => "SDL_ttf.renderer_text_engine.create.renderer"u8;
[NativeTypeName("#define TTF_PROP_RENDERER_TEXT_ENGINE_ATLAS_TEXTURE_SIZE_NUMBER \"SDL_ttf.renderer_text_engine.create.atlas_texture_size\"")]
public static ReadOnlySpan<byte> TTF_PROP_RENDERER_TEXT_ENGINE_ATLAS_TEXTURE_SIZE_NUMBER => "SDL_ttf.renderer_text_engine.create.atlas_texture_size"u8;
[NativeTypeName("#define TTF_PROP_GPU_TEXT_ENGINE_DEVICE_POINTER \"SDL_ttf.gpu_text_engine.create.device\"")]
public static ReadOnlySpan<byte> TTF_PROP_GPU_TEXT_ENGINE_DEVICE_POINTER => "SDL_ttf.gpu_text_engine.create.device"u8;
[NativeTypeName("#define TTF_PROP_GPU_TEXT_ENGINE_ATLAS_TEXTURE_SIZE_NUMBER \"SDL_ttf.gpu_text_engine.create.atlas_texture_size\"")]
public static ReadOnlySpan<byte> TTF_PROP_GPU_TEXT_ENGINE_ATLAS_TEXTURE_SIZE_NUMBER => "SDL_ttf.gpu_text_engine.create.atlas_texture_size"u8;
[NativeTypeName("#define TTF_SUBSTRING_DIRECTION_MASK 0x000000FF")]
public const int TTF_SUBSTRING_DIRECTION_MASK = 0x000000FF;
[NativeTypeName("#define TTF_SUBSTRING_TEXT_START 0x00000100")]
public const int TTF_SUBSTRING_TEXT_START = 0x00000100;
[NativeTypeName("#define TTF_SUBSTRING_LINE_START 0x00000200")]
public const int TTF_SUBSTRING_LINE_START = 0x00000200;
[NativeTypeName("#define TTF_SUBSTRING_LINE_END 0x00000400")]
public const int TTF_SUBSTRING_LINE_END = 0x00000400;
[NativeTypeName("#define TTF_SUBSTRING_TEXT_END 0x00000800")]
public const int TTF_SUBSTRING_TEXT_END = 0x00000800;
} }
} }

View File

@ -1,12 +0,0 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
namespace SDL
{
#pragma warning disable CS0618 // Type or member is obsolete
public partial struct TTF_TextEngine : SDL3.ISDLInterface
#pragma warning restore CS0618 // Type or member is obsolete
{
uint SDL3.ISDLInterface.version { set => version = value; }
}
}

View File

@ -7,20 +7,8 @@ namespace SDL
{ {
[Flags] [Flags]
[Typedef] [Typedef]
public enum TTF_FontStyleFlags : UInt32 public enum TTF_SubStringFlags : int
{ {
TTF_STYLE_NORMAL = SDL3_ttf.TTF_STYLE_NORMAL,
TTF_STYLE_BOLD = SDL3_ttf.TTF_STYLE_BOLD,
TTF_STYLE_ITALIC = SDL3_ttf.TTF_STYLE_ITALIC,
TTF_STYLE_UNDERLINE = SDL3_ttf.TTF_STYLE_UNDERLINE,
TTF_STYLE_STRIKETHROUGH = SDL3_ttf.TTF_STYLE_STRIKETHROUGH,
}
[Flags]
[Typedef]
public enum TTF_SubStringFlags : UInt32
{
TTF_SUBSTRING_DIRECTION_MASK = SDL3_ttf.TTF_SUBSTRING_DIRECTION_MASK,
TTF_SUBSTRING_TEXT_START = SDL3_ttf.TTF_SUBSTRING_TEXT_START, TTF_SUBSTRING_TEXT_START = SDL3_ttf.TTF_SUBSTRING_TEXT_START,
TTF_SUBSTRING_LINE_START = SDL3_ttf.TTF_SUBSTRING_LINE_START, TTF_SUBSTRING_LINE_START = SDL3_ttf.TTF_SUBSTRING_LINE_START,
TTF_SUBSTRING_LINE_END = SDL3_ttf.TTF_SUBSTRING_LINE_END, TTF_SUBSTRING_LINE_END = SDL3_ttf.TTF_SUBSTRING_LINE_END,
@ -29,10 +17,7 @@ namespace SDL
public static unsafe partial class SDL3_ttf public static unsafe partial class SDL3_ttf
{ {
[Macro] [Constant]
public static bool SDL_TTF_VERSION_ATLEAST(int X, int Y, int Z) => public static readonly int SDL_TTF_VERSION = SDL3.SDL_VERSIONNUM(SDL_TTF_MAJOR_VERSION, SDL_TTF_MINOR_VERSION, SDL_TTF_MICRO_VERSION);
((SDL_TTF_MAJOR_VERSION >= X) &&
(SDL_TTF_MAJOR_VERSION > X || SDL_TTF_MINOR_VERSION >= Y) &&
(SDL_TTF_MAJOR_VERSION > X || SDL_TTF_MINOR_VERSION > Y || SDL_TTF_MICRO_VERSION >= Z));
} }
} }

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -4,6 +4,20 @@
<dict> <dict>
<key>AvailableLibraries</key> <key>AvailableLibraries</key>
<array> <array>
<dict>
<key>BinaryPath</key>
<string>SDL3.framework/SDL3</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>SDL3.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
<dict> <dict>
<key>BinaryPath</key> <key>BinaryPath</key>
<string>SDL3.framework/SDL3</string> <string>SDL3.framework/SDL3</string>
@ -21,27 +35,9 @@
<key>SupportedPlatformVariant</key> <key>SupportedPlatformVariant</key>
<string>simulator</string> <string>simulator</string>
</dict> </dict>
<dict>
<key>BinaryPath</key>
<string>SDL3.framework/SDL3</string>
<key>DebugSymbolsPath</key>
<string>dSYMs</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>SDL3.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
<dict> <dict>
<key>BinaryPath</key> <key>BinaryPath</key>
<string>SDL3.framework/Versions/A/SDL3</string> <string>SDL3.framework/Versions/A/SDL3</string>
<key>DebugSymbolsPath</key>
<string>dSYMs</string>
<key>LibraryIdentifier</key> <key>LibraryIdentifier</key>
<string>macos-arm64_x86_64</string> <string>macos-arm64_x86_64</string>
<key>LibraryPath</key> <key>LibraryPath</key>
@ -54,22 +50,6 @@
<key>SupportedPlatform</key> <key>SupportedPlatform</key>
<string>macos</string> <string>macos</string>
</dict> </dict>
<dict>
<key>BinaryPath</key>
<string>SDL3.framework/SDL3</string>
<key>DebugSymbolsPath</key>
<string>dSYMs</string>
<key>LibraryIdentifier</key>
<string>tvos-arm64</string>
<key>LibraryPath</key>
<string>SDL3.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>tvos</string>
</dict>
<dict> <dict>
<key>BinaryPath</key> <key>BinaryPath</key>
<string>SDL3.framework/SDL3</string> <string>SDL3.framework/SDL3</string>
@ -87,6 +67,20 @@
<key>SupportedPlatformVariant</key> <key>SupportedPlatformVariant</key>
<string>simulator</string> <string>simulator</string>
</dict> </dict>
<dict>
<key>BinaryPath</key>
<string>SDL3.framework/SDL3</string>
<key>LibraryIdentifier</key>
<string>tvos-arm64</string>
<key>LibraryPath</key>
<string>SDL3.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>tvos</string>
</dict>
</array> </array>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>XFWK</string> <string>XFWK</string>

View File

@ -1,90 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>BinaryPath</key>
<string>SDL3_image.framework/SDL3_image</string>
<key>LibraryIdentifier</key>
<string>tvos-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>SDL3_image.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>tvos</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>SDL3_image.framework/SDL3_image</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>SDL3_image.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>SDL3_image.framework/SDL3_image</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>SDL3_image.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>SDL3_image.framework/Versions/A/SDL3_image</string>
<key>LibraryIdentifier</key>
<string>macos-arm64_x86_64</string>
<key>LibraryPath</key>
<string>SDL3_image.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>macos</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>SDL3_image.framework/SDL3_image</string>
<key>LibraryIdentifier</key>
<string>tvos-arm64</string>
<key>LibraryPath</key>
<string>SDL3_image.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>tvos</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>

Some files were not shown because too many files have changed in this diff Show More