Watch
2
0
Fork
You've already forked raylib-cs
0

chg: New build system that uses the officially distributed binaries, bumped version to 8.0.0, simplified git workflow, removed deprecated OpenGL 1.1 functionality, removed deprecated Raylib 5.0 (and earlier) functions.

This commit is contained in:
Tiger Jove 2026-01-04 15:35:55 +01:00 committed by Tiger Jove
commit 760761ed39
21 changed files with 331 additions and 392 deletions

View file

@ -1,54 +1,193 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
<EnableDefaultItems>false</EnableDefaultItems>
<AssemblyName>Raylib-cs</AssemblyName>
<RootNamespace>Raylib_cs</RootNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<NoWarn>$(NoWarn);1591</NoWarn>
<LangVersion>12</LangVersion>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
<AssemblyName>Raylib-cs</AssemblyName>
<RootNamespace>Raylib_cs</RootNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>12</LangVersion>
<PackageRids>win-x64;win-x86;linux-x64;osx-x64;osx-arm64;browser-wasm</PackageRids>
</PropertyGroup>
<PropertyGroup>
<Title>Raylib-cs</Title>
<Description>C# bindings for raylib - A simple and easy-to-use library to learn videogames programming</Description>
<RepositoryUrl>https://github.com/raylib-cs/raylib-cs/</RepositoryUrl>
<Authors>raylib-cs</Authors>
<PackageLicenseExpression>Zlib</PackageLicenseExpression>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>raylib-cs_64x64.png</PackageIcon>
<PackageTags>raylib csharp gamedev</PackageTags>
<PackageProjectUrl>https://www.raylib.com/</PackageProjectUrl>
<PackProject>true</PackProject>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<RepositoryType>git</RepositoryType>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<PropertyGroup>
<NoWarn>$(NoWarn);1591</NoWarn> <!-- missing XML comment on public member -->
</PropertyGroup>
<ItemGroup>
<None Include="logo/raylib-cs_64x64.png" Pack="true" PackagePath="" />
<None Include="../README.md" Pack="true" PackagePath="" />
</ItemGroup>
<PropertyGroup>
<PackageId>Raylib-cs</PackageId>
<Version>8.0.0</Version>
<Description>C# bindings for raylib</Description>
<RepositoryUrl>https://github.com/raylib-cs/raylib-cs/</RepositoryUrl>
<Authors>raylib-cs</Authors>
<PackageLicenseExpression>Zlib</PackageLicenseExpression>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>raylib-cs_64x64.png</PackageIcon>
<PackageTags>raylib csharp gamedev</PackageTags>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
</ItemGroup>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<Import Project="./Build.props" />
<ItemGroup>
<!-- Use explicit PackagePath for these to prevent ambiguity -->
<None Include="logo/raylib-cs_64x64.png" Pack="true" PackagePath="raylib-cs_64x64.png"/>
<None Include="../README.md" Pack="true" PackagePath="README.md"/>
<None Include="Raylib-cs.targets" Pack="true" PackagePath="buildTransitive\Raylib-cs.targets"/>
</ItemGroup>
<ItemGroup>
<Content Include="runtimes/**" Link="runtimes/%(RecursiveDir)/%(Filename)%(Extension)">
<PackagePath>runtimes/</PackagePath>
<Pack>true</Pack>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<!-- Import Build Props -->
<Import Project="./Build.props" Condition="Exists('./Build.props')"/>
<PropertyGroup Condition="'$(TargetRaylibTag)' == ''">
<TargetRaylibTag>6.0</TargetRaylibTag>
</PropertyGroup>
<ItemGroup>
<Compile Include="interop\*.cs" />
<Compile Include="types\*.cs" />
<Compile Include="types\native\*.cs" />
</ItemGroup>
</Project>
<PropertyGroup>
<NativesRoot>$(BaseIntermediateOutputPath)natives/</NativesRoot>
</PropertyGroup>
<Choose>
<When Condition="'$(RuntimeIdentifier)' == 'win-x64'">
<PropertyGroup>
<RaylibPackageName>raylib-$(TargetRaylibTag)_win64_msvc16</RaylibPackageName>
<ArchiveExt>.zip</ArchiveExt>
<LibPattern>raylib.dll</LibPattern>
</PropertyGroup>
</When>
<When Condition="'$(RuntimeIdentifier)' == 'win-x86'">
<PropertyGroup>
<RaylibPackageName>raylib-$(TargetRaylibTag)_win32_msvc16</RaylibPackageName>
<ArchiveExt>.zip</ArchiveExt>
<LibPattern>raylib.dll</LibPattern>
</PropertyGroup>
</When>
<When Condition="'$(RuntimeIdentifier)' == 'linux-x64'">
<PropertyGroup>
<RaylibPackageName>raylib-$(TargetRaylibTag)_linux_amd64</RaylibPackageName>
<ArchiveExt>.tar.gz</ArchiveExt>
<LibPattern>libraylib.so*</LibPattern>
</PropertyGroup>
</When>
<When Condition="'$(RuntimeIdentifier)' == 'osx-x64'">
<PropertyGroup>
<RaylibPackageName>raylib-$(TargetRaylibTag)_macos</RaylibPackageName>
<ArchiveExt>.tar.gz</ArchiveExt>
<LibPattern>libraylib.dylib</LibPattern>
</PropertyGroup>
</When>
<When Condition="'$(RuntimeIdentifier)' == 'osx-arm64'">
<PropertyGroup>
<RaylibPackageName>raylib-$(TargetRaylibTag)_macos</RaylibPackageName>
<ArchiveExt>.tar.gz</ArchiveExt>
<LibPattern>libraylib.dylib</LibPattern>
</PropertyGroup>
</When>
<When Condition="'$(RuntimeIdentifier)' == 'browser-wasm'">
<PropertyGroup>
<RaylibPackageName>raylib-$(TargetRaylibTag)_webassembly</RaylibPackageName>
<ArchiveExt>.zip</ArchiveExt>
<LibPattern>libraylib.web.a</LibPattern>
</PropertyGroup>
</When>
</Choose>
<!-- ================================================================== -->
<!-- TARGET: PACKING -->
<!-- ================================================================== -->
<Target Name="PrepareNativesForPack" BeforeTargets="_GetPackageFiles">
<ItemGroup>
<_TargetRids Include="$(PackageRids)"/>
</ItemGroup>
<MSBuild Projects="$(MSBuildThisFileFullPath)"
Targets="_DownloadAndExtractInternal"
Properties="RuntimeIdentifier=%(_TargetRids.Identity);TargetFramework=$(TargetFramework);TargetRaylibTag=$(TargetRaylibTag)"
BuildInParallel="false"/>
<!-- Direct injection into _PackageFiles -->
<ItemGroup>
<_PackageFiles Include="$(NativesRoot)win-x64/raylib-$(TargetRaylibTag)_win64_msvc16/lib/raylib.dll">
<PackagePath>runtimes/win-x64/native/</PackagePath>
<BuildAction>None</BuildAction>
</_PackageFiles>
<_PackageFiles Include="$(NativesRoot)win-x86/raylib-$(TargetRaylibTag)_win32_msvc16/lib/raylib.dll">
<PackagePath>runtimes/win-x86/native/</PackagePath>
<BuildAction>None</BuildAction>
</_PackageFiles>
<_PackageFiles Include="$(NativesRoot)linux-x64/raylib-$(TargetRaylibTag)_linux_amd64/lib/libraylib.so">
<PackagePath>runtimes/linux-x64/native/</PackagePath>
<BuildAction>None</BuildAction>
</_PackageFiles>
<_PackageFiles Include="$(NativesRoot)osx-x64/raylib-$(TargetRaylibTag)_macos/lib/libraylib.dylib">
<PackagePath>runtimes/osx-x64/native/</PackagePath>
<BuildAction>None</BuildAction>
</_PackageFiles>
<_PackageFiles Include="$(NativesRoot)osx-arm64/raylib-$(TargetRaylibTag)_macos/lib/libraylib.dylib">
<PackagePath>runtimes/osx-arm64/native/</PackagePath>
<BuildAction>None</BuildAction>
</_PackageFiles>
<_PackageFiles Include="$(NativesRoot)browser-wasm/raylib-$(TargetRaylibTag)_webassembly/lib/libraylib.web.a">
<PackagePath>runtimes/browser-wasm/native/raylib.a</PackagePath>
<BuildAction>None</BuildAction>
</_PackageFiles>
</ItemGroup>
</Target>
<!-- ================================================================== -->
<!-- TARGET: LOCAL DEVELOPMENT -->
<!-- ================================================================== -->
<Target Name="CopyNativeToOutput" AfterTargets="Build"
Condition="'$(GeneratePackageOnBuild)' != 'true' AND '$(RuntimeIdentifier)' != ''">
<CallTarget Targets="_DownloadAndExtractInternal"/>
<ItemGroup>
<_NativeToCopy Include="$(NativesRoot)$(RuntimeIdentifier)/**/$(LibPattern)"/>
</ItemGroup>
<Copy SourceFiles="@(_NativeToCopy)" DestinationFolder="$(OutputPath)" SkipUnchangedFiles="true"/>
</Target>
<!-- ================================================================== -->
<!-- WORKER: DOWNLOADER -->
<!-- ================================================================== -->
<Target Name="_DownloadAndExtractInternal" Condition="'$(RaylibPackageName)' != ''">
<PropertyGroup>
<_WorkDir>$(NativesRoot)$(RuntimeIdentifier)/</_WorkDir>
<_ArchiveFile>$(_WorkDir)$(RaylibPackageName)$(ArchiveExt)</_ArchiveFile>
<_ExtractMarker>$(_WorkDir).extracted</_ExtractMarker>
</PropertyGroup>
<Message Text="=== _DownloadAndExtractInternal ===" Importance="high"/>
<Message Text="RID = $(RuntimeIdentifier)" Importance="high"/>
<Message Text="Archive = $(_ArchiveFile)" Importance="high"/>
<Message Text="Marker = $(_ExtractMarker)" Importance="high"/>
<MakeDir Directories="$(_WorkDir)"/>
<DownloadFile
SourceUrl="https://github.com/raysan5/raylib/releases/download/$(TargetRaylibTag)/$(RaylibPackageName)$(ArchiveExt)"
DestinationFolder="$(_WorkDir)"
DestinationFileName="$(RaylibPackageName)$(ArchiveExt)"
Condition="!Exists('$(_ArchiveFile)')"
Retries="3"/>
<Message Text="unZIPping" Importance="high" Condition="'$(ArchiveExt)' == '.zip' AND !Exists('$(_ExtractMarker)')"/>
<Unzip SourceFiles="$(_ArchiveFile)"
DestinationFolder="$(_WorkDir)"
OverwriteReadOnlyFiles="true"
Condition="'$(ArchiveExt)' == '.zip' AND !Exists('$(_ExtractMarker)')"/>
<Message Text="unTARing" Importance="high" Condition="'$(ArchiveExt)' == '.tar.gz' AND !Exists('$(_ExtractMarker)')"/>
<Exec Command="tar -xzf &quot;$(RaylibPackageName)$(ArchiveExt)&quot;"
WorkingDirectory="$(_WorkDir)"
Condition="'$(ArchiveExt)' == '.tar.gz' AND !Exists('$(_ExtractMarker)')"/>
<Touch Files="$(_ExtractMarker)" AlwaysCreate="true"/>
<Message Text="Extraction complete" Importance="high"/>
</Target>
</Project>

