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,184 +1,45 @@
name: Build
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: .NET
on:
push:
branches: ["main"]
branches: ["master"]
pull_request:
branches: ["*"]
paths-ignore:
- "README.md"
- ".github/ISSUE_TEMPLATE/**"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-22.04
outputs:
version: ${{ steps.version.outputs.version }}
pkgversion: ${{ steps.version.outputs.pkgversion }}
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v4
- uses: actions/checkout@v4
- name: check raylib version
id: version
shell: bash
run: |
echo "version=$(sed -n 's/.*<TargetRaylibTag>\(.*\)<\/TargetRaylibTag>.*/\1/p' Raylib-cs/Build.props)">> ${GITHUB_OUTPUT}
echo "pkgversion=$(sed -n 's/.*<PackageVersion>\(.*\)<\/PackageVersion>.*/\1/p' Raylib-cs/Build.props)">> ${GITHUB_OUTPUT}
build-linux:
runs-on: ubuntu-22.04
needs: build
steps:
- name: checkout repository
uses: actions/checkout@v4
- name: setup dotnet
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
9.0.x
10.0.x
- name: setup dependencies
run: |
sudo apt-get update
sudo apt-get install \
libasound2-dev \
libx11-dev \
libxrandr-dev \
libxi-dev \
libgl1-mesa-dev \
libglu1-mesa-dev \
libxcursor-dev \
libxinerama-dev
- name: build projects
run: dotnet build -c Release
- name: run tests
run: dotnet test Raylib-cs.Tests -c Release
- name: upload build
uses: actions/upload-artifact@v4
with:
name: linux-x64
path: Raylib-cs.Native/bin/Release/native/raylib/libraylib.so
if-no-files-found: error
build-osx:
runs-on: macos-latest
needs: build
strategy:
matrix:
name: [arm64, x64]
include:
- name: arm64
arch: arm64
- name: x64
arch: x86_64
steps:
- name: checkout repository
uses: actions/checkout@v4
- name: setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
- name: build projects
run: dotnet build -c Release /p:BuildArch=${{ matrix.arch }}
- name: run tests
run: dotnet test Raylib-cs.Tests -c Release
- name: upload build
uses: actions/upload-artifact@v4
with:
name: osx-${{ matrix.name }}
path: Raylib-cs.Native/bin/Release/native/raylib/libraylib.dylib
if-no-files-found: error
build-windows:
runs-on: windows-latest
needs: build
strategy:
matrix:
name: [x86, x64]
include:
- name: x86
arch: win32
- name: x64
arch: x64
steps:
- name: checkout repository
uses: actions/checkout@v4
- name: setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
- name: build projects
run: dotnet build -c Release /p:BuildArch=${{ matrix.arch }}
- name: run tests
run: dotnet test Raylib-cs.Tests -c Release
- name: upload build
uses: actions/upload-artifact@v4
with:
name: win-${{ matrix.name }}
path: Raylib-cs.Native/bin/Release/native/raylib/Release/raylib.dll
if-no-files-found: error
build-publish:
runs-on: ubuntu-22.04
needs:
- build-linux
- build-osx
- build-windows
steps:
- name: checkout repository
uses: actions/checkout@v4
- uses: actions/download-artifact@v4.1.7
with:
name: linux-x64
path: Raylib-cs/runtimes/linux-x64/native
- uses: actions/download-artifact@v4.1.7
with:
name: osx-arm64
path: Raylib-cs/runtimes/osx-arm64/native
- uses: actions/download-artifact@v4.1.7
with:
name: osx-x64
path: Raylib-cs/runtimes/osx-x64/native
- uses: actions/download-artifact@v4.1.7
with:
name: win-x86
path: Raylib-cs/runtimes/win-x86/native
- uses: actions/download-artifact@v4.1.7
with:
name: win-x64
path: Raylib-cs/runtimes/win-x64/native
- name: setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
- name: create NuGet Package
- name: Create NuGet Package
run: dotnet pack Raylib-cs -c Release --output nuget
- name: Restore + Install Built Package
run: |
dotnet restore
- name: Run Tests
run: |
dotnet test --verbosity normal
- name: upload NuGet Package As Artifact
uses: actions/upload-artifact@v4

View file

@ -21,7 +21,6 @@
using System.Numerics;
using Raylib_cs;
using static Raylib_cs.Raylib;
namespace Examples.Core;

View file

