From 5e2b5aef34ed83499cf074014b03d56ab4e0e278 Mon Sep 17 00:00:00 2001 From: Chris Dill Date: Fri, 31 Jul 2026 08:24:07 +0100 Subject: [PATCH] Review README files and comment style --- Examples/Core/Customlogging.cs | 2 +- Examples/Shapes/EllipseCollision.cs | 2 +- Examples/Web/README.md | 4 +- Examples/Web/index.html | 4 +- README.md | 62 ++++++++++++++--------------- 5 files changed, 37 insertions(+), 37 deletions(-) diff --git a/Examples/Core/Customlogging.cs b/Examples/Core/Customlogging.cs index 5b8ccb0..a70a0f4 100644 --- a/Examples/Core/Customlogging.cs +++ b/Examples/Core/Customlogging.cs @@ -80,7 +80,7 @@ public unsafe partial class CustomLogging : IExample { #if !BROWSER // Restore the default formatting logger on desktop. On WebAssembly we leave the (wasm-safe) - // custom logger in place — Logging.LogConsole formats via vsprintf, which traps on wasm. + // custom logger in place - Logging.LogConsole formats via vsprintf, which traps on wasm. SetTraceLogCallback(&Logging.LogConsole); #endif } diff --git a/Examples/Shapes/EllipseCollision.cs b/Examples/Shapes/EllipseCollision.cs index c73ca3e..da8f7f2 100644 --- a/Examples/Shapes/EllipseCollision.cs +++ b/Examples/Shapes/EllipseCollision.cs @@ -46,7 +46,7 @@ public partial class EllipseCollision : IExample } // Check if two ellipses collide - // Uses radial boundary distance in the direction between centers — scales correctly with radii + // Uses radial boundary distance in the direction between centers - scales correctly with radii private static bool CheckCollisionEllipses(Vector2 c1, float rx1, float ry1, Vector2 c2, float rx2, float ry2) { float dx = c2.X - c1.X; diff --git a/Examples/Web/README.md b/Examples/Web/README.md index 7b8b9d6..fae4651 100644 --- a/Examples/Web/README.md +++ b/Examples/Web/README.md @@ -1,4 +1,4 @@ -# Examples/Web — raylib-cs in the browser (WebAssembly) +# Examples/Web - raylib-cs in the browser (WebAssembly) Runs the raylib examples in the browser via WebAssembly, with a dropdown and Prev/Next buttons to switch between them. @@ -73,7 +73,7 @@ page), so frames are driven from JavaScript: ## Adding more examples -Examples are **auto-discovered by reflection** (`ExampleRegistry.DiscoverAll`) — no list to edit. +Examples are **auto-discovered by reflection** (`ExampleRegistry.DiscoverAll`) - no list to edit. Drop a new `.cs` file in the matching category folder implementing `IExample`, splitting the original monolithic `Main` as: diff --git a/Examples/Web/index.html b/Examples/Web/index.html index 290f781..c2d6037 100644 --- a/Examples/Web/index.html +++ b/Examples/Web/index.html @@ -3,7 +3,7 @@ - raylib-cs — browser examples + raylib-cs - browser examples @@ -71,7 +71,7 @@ - +
diff --git a/README.md b/README.md index e2457c2..38b67a7 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ Raylib-cs targets net8.0, net10.0 and uses the [official 6.0 release](https://gi to build the native libraries. ### Version 8.1.0 of Raylib-cs supports the following runtimes: + - **browser-wasm** *(raylib-6.0_webassembly)* 🆕 - **linux-x64** *(raylib-6.0_linux_amd64)* - **osx-arm64** *(raylib-6.0_macos)* @@ -24,7 +25,6 @@ to build the native libraries. The following frameworks are deprecated (fall back to Version 7.x if required): - net6.0 (end of life) - ## Status Raylib-cs is passively maintained. Occasional updates may be released from time to time. Pull requests may be @@ -34,14 +34,14 @@ accepted if they don't have a large maintenance burden. This is the preferred method to get started. -1) Pick a folder in which you would like to start a raylib project. For example, "MyRaylibCSProj." +1) Pick a folder in which you would like to start a raylib project. For example, "HelloRaylibCS." 2) Then from a terminal (for example, a VSCode terminal), whilst in the directory you just created run the following commands. (Please keep in mind .NET should already be installed on your system) -``` +```sh dotnet new console ``` -``` +```sh dotnet add package Raylib-cs ``` @@ -65,25 +65,6 @@ otherwise the command won't work. 5. Start coding! -## Building from source - -The `Examples` and `Raylib-cs.Tests` projects consume the binding as a NuGet package, and the in-repo -version may not be published on nuget.org yet. Pack it once into the local feed before the first build: - -``` -dotnet pack Raylib-cs -c Release -o nuget -dotnet build -``` - -`NuGet.config` points restore at the local `./nuget` feed, so both projects pick up the freshly packed -package. If you skip the pack step on a fresh clone, restore fails with NU1301 (the `./nuget` source -doesn't exist) or NU1102 (Raylib-cs not found) — running the pack command fixes both. - -When iterating on the binding itself, note that NuGet caches the extracted package by version and -ignores repacks of the same version. After repacking, delete the old package from `./nuget` and clear -the cached copy (`dotnet nuget locals global-packages --clear`, or delete -`~/.nuget/packages/raylib-cs/`) before restoring again. - ## Hello, World! ```csharp @@ -115,21 +96,40 @@ internal static class Program } ``` -## Building the examples locally +## Building from source -The `Examples` project references the sibling `Raylib-cs` project by default, so local changes to the -bindings are picked up directly: +The `Examples` and `Raylib-cs.Tests` projects reference the sibling `Raylib-cs` project by default, so local changes to the the bindings are picked up directly: -``` +```sh dotnet run --project Examples ``` - -To build the examples against the Raylib-cs NuGet package instead (the version set by -`RaylibCsVersion` in [Directory.Build.props](Directory.Build.props)), set `UseRaylibCsPackage`: - +```sh +dotnet test ``` + +Both projects can also consume the binding as a NuGet package but the in-repo version may not be published on nuget.org +yet. Pack it once into the local feed before the first build. Then to run against the Raylib-cs NuGet package (the +version set by `RaylibCsVersion` in [Directory.Build.props](Directory.Build.props)), set `UseRaylibCsPackage`: + +```sh +dotnet pack Raylib-cs -c Release -o nuget +dotnet build +``` +```sh dotnet run --project Examples -p:UseRaylibCsPackage=true ``` +```sh +dotnet test -p:UseRaylibCsPackage=true +``` + +Note that `NuGet.config` points restore at the local `./nuget` feed, so both projects pick up the freshly packed +package. If you skip the pack step on a fresh clone, restore fails with NU1301 (the `./nuget` source +doesn't exist) or NU1102 (Raylib-cs not found) - running the pack command fixes both. + +When iterating on the binding itself, note that NuGet caches the extracted package by version and +ignores repacks of the same version. After repacking, delete the old package from `./nuget` and clear +the cached copy (`dotnet nuget locals global-packages --clear`, or delete +`~/.nuget/packages/raylib-cs/`) before restoring again. ## Contributing