This commit is contained in:
Dan Balasescu 2025-09-11 08:31:17 +02:00 committed by GitHub
commit b2542fdacd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 464 additions and 20 deletions

View File

@ -119,7 +119,7 @@ jobs:
- name: Build (iOS)
run: |
modules=("SDL3" "SDL3_image" "SDL3_ttf" "SDL3_mixer")
modules=("SDL3" "SDL3_image" "SDL3_ttf" "SDL3_mixer" "SDL_shadercross")
architectures=("ios-arm64" "ios-arm64_x86_64-simulator")
for module in "${modules[@]}"; do

View File

@ -34,6 +34,7 @@ jobs:
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_mixer-CS/SDL3_mixer-CS.csproj -c Release /p:Version=$(git describe --exact-match --tags HEAD) -o artifacts
dotnet pack SDL3_shadercross-CS/SDL3_shadercross-CS.csproj -c Release /p:Version=$(git describe --exact-match --tags HEAD) -o artifacts
- name: Upload artifact
uses: actions/upload-artifact@v4

3
.gitmodules vendored
View File

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

1
External/SDL_shadercross vendored Submodule

@ -0,0 +1 @@
Subproject commit 4ce748310f57d405b4eb2a79fbbc7e974d6491ec

17
External/build.sh vendored
View File

@ -52,6 +52,7 @@ if [[ $BUILD_PLATFORM != 'Android' ]]; then
wayland-scanner++ \
wayland-protocols \
meson \
patchelf \
pkg-config$TARGET_APT_ARCH \
libasound2-dev$TARGET_APT_ARCH \
libdbus-1-dev$TARGET_APT_ARCH \
@ -115,6 +116,7 @@ if [[ $RUNNER_OS == 'Linux' ]]; then
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
git config --global --add safe.directory $PWD/SDL_shadercross
fi
CMAKE_INSTALL_PREFIX="$PWD/install_output"
@ -159,9 +161,20 @@ run_cmake() {
cmake --build build/ --config $BUILD_TYPE --verbose
cmake --install build/ --prefix $CMAKE_INSTALL_PREFIX --config $BUILD_TYPE
# Add loader rpath
if [[ $BUILD_PLATFORM == 'Linux' ]]; then
patchelf $CMAKE_INSTALL_PREFIX/$LIB_OUTPUT --add-rpath "\$ORIGIN"
elif [[ $BUILD_PLATFORM == 'macOS' ]]; then
install_name_tool $CMAKE_INSTALL_PREFIX/$LIB_OUTPUT -add_rpath "@loader_path"
fi
# Move build lib into correct folders
cp $CMAKE_INSTALL_PREFIX/$LIB_OUTPUT ../../native/$NATIVE_PATH
if [[ $LIB_NAME == 'SDL_shadercross' ]]; then
cp $CMAKE_INSTALL_PREFIX/${OUTPUT_LIB/SDL3variant/spirv-cross-c-shared} ../../native/$NATIVE_PATH
fi
popd
}
@ -178,4 +191,8 @@ run_cmake SDL_image ${OUTPUT_LIB/variant/_image} -DCMAKE_PREFIX_PATH=$CMAKE_PREF
# Fixing using the proposed solution causes more issues.
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
# Build SDL_shadercross
run_cmake SDL_shadercross ${OUTPUT_LIB/variant/_shadercross} -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH -DSDLSHADERCROSS_DXC=OFF -DSDLSHADERCROSS_INSTALL=ON -DSDLSHADERCROSS_SHARED=ON -DSDLSHADERCROSS_VENDORED=ON
popd

View File