@ -24,53 +24,53 @@ public static class SmoothPixelPerfect
{
// Initialization
//--------------------------------------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
const int screenWidth = 800;
const int screenHeight = 450;
const int virtualScreenWidth = 160;
const int virtualScreenHeight = 90;
const int virtualScreenWidth = 160;
const int virtualScreenHeight = 90;
const float virtualRatio = (float)screenWidth / (float)virtualScreenWidth;
const float virtualRatio = (float)screenWidth / (float)virtualScreenWidth;
InitWindow(screenWidth, screenHeight, "raylib [core] example - smooth pixel-perfect camera");
InitWindow(screenWidth, screenHeight, "raylib [core] example - smooth pixel-perfect camera");
// Game world camera
Camera2D worldSpaceCamera = new();
worldSpaceCamera.Zoom = 1.0f;
// Game world camera
Camera2D worldSpaceCamera = new();
worldSpaceCamera.Zoom = 1.0f;
// Smoothing camera
Camera2D screenSpaceCamera = new();
screenSpaceCamera.Zoom = 1.0f;
// Smoothing camera
Camera2D screenSpaceCamera = new();
screenSpaceCamera.Zoom = 1.0f;
// This is where we'll draw all our objects.
RenderTexture2D target = LoadRenderTexture(virtualScreenWidth, virtualScreenHeight);
// This is where we'll draw all our objects.
RenderTexture2D target = LoadRenderTexture(virtualScreenWidth, virtualScreenHeight);
Rectangle rec01 = new(70.0f, 35.0f, 20.0f, 20.0f);
Rectangle rec02 = new(90.0f, 55.0f, 30.0f, 10.0f);
Rectangle rec03 = new(80.0f, 65.0f, 15.0f, 25.0f);
Rectangle rec01 = new(70.0f, 35.0f, 20.0f, 20.0f);
Rectangle rec02 = new(90.0f, 55.0f, 30.0f, 10.0f);
Rectangle rec03 = new(80.0f, 65.0f, 15.0f, 25.0f);
// The target's height is flipped (in the source Rectangle), due to OpenGL reasons
Rectangle sourceRec = new(
0.0f,
0.0f,
(float)target.Texture.Width,
-(float)target.Texture.Height
);
Rectangle destRec = new(
-virtualRatio,
-virtualRatio,
screenWidth + (virtualRatio * 2),
screenHeight + (virtualRatio * 2)
);
// The target's height is flipped (in the source Rectangle), due to OpenGL reasons
Rectangle sourceRec = new(
0.0f,
0.0f,
(float)target.Texture.Width,
-(float)target.Texture.Height
);
Rectangle destRec = new(
-virtualRatio,
-virtualRatio,
screenWidth + (virtualRatio * 2),
screenHeight + (virtualRatio * 2)
);
Vector2 origin = new(0.0f, 0.0f);
Vector2 origin = new(0.0f, 0.0f);
float rotation = 0.0f;
float rotation = 0.0f;
float cameraX = 0.0f;
float cameraY = 0.0f;
float cameraX = 0.0f;
float cameraY = 0.0f;
SetTargetFPS(60);
SetTargetFPS(60);
//--------------------------------------------------------------------------------------
// Main game loop

View file

@ -1,25 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<StartupObject>Examples.Program</StartupObject>
<RunWorkingDirectory>$(MSBuildThisFileDirectory)</RunWorkingDirectory>
<LangVersion>default</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<StartupObject>Examples.Program</StartupObject>
<RunWorkingDirectory>$(MSBuildThisFileDirectory)</RunWorkingDirectory>
<LangVersion>12</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Core/LoadingThread.cs"/>
<Compile Remove="Text/Unicode.cs"/>
</ItemGroup>
<ItemGroup>
<Compile Remove="Core/LoadingThread.cs"/>
<Compile Remove="Text/Unicode.cs"/>
</ItemGroup>
<ItemGroup>
<Using Include="Raylib_cs" />
</ItemGroup>
<ItemGroup>
<Using Include="Raylib_cs"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../Raylib-cs/Raylib-cs.csproj" />
<ProjectReference Include="../Raylib-cs.Native/Raylib-cs.Native.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Raylib-cs" Version="8.0.0"/>
</ItemGroup>
</Project>

View file

@ -11,6 +11,7 @@
using System;
using System.Numerics;
using Raylib_cs;
using static Raylib_cs.Raylib;
namespace Examples.Shapes;

7
NuGet.config Normal file
View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="LocalRaylibBuild" value="./nuget" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>

View file

@ -2,7 +2,7 @@
# Raylib-cs
C# bindings for raylib, a simple and easy-to-use library to learn videogames programming (www.raylib.com)
C# bindings for raylib, a simple and easy-to-use library to learn video games programming (www.raylib.com)
[![GitHub contributors](https://img.shields.io/github/contributors/raylib-cs/raylib-cs)](https://github.com/raylib-cs/raylib-cs/graphs/contributors)
[![License](https://img.shields.io/badge/license-zlib%2Flibpng-blue.svg)](LICENSE)
@ -13,17 +13,30 @@ C# bindings for raylib, a simple and easy-to-use library to learn videogames pro
Raylib-cs targets net8.0, net10.0 and uses the [official 6.0 release](https://github.com/raysan5/raylib/releases/tag/6.0)
to build the native libraries.
### Version 8.0.0 of Raylib-cs supports the following runtimes:
- **browser-wasm** *(raylib-6.0_webassembly)* 🆕
- **linux-x64** *(raylib-6.0_linux_amd64)*
- **osx-arm64** *(raylib-6.0_macos)*
- **osx-x64** *(raylib-6.0_macos)*
- **win-x64** *(raylib-6.0_win64_msvc16)*
- **win-x86** *(raylib-6.0_win32_msvc16)*
The following frameworks are deprecated (fall back to Version 7.x if required):
- net6.0 (end of life)
## Status
Raylib-cs is passively maintained. Occasional updates may be released from time to time. Pull requests may be
accepted if they don't have a large maintainence burden.
accepted if they don't have a large maintenance burden.
## Installation - NuGet
This is the prefered method to get started.
This is the preferred method to get started.
1) Pick a folder in which you would like to start a raylib project. For example "MyRaylibCSProj".
2) Then from a terminal whilst in the directory you just created run the following commands. (Please keep in mind .NET should already be installed on your system).
1) Pick a folder in which you would like to start a raylib project. For example, "MyRaylibCSProj."
2) Then from a terminal (for example, a VSCode terminal), whilst in the directory you just created
run the following commands. (Please keep in mind .NET should already be installed on your system)
```
dotnet new console
@ -34,9 +47,11 @@ dotnet add package Raylib-cs
[![NuGet](https://img.shields.io/nuget/dt/raylib-cs)](https://www.nuget.org/packages/Raylib-cs/)
If you need to edit Raylib-cs source then you will need to add the bindings as a project (see below).
If you need to edit the Raylib-cs source, then you will need to add the bindings as a project (see below).
Remember if you are trying to run the above commands in the terminal that you need to be *inside the intended project directory* (not just inside the solution directory) otherwise the command won't work.
If you are new to using NuGet (or you've forgotten) and are trying to run the above command in the command prompt,
remember that you need to be *inside the intended project directory* (not just inside the solution directory);
otherwise the command won't work.
## Installation - Manual
@ -46,9 +61,9 @@ Remember if you are trying to run the above commands in the terminal that you ne
3. Download/build the native libraries for the platforms you want using the [official 6.0 release](https://github.com/raysan5/raylib/releases/tag/6.0). **NOTE: the MSVC version is required for Windows platforms**
4. Add the native libraries to your project so they are in the same directory as the executable/can be found in the [search path](https://www.mono-project.com/docs/advanced/pinvoke/).
4. Set up the native libraries, so they are in the same directory as the executable/can be found in the [search path](https://www.mono-project.com/docs/advanced/pinvoke/).
6. Start coding!
5. Start coding!
## Hello, World!

View file

@ -1,5 +0,0 @@
namespace Raylib_cs.Native;
internal class Native
{
}

View file

@ -1,71 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk" InitialTargets="ConfigureNative">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<DebugType>none</DebugType>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateDependencyFile>False</GenerateDependencyFile>
</PropertyGroup>
<Import Project="../Raylib-cs/Build.props" />
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Linux'))">
<NativeExt>so</NativeExt>
<NativePre>lib</NativePre>
<NativeArch>x64</NativeArch>
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('OSX'))">
<NativeExt>dylib</NativeExt>
<NativePre>lib</NativePre>
<NativeArch Condition="$(BuildArch) == ''">x86_x64</NativeArch>
<NativeArch Condition="$(BuildArch) != ''">$(BuildArch)</NativeArch>
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))">
<NativeExt>dll</NativeExt>
<NativePre>$(Configuration)/</NativePre>
<NativeArch Condition="$(BuildArch) == ''">x64</NativeArch>
<NativeArch Condition="$(BuildArch) != ''">$(BuildArch)</NativeArch>
</PropertyGroup>
<ItemGroup Condition="$([MSBuild]::IsOSPlatform('OSX')) AND $(NativeArch) == 'arm64'">
<CMakeArgs Include="-D CMAKE_OSX_ARCHITECTURES=arm64" />
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::IsOSPlatform('OSX')) AND $(NativeArch) == 'x86_64'">
<CMakeArgs Include="-D CMAKE_OSX_ARCHITECTURES=x86_64" />
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::IsOsPlatform('Windows')) AND $(NativeArch) == 'win32'">
<CMakeArgs Include="-A win32" />
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::IsOsPlatform('Windows')) AND $(NativeArch) == 'x64'">
<CMakeArgs Include="-A x64" />
</ItemGroup>
<ItemGroup>
<Content Include="$(OutputPath)native/raylib/$(NativePre)raylib.$(NativeExt)" Link="%(Filename)%(Extension)" CopyToOutputDirectory="PreserveNewest" Condition="Exists('$(OutputPath)native/raylib/$(NativePre)raylib.$(NativeExt)')" />
<CMakeArgs Include="-B $(OutputPath)native" />
<CMakeArgs Include="-S $(BaseIntermediateOutputPath)raylib-$(TargetRaylibTag)" />
<CMakeArgs Include="-D CMAKE_BUILD_TYPE=$(Configuration)" />
<CMakeArgs Include="-D BUILD_SHARED_LIBS=ON" />
<CMakeArgs Include="-D BUILD_EXAMPLES=OFF" />
<CMakeArgs Include="-D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded" />
<CMakeArgs Include="-D CMAKE_MINIMUM_REQUIRED_VERSION=3.15" />
<CMakeArgs Include="-D CMAKE_POLICY_DEFAULT_CMP0091=NEW" />
<!-- <CMakeArgs Include="-D GLFW_BUILD_WAYLAND=ON" /> -->
<!-- <CMakeArgs Include="-D GRAPHICS=GRAPHICS_API_OPENGL_43" /> -->
</ItemGroup>
<Target Name="ConfigureNative" Condition="$(SkipLocalBuild) != true">
<DownloadFile SourceUrl="https://github.com/raysan5/raylib/archive/refs/tags/$(TargetRaylibTag).zip" DestinationFolder="$(BaseIntermediateOutputPath)" DestinationFileName="raylib.zip" Condition="!Exists('$(BaseIntermediateOutputPath)raylib.zip')" />
<Unzip SourceFiles="$(BaseIntermediateOutputPath)raylib.zip" DestinationFolder="$(BaseIntermediateOutputPath)" OverwriteReadOnlyFiles="true" Condition="!Exists('$(BaseIntermediateOutputPath)raylib-$(TargetRaylibTag)')" />
<Exec Command="cmake @(CMakeArgs, ' ') $(CMakeExtraArgs)" />
<Exec Command="cmake --build $(OutputPath)native --config $(Configuration)" />
</Target>
</Project>

View file

@ -1,18 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net10.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>12</LangVersion>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>12</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.4" />
<PackageReference Include="coverlet.collector" Version="6.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0"/>
<PackageReference Include="xunit" Version="2.6.2"/>
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.4"/>
<PackageReference Include="coverlet.collector" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Raylib-cs\Raylib-cs.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Raylib-cs" Version="8.0.0"/>
</ItemGroup>
</Project>

View file

@ -15,7 +15,7 @@ public static class BlittableHelper
public class RaylibTests
{
private unsafe void CheckType<T>() where T : unmanaged
private static void CheckType<T>() where T : unmanaged
{
Assert.True(BlittableHelper.IsBlittable<T>());
}

View file

@ -9,8 +9,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Raylib-cs.Tests", "Raylib-c
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Examples", "Examples\Examples.csproj", "{1E2A5986-3F11-457F-AF97-D0C08D0060BA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Raylib-cs.Native", "Raylib-cs.Native\Raylib-cs.Native.csproj", "{B89AA313-3675-42A3-80BC-6156913E3A27}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -32,9 +30,5 @@ Global
{1E2A5986-3F11-457F-AF97-D0C08D0060BA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1E2A5986-3F11-457F-AF97-D0C08D0060BA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1E2A5986-3F11-457F-AF97-D0C08D0060BA}.Release|Any CPU.Build.0 = Release|Any CPU
{B89AA313-3675-42A3-80BC-6156913E3A27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B89AA313-3675-42A3-80BC-6156913E3A27}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B89AA313-3675-42A3-80BC-6156913E3A27}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B89AA313-3675-42A3-80BC-6156913E3A27}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

View file

@ -0,0 +1,2 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/UserDictionary/Words/=macos/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

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