View file

@ -0,0 +1,10 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Condition="'$(RuntimeIdentifier)' == 'browser-wasm'">
<!-- WASM build needs explicit native reference due to semi-static linkage (?) -->
<NativeFileReference Include="$(MSBuildThisFileDirectory)..\runtimes\browser-wasm\native\raylib.a"/>
</ItemGroup>
<PropertyGroup Condition="'$(RuntimeIdentifier)' == 'browser-wasm'">
<EmccFlags>$(EmccFlags) -sUSE_GLFW=3</EmccFlags>
</PropertyGroup>
</Project>

View file

@ -298,19 +298,6 @@ public static unsafe partial class Rlgl
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
public static partial void DisableVertexAttribute(uint index);
/// <summary>Enable attribute state pointer<br/>
/// NOTE: Only available for GRAPHICS_API_OPENGL_11</summary>
[LibraryImport(NativeLibName, EntryPoint = "rlEnableStatePointer")]
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
public static partial void EnableStatePointer(int vertexAttribType, void* buffer);
/// <summary>Disable attribute state pointer<br/>
/// NOTE: Only available for GRAPHICS_API_OPENGL_11</summary>
[LibraryImport(NativeLibName, EntryPoint = "rlDisableStatePointer")]
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
public static partial void DisableStatePointer(int vertexAttribType);
// Textures state
/// <summary>Select and active a texture slot</summary>

View file

@ -1 +0,0 @@

View file

@ -1 +0,0 @@

View file

@ -1 +0,0 @@