Raylib-CsLo 4.0.0-alpha.2

This is a prerelease version of Raylib-CsLo.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Raylib-CsLo --version 4.0.0-alpha.2
NuGet\Install-Package Raylib-CsLo -Version 4.0.0-alpha.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Raylib-CsLo" Version="4.0.0-alpha.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Raylib-CsLo --version 4.0.0-alpha.2
#r "nuget: Raylib-CsLo, 4.0.0-alpha.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Raylib-CsLo as a Cake Addin
#addin nuget:?package=Raylib-CsLo&version=4.0.0-alpha.2&prerelease

// Install Raylib-CsLo as a Cake Tool
#tool nuget:?package=Raylib-CsLo&version=4.0.0-alpha.2&prerelease

<h1 align="center"> <a href="#"><img align="center" src="meta/logos/raylib-cslo_128x128.png" height="96"> Raylib-CsLo</a> <br /> </h1>

<div align="center">

Status ALPHA Nuget Package Commit Activity .NET 6.0 Chat on Discord

</div>

Raylib-CsLo

LowLevel autogen bindings to Raylib 4.0 and convenience wrappers on top.

  • Requires use of unsafe
  • A focus on performance. No runtime allocations if at all possible.
  • because these are autogen, there won't be any intellisense docs. read the raylib cheatsheet for docs

Table of Contents

🚧🚨🚧 UNDER CONSTRUCTION 🚧🚨🚧

Currently the bindings work, but because these are bare-bones, autogen bindings, they are not user friendly, even for unsafe use. Right now only the Core Examples have been ported.

Release timeline

ALPHA

BETA

  • Triggered when the model and shaders examples are ported.

RELEASE

  • Triggered when all examples are ported. You can contribute to make this happen.

Differences from raylib-cs

raylib-cs raylib-cslo
each binding is hand crafted with carefull design Autogen with wrappers to make the raylib examples work (with minimal changes). Bindings not used in examples will probably be painful to use (example: convert sbyte* to strings).
Optimized for normal C# usage Optimized for maximum performance and requires unsafe
New Raylib version? Harder to detect breaking changes New Raylib version? Breaking changes are easy to spot and fix
includes Intellisence docs No docs. Use the Cheatsheet
has a long track record didn't exist till mid november 2021!
has lots of examples only the Core examples
zlib licensed lgpl licensed
Nuget Package Nuget Package
Stable Alpha
Works with various dotnet flavors? Focus on DotNet6.0
lots of contribs just little 'ol me

Usage Tips / FAQ

  • Is there a wrapper for this function? or do I have to really cast my Enum to int?
    • The autogen bindings are left untouched, however convenience wrappers are added. Usually these will automagically "work" via function overloads, but where this is not possible, try adding an underscore _ to the end of the function/property. For example: Camera3D.projection_ = CameraProjection.CAMERA_ORTHOGRAPHIC; or Gesture gesture = Raylib.GetGestureDetected_();
  • I ran the examples in a profiler. What are all these sbyte[] arrays being allocated?
    • A pool of sbyte[] is allocated for string marshall purposes, to avoid runtime allocations.
  • Why don't you add wrappers for the Math helpers?
    • The RayMath helper functions have been translated into C# code. This is because crossing between Managed and Native code isn't free. Better you do all your maths in managed code, and pass the final result to raylib.
  • Why are my matricies corrupt?
    • Raylib/OpenGl uses column-major matricies, while dotnet/vulkan/directx uses row-major. When passing your final calculated matrix to raylib for rendering, call Matrix4x4.Transpose(yourMatrix)

How to Contribute

  1. assume you are using Visual Studio (or maybe rider?) and can run dev.sln
  2. fork the repo, build and try out the example project
  3. Look at how a lot of the raylib functions used in the core examples have convenience wrappers.
  4. Pick one of the raylib example groups not being worked on, and let novaleaf know either on discord or via an issue
  5. port the example group, following the general design as the core examples.
~ example group ~ ~ contrib doing port ~ ~ done? ~
core novaleaf [x]
shapes [ ]
textures [ ]
text [ ]
models novaleaf [x]
shaders [ ]
audio [ ]
physics [ ]

ChangeLog

  • 4.0.0-alpha.2 (2021/11/18): Model examples ported. AutoGen Bindings expanded to include all api's exposed by Raylib.dll (adding RayMath, RlGl, RayGui)
  • 4.0.0-alpha.1 (2021/11/16): all core examples ported, so "feature complete" for the workflows used in those examples (and, complete only for those workflows)
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Raylib-CsLo:

Package Downloads
RayWrapper.Base

This is the Base package for RayWrapper

Raylib_ImGui

Open-source ImGui renderer for Raylib

RayWork.RLImgui

Imgui.Net integration

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on Raylib-CsLo:

Repository Stars
sinshu/meltysynth
A SoundFont MIDI synthesizer for .NET
Version Downloads Last updated
4.2.0.9 8,718 3/2/2023
4.2.0.9-pre-m1-0 5,885 3/1/2023
4.2.0.8 6,016 3/1/2023
4.2.0.7 5,897 2/28/2023
4.2.0.6 6,002 2/25/2023
4.2.0.5 6,122 2/6/2023
4.2.0.5-alpha1 5,801 2/2/2023
4.2.0.4 6,061 1/31/2023
4.2.0.3 8,614 9/22/2022
4.2.0.2 5,694 9/20/2022
4.2.0.1 5,764 9/20/2022
4.2.0-alpha1 5,623 9/20/2022
4.2.0-alpha0 5,463 9/19/2022
4.0.1 8,486 4/9/2022
4.0.0 6,631 1/16/2022
4.0.0-rc.5.0 306 12/15/2021
4.0.0-rc.4.2 163 12/11/2021
4.0.0-rc.4.1 162 12/9/2021
4.0.0-rc.4.0 173 12/5/2021
4.0.0-rc.3.1 929 11/29/2021
4.0.0-rc.3 833 11/29/2021
4.0.0-rc.2 165 11/27/2021
4.0.0-rc.1 2,977 11/25/2021
4.0.0-rc.0.1 5,768 11/23/2021
4.0.0-rc.0 138 11/23/2021
4.0.0-beta.2 148 11/22/2021
4.0.0-beta.1 929 11/20/2021
4.0.0-beta.0 931 11/20/2021
4.0.0-alpha.2 145 11/19/2021
4.0.0-alpha.1 205 11/17/2021
4.0.0-alpha.0 237 11/17/2021

Alpha release.  It works, but check the examples on github.