From 5bedaa33a32b861bcf4e99ac5292d482aad1fc72 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Tue, 2 Aug 2022 00:34:52 +0200 Subject: [PATCH] Remove reflection from SwapChain sample setup --- samples/ComputeSharp.SwapChain/Program.cs | 28 +++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/samples/ComputeSharp.SwapChain/Program.cs b/samples/ComputeSharp.SwapChain/Program.cs index bdf8f3d4..3e54f1ef 100644 --- a/samples/ComputeSharp.SwapChain/Program.cs +++ b/samples/ComputeSharp.SwapChain/Program.cs @@ -16,19 +16,19 @@ class Program /// /// The mapping of available samples to choose from. /// - private static readonly (Type ShaderType, Win32Application Application)[] Samples = new (Type, Win32Application)[] + private static readonly (string ShaderName, Win32Application Application)[] Samples = new (string, Win32Application)[] { - (typeof(HelloWorld), new SwapChainApplication(static time => new((float)time.TotalSeconds))), - (typeof(FourColorGradient), new SwapChainApplication(static time => new((float)time.TotalSeconds))), - (typeof(ColorfulInfinity), new SwapChainApplication(static time => new((float)time.TotalSeconds))), - (typeof(FractalTiling), new SwapChainApplication(static time => new((float)time.TotalSeconds))), - (typeof(TwoTiledTruchet), new SwapChainApplication(static time => new((float)time.TotalSeconds))), - (typeof(MengerJourney), new SwapChainApplication(static time => new((float)time.TotalSeconds))), - (typeof(Octagrams), new SwapChainApplication(static time => new((float)time.TotalSeconds))), - (typeof(ProteanClouds), new SwapChainApplication(static time => new((float)time.TotalSeconds))), - (typeof(ExtrudedTruchetPattern), new SwapChainApplication(static time => new((float)time.TotalSeconds))), - (typeof(PyramidPattern), new SwapChainApplication(static time => new((float)time.TotalSeconds))), - (typeof(TriangleGridContouring), new SwapChainApplication(static time => new((float)time.TotalSeconds))) + (nameof(HelloWorld), new SwapChainApplication(static time => new((float)time.TotalSeconds))), + (nameof(FourColorGradient), new SwapChainApplication(static time => new((float)time.TotalSeconds))), + (nameof(ColorfulInfinity), new SwapChainApplication(static time => new((float)time.TotalSeconds))), + (nameof(FractalTiling), new SwapChainApplication(static time => new((float)time.TotalSeconds))), + (nameof(TwoTiledTruchet), new SwapChainApplication(static time => new((float)time.TotalSeconds))), + (nameof(MengerJourney), new SwapChainApplication(static time => new((float)time.TotalSeconds))), + (nameof(Octagrams), new SwapChainApplication(static time => new((float)time.TotalSeconds))), + (nameof(ProteanClouds), new SwapChainApplication(static time => new((float)time.TotalSeconds))), + (nameof(ExtrudedTruchetPattern), new SwapChainApplication(static time => new((float)time.TotalSeconds))), + (nameof(PyramidPattern), new SwapChainApplication(static time => new((float)time.TotalSeconds))), + (nameof(TriangleGridContouring), new SwapChainApplication(static time => new((float)time.TotalSeconds))) }; static void Main() @@ -43,7 +43,7 @@ class Program for (int i = 0; i < Samples.Length; i++) { - Console.WriteLine($"{i}: {Samples[i].ShaderType.Name}"); + Console.WriteLine($"{i}: {Samples[i].ShaderName}"); } Console.WriteLine($"{Samples.Length}+: Exit (Use Escape, 'Q', or Alt + F4 to exit a sample once chosen)"); @@ -58,7 +58,7 @@ class Program if (index >= 0 && index < Samples.Length) { Console.WriteLine(); - Console.WriteLine($"Starting {Samples[index].ShaderType.Name}..."); + Console.WriteLine($"Starting {Samples[index].ShaderName}..."); Win32ApplicationRunner.Run(Samples[index].Application); }