Watch
2
0
Fork
You've already forked raylib-cs
0

Update Examples to use separate processes

This commit is contained in:
Rgebee 2026-05-19 20:42:19 +01:00
commit 1b890169c5

View file

@ -1,4 +1,5 @@
using System; using System;
using System.Diagnostics;
using Examples.Core; using Examples.Core;
using Examples.Shapes; using Examples.Shapes;
using Examples.Textures; using Examples.Textures;
@ -175,23 +176,26 @@ class Program
{ {
var example = ExampleList.GetExample(args[0]); var example = ExampleList.GetExample(args[0]);
example?.Main?.Invoke(); example?.Main?.Invoke();
return;
} }
else
foreach (var example in ExampleList.AllExamples)
{ {
RunExamples(ExampleList.AllExamples); RunExampleProcess(Environment.ProcessPath, example.Name);
} }
} }
static void RunExamples(ExampleInfo[] examples) static void RunExampleProcess(
string fileName,
string exampleName
)
{ {
var configFlags = Enum.GetValues(typeof(ConfigFlags)); var processStartInfo = new ProcessStartInfo
foreach (var example in examples)
{ {
example?.Main?.Invoke(); FileName = fileName,
foreach (ConfigFlags flag in configFlags) Arguments = exampleName
{ };
Raylib.ClearWindowState(flag); using var process = Process.Start(processStartInfo);
} process?.WaitForExit();
}
} }
} }