Watch
2
0
Fork
You've already forked raylib-cs
0
C# bindings for raylib, a simple and easy-to-use library to learn videogames programming http://www.raylib.com/
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
ChrisDill b1f46d3307 Fix pinvoke crashes when returning strings for GetMonitorName, GetClipboardText and GetGamepadName
- These functions return native memory to strings. However it was trying to free the native memory.
- I changed it so they return IntPtr internally and the public versions use Marshal.PtrToStringAnsi to copy it into a
string which fixes this issue.
2020-12-29 18:34:04 +00:00
.github/workflows Update workflow and README.md ready to merge into master 2020-12-27 17:11:21 +00:00
Logo Added logos and updated readme 2018-09-13 12:00:51 +01:00
Physac-cs Dropping experimental netfx support 2020-11-12 11:17:03 +00:00
Raygui-cs Dropping experimental netfx support 2020-11-12 11:17:03 +00:00
Raylib-cs Fix pinvoke crashes when returning strings for GetMonitorName, GetClipboardText and GetGamepadName 2020-12-29 18:34:04 +00:00
Raylib-cs.Tests Update to net5.0 using a fix for net5.0 support in dotnetcore.yml 2020-11-28 14:50:11 +00:00
.gitignore - Improvements for 2.5 release. Alot more work than I expected. 2019-04-22 07:40:01 +01:00
app.config Initial project update. 2020-04-01 14:35:26 +01:00
LICENSE Minor update. 2020-09-15 08:57:14 +01:00
netfx.props Initial project update. 2020-04-01 14:35:26 +01:00
Raylib-cs.sln Added Platform.cs - to copy (correct) native library at runtime (for netfx) 2020-05-08 02:20:20 +10:00
README.md Update README.md 2020-12-28 10:56:29 +00:00

Raylib-cs Logo

Raylib-cs

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

GitHub contributors License .NET Core GitHub stars

Chat on Discord

Raylib-cs targets netstandard2.1 and supports netcoreapp3.0+ and net5.0.

Installation - NuGet

This is the prefered method to get started - The package is still new so please report any issues.

NOTE: The nuget package uses raylib 3.0. It will soon be updated to raylib 3.5.0.

dotnet add package Raylib-cs --version 3.1.5

NuGet

If you need to edit Raylib-cs source then you will need to add the bindings as a project (see below).

Installation - Manual

  1. Download/Clone this repo

  2. Add Raylib-cs/Raylib-cs.csproj to your project as an existing project.

  3. Download the native libraries for the platforms you want to build for using the official 3.5.0 release. NOTE: the MSVC version is required for Windows platforms

  4. (Recommended) Put the native library for each platform under Raylib-cs/runtimes/{platform}/native/ (Optional) If you want to handle the native libraries yourself, make sure they are either in the same directory as the executable and/or can be found in the search path. See https://www.mono-project.com/docs/advanced/pinvoke/ for details.

  5. Start coding!

using Raylib_cs;

namespace HelloWorld
{
    static class Program
    {
        public static void Main()
        {
            Raylib.InitWindow(800, 480, "Hello World");

            while (!Raylib.WindowShouldClose())
            {
                Raylib.BeginDrawing();
                Raylib.ClearBackground(Color.WHITE);

                Raylib.DrawText("Hello, world!", 12, 12, 20, Color.BLACK);

                Raylib.EndDrawing();
            }

            Raylib.CloseWindow();
        }
    }
}

Physac-cs and Raygui-cs

These are unfinished EXPERIMENTAL bindings to physac and raygui. Added as a test to Raylib-cs but caused confusion in project setup so they were moved into their own libraries.

Documentation

Examples for Raylib-cs can be found at Raylib-cs-Examples.

Details about Raylib-cs can be found on the Raylib-cs wiki.

Contributing

If you have any ideas, feel free to open an issue and tell me what you think. If you'd like to contribute, please fork the repository and make changes as you'd like. Pull requests are warmly welcome.

If you want to request features or report bugs related to the library (in contrast to this binding), please refer to the author's project repo.

License

See LICENSE for details.