danilwhale / Raylib-cs.BleedingEdge

C# binding for raylib, a simple and easy-to-use library to learn videogames programming
zlib License
3 stars 1 forks source link

logo

Raylib-cs.BleedingEdge

C# bindings for raylib, a simple and easy-to-use library to learn videogames programming (www.raylib.com)

NuGet Downloads GitHub License Discord GitHub Repo stars GitHub commit activity GitHub Actions Workflow Status


Raylib-cs.BleedingEdge targets .NET 8+ and uses the master branch of raylib repo

To see examples, you can reference the Raylib-cs examples as this binding has mostly same function signatures (see API differences)

installation

You will need to install the following NuGet packages:

If you need only prebuilt raylib library natives, you can just install Raylib-cs.BleedingEdge.Runtimes

If you want to customize raylib, you need to copy CompileNatives.props to your project files and add <Import Project="CompileNatives.props"> to your project file (.csproj)

[!NOTE] If you want to compile a static library, add <CompileShared>false</CompileShared> in your project file's PropertyGroup

If you need static library, go to GitHub Actions, open the latest build (top most) and download RID-static artifact

[!NOTE] You will need GitHub account to download artifacts

basic example

using Raylib_cs.BleedingEdge;
using static Raylib_cs.BleedingEdge.Raylib;

const int screenWidth = 800;
const int screenHeight = 540;

InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window");

while (!WindowShouldClose())
{
    BeginDrawing();
    ClearBackground(Color.RayWhite);

    DrawText("Congrats! You created your first window!", 190, 200, 20, Color.LightGray);

    EndDrawing();
}

CloseWindow();

differences from Raylib-cs

main differences

Raylib-cs Raylib-cs.BleedingEdge
.NET 6.0+ .NET 8.0+
Released 07-2018 Released 08-2024
raylib 5.0 raylib 5.5-dev (master)

API differences

[!NOTE] There are minor enum value name differences, such as WindowHighDpi instead of HighDpiWindow, KbMenu instead of KeyboardMenu. Enum value names in this binding are same as in raylib, but renamed to match PascalCase

Raylib-cs Raylib-cs.BleedingEdge
using Raylib-cs using Raylib-cs.BleedingEdge
T[] for functions with pointers Span<T> for functions with pointers
int argument for the length of array -, use Span<T>.Slice if necessary
Utf8Buffer Utf8Handle
AudioCallback AudioMixedCallback