2
0
mirror of https://github.com/raylib-cs/raylib-cs synced 2025-04-03 11:09:40 -04:00
raylib-cs/README.md
Chris e5934b86ba 4.0 (#100)
* Fix formatting/update doc comments in Raylib.cs

* Update types in Raylib.cs to 4.0

* Remove app.config

* Update Raylib.cs functions

* Split Enums, Structs & Classes into own files

* Testing utils for Raylib.cs

* Update Raylib-cs.csproj

* Reorganize types
- Move into types folder
- Group types based on usage

* Fix parameter names

* Rename CloseAudioStream to UnloadAudioStream

* Remove ref SetShaderValue overloads

* Remove some constants from Raylib.cs

* Include README.md in package

* Replace old version of GetDroppedUtils

* Update README.md

* Remove Physac-cs and Raygui-cs
- Not actively maintained and a pain for users to setup...

* Update comments to xmldoc

* Rename Gestures enum to Gesture

* Minor fixes
- Rename Gestures enum to Gesture
- Update tests to net6.0

* Testing CBool type instead of bool

* Update XmlDoc comments

* Update build.yml to net6.0 for tests

* Remove Easings.cs
- Easings used to be part of raylib. It is now a separate extra library
so I am removing it from the main bindings.

* Update rlgl

* More XmlDoc comments

* Use CBool in structs

* Big unsafe update

* Fix typos and change refs to pointers in Rlgl

* Update LoggingUtils and Material

* Fix typo in Rlgl

* Update build.yml

* Rename RaylibUtils.cs to Raylib.Utils
now a partial class

* Convert some RLGL consts to Enums

Also added helper methods/overloads for related methods

* Make class Raylib partial

* Convert some text functions to not use ref

I dont think they will work. need testing

* Testing fixes for Text functions

* Create rlMultMatrixf safe overload

* Implement safe ModelAnimation

* Testing fix for ModelAnimation using wrapper struct

* Added TODOs

* Fix rlMultMatrixf
- Add missing ToFloatV functions to Raymath
- Fix rlMultMatrixf overload to use MatrixToFloatV

* Fix IsGestureDetected and formatting

* Add a few text tests

* Move wrapper functions into Raylib.Utils

* Remove ref from raylib bindings

* Multi-target net5.0

* Testing string approaches

* Fixing more util and unsafe functions

* Testing TraceLogCallback fix

Set lang version to C# 10

* Replace managed callbacks with unsafe delegates

* Update default LogConsole callback

* Setup unsafe/safe functions for math types in Raylib.cs

* Replace string in Rlgl with sbyte*

* Yet more string changes
- Use sbyte/byte correctly in Raylib.cs
- Using Marshal.StringToCoTaskMemUTF8
- Update utils string usage

* Fix typo bug and whitespace

* Fix DrawTextPro and more whitespace

* Remove unused ToString

* Add file functions back into Raylib

* Test paths filter for pull requests

* Change to paths-ignore filter

* Redo partial change

* Move binding functions into interop folder

Co-authored-by: Ben Parsons <9parsonsb@gmail.com>
2022-02-15 00:00:13 +11:00

3.4 KiB

Raylib-cs Logo

Raylib-cs

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

GitHub contributors License

Chat on Discord GitHub stars

Build

Raylib-cs targets net5.0 and net6.0.

Installation - NuGet

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

dotnet add package Raylib-cs --version 4.0.0

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 4.0.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!

Hello, World!

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();
        }
    }
}

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 raylib directly (in contrast to this binding), please refer to the author's project repo.

License

See LICENSE for details.