Raylib-CsLo
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
- Raylib-CsLo
- Table of Contents
-
π§ π¨ π§ UNDER CONSTRUCTIONπ§ π¨ π§ - Differences from
raylib-cs
- Usage Tips / FAQ
- How to Contribute
π§
π¨
π§
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 about 10 core examples have been ported.
Release timeline
PRE-ALPHA
- The current status.
- You can look around, try out the samples, but I would not recomend using it.
ALPHA
- A Nuget package will be released at that time.
- Triggered when all the core examples are ported. This will ensure that a minimal set of convenience wrappers are in place to keep things from getting too miserable.
BETA
- Triggered when the
model
andshaders
examples are ported.
RELEASE
- Triggered when all examples are ported. You can contribute to make this happen.
raylib-cs
Differences from 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 | not that many examples yet |
zlib licensed | lgpl licensed |
Nuget Package | just this repo right now |
Stable | in development |
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;
orGesture gesture = Raylib.GetGestureDetected_();
- 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
- 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.
- A pool of
- Why don't you add wrappers for the Math helpers?
- 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)
- Raylib/OpenGl uses column-major matricies, while dotnet/vulkan/directx uses row-major. When passing your final calculated matrix to raylib for rendering, call
How to Contribute
- assume you are using Visual Studio (or maybe rider?) and can run
dev.sln
- fork the repo, build and try out the example project
- Look at how a lot of the raylib functions used in the core examples have convenience wrappers.
- Pick one of the raylib example groups not being worked on, and let novaleaf know either on discord or via an issue
- port the example group, following the general design as the core examples.
example group | contrib doing port | done? |
---|---|---|
core | novaleaf | [ ] |
shapes | [ ] | |
textures | [ ] | |
text | [ ] | |
models | [ ] | |
shaders | [ ] | |
audio | [ ] | |
physics | [ ] |