Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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 change: 1 addition & 0 deletions External/SDL_shadercross
Submodule SDL_shadercross added at 4ce748
17 changes: 17 additions & 0 deletions External/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
}

Expand All @@ -181,4 +194,8 @@ run_cmake SDL_image ${OUTPUT_LIB/variant/_image} -DCMAKE_PREFIX_PATH=$CMAKE_PREF
# See: https://github.com/libsdl-org/SDL_mixer/issues/745
run_cmake SDL_mixer ${OUTPUT_LIB/variant/_mixer} -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH -DSDLMIXER_MP3_MPG123=OFF -DSDLMIXER_FLAC_LIBFLAC=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

14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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

Expand Down
16 changes: 9 additions & 7 deletions README_nuget.md
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | |
5 changes: 3 additions & 2 deletions SDL3-CS.Android.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
}
}
5 changes: 3 additions & 2 deletions SDL3-CS.Desktop.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
}
}
1 change: 1 addition & 0 deletions SDL3-CS.Tests/SDL3-CS.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
5 changes: 3 additions & 2 deletions SDL3-CS.iOS.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
}
}
6 changes: 6 additions & 0 deletions SDL3-CS.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions SDL3-CS/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
[assembly: InternalsVisibleTo("SDL3_ttf-CS")]
[assembly: InternalsVisibleTo("SDL3_image-CS")]
[assembly: InternalsVisibleTo("SDL3_mixer-CS")]
[assembly: InternalsVisibleTo("SDL3_shadercross-CS")]
Loading
Loading