Update Examples to use separate processes
This commit is contained in:
parent
73e3428ca0
commit
1b890169c5
1 changed files with 15 additions and 11 deletions
|
|
@ -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();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue