samples: add Hello/Demo samples for most BRUTAL packages

Add samples/, a collection of single-file .NET 10 apps run with
`dotnet run <file>.cs`. Hello/ has one minimal sample per package
that has a public API, many of them headless; Demo/ has fuller
programs that combine packages into a more interesting application.

samples/README.md indexes every sample and covers the layout, error
handling and per-OS requirements.
This commit is contained in:
Rian Drake 2026-10-18 18:01:24 +13:00
commit b0c9fd9cdc

View file

@ -0,0 +1,23 @@
/*
* HelloRenderDoc
*
* Checks whether RenderDoc's in-application API is available (not on macOS) and prints its state.
*/
#:package Ahwoo.Brutal.RenderDoc@2026.10.2
// RIAN: Use this package to debug your rendering more easily.
using Brutal.RenderDocApi;
// Call as early as possible, before any graphics API is initialized.
RenderDoc.Initialize();
Console.WriteLine($"RenderDoc available: {RenderDoc.IsAvailable}, state: {RenderDoc.State}");
if (RenderDoc.IsAvailable)
Console.WriteLine($"RenderDoc API version: {RenderDoc.Version}");
else
Console.WriteLine(
"RenderDoc loads when the app is launched from RenderDoc (Windows or Linux), or on Windows when it is installed in C:\\Program Files\\RenderDoc."
);