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 fa3039fb11 Big commit. Starting the update to 3.0!!!
- Renamed the Bindings folder to Raylib-cs.
- Renamed namespace from Raylib to Raylib_cs.
- Updated functions to raylib 3.0.
- Documenting IntPtr types for reference.
- Separating modules by making the class and nativeLibName unique to the module.
- Added rlgl bindings.
2020-04-01 14:46:51 +01:00
.github/workflows Initial project update. 2020-04-01 14:35:26 +01:00
Generator Updating .csproj files to help with testing continuous integration. 2020-01-29 19:37:21 +00:00
Logo Added logos and updated readme 2018-09-13 12:00:51 +01:00
Raylib-cs Big commit. Starting the update to 3.0!!! 2020-04-01 14:46:51 +01:00
Tests Updating .csproj files to help with testing continuous integration. 2020-01-29 19:37:21 +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.md Updated project files. 2019-12-11 11:24:20 +00:00
netfx.props Initial project update. 2020-04-01 14:35:26 +01:00
Raylib-cs.sln Initial project update. 2020-04-01 14:35:26 +01:00
README.md Update README.md 2019-06-04 08:17:54 +01:00

Raylib-cs Logo

Raylib-cs

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

Installation

So far, I have only done a few tests on Windows and Linux.

  1. Copy or reference the bindings folder in your project. See the test projects for reference.

  2. The bindings need a native library to load. It should match your platform and configuration. You can either:

    • Download a raylib release.

    • Build raylib from source. Use this if your using module bindings that are not built in relesaes by default.

  3. Make sure the native library is in a place your project can find it. This will vary for your platform. See https://www.mono-project.com/docs/advanced/pinvoke/ for more details.

  4. Start coding!

using Raylib;
using rl = Raylib.Raylib;

static class Program
{
    public static void Main() 
    {
        rl.InitWindow(640, 480, "Hello World");

        while (!rl.WindowShouldClose())
        {
            rl.BeginDrawing();

            rl.ClearBackground(Color.WHITE);
            rl.DrawText("Hello, world!", 12, 12, 20, Color.BLACK);

            rl.EndDrawing();
        }

        rl.CloseWindow();
    }
}

Tech notes

  • Certain funtions take a enum instead of a int such as IsKeyPressed.
  • Colors stored in the Color struct. RED changes to Color.RED
  • Uses string.Format instead of TextFormat.
  • Adds constructors for structs.
  • Adds operator overloads for math structs.

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

raylib-cs (and raylib) is licensed under an unmodified zlib/libpng license, which is an OSI-certified, BSD-like license that allows static linking with closed source software. Check LICENSE for further details.