Compare commits
1 Commits
master
...
fix/missin
Author | SHA1 | Date | |
---|---|---|---|
|
16e15fdb2d |
1
.github/FUNDING.yml
vendored
Normal file
1
.github/FUNDING.yml
vendored
Normal file
@ -0,0 +1 @@
|
||||
github: [flibitijibibo]
|
9
.github/dependabot.yml
vendored
9
.github/dependabot.yml
vendored
@ -1,9 +0,0 @@
|
||||
version: 2
|
||||
updates:
|
||||
- directory: /
|
||||
package-ecosystem: github-actions
|
||||
reviewers:
|
||||
- marysaka
|
||||
- TSRBerry
|
||||
schedule:
|
||||
interval: daily
|
92
.github/workflows/build.yml
vendored
92
.github/workflows/build.yml
vendored
@ -1,92 +0,0 @@
|
||||
name: build-native
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
rev:
|
||||
description: 'Ryujinx/SDL commit to build (this has to be a full commit sha, otherwise it will not work)'
|
||||
required: true
|
||||
# schedule:
|
||||
# - cron: '0 0 * * *'
|
||||
env:
|
||||
BUILD_TYPE: Release
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: ${{ matrix.platform.name }}
|
||||
runs-on: ${{ matrix.platform.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform:
|
||||
- { name: win-x64, os: windows-latest, arch: x64 }
|
||||
# - { name: win-x86, os: windows-latest, arch: Win32 }
|
||||
- { name: win-arm64, os: windows-latest, arch: ARM64 }
|
||||
- { name: linux-x64, os: ubuntu-20.04, arch: amd64 }
|
||||
# - { name: linux-x86, os: ubuntu-20.04, arch: i386 }
|
||||
- { name: linux-arm64, os: ubuntu-20.04, arch: arm64 }
|
||||
- { name: osx-x64, os: macos-latest, arch: x86_64 }
|
||||
- { name: osx-arm64, os: macos-latest, arch: arm64 }
|
||||
steps:
|
||||
- name: Setup qemu static
|
||||
uses: docker/setup-qemu-action@v3
|
||||
if: runner.os == 'Linux'
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
repository: Ryujinx/SDL
|
||||
ref: ${{ github.event.inputs.rev }}
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
path: 'SDL2-CS'
|
||||
- name: Build and prepare release
|
||||
run: SDL2-CS/ci/run.sh $PWD $PWD/SDL2-CS/native/${{ matrix.platform.name }} ${{ matrix.platform.arch }}
|
||||
shell: bash
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ matrix.platform.name }}-binaries
|
||||
path: install_output
|
||||
- name: Create pull request
|
||||
uses: peter-evans/create-pull-request@v4
|
||||
with:
|
||||
commit-message: Update ${{ matrix.platform.name }} SDL binaries
|
||||
title: Update ${{ matrix.platform.name }} SDL binaries
|
||||
body: This PR has been auto-generated to update the ${{ matrix.platform.name }} SDL binaries.
|
||||
branch: update-${{ matrix.platform.name }}-binaries
|
||||
path: 'SDL2-CS'
|
||||
env:
|
||||
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
|
||||
|
||||
build-ios:
|
||||
name: ios
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
repository: Ryujinx/SDL
|
||||
ref: ${{ github.event.inputs.rev }}
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
path: 'SDL2-CS'
|
||||
- name: Build (iOS)
|
||||
run: xcodebuild -project Xcode/SDL/SDL.xcodeproj -scheme xcFramework-iOS -configuration Release
|
||||
- name: Prepare release directory (iOS)
|
||||
run: mkdir -p SDL2-CS/native/ios
|
||||
- name: Prepare release (iOS)
|
||||
run: |
|
||||
mkdir -p SDL2-CS/native/ios/SDL2.xcframework/ios-arm64/SDL2.framework;
|
||||
mkdir -p SDL2-CS/native/ios/SDL2.xcframework/ios-arm64_x86_64-simulator/SDL2.framework;
|
||||
cp Xcode/SDL/Products/SDL2.xcframework/Info.plist SDL2-CS/native/ios/SDL2.xcframework/Info.plist;
|
||||
cp Xcode/SDL/Products/SDL2.xcframework/ios-arm64/SDL2.framework/SDL2 SDL2-CS/native/ios/SDL2.xcframework/ios-arm64/SDL2.framework/SDL2;
|
||||
cp Xcode/SDL/Products/SDL2.xcframework/ios-arm64/SDL2.framework/Info.plist SDL2-CS/native/ios/SDL2.xcframework/ios-arm64/SDL2.framework/Info.plist;
|
||||
cp Xcode/SDL/Products/SDL2.xcframework/ios-arm64_x86_64-simulator/SDL2.framework/SDL2 SDL2-CS/native/ios/SDL2.xcframework/ios-arm64_x86_64-simulator/SDL2.framework/SDL2;
|
||||
cp Xcode/SDL/Products/SDL2.xcframework/ios-arm64_x86_64-simulator/SDL2.framework/Info.plist SDL2-CS/native/ios/SDL2.xcframework/ios-arm64_x86_64-simulator/SDL2.framework/Info.plist;
|
||||
- name: Create pull request
|
||||
uses: peter-evans/create-pull-request@v4
|
||||
with:
|
||||
commit-message: Update iOS SDL binaries
|
||||
title: Update iOS SDL binaries
|
||||
body: This PR has been auto-genereated to update the iOS SDL binaries
|
||||
branch: update-ios-binaries
|
||||
path: 'SDL2-CS'
|
||||
env:
|
||||
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
|
34
.github/workflows/ci.yml
vendored
34
.github/workflows/ci.yml
vendored
@ -1,34 +0,0 @@
|
||||
name: Build
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs: {}
|
||||
#push:
|
||||
# branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v3
|
||||
with:
|
||||
dotnet-version: 7.0.x
|
||||
- uses: nuget/setup-nuget@v1
|
||||
with:
|
||||
nuget-api-key: ${{ secrets.NUGET_API_KEY }}
|
||||
nuget-version: '6.x'
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore
|
||||
- name: Build
|
||||
run: dotnet build --no-restore
|
||||
- name: Test
|
||||
run: dotnet test --no-build --verbosity normal
|
||||
- name: Pack & Publish
|
||||
run: |
|
||||
dotnet pack --version-suffix "build${{ github.run_number }}" -c Release .\SDL2-CS.csproj -o .
|
||||
$file_to_publish = Get-ChildItem -Path $dir -Filter *.nupkg | Select -First 1
|
||||
echo $file_to_publish
|
||||
nuget push $file_to_publish -Source https://api.nuget.org/v3/index.json
|
58
.gitlab-ci.yml
Normal file
58
.gitlab-ci.yml
Normal file
@ -0,0 +1,58 @@
|
||||
stages:
|
||||
- build
|
||||
- package
|
||||
- deploy
|
||||
|
||||
build_net461:
|
||||
image: mono
|
||||
stage: build
|
||||
only:
|
||||
- schedules
|
||||
script:
|
||||
- ./gitlab-ci/build-net461.sh
|
||||
artifacts:
|
||||
paths:
|
||||
- bin/
|
||||
tags:
|
||||
- docker
|
||||
|
||||
build_netcore:
|
||||
image: microsoft/dotnet:2.1-sdk
|
||||
stage: build
|
||||
only:
|
||||
- schedules
|
||||
script:
|
||||
- ./gitlab-ci/build-netcore.sh
|
||||
artifacts:
|
||||
paths:
|
||||
- bin/
|
||||
tags:
|
||||
- docker
|
||||
|
||||
package_nuget:
|
||||
image: mono
|
||||
stage: package
|
||||
only:
|
||||
- schedules
|
||||
script:
|
||||
- ./gitlab-ci/package.sh
|
||||
dependencies:
|
||||
- build_net461
|
||||
- build_netcore
|
||||
artifacts:
|
||||
paths:
|
||||
- '*.nupkg'
|
||||
|
||||
deploy_nuget:
|
||||
image: mono
|
||||
stage: deploy
|
||||
only:
|
||||
- schedules
|
||||
script:
|
||||
- ./gitlab-ci/deploy.sh
|
||||
dependencies:
|
||||
- package_nuget
|
||||
environment:
|
||||
name: nuget
|
||||
url: http://nuget.org/
|
||||
|
32
Makefile
Normal file
32
Makefile
Normal file
@ -0,0 +1,32 @@
|
||||
# Makefile for SDL2#
|
||||
# Written by Ethan "flibitijibibo" Lee
|
||||
|
||||
# Source Lists
|
||||
SRC = \
|
||||
src/SDL2.cs \
|
||||
src/SDL2_image.cs \
|
||||
src/SDL2_mixer.cs \
|
||||
src/SDL2_ttf.cs
|
||||
|
||||
# Targets
|
||||
|
||||
debug: clean-debug
|
||||
mkdir -p bin/Debug
|
||||
cp app.config bin/Debug/SDL2-CS.dll.config
|
||||
mcs /unsafe -debug -out:bin/Debug/SDL2-CS.dll -target:library $(SRC)
|
||||
|
||||
clean-debug:
|
||||
rm -rf bin/Debug
|
||||
|
||||
release: clean-release
|
||||
mkdir -p bin/Release
|
||||
cp app.config bin/Release/SDL2-CS.dll.config
|
||||
mcs /unsafe -optimize -out:bin/Release/SDL2-CS.dll -target:library $(SRC)
|
||||
|
||||
clean-release:
|
||||
rm -rf bin/Release
|
||||
|
||||
clean: clean-debug clean-release
|
||||
rm -rf bin
|
||||
|
||||
all: debug release
|
1
README
1
README
@ -19,7 +19,6 @@ is written in a way that can be used for any general C# application.
|
||||
|
||||
The wrapper provides bindings for the following libraries:
|
||||
- SDL2
|
||||
- SDL2_gfx
|
||||
- SDL2_image
|
||||
- SDL2_mixer
|
||||
- SDL2_ttf
|
||||
|
30
SDL2-CS.Core.csproj
Normal file
30
SDL2-CS.Core.csproj
Normal file
@ -0,0 +1,30 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net40;netstandard2.0</TargetFrameworks>
|
||||
<Platforms>x64</Platforms>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<EnableDefaultItems>false</EnableDefaultItems>
|
||||
<AssemblyName>SDL2-CS</AssemblyName>
|
||||
<RootNamespace>SDL2</RootNamespace>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SDLSettingsPropsFilePath>$(SolutionDir)SDL2-CS.Settings.props</SDLSettingsPropsFilePath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(SDLSettingsPropsFilePath)" Condition="Exists('$(SDLSettingsPropsFilePath)')" />
|
||||
<Target Name="ValidatePropsFilePath" BeforeTargets="BeforeBuild">
|
||||
<Message Importance="High" Text="No property overrides found at '$(SDLSettingsPropsFilePath)'" Condition="!Exists('$(SDLSettingsPropsFilePath)')" />
|
||||
<Message Importance="High" Text="Loaded property overrides from '$(SDLSettingsPropsFilePath)'" Condition="Exists('$(SDLSettingsPropsFilePath)')" />
|
||||
</Target>
|
||||
<ItemGroup>
|
||||
<Compile Include="src\SDL2.cs" />
|
||||
<Compile Include="src\SDL2_image.cs" />
|
||||
<Compile Include="src\SDL2_mixer.cs" />
|
||||
<Compile Include="src\SDL2_ttf.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
</ItemGroup>
|
||||
</Project>
|
161
SDL2-CS.csproj
161
SDL2-CS.csproj
@ -1,62 +1,101 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<OutputType>Library</OutputType>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<AssemblyTitle>SDL2#</AssemblyTitle>
|
||||
<AssemblyName>SDL2-CS</AssemblyName>
|
||||
<Description>libSDL2 bindings for C#</Description>
|
||||
<RootNamespace>SDL2</RootNamespace>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<VersionPrefix>2.30.0</VersionPrefix>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="NuGet">
|
||||
<Authors>marysaka & ppy Pty Ltd & flibitijibibo</Authors>
|
||||
<Title>SDL2#</Title>
|
||||
<PackageId>Ryujinx.SDL2-CS</PackageId>
|
||||
<PackageProjectUrl>https://github.com/Ryujinx/SDL2-CS</PackageProjectUrl>
|
||||
<RepositoryUrl>https://github.com/Ryujinx/SDL2-CS</RepositoryUrl>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="$(MSBuildThisFileDirectory)native\win-x64\SDL2.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<PackagePath>runtimes/win-x64/native</PackagePath>
|
||||
<Pack>true</Pack>
|
||||
</Content>
|
||||
<Content Include="$(MSBuildThisFileDirectory)native\win-arm64\SDL2.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<PackagePath>runtimes/win-arm64/native</PackagePath>
|
||||
<Pack>true</Pack>
|
||||
</Content>
|
||||
<Content Include="$(MSBuildThisFileDirectory)native\osx-x64\libSDL2.dylib">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<PackagePath>runtimes/osx-x64/native</PackagePath>
|
||||
<Pack>true</Pack>
|
||||
</Content>
|
||||
<Content Include="$(MSBuildThisFileDirectory)native\osx-arm64\libSDL2.dylib">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<PackagePath>runtimes/osx-arm64/native</PackagePath>
|
||||
<Pack>true</Pack>
|
||||
</Content>
|
||||
<Content Include="$(MSBuildThisFileDirectory)native\linux-x64\libSDL2.so">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<PackagePath>runtimes/linux-x64/native</PackagePath>
|
||||
<Pack>true</Pack>
|
||||
</Content>
|
||||
<Content Include="$(MSBuildThisFileDirectory)native\linux-arm64\libSDL2.so">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<PackagePath>runtimes/linux-arm64/native</PackagePath>
|
||||
<Pack>true</Pack>
|
||||
</Content>
|
||||
<Content Include="$(MSBuildThisFileDirectory)native\ios\**\*">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<PackagePath>runtimes/ios/native</PackagePath>
|
||||
<Pack>true</Pack>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="app.config">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{85480198-8711-4355-830E-72FD794AD3F6}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>SDL2</RootNamespace>
|
||||
<AssemblyName>SDL2-CS</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<SDLSettingsPropsFilePath>$(SolutionDir)SDL2-CS.Settings.props</SDLSettingsPropsFilePath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(SDLSettingsPropsFilePath)" Condition="Exists('$(SDLSettingsPropsFilePath)')" />
|
||||
<Target Name="ValidatePropsFilePath" BeforeTargets="BeforeBuild">
|
||||
<Message Importance="High" Text="No property overrides found at '$(SDLSettingsPropsFilePath)'" Condition="!Exists('$(SDLSettingsPropsFilePath)')" />
|
||||
<Message Importance="High" Text="Loaded property overrides from '$(SDLSettingsPropsFilePath)'" Condition="Exists('$(SDLSettingsPropsFilePath)')" />
|
||||
</Target>
|
||||
<ItemGroup>
|
||||
<Compile Include="src\SDL2.cs" />
|
||||
<Compile Include="src\SDL2_image.cs" />
|
||||
<Compile Include="src\SDL2_mixer.cs" />
|
||||
<Compile Include="src\SDL2_ttf.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config">
|
||||
<Link>$(TargetFileName).config</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
14
app.config
14
app.config
@ -1,6 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<dllmap dll="SDL2" os="windows" target="SDL2.dll"/>
|
||||
<dllmap dll="SDL2" os="osx" target="libSDL2.dylib"/>
|
||||
<dllmap dll="SDL2" os="osx" target="libSDL2-2.0.0.dylib"/>
|
||||
<dllmap dll="SDL2" os="linux" target="libSDL2-2.0.so.0"/>
|
||||
|
||||
<dllmap dll="SDL2_image" os="windows" target="SDL2_image.dll"/>
|
||||
<dllmap dll="SDL2_image" os="osx" target="libSDL2_image-2.0.0.dylib"/>
|
||||
<dllmap dll="SDL2_image" os="linux" target="libSDL2_image-2.0.so.0"/>
|
||||
|
||||
<dllmap dll="SDL2_mixer" os="windows" target="SDL2_mixer.dll"/>
|
||||
<dllmap dll="SDL2_mixer" os="osx" target="libSDL2_mixer-2.0.0.dylib"/>
|
||||
<dllmap dll="SDL2_mixer" os="linux" target="libSDL2_mixer-2.0.so.0"/>
|
||||
|
||||
<dllmap dll="SDL2_ttf" os="windows" target="SDL2_ttf.dll"/>
|
||||
<dllmap dll="SDL2_ttf" os="osx" target="libSDL2_ttf-2.0.0.dylib"/>
|
||||
<dllmap dll="SDL2_ttf" os="linux" target="libSDL2_ttf-2.0.so.0"/>
|
||||
</configuration>
|
||||
|
@ -1,8 +0,0 @@
|
||||
image: Visual Studio 2022
|
||||
build_script:
|
||||
- cmd: dotnet restore
|
||||
- cmd: dotnet pack SDL2-CS.csproj -c:Release --include-symbols /p:Version=%APPVEYOR_BUILD_VERSION%
|
||||
test: off
|
||||
version: 1.0.{build}-alpha
|
||||
artifacts:
|
||||
- path: 'bin\Release\*.nupkg'
|
109
ci/compile.sh
109
ci/compile.sh
@ -1,109 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$#" -le 1 ]; then
|
||||
echo "usage: <sdl_dir> <output_path> [build_arch]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
uname_system="$(uname -s)"
|
||||
|
||||
case "${uname_system}" in
|
||||
Linux*) system_name=linux;;
|
||||
Darwin*) system_name=macos;;
|
||||
CYGWIN*) system_name=win;;
|
||||
MINGW*) system_name=win;;
|
||||
*) system_name="Unknown OS: ${uname_system}"
|
||||
esac
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
sdl_dir=$1
|
||||
output_path=$2
|
||||
build_arch=$3
|
||||
|
||||
mkdir -p $output_path
|
||||
|
||||
if [ -z "$3" ]; then
|
||||
if [ $system_name == "linux" ]; then
|
||||
build_arch=$(dpkg --print-architecture)
|
||||
else
|
||||
echo "ERROR - build_arch parameter needed on macOS and Windows"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if command -v sudo &> /dev/null
|
||||
then
|
||||
SUDO=sudo
|
||||
fi
|
||||
|
||||
if [[ $system_name == "linux" ]]; then
|
||||
if [[ $build_arch == "i386" ]]; then
|
||||
sudo dpkg --add-architecture i386
|
||||
|
||||
export CFLAGS=-m32
|
||||
export CXXFLAGS=-m32
|
||||
fi
|
||||
|
||||
$SUDO apt-get update -y
|
||||
$SUDO apt-get install -y \
|
||||
build-essential \
|
||||
cmake \
|
||||
ninja-build \
|
||||
wayland-scanner++ \
|
||||
wayland-protocols \
|
||||
pkg-config:$build_arch \
|
||||
libasound2-dev:$build_arch \
|
||||
libdbus-1-dev:$build_arch \
|
||||
libegl1-mesa-dev:$build_arch \
|
||||
libgl1-mesa-dev:$build_arch \
|
||||
libgles2-mesa-dev:$build_arch \
|
||||
libglu1-mesa-dev:$build_arch \
|
||||
libibus-1.0-dev:$build_arch \
|
||||
libpulse-dev:$build_arch \
|
||||
libsdl2-2.0-0:$build_arch \
|
||||
libsndio-dev:$build_arch \
|
||||
libudev-dev:$build_arch \
|
||||
libwayland-dev:$build_arch \
|
||||
libx11-dev:$build_arch \
|
||||
libxcursor-dev:$build_arch \
|
||||
libxext-dev:$build_arch \
|
||||
libxi-dev:$build_arch \
|
||||
libxinerama-dev:$build_arch \
|
||||
libxkbcommon-dev:$build_arch \
|
||||
libxrandr-dev:$build_arch \
|
||||
libxss-dev:$build_arch \
|
||||
libxt-dev:$build_arch \
|
||||
libxv-dev:$build_arch \
|
||||
libxxf86vm-dev:$build_arch \
|
||||
libdrm-dev:$build_arch \
|
||||
libgbm-dev:$build_arch \
|
||||
libpulse-dev:$build_arch \
|
||||
libhidapi-dev:$build_arch \
|
||||
libwayland-client++0:$build_arch \
|
||||
libwayland-cursor++0:$build_arch
|
||||
|
||||
extra_cmake_flags="-GNinja"
|
||||
elif [[ $system_name == "macos" ]]; then
|
||||
extra_cmake_flags="-DCMAKE_OSX_ARCHITECTURES=\"$build_arch\" -DCMAKE_OSX_DEPLOYMENT_TARGET=\"11.0\""
|
||||
elif [[ $system_name == "win" ]]; then
|
||||
extra_cmake_flags="-A $build_arch"
|
||||
fi
|
||||
|
||||
pushd $sdl_dir
|
||||
cmake -B build -DCMAKE_BUILD_TYPE=Release -DSDL_SHARED_ENABLED_BY_DEFAULT=ON -DSDL_STATIC_ENABLED_BY_DEFAULT=ON $extra_cmake_flags
|
||||
cmake --build build/ --config Release
|
||||
$SUDO cmake --install build/ --prefix install_output --config Release
|
||||
|
||||
mkdir -p $output_path
|
||||
|
||||
if [[ $system_name == "linux" ]]; then
|
||||
cp install_output/lib/libSDL2-2.0.so.0 $output_path/libSDL2.so
|
||||
elif [[ $system_name == "macos" ]]; then
|
||||
cp install_output/lib/libSDL2-2.0.dylib $output_path/libSDL2.dylib
|
||||
elif [[ $system_name == "win" ]]; then
|
||||
cp install_output/bin/SDL2.dll $output_path/SDL2.dll
|
||||
fi
|
||||
popd
|
41
ci/run.sh
41
ci/run.sh
@ -1,41 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$#" -le 2 ]; then
|
||||
echo "usage: <sdl_dir> <output_path> <build_arch>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
uname_system="$(uname -s)"
|
||||
|
||||
case "${uname_system}" in
|
||||
Linux*) system_name=linux;;
|
||||
Darwin*) system_name=macos;;
|
||||
CYGWIN*) system_name=win;;
|
||||
MINGW*) system_name=win;;
|
||||
*) system_name="Unknown OS: ${uname_system}"
|
||||
esac
|
||||
|
||||
sdl_dir=$1
|
||||
output_path=$2
|
||||
build_arch=$3
|
||||
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
|
||||
mkdir -p $output_path
|
||||
|
||||
if [ $system_name == "linux" ] && [ $build_arch == "arm64" ]; then
|
||||
if command -v podman &> /dev/null; then
|
||||
DOCKER=podman
|
||||
elif command -v docker &> /dev/null; then
|
||||
DOCKER=docker
|
||||
else
|
||||
echo "ERROR - Missing docker/podman env, cannot crossbuild"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$DOCKER run --rm -v $SCRIPT_DIR:/scripts -v $output_path:/output -v $sdl_dir:/source -t arm64v8/ubuntu:focal bash /scripts/compile.sh /source /output $build_arch
|
||||
else
|
||||
$SCRIPT_DIR/compile.sh "$sdl_dir" "$output_path" "$build_arch"
|
||||
fi
|
23
gitlab-ci/SDL2-CS.nuspec
Normal file
23
gitlab-ci/SDL2-CS.nuspec
Normal file
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0"?>
|
||||
<package >
|
||||
<metadata>
|
||||
<id>SDL2-CS-Rolling</id>
|
||||
<version>2000.1.1</version>
|
||||
<authors>flibitijibibo</authors>
|
||||
<owners>beannaich</owners>
|
||||
<licenseUrl>https://github.com/flibitijibibo/SDL2-CS/blob/master/LICENSE</licenseUrl>
|
||||
<projectUrl>https://github.com/flibitijibibo/SDL2-CS</projectUrl>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>SDL2# - C# Wrapper for SDL2</description>
|
||||
<copyright>Copyright 2013-2021</copyright>
|
||||
<tags>SDL2# SDL2 SDL</tags>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="..\bin\Debug\*.dll" target="lib/net461" />
|
||||
<file src="..\bin\Debug\*.dll.config" target="lib/net461" />
|
||||
<file src="..\bin\Debug\*.pdb" target="lib/net461" />
|
||||
<file src="..\bin\Debug\netstandard2.0\*.dll" target="lib/netstandard2.0" />
|
||||
<file src="..\bin\Debug\netstandard2.0\*.dll.config" target="lib/netstandard2.0" />
|
||||
<file src="..\bin\Debug\netstandard2.0\*.pdb" target="lib/netstandard2.0" />
|
||||
</files>
|
||||
</package>
|
3
gitlab-ci/build-net461.sh
Executable file
3
gitlab-ci/build-net461.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
msbuild /p:Configuration=Release SDL2-CS.csproj
|
3
gitlab-ci/build-netcore.sh
Executable file
3
gitlab-ci/build-netcore.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
dotnet build -c Release SDL2-CS.Core.csproj
|
9
gitlab-ci/deploy.sh
Executable file
9
gitlab-ci/deploy.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
nuget setApiKey $NUGET_API_KEY -verbosity quiet
|
||||
|
||||
for package in `find *.nupkg`; do
|
||||
nuget push $package -source https://nuget.org/
|
||||
done
|
9
gitlab-ci/package.sh
Executable file
9
gitlab-ci/package.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
version=`date +"%Y.%m.%d"`
|
||||
|
||||
nuspec="gitlab-ci/SDL2-CS.nuspec"
|
||||
|
||||
nuget pack $nuspec -Version $version
|
@ -1,19 +0,0 @@
|
||||
FROM debian:jessie
|
||||
|
||||
# We build on Jessie, but libwayland-dev and wayland-protocols are only in
|
||||
# Stretch and later.
|
||||
COPY stretch-package-pins /etc/apt/preferences.d/stretch
|
||||
|
||||
# Packages are from https://hg.libsdl.org/SDL/file/default/docs/README-linux.md
|
||||
RUN echo deb http://deb.debian.org/debian/ stretch main > /etc/apt/sources.list.d/stretch.list && \
|
||||
echo deb http://security.debian.org/debian-security stretch/updates main >> /etc/apt/sources.list.d/stretch.list && \
|
||||
apt-get update && \
|
||||
apt-get install -y build-essential mercurial make cmake autoconf automake \
|
||||
libtool libasound2-dev libpulse-dev libaudio-dev libx11-dev libxext-dev \
|
||||
libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev \
|
||||
libxss-dev libgl1-mesa-dev libesd0-dev libdbus-1-dev libudev-dev \
|
||||
libgles1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev libibus-1.0-dev \
|
||||
fcitx-libs-dev libsamplerate0-dev libsndio-dev libwayland-dev \
|
||||
libxkbcommon-dev wayland-protocols
|
||||
|
||||
ENTRYPOINT ["/entry"]
|
@ -1,19 +0,0 @@
|
||||
FROM i386/debian:jessie
|
||||
|
||||
# We build on Jessie, but libwayland-dev and wayland-protocols are only in
|
||||
# Stretch and later.
|
||||
COPY stretch-package-pins /etc/apt/preferences.d/stretch
|
||||
|
||||
# Packages are from https://hg.libsdl.org/SDL/file/default/docs/README-linux.md
|
||||
RUN echo deb http://deb.debian.org/debian/ stretch main > /etc/apt/sources.list.d/stretch.list && \
|
||||
echo deb http://security.debian.org/debian-security stretch/updates main >> /etc/apt/sources.list.d/stretch.list && \
|
||||
apt-get update && \
|
||||
apt-get install -y build-essential mercurial make cmake autoconf automake \
|
||||
libtool libasound2-dev libpulse-dev libaudio-dev libx11-dev libxext-dev \
|
||||
libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev \
|
||||
libxss-dev libgl1-mesa-dev libesd0-dev libdbus-1-dev libudev-dev \
|
||||
libgles1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev libibus-1.0-dev \
|
||||
fcitx-libs-dev libsamplerate0-dev libsndio-dev libwayland-dev \
|
||||
libxkbcommon-dev wayland-protocols
|
||||
|
||||
ENTRYPOINT ["/entry"]
|
@ -1,11 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euf -o pipefail
|
||||
|
||||
cd /src
|
||||
rm -rf build
|
||||
mkdir build
|
||||
cd build
|
||||
../configure --prefix=/io
|
||||
make -j$(nproc)
|
||||
make install
|
@ -1,27 +0,0 @@
|
||||
Package: *
|
||||
Pin: release n=stretch
|
||||
Pin-Priority: 50
|
||||
|
||||
Package: libwayland-dev
|
||||
Pin: release n=stretch
|
||||
Pin-Priority: 800
|
||||
|
||||
Package: libwayland-bin
|
||||
Pin: release n=stretch
|
||||
Pin-Priority: 800
|
||||
|
||||
Package: libwayland-client0
|
||||
Pin: release n=stretch
|
||||
Pin-Priority: 800
|
||||
|
||||
Package: libwayland-cursor0
|
||||
Pin: release n=stretch
|
||||
Pin-Priority: 800
|
||||
|
||||
Package: libwayland-server0
|
||||
Pin: release n=stretch
|
||||
Pin-Priority: 800
|
||||
|
||||
Package: wayland-protocols
|
||||
Pin: release n=stretch
|
||||
Pin-Priority: 800
|
@ -1,40 +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>LibraryIdentifier</key>
|
||||
<string>ios-arm64</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>SDL2.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>ios</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>ios-arm64_x86_64-simulator</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>SDL2.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>
|
||||
</array>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XFWK</string>
|
||||
<key>XCFrameworkFormatVersion</key>
|
||||
<string>1.0</string>
|
||||
</dict>
|
||||
</plist>
|
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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
317
src/SDL2.cs
317
src/SDL2.cs
@ -37,12 +37,6 @@ namespace SDL2
|
||||
{
|
||||
public static class SDL
|
||||
{
|
||||
static SDL()
|
||||
{
|
||||
if (OperatingSystem.IsIOS())
|
||||
NativeLibrary.SetDllImportResolver(typeof(SDL).Assembly, (_, assembly, path) => NativeLibrary.Load("@rpath/SDL2.framework/SDL2", assembly, path));
|
||||
}
|
||||
|
||||
#region SDL2# Variables
|
||||
|
||||
private const string nativeLibName = "SDL2";
|
||||
@ -717,54 +711,6 @@ namespace SDL2
|
||||
public const string SDL_HINT_VIDEO_WAYLAND_ALLOW_LIBDECOR =
|
||||
"SDL_VIDEO_WAYLAND_ALLOW_LIBDECOR";
|
||||
|
||||
/* Only available in 2.0.18 or higher. */
|
||||
public const string SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY =
|
||||
"SDL_VIDEO_EGL_ALLOW_TRANSPARENCY";
|
||||
public const string SDL_HINT_APP_NAME =
|
||||
"SDL_APP_NAME";
|
||||
public const string SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME =
|
||||
"SDL_SCREENSAVER_INHIBIT_ACTIVITY_NAME";
|
||||
public const string SDL_HINT_IME_SHOW_UI =
|
||||
"SDL_IME_SHOW_UI";
|
||||
public const string SDL_HINT_WINDOW_NO_ACTIVATION_WHEN_SHOWN =
|
||||
"SDL_WINDOW_NO_ACTIVATION_WHEN_SHOWN";
|
||||
public const string SDL_HINT_POLL_SENTINEL =
|
||||
"SDL_POLL_SENTINEL";
|
||||
public const string SDL_HINT_JOYSTICK_DEVICE =
|
||||
"SDL_JOYSTICK_DEVICE";
|
||||
public const string SDL_HINT_LINUX_JOYSTICK_CLASSIC =
|
||||
"SDL_LINUX_JOYSTICK_CLASSIC";
|
||||
|
||||
/* Only available in 2.0.20 or higher. */
|
||||
public const string SDL_HINT_RENDER_LINE_METHOD =
|
||||
"SDL_RENDER_LINE_METHOD";
|
||||
|
||||
/* Only available in 2.0.22 or higher. */
|
||||
public const string SDL_HINT_FORCE_RAISEWINDOW =
|
||||
"SDL_HINT_FORCE_RAISEWINDOW";
|
||||
public const string SDL_HINT_IME_SUPPORT_EXTENDED_TEXT =
|
||||
"SDL_IME_SUPPORT_EXTENDED_TEXT";
|
||||
public const string SDL_HINT_JOYSTICK_GAMECUBE_RUMBLE_BRAKE =
|
||||
"SDL_JOYSTICK_GAMECUBE_RUMBLE_BRAKE";
|
||||
public const string SDL_HINT_JOYSTICK_ROG_CHAKRAM =
|
||||
"SDL_JOYSTICK_ROG_CHAKRAM";
|
||||
public const string SDL_HINT_MOUSE_RELATIVE_MODE_CENTER =
|
||||
"SDL_MOUSE_RELATIVE_MODE_CENTER";
|
||||
public const string SDL_HINT_MOUSE_AUTO_CAPTURE =
|
||||
"SDL_MOUSE_AUTO_CAPTURE";
|
||||
public const string SDL_HINT_VITA_TOUCH_MOUSE_DEVICE =
|
||||
"SDL_HINT_VITA_TOUCH_MOUSE_DEVICE";
|
||||
public const string SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR =
|
||||
"SDL_VIDEO_WAYLAND_PREFER_LIBDECOR";
|
||||
public const string SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL =
|
||||
"SDL_VIDEO_FOREIGN_WINDOW_OPENGL";
|
||||
public const string SDL_HINT_VIDEO_FOREIGN_WINDOW_VULKAN =
|
||||
"SDL_VIDEO_FOREIGN_WINDOW_VULKAN";
|
||||
public const string SDL_HINT_X11_WINDOW_TYPE =
|
||||
"SDL_X11_WINDOW_TYPE";
|
||||
public const string SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE =
|
||||
"SDL_QUIT_ON_LAST_WINDOW_CLOSE";
|
||||
|
||||
public enum SDL_HintPriority
|
||||
{
|
||||
SDL_HINT_DEFAULT,
|
||||
@ -1338,7 +1284,7 @@ namespace SDL2
|
||||
*/
|
||||
public const int SDL_MAJOR_VERSION = 2;
|
||||
public const int SDL_MINOR_VERSION = 0;
|
||||
public const int SDL_PATCHLEVEL = 22;
|
||||
public const int SDL_PATCHLEVEL = 16;
|
||||
|
||||
public static readonly int SDL_COMPILEDVERSION = SDL_VERSIONNUM(
|
||||
SDL_MAJOR_VERSION,
|
||||
@ -1455,10 +1401,7 @@ namespace SDL2
|
||||
SDL_WINDOWEVENT_CLOSE,
|
||||
/* Only available in 2.0.5 or higher. */
|
||||
SDL_WINDOWEVENT_TAKE_FOCUS,
|
||||
SDL_WINDOWEVENT_HIT_TEST,
|
||||
/* Only available in 2.0.18 or higher. */
|
||||
SDL_WINDOWEVENT_ICCPROF_CHANGED,
|
||||
SDL_WINDOWEVENT_DISPLAY_CHANGED
|
||||
SDL_WINDOWEVENT_HIT_TEST
|
||||
}
|
||||
|
||||
public enum SDL_DisplayEventID : byte
|
||||
@ -1784,17 +1727,6 @@ namespace SDL2
|
||||
out SDL_DisplayMode mode
|
||||
);
|
||||
|
||||
/* IntPtr refers to a void*
|
||||
* window refers to an SDL_Window*
|
||||
* mode refers to a size_t*
|
||||
* Only available in 2.0.18 or higher.
|
||||
*/
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr SDL_GetWindowICCProfile(
|
||||
IntPtr window,
|
||||
out IntPtr mode
|
||||
);
|
||||
|
||||
/* window refers to an SDL_Window* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern uint SDL_GetWindowFlags(IntPtr window);
|
||||
@ -2260,35 +2192,6 @@ namespace SDL2
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr SDL_GetGrabbedWindow();
|
||||
|
||||
/* window refers to an SDL_Window*
|
||||
* Only available in 2.0.18 or higher.
|
||||
*/
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_SetWindowMouseRect(
|
||||
IntPtr window,
|
||||
ref SDL_Rect rect
|
||||
);
|
||||
|
||||
/* window refers to an SDL_Window*
|
||||
* rect refers to an SDL_Rect*
|
||||
* This overload allows for IntPtr.Zero (null) to be passed for rect.
|
||||
* Only available in 2.0.18 or higher.
|
||||
*/
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_SetWindowMouseRect(
|
||||
IntPtr window,
|
||||
IntPtr rect
|
||||
);
|
||||
|
||||
/* window refers to an SDL_Window*
|
||||
* IntPtr refers to an SDL_Rect*
|
||||
* Only available in 2.0.18 or higher.
|
||||
*/
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr SDL_GetWindowMouseRect(
|
||||
IntPtr window
|
||||
);
|
||||
|
||||
/* window refers to an SDL_Window*
|
||||
* Only available in 2.0.16 or higher.
|
||||
*/
|
||||
@ -2505,15 +2408,6 @@ namespace SDL2
|
||||
SDL_ScaleModeBest
|
||||
}
|
||||
|
||||
/* Only available in 2.0.18 or higher. */
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct SDL_Vertex
|
||||
{
|
||||
public SDL_FPoint position;
|
||||
public SDL_Color color;
|
||||
public SDL_FPoint tex_coord;
|
||||
}
|
||||
|
||||
/* IntPtr refers to an SDL_Renderer*, window to an SDL_Window* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr SDL_CreateRenderer(
|
||||
@ -2582,22 +2476,6 @@ namespace SDL2
|
||||
out SDL_ScaleMode scaleMode
|
||||
);
|
||||
|
||||
/* texture refers to an SDL_Texture*
|
||||
* userdata refers to a void*
|
||||
* Only available in 2.0.18 or higher.
|
||||
*/
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_SetTextureUserData(
|
||||
IntPtr texture,
|
||||
IntPtr userdata
|
||||
);
|
||||
|
||||
/* IntPtr refers to a void*, texture refers to an SDL_Texture*
|
||||
* Only available in 2.0.18 or higher.
|
||||
*/
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr SDL_GetTextureUserData(IntPtr texture);
|
||||
|
||||
/* renderer refers to an SDL_Renderer* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_GetRenderDrawColor(
|
||||
@ -3153,41 +3031,6 @@ namespace SDL2
|
||||
SDL_RendererFlip flip
|
||||
);
|
||||
|
||||
/* renderer refers to an SDL_Renderer*
|
||||
* texture refers to an SDL_Texture*
|
||||
* Only available in 2.0.18 or higher.
|
||||
*/
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_RenderGeometry(
|
||||
IntPtr renderer,
|
||||
IntPtr texture,
|
||||
[In] SDL_Vertex[] vertices,
|
||||
int num_vertices,
|
||||
[In] int[] indices,
|
||||
int num_indices
|
||||
);
|
||||
|
||||
/* renderer refers to an SDL_Renderer*
|
||||
* texture refers to an SDL_Texture*
|
||||
* indices refers to a void*
|
||||
* Only available in 2.0.18 or higher.
|
||||
*/
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_RenderGeometryRaw(
|
||||
IntPtr renderer,
|
||||
IntPtr texture,
|
||||
[In] float[] xy,
|
||||
int xy_stride,
|
||||
[In] int[] color,
|
||||
int color_stride,
|
||||
[In] float[] uv,
|
||||
int uv_stride,
|
||||
int num_vertices,
|
||||
IntPtr indices,
|
||||
int num_indices,
|
||||
int size_indices
|
||||
);
|
||||
|
||||
/* renderer refers to an SDL_Renderer* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_RenderDrawPointF(
|
||||
@ -3295,30 +3138,6 @@ namespace SDL2
|
||||
out float scaleY
|
||||
);
|
||||
|
||||
/* renderer refers to an SDL_Renderer*
|
||||
* Only available in 2.0.18 or higher.
|
||||
*/
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SDL_RenderWindowToLogical(
|
||||
IntPtr renderer,
|
||||
int windowX,
|
||||
int windowY,
|
||||
out float logicalX,
|
||||
out float logicalY
|
||||
);
|
||||
|
||||
/* renderer refers to an SDL_Renderer*
|
||||
* Only available in 2.0.18 or higher.
|
||||
*/
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SDL_RenderLogicalToWindow(
|
||||
IntPtr renderer,
|
||||
float logicalX,
|
||||
float logicalY,
|
||||
out int windowX,
|
||||
out int windowY
|
||||
);
|
||||
|
||||
/* renderer refers to an SDL_Renderer* */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_RenderGetViewport(
|
||||
@ -3512,12 +3331,6 @@ namespace SDL2
|
||||
IntPtr renderer
|
||||
);
|
||||
|
||||
/* renderer refers to an SDL_Renderer*
|
||||
* Only available in 2.0.18 or higher.
|
||||
*/
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_RenderSetVSync(IntPtr renderer, int vsync);
|
||||
|
||||
/* renderer refers to an SDL_Renderer*
|
||||
* Only available in 2.0.4 or higher.
|
||||
*/
|
||||
@ -4387,21 +4200,6 @@ namespace SDL2
|
||||
int dst_pitch
|
||||
);
|
||||
|
||||
/* src and dst are void* pointers
|
||||
* Only available in 2.0.18 or higher.
|
||||
*/
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_PremultiplyAlpha(
|
||||
int width,
|
||||
int height,
|
||||
uint src_format,
|
||||
IntPtr src,
|
||||
int src_pitch,
|
||||
uint dst_format,
|
||||
IntPtr dst,
|
||||
int dst_pitch
|
||||
);
|
||||
|
||||
/* IntPtr refers to an SDL_Surface*
|
||||
* src refers to an SDL_Surface*
|
||||
* fmt refers to an SDL_PixelFormat*
|
||||
@ -4778,7 +4576,6 @@ namespace SDL2
|
||||
SDL_TEXTEDITING,
|
||||
SDL_TEXTINPUT,
|
||||
SDL_KEYMAPCHANGED,
|
||||
SDL_TEXTEDITING_EXT,
|
||||
|
||||
/* Mouse events */
|
||||
SDL_MOUSEMOTION = 0x400,
|
||||
@ -4842,10 +4639,6 @@ namespace SDL2
|
||||
/* Only available in SDL 2.0.4 or higher. */
|
||||
SDL_RENDER_DEVICE_RESET,
|
||||
|
||||
/* Internal events */
|
||||
/* Only available in 2.0.18 or higher. */
|
||||
SDL_POLLSENTINEL = 0x7F00,
|
||||
|
||||
/* Events SDL_USEREVENT through SDL_LASTEVENT are for
|
||||
* your use, and should be allocated with
|
||||
* SDL_RegisterEvents()
|
||||
@ -4933,17 +4726,6 @@ namespace SDL2
|
||||
public Int32 length;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public unsafe struct SDL_TextEditingExtEvent
|
||||
{
|
||||
public SDL_EventType type;
|
||||
public UInt32 timestamp;
|
||||
public UInt32 windowID;
|
||||
public IntPtr text; /* char*, free with SDL_free */
|
||||
public Int32 start;
|
||||
public Int32 length;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public unsafe struct SDL_TextInputEvent
|
||||
{
|
||||
@ -5004,8 +4786,6 @@ namespace SDL2
|
||||
public Int32 x; /* amount scrolled horizontally */
|
||||
public Int32 y; /* amount scrolled vertically */
|
||||
public UInt32 direction; /* Set to one of the SDL_MOUSEWHEEL_* defines */
|
||||
public float preciseX; /* Requires >= 2.0.18 */
|
||||
public float preciseY; /* Requires >= 2.0.18 */
|
||||
}
|
||||
|
||||
// Ignore private members used for padding in this struct
|
||||
@ -5288,8 +5068,6 @@ namespace SDL2
|
||||
[FieldOffset(0)]
|
||||
public SDL_TextEditingEvent edit;
|
||||
[FieldOffset(0)]
|
||||
public SDL_TextEditingExtEvent editExt;
|
||||
[FieldOffset(0)]
|
||||
public SDL_TextInputEvent text;
|
||||
[FieldOffset(0)]
|
||||
public SDL_MouseMotionEvent motion;
|
||||
@ -5314,9 +5092,9 @@ namespace SDL2
|
||||
[FieldOffset(0)]
|
||||
public SDL_ControllerDeviceEvent cdevice;
|
||||
[FieldOffset(0)]
|
||||
public SDL_ControllerTouchpadEvent ctouchpad;
|
||||
public SDL_ControllerDeviceEvent ctouchpad;
|
||||
[FieldOffset(0)]
|
||||
public SDL_ControllerSensorEvent csensor;
|
||||
public SDL_ControllerDeviceEvent csensor;
|
||||
[FieldOffset(0)]
|
||||
public SDL_AudioDeviceEvent adevice;
|
||||
[FieldOffset(0)]
|
||||
@ -6054,15 +5832,13 @@ namespace SDL2
|
||||
KMOD_NUM = 0x1000,
|
||||
KMOD_CAPS = 0x2000,
|
||||
KMOD_MODE = 0x4000,
|
||||
KMOD_SCROLL = 0x8000,
|
||||
KMOD_RESERVED = 0x8000,
|
||||
|
||||
/* These are defines in the SDL headers */
|
||||
KMOD_CTRL = (KMOD_LCTRL | KMOD_RCTRL),
|
||||
KMOD_SHIFT = (KMOD_LSHIFT | KMOD_RSHIFT),
|
||||
KMOD_ALT = (KMOD_LALT | KMOD_RALT),
|
||||
KMOD_GUI = (KMOD_LGUI | KMOD_RGUI),
|
||||
|
||||
KMOD_RESERVED = KMOD_SCROLL
|
||||
KMOD_GUI = (KMOD_LGUI | KMOD_RGUI)
|
||||
}
|
||||
|
||||
#endregion
|
||||
@ -6165,12 +5941,6 @@ namespace SDL2
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SDL_StopTextInput();
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SDL_ClearComposition();
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern SDL_bool SDL_IsTextInputShown();
|
||||
|
||||
/* Set the rectangle used for text input, hint for IME */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SDL_SetTextInputRect(ref SDL_Rect rect);
|
||||
@ -6764,18 +6534,6 @@ namespace SDL2
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern SDL_bool SDL_JoystickHasLED(IntPtr joystick);
|
||||
|
||||
/* IntPtr refers to an SDL_Joystick*.
|
||||
* Only available in 2.0.18 or higher.
|
||||
*/
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern SDL_bool SDL_JoystickHasRumble(IntPtr joystick);
|
||||
|
||||
/* IntPtr refers to an SDL_Joystick*.
|
||||
* Only available in 2.0.18 or higher.
|
||||
*/
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern SDL_bool SDL_JoystickHasRumbleTriggers(IntPtr joystick);
|
||||
|
||||
/* IntPtr refers to an SDL_Joystick*.
|
||||
* Only available in 2.0.14 or higher.
|
||||
*/
|
||||
@ -7217,40 +6975,6 @@ namespace SDL2
|
||||
IntPtr gamecontroller
|
||||
);
|
||||
|
||||
/* gamecontroller refers to an SDL_GameController*
|
||||
* Only available in 2.0.18 or higher.
|
||||
*/
|
||||
[DllImport(nativeLibName, EntryPoint = "SDL_GameControllerGetAppleSFSymbolsNameForButton", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern IntPtr INTERNAL_SDL_GameControllerGetAppleSFSymbolsNameForButton(
|
||||
IntPtr gamecontroller,
|
||||
SDL_GameControllerButton button
|
||||
);
|
||||
public static string SDL_GameControllerGetAppleSFSymbolsNameForButton(
|
||||
IntPtr gamecontroller,
|
||||
SDL_GameControllerButton button
|
||||
) {
|
||||
return UTF8_ToManaged(
|
||||
INTERNAL_SDL_GameControllerGetAppleSFSymbolsNameForButton(gamecontroller, button)
|
||||
);
|
||||
}
|
||||
|
||||
/* gamecontroller refers to an SDL_GameController*
|
||||
* Only available in 2.0.18 or higher.
|
||||
*/
|
||||
[DllImport(nativeLibName, EntryPoint = "SDL_GameControllerGetAppleSFSymbolsNameForAxis", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern IntPtr INTERNAL_SDL_GameControllerGetAppleSFSymbolsNameForAxis(
|
||||
IntPtr gamecontroller,
|
||||
SDL_GameControllerAxis axis
|
||||
);
|
||||
public static string SDL_GameControllerGetAppleSFSymbolsNameForAxis(
|
||||
IntPtr gamecontroller,
|
||||
SDL_GameControllerAxis axis
|
||||
) {
|
||||
return UTF8_ToManaged(
|
||||
INTERNAL_SDL_GameControllerGetAppleSFSymbolsNameForAxis(gamecontroller, axis)
|
||||
);
|
||||
}
|
||||
|
||||
/* int refers to an SDL_JoystickID, IntPtr to an SDL_GameController*.
|
||||
* Only available in 2.0.4 or higher.
|
||||
*/
|
||||
@ -7296,22 +7020,6 @@ namespace SDL2
|
||||
IntPtr gamecontroller
|
||||
);
|
||||
|
||||
/* gamecontroller refers to an SDL_GameController*.
|
||||
* Only available in 2.0.18 or higher.
|
||||
*/
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern SDL_bool SDL_GameControllerHasRumble(
|
||||
IntPtr gamecontroller
|
||||
);
|
||||
|
||||
/* gamecontroller refers to an SDL_GameController*.
|
||||
* Only available in 2.0.18 or higher.
|
||||
*/
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern SDL_bool SDL_GameControllerHasRumbleTriggers(
|
||||
IntPtr gamecontroller
|
||||
);
|
||||
|
||||
/* gamecontroller refers to an SDL_GameController*.
|
||||
* Only available in 2.0.14 or higher.
|
||||
*/
|
||||
@ -8286,12 +7994,6 @@ namespace SDL2
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UInt32 SDL_GetTicks();
|
||||
|
||||
/* Returns the milliseconds that have passed since SDL was initialized
|
||||
* Only available in 2.0.18 or higher.
|
||||
*/
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UInt64 SDL_GetTicks64();
|
||||
|
||||
/* Get the current value of the high resolution counter */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UInt64 SDL_GetPerformanceCounter();
|
||||
@ -8346,7 +8048,7 @@ namespace SDL2
|
||||
|
||||
/* renderer refers to an SDL_Renderer*
|
||||
* IntPtr refers to an ID3D11Device*
|
||||
* Only available in 2.0.16 or higher.
|
||||
* Only available in 2.0.18 or higher.
|
||||
*/
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr SDL_RenderGetD3D11Device(IntPtr renderer);
|
||||
@ -8435,7 +8137,7 @@ namespace SDL2
|
||||
}
|
||||
|
||||
/* Only available in 2.0.16 or higher. */
|
||||
[DllImport(nativeLibName, EntryPoint = "SDL_AndroidShowToast", CallingConvention = CallingConvention.Cdecl)]
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
private static unsafe extern int INTERNAL_SDL_AndroidShowToast(
|
||||
byte* message,
|
||||
int duration,
|
||||
@ -8553,9 +8255,6 @@ namespace SDL2
|
||||
public IntPtr shell_surface; // Refers to a wl_shell_surface*
|
||||
public IntPtr egl_window; // Refers to an egl_window*, requires >= 2.0.16
|
||||
public IntPtr xdg_surface; // Refers to an xdg_surface*, requires >= 2.0.16
|
||||
public IntPtr xdg_toplevel; // Referes to an xdg_toplevel*, requires >= 2.0.18
|
||||
public IntPtr xdg_popup;
|
||||
public IntPtr xdg_positioner;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
|
390
src/SDL2_gfx.cs
390
src/SDL2_gfx.cs
@ -1,390 +0,0 @@
|
||||
#region License
|
||||
/* SDL2# - C# Wrapper for SDL2
|
||||
*
|
||||
* Copyright (c) 2013-2021 Ethan Lee.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Ethan "flibitijibibo" Lee <flibitijibibo@flibitijibibo.com>
|
||||
*
|
||||
*/
|
||||
#endregion
|
||||
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
#endregion
|
||||
|
||||
namespace SDL2
|
||||
{
|
||||
public static class SDL_gfx
|
||||
{
|
||||
#region SDL2# Variables
|
||||
|
||||
/* Used by DllImport to load the native library. */
|
||||
private const string nativeLibName = "SDL2_gfx";
|
||||
|
||||
#endregion
|
||||
|
||||
public const double M_PI = 3.1415926535897932384626433832795;
|
||||
|
||||
#region SDL2_gfxPrimitives.h
|
||||
|
||||
public const uint SDL2_GFXPRIMITIVES_MAJOR = 1;
|
||||
public const uint SDL2_GFXPRIMITIVES_MINOR = 0;
|
||||
public const uint SDL2_GFXPRIMITIVES_MICRO = 1;
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int pixelColor(IntPtr renderer, short x, short y, uint color);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int pixelRGBA(IntPtr renderer, short x, short y, byte r, byte g, byte b, byte a);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int hlineColor(IntPtr renderer, short x1, short x2, short y, uint color);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int hlineRGBA(IntPtr renderer, short x1, short x2, short y, byte r, byte g, byte b, byte a);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int vlineColor(IntPtr renderer, short x, short y1, short y2, uint color);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int vlineRGBA(IntPtr renderer, short x, short y1, short y2, byte r, byte g, byte b, byte a);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int rectangleColor(IntPtr renderer, short x1, short y1, short x2, short y2, uint color);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int rectangleRGBA(IntPtr renderer, short x1, short y1, short x2, short y2, byte r, byte g, byte b, byte a);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int roundedRectangleColor(IntPtr renderer, short x1, short y1, short x2, short y2, short rad, uint color);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int roundedRectangleRGBA(IntPtr renderer, short x1, short y1, short x2, short y2, short rad, byte r, byte g, byte b, byte a);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int boxColor(IntPtr renderer, short x1, short y1, short x2, short y2, uint color);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int boxRGBA(IntPtr renderer, short x1, short y1, short x2, short y2, byte r, byte g, byte b, byte a);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int roundedBoxColor(IntPtr renderer, short x1, short y1, short x2, short y2, short rad, uint color);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int roundedBoxRGBA(IntPtr renderer, short x1, short y1, short x2, short y2, short rad, byte r, byte g, byte b, byte a);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int lineColor(IntPtr renderer, short x1, short y1, short x2, short y2, uint color);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int lineRGBA(IntPtr renderer, short x1, short y1, short x2, short y2, byte r, byte g, byte b, byte a);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int aalineColor(IntPtr renderer, short x1, short y1, short x2, short y2, uint color);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int aalineRGBA(IntPtr renderer, short x1, short y1, short x2, short y2, byte r, byte g, byte b, byte a);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int thickLineColor(IntPtr renderer, short x1, short y1, short x2, short y2, byte width, uint color);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int thickLineRGBA(IntPtr renderer, short x1, short y1, short x2, short y2, byte width, byte r, byte g, byte b, byte a);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int circleColor(IntPtr renderer, short x, short y, short rad, uint color);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int circleRGBA(IntPtr renderer, short x, short y, short rad, byte r, byte g, byte b, byte a);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int arcColor(IntPtr renderer, short x, short y, short rad, short start, short end, uint color);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int arcRGBA(IntPtr renderer, short x, short y, short rad, short start, short end, byte r, byte g, byte b, byte a);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int aacircleColor(IntPtr renderer, short x, short y, short rad, uint color);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int aacircleRGBA(IntPtr renderer, short x, short y, short rad, byte r, byte g, byte b, byte a);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int filledCircleColor(IntPtr renderer, short x, short y, short rad, uint color);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int filledCircleRGBA(IntPtr renderer, short x, short y, short rad, byte r, byte g, byte b, byte a);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int ellipseColor(IntPtr renderer, short x, short y, short rx, short ry, uint color);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int ellipseRGBA(IntPtr renderer, short x, short y, short rx, short ry, byte r, byte g, byte b, byte a);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int aaellipseColor(IntPtr renderer, short x, short y, short rx, short ry, uint color);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int aaellipseRGBA(IntPtr renderer, short x, short y, short rx, short ry, byte r, byte g, byte b, byte a);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int filledEllipseColor(IntPtr renderer, short x, short y, short rx, short ry, uint color);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int filledEllipseRGBA(IntPtr renderer, short x, short y, short rx, short ry, byte r, byte g, byte b, byte a);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int pieColor(IntPtr renderer, short x, short y, short rad, short start, short end, uint color);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int pieRGBA(IntPtr renderer, short x, short y, short rad, short start, short end, byte r, byte g, byte b, byte a);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int filledPieColor(IntPtr renderer, short x, short y, short rad, short start, short end, uint color);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int filledPieRGBA(IntPtr renderer, short x, short y, short rad, short start, short end, byte r, byte g, byte b, byte a);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int trigonColor(IntPtr renderer, short x1, short y1, short x2, short y2, short x3, short y3, uint color);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int trigonRGBA(IntPtr renderer, short x1, short y1, short x2, short y2, short x3, short y3, byte r, byte g, byte b, byte a);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int aatrigonColor(IntPtr renderer, short x1, short y1, short x2, short y2, short x3, short y3, uint color);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int aatrigonRGBA(IntPtr renderer, short x1, short y1, short x2, short y2, short x3, short y3, byte r, byte g, byte b, byte a);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int filledTrigonColor(IntPtr renderer, short x1, short y1, short x2, short y2, short x3, short y3, uint color);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int filledTrigonRGBA(IntPtr renderer, short x1, short y1, short x2, short y2, short x3, short y3, byte r, byte g, byte b, byte a);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int polygonColor(IntPtr renderer, [In] short[] vx, [In] short[] vy, int n, uint color);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int polygonRGBA(IntPtr renderer, [In] short[] vx, [In] short[] vy, int n, byte r, byte g, byte b, byte a);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int aapolygonColor(IntPtr renderer, [In] short[] vx, [In] short[] vy, int n, uint color);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int aapolygonRGBA(IntPtr renderer, [In] short[] vx, [In] short[] vy, int n, byte r, byte g, byte b, byte a);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int filledPolygonColor(IntPtr renderer, [In] short[] vx, [In] short[] vy, int n, uint color);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int filledPolygonRGBA(IntPtr renderer, [In] short[] vx, [In] short[] vy, int n, byte r, byte g, byte b, byte a);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int texturedPolygon(IntPtr renderer, [In] short[] vx, [In] short[] vy, int n, IntPtr texture, int texture_dx, int texture_dy);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int bezierColor(IntPtr renderer, [In] short[] vx, [In] short[] vy, int n, int s, uint color);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int bezierRGBA(IntPtr renderer, [In] short[] vx, [In] short[] vy, int n, int s, byte r, byte g, byte b, byte a);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void gfxPrimitivesSetFont([In] byte[] fontdata, uint cw, uint ch);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void gfxPrimitivesSetFontRotation(uint rotation);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int characterColor(IntPtr renderer, short x, short y, char c, uint color);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int characterRGBA(IntPtr renderer, short x, short y, char c, byte r, byte g, byte b, byte a);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int stringColor(IntPtr renderer, short x, short y, string s, uint color);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int stringRGBA(IntPtr renderer, short x, short y, string s, byte r, byte g, byte b, byte a);
|
||||
|
||||
#endregion
|
||||
|
||||
#region SDL2_rotozoom.h
|
||||
|
||||
public const int SMOOTHING_OFF = 0;
|
||||
public const int SMOOTHING_ON = 1;
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr rotozoomSurface(IntPtr src, double angle, double zoom, int smooth);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr rotozoomSurfaceXY(IntPtr src, double angle, double zoomx, double zoomy, int smooth);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void rotozoomSurfaceSize(int width, int height, double angle, double zoom, out int dstwidth, out int dstheight);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void rotozoomSurfaceSizeXY(int width, int height, double angle, double zoomx, double zoomy, out int dstwidth, out int dstheight);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr zoomSurface(IntPtr src, double zoomx, double zoomy, int smooth);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void zoomSurfaceSize(int width, int height, double zoomx, double zoomy, out int dstwidth, out int dstheight);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr shrinkSurface(IntPtr src, int factorx, int factory);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr rotateSurface90Degrees(IntPtr src, int numClockwiseTurns);
|
||||
|
||||
#endregion
|
||||
|
||||
#region SDL2_framerate.h
|
||||
|
||||
public const int FPS_UPPER_LIMIT = 200;
|
||||
public const int FPS_LOWER_LIMIT = 1;
|
||||
public const int FPS_DEFAULT = 30;
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct FPSmanager
|
||||
{
|
||||
public uint framecount;
|
||||
public float rateticks;
|
||||
public uint baseticks;
|
||||
public uint lastticks;
|
||||
public uint rate;
|
||||
}
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SDL_initFramerate(ref FPSmanager manager);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_setFramerate(ref FPSmanager manager, uint rate);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_getFramerate(ref FPSmanager manager);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_getFramecount(ref FPSmanager manager);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern uint SDL_framerateDelay(ref FPSmanager manager);
|
||||
|
||||
#endregion
|
||||
|
||||
#region SDL2_imageFilter.h
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_imageFilterMMXdetect();
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SDL_imageFilterMMXoff();
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SDL_imageFilterMMXon();
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_imageFilterAdd([In] byte[] src1, [In] byte[] src2, [Out] byte[] dest, uint length);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_imageFilterMean([In] byte[] src1, [In] byte[] src2, [Out] byte[] dest, uint length);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_imageFilterSub([In] byte[] src1, [In] byte[] src2, [Out] byte[] dest, uint length);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_imageFilterAbsDiff([In] byte[] src1, [In] byte[] src2, [Out] byte[] dest, uint length);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_imageFilterMult([In] byte[] src1, [In] byte[] src2, [Out] byte[] dest, uint length);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_imageFilterMultNor([In] byte[] src1, [In] byte[] src2, [Out] byte[] dest, uint length);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_imageFilterMultDivby2([In] byte[] src1, [In] byte[] src2, [Out] byte[] dest, uint length);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_imageFilterMultDivby4([In] byte[] src1, [In] byte[] src2, [Out] byte[] dest, uint length);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_imageFilterBitAnd([In] byte[] src1, [In] byte[] src2, [Out] byte[] dest, uint length);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_imageFilterBitOr([In] byte[] src1, [In] byte[] src2, [Out] byte[] dest, uint length);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_imageFilterDiv([In] byte[] src1, [In] byte[] src2, [Out] byte[] dest, uint length);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_imageFilterBitNegation([In] byte[] src1, [Out] byte[] dest, uint length);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_imageFilterAddByte([In] byte[] src1, [Out] byte[] dest, uint length, byte c);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_imageFilterAddUint([In] byte[] src1, [Out] byte[] dest, uint length, uint c);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_imageFilterAddByteToHalf([In] byte[] src1, [Out] byte[] dest, uint length, byte c);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_imageFilterSubByte([In] byte[] src1, [Out] byte[] dest, uint length, byte c);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_imageFilterSubUint([In] byte[] src1, [Out] byte[] dest, uint length, uint c);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_imageFilterShiftRight([In] byte[] src1, [Out] byte[] dest, uint length, byte n);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_imageFilterShiftRightUint([In] byte[] src1, [Out] byte[] dest, uint length, byte n);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_imageFilterMultByByte([In] byte[] src1, [Out] byte[] dest, uint length, byte c);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_imageFilterShiftRightAndMultByByte([In] byte[] src1, [Out] byte[] dest, uint length, byte n, byte c);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_imageFilterShiftLeftByte([In] byte[] src1, [Out] byte[] dest, uint length, byte n);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_imageFilterShiftLeftUint([In] byte[] src1, [Out] byte[] dest, uint length, byte n);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_imageFilterShiftLeft([In] byte[] src1, [Out] byte[] dest, uint length, byte n);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_imageFilterBinarizeUsingThreshold([In] byte[] src1, [Out] byte[] dest, uint length, byte t);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_imageFilterClipToRange([In] byte[] src1, [Out] byte[] dest, uint length, byte tmin, byte tmax);
|
||||
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int SDL_imageFilterNormalizeLinear([In] byte[] src1, [Out] byte[] dest, uint length, int cmin, int cmax, int nmin, int nmax);
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -314,4 +314,4 @@ namespace SDL2
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -646,21 +646,6 @@ namespace SDL2
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void Mix_CloseAudio();
|
||||
|
||||
public static string Mix_GetError()
|
||||
{
|
||||
return SDL.SDL_GetError();
|
||||
}
|
||||
|
||||
public static void Mix_SetError(string fmtAndArglist)
|
||||
{
|
||||
SDL.SDL_SetError(fmtAndArglist);
|
||||
}
|
||||
|
||||
public static void Mix_ClearError()
|
||||
{
|
||||
SDL.SDL_ClearError();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@ -754,16 +754,6 @@ namespace SDL2
|
||||
ushort ch
|
||||
);
|
||||
|
||||
public static string TTF_GetError()
|
||||
{
|
||||
return SDL.SDL_GetError();
|
||||
}
|
||||
|
||||
public static void TTF_SetError(string fmtAndArglist)
|
||||
{
|
||||
SDL.SDL_SetError(fmtAndArglist);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user