@ -2,12 +2,13 @@
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) |
| 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) |
| [`SDL_shadercross`](https://github.com/libsdl-org/SDL_shadercross/tree/main) | `dotnet add package ppy.SDL3_shadercross-CS` | [![NuGet](https://img.shields.io/nuget/v/ppy.SDL3_shadercross-CS?label=nuget)](https://www.nuget.org/packages/ppy.SDL3_shadercross-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.
@ -19,6 +20,7 @@ Contributions to keep the bindings up-to-date with upstream changes are welcome.
| `SDL3_image-CS` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| `SDL3_ttf-CS` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| `SDL3_mixer-CS` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| `SDL3_shadercross-CS` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | |
## Generating bindings

View File

@ -1,11 +1,12 @@
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) |
| 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) |
| [`SDL_shadercross`](https://github.com/libsdl-org/SDL_shadercross/tree/main) | `dotnet add package ppy.SDL3_shadercross-CS` | [![NuGet](https://img.shields.io/nuget/v/ppy.SDL3_shadercross-CS?label=nuget)](https://www.nuget.org/packages/ppy.SDL3_shadercross-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.
@ -16,4 +17,5 @@ Contributions to keep the bindings up-to-date with upstream changes are welcome.
| `SDL3-CS` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| `SDL3_image-CS` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| `SDL3_ttf-CS` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| `SDL3_mixer-CS` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| `SDL3_mixer-CS` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| `SDL3_shadercross-CS` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | |

View File

@ -8,7 +8,8 @@
"SDL3-CS\\SDL3-CS.csproj",
"SDL3_image-CS\\SDL3_image-CS.csproj",
"SDL3_mixer-CS\\SDL3_mixer-CS.csproj",
"SDL3_ttf-CS\\SDL3_ttf-CS.csproj"
"SDL3_ttf-CS\\SDL3_ttf-CS.csproj",
"SDL3_shadercross-CS\\SDL3_shadercross-CS.csproj"
]
}
}
}

View File

@ -8,7 +8,8 @@
"SDL3-CS\\SDL3-CS.csproj",
"SDL3_image-CS\\SDL3_image-CS.csproj",
"SDL3_mixer-CS\\SDL3_mixer-CS.csproj",
"SDL3_ttf-CS\\SDL3_ttf-CS.csproj"
"SDL3_ttf-CS\\SDL3_ttf-CS.csproj",
"SDL3_shadercross-CS\\SDL3_shadercross-CS.csproj"
]
}
}
}

View File

@ -25,6 +25,7 @@
<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"/>
<ProjectReference Include="..\SDL3_shadercross-CS\SDL3_shadercross-CS.csproj"/>
</ItemGroup>
<ItemGroup>

View File

@ -8,7 +8,8 @@
"SDL3-CS\\SDL3-CS.csproj",
"SDL3_image-CS\\SDL3_image-CS.csproj",
"SDL3_mixer-CS\\SDL3_mixer-CS.csproj",
"SDL3_ttf-CS\\SDL3_ttf-CS.csproj"
"SDL3_ttf-CS\\SDL3_ttf-CS.csproj",
"SDL3_shadercross-CS\\SDL3_shadercross-CS.csproj"
]
}
}
}

View File

@ -31,6 +31,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SDL3_image-CS", "SDL3_image
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SDL3_mixer-CS", "SDL3_mixer-CS\SDL3_mixer-CS.csproj", "{421748C4-B51F-4B00-9637-566DBFD96E02}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SDL3_shadercross-CS", "SDL3_shadercross-CS\SDL3_shadercross-CS.csproj", "{E98595B3-A9FA-4217-9F22-1023A7C55C2B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -73,6 +75,10 @@ Global
{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
{E98595B3-A9FA-4217-9F22-1023A7C55C2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E98595B3-A9FA-4217-9F22-1023A7C55C2B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E98595B3-A9FA-4217-9F22-1023A7C55C2B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E98595B3-A9FA-4217-9F22-1023A7C55C2B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -9,3 +9,4 @@ using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("SDL3_ttf-CS")]
[assembly: InternalsVisibleTo("SDL3_image-CS")]
[assembly: InternalsVisibleTo("SDL3_mixer-CS")]
[assembly: InternalsVisibleTo("SDL3_shadercross-CS")]

View File

@ -0,0 +1,159 @@
<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_shadercross-CS</Product>
<PackageId>ppy.SDL3_shadercross-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_shadercross.dll">
<PackagePath>runtimes/win-x64/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\win-x64\spirv-cross-c-shared.dll">
<PackagePath>runtimes/win-x64/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\win-arm64\SDL3_shadercross.dll">
<PackagePath>runtimes/win-arm64/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\win-arm64\spirv-cross-c-shared.dll">
<PackagePath>runtimes/win-x64/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\win-x86\SDL3_shadercross.dll">
<PackagePath>runtimes/win-x86/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\win-x86\spirv-cross-c-shared.dll">
<PackagePath>runtimes/win-x64/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\osx-x64\libSDL3_shadercross.dylib">
<PackagePath>runtimes/osx-x64/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\osx-x64\libspirv-cross-c-shared.dylib">
<PackagePath>runtimes/osx-arm64/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\osx-arm64\libSDL3_shadercross.dylib">
<PackagePath>runtimes/osx-arm64/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\osx-arm64\libspirv-cross-c-shared.dylib">
<PackagePath>runtimes/osx-arm64/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\linux-x64\libSDL3_shadercross.so">
<PackagePath>runtimes/linux-x64/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\linux-x64\libspirv-cross-c-shared.so">
<PackagePath>runtimes/linux-x64/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\linux-x86\libSDL3_shadercross.so">
<PackagePath>runtimes/linux-x86/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\linux-x86\libspirv-cross-c-shared.so">
<PackagePath>runtimes/linux-x64/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\linux-arm64\libSDL3_shadercross.so">
<PackagePath>runtimes/linux-arm64/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\linux-arm64\libspirv-cross-c-shared.so">
<PackagePath>runtimes/linux-x64/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\linux-arm\libSDL3_shadercross.so">
<PackagePath>runtimes/linux-arm/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\linux-arm\libspirv-cross-c-shared.so">
<PackagePath>runtimes/linux-x64/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\ios\SDL3_shadercross.xcframework\**\*">
<PackagePath>runtimes/ios/native/SDL3_shadercross.xcframework</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\android\armeabi-v7a\libSDL3_shadercross.so">
<PackagePath>runtimes/android-arm/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\android\armeabi-v7a\libspirv-cross-c-shared.so">
<PackagePath>runtimes/android-arm/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\android\arm64-v8a\libSDL3_shadercross.so">
<PackagePath>runtimes/android-arm64/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\android\arm64-v8a\libspirv-cross-c-shared.so">
<PackagePath>runtimes/android-arm/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\android\x86_64\libSDL3_shadercross.so">
<PackagePath>runtimes/android-x64/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\android\x86_64\libspirv-cross-c-shared.so">
<PackagePath>runtimes/android-arm/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\android\x86\libSDL3_shadercross.so">
<PackagePath>runtimes/android-x86/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\android\x86\libspirv-cross-c-shared.so">
<PackagePath>runtimes/android-arm/native</PackagePath>
<Pack>true</Pack>
</None>
</ItemGroup>
</Project>

View File

@ -0,0 +1,248 @@
/*
<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 enum SDL_ShaderCross_IOVarType
{
SDL_SHADERCROSS_IOVAR_TYPE_UNKNOWN,
SDL_SHADERCROSS_IOVAR_TYPE_INT8,
SDL_SHADERCROSS_IOVAR_TYPE_UINT8,
SDL_SHADERCROSS_IOVAR_TYPE_INT16,
SDL_SHADERCROSS_IOVAR_TYPE_UINT16,
SDL_SHADERCROSS_IOVAR_TYPE_INT32,
SDL_SHADERCROSS_IOVAR_TYPE_UINT32,
SDL_SHADERCROSS_IOVAR_TYPE_INT64,
SDL_SHADERCROSS_IOVAR_TYPE_UINT64,
SDL_SHADERCROSS_IOVAR_TYPE_FLOAT16,
SDL_SHADERCROSS_IOVAR_TYPE_FLOAT32,
SDL_SHADERCROSS_IOVAR_TYPE_FLOAT64,
}
public enum SDL_ShaderCross_ShaderStage
{
SDL_SHADERCROSS_SHADERSTAGE_VERTEX,
SDL_SHADERCROSS_SHADERSTAGE_FRAGMENT,
SDL_SHADERCROSS_SHADERSTAGE_COMPUTE,
}
public unsafe partial struct SDL_ShaderCross_IOVarMetadata
{
[NativeTypeName("char *")]
public byte* name;
[NativeTypeName("Uint32")]
public uint location;
public SDL_ShaderCross_IOVarType vector_type;
[NativeTypeName("Uint32")]
public uint vector_size;
}
public unsafe partial struct SDL_ShaderCross_GraphicsShaderMetadata
{
[NativeTypeName("Uint32")]
public uint num_samplers;
[NativeTypeName("Uint32")]
public uint num_storage_textures;
[NativeTypeName("Uint32")]
public uint num_storage_buffers;
[NativeTypeName("Uint32")]
public uint num_uniform_buffers;
[NativeTypeName("Uint32")]
public uint num_inputs;
public SDL_ShaderCross_IOVarMetadata* inputs;
[NativeTypeName("Uint32")]
public uint num_outputs;
public SDL_ShaderCross_IOVarMetadata* outputs;
}
public partial struct SDL_ShaderCross_ComputePipelineMetadata
{
[NativeTypeName("Uint32")]
public uint num_samplers;
[NativeTypeName("Uint32")]
public uint num_readonly_storage_textures;
[NativeTypeName("Uint32")]
public uint num_readonly_storage_buffers;
[NativeTypeName("Uint32")]
public uint num_readwrite_storage_textures;
[NativeTypeName("Uint32")]
public uint num_readwrite_storage_buffers;
[NativeTypeName("Uint32")]
public uint num_uniform_buffers;
[NativeTypeName("Uint32")]
public uint threadcount_x;
[NativeTypeName("Uint32")]
public uint threadcount_y;
[NativeTypeName("Uint32")]
public uint threadcount_z;
}
public unsafe partial struct SDL_ShaderCross_SPIRV_Info
{
[NativeTypeName("const Uint8 *")]
public byte* bytecode;
[NativeTypeName("size_t")]
public nuint bytecode_size;
[NativeTypeName("const char *")]
public byte* entrypoint;
public SDL_ShaderCross_ShaderStage shader_stage;
[NativeTypeName("bool")]
public SDLBool enable_debug;
[NativeTypeName("const char *")]
public byte* name;
public SDL_PropertiesID props;
}
public unsafe partial struct SDL_ShaderCross_HLSL_Define
{
[NativeTypeName("char *")]
public byte* name;
[NativeTypeName("char *")]
public byte* value;
}
public unsafe partial struct SDL_ShaderCross_HLSL_Info
{
[NativeTypeName("const char *")]
public byte* source;
[NativeTypeName("const char *")]
public byte* entrypoint;
[NativeTypeName("const char *")]
public byte* include_dir;
public SDL_ShaderCross_HLSL_Define* defines;
public SDL_ShaderCross_ShaderStage shader_stage;
[NativeTypeName("bool")]
public SDLBool enable_debug;
[NativeTypeName("const char *")]
public byte* name;
public SDL_PropertiesID props;
}
public static unsafe partial class SDL3_shadercross
{
[DllImport("SDL3_shadercross", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ShaderCross_Init();
[DllImport("SDL3_shadercross", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_ShaderCross_Quit();
[DllImport("SDL3_shadercross", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_GPUShaderFormat SDL_ShaderCross_GetSPIRVShaderFormats();
[DllImport("SDL3_shadercross", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("void*")]
public static extern IntPtr SDL_ShaderCross_TranspileMSLFromSPIRV([NativeTypeName("const SDL_ShaderCross_SPIRV_Info *")] SDL_ShaderCross_SPIRV_Info* info);
[DllImport("SDL3_shadercross", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("void*")]
public static extern IntPtr SDL_ShaderCross_TranspileHLSLFromSPIRV([NativeTypeName("const SDL_ShaderCross_SPIRV_Info *")] SDL_ShaderCross_SPIRV_Info* info);
[DllImport("SDL3_shadercross", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("void*")]
public static extern IntPtr SDL_ShaderCross_CompileDXBCFromSPIRV([NativeTypeName("const SDL_ShaderCross_SPIRV_Info *")] SDL_ShaderCross_SPIRV_Info* info, [NativeTypeName("size_t *")] nuint* size);
[DllImport("SDL3_shadercross", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("void*")]
public static extern IntPtr SDL_ShaderCross_CompileDXILFromSPIRV([NativeTypeName("const SDL_ShaderCross_SPIRV_Info *")] SDL_ShaderCross_SPIRV_Info* info, [NativeTypeName("size_t *")] nuint* size);
[DllImport("SDL3_shadercross", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_GPUShader* SDL_ShaderCross_CompileGraphicsShaderFromSPIRV(SDL_GPUDevice* device, [NativeTypeName("const SDL_ShaderCross_SPIRV_Info *")] SDL_ShaderCross_SPIRV_Info* info, [NativeTypeName("const SDL_ShaderCross_GraphicsShaderMetadata *")] SDL_ShaderCross_GraphicsShaderMetadata* metadata, SDL_PropertiesID props);
[DllImport("SDL3_shadercross", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_GPUComputePipeline* SDL_ShaderCross_CompileComputePipelineFromSPIRV(SDL_GPUDevice* device, [NativeTypeName("const SDL_ShaderCross_SPIRV_Info *")] SDL_ShaderCross_SPIRV_Info* info, [NativeTypeName("const SDL_ShaderCross_ComputePipelineMetadata *")] SDL_ShaderCross_ComputePipelineMetadata* metadata, SDL_PropertiesID props);
[DllImport("SDL3_shadercross", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_ShaderCross_GraphicsShaderMetadata* SDL_ShaderCross_ReflectGraphicsSPIRV([NativeTypeName("const Uint8 *")] byte* bytecode, [NativeTypeName("size_t")] nuint bytecode_size, SDL_PropertiesID props);
[DllImport("SDL3_shadercross", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_ShaderCross_ComputePipelineMetadata* SDL_ShaderCross_ReflectComputeSPIRV([NativeTypeName("const Uint8 *")] byte* bytecode, [NativeTypeName("size_t")] nuint bytecode_size, SDL_PropertiesID props);
[DllImport("SDL3_shadercross", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_GPUShaderFormat SDL_ShaderCross_GetHLSLShaderFormats();
[DllImport("SDL3_shadercross", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("void*")]
public static extern IntPtr SDL_ShaderCross_CompileDXBCFromHLSL([NativeTypeName("const SDL_ShaderCross_HLSL_Info *")] SDL_ShaderCross_HLSL_Info* info, [NativeTypeName("size_t *")] nuint* size);
[DllImport("SDL3_shadercross", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("void*")]
public static extern IntPtr SDL_ShaderCross_CompileDXILFromHLSL([NativeTypeName("const SDL_ShaderCross_HLSL_Info *")] SDL_ShaderCross_HLSL_Info* info, [NativeTypeName("size_t *")] nuint* size);
[DllImport("SDL3_shadercross", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("void*")]
public static extern IntPtr SDL_ShaderCross_CompileSPIRVFromHLSL([NativeTypeName("const SDL_ShaderCross_HLSL_Info *")] SDL_ShaderCross_HLSL_Info* info, [NativeTypeName("size_t *")] nuint* size);
[NativeTypeName("#define SDL_SHADERCROSS_MAJOR_VERSION 3")]
public const int SDL_SHADERCROSS_MAJOR_VERSION = 3;
[NativeTypeName("#define SDL_SHADERCROSS_MINOR_VERSION 0")]
public const int SDL_SHADERCROSS_MINOR_VERSION = 0;
[NativeTypeName("#define SDL_SHADERCROSS_MICRO_VERSION 0")]
public const int SDL_SHADERCROSS_MICRO_VERSION = 0;
[NativeTypeName("#define SDL_SHADERCROSS_PROP_SPIRV_PSSL_COMPATIBILITY \"SDL.shadercross.spirv.pssl.compatibility\"")]
public static ReadOnlySpan<byte> SDL_SHADERCROSS_PROP_SPIRV_PSSL_COMPATIBILITY => "SDL.shadercross.spirv.pssl.compatibility"u8;
[NativeTypeName("#define SDL_SHADERCROSS_PROP_SPIRV_MSL_VERSION \"SDL.shadercross.spirv.msl.version\"")]
public static ReadOnlySpan<byte> SDL_SHADERCROSS_PROP_SPIRV_MSL_VERSION => "SDL.shadercross.spirv.msl.version"u8;
}
}