Merge pull request #423 from kant2002/kant/reflection-free

Add support for reflection-free mode
このコミットが含まれているのは:
Sergio Pedri authored and GitHub committed 2022-11-07 15:04:18 -08:00
コミット d0dd5c5ef1
3ファイル変更
+9 -8

検索条件に一致するファイルはありません

+7 -6
ファイルの表示
@@ -1,7 +1,6 @@
using System;
using System.Diagnostics;
using System.Drawing;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading;
using TerraFX.Interop.Windows;
@@ -43,15 +42,17 @@ internal static unsafe class Win32ApplicationRunner
/// and it should be called as soon as the process is launched, excluding any other additional initialization needed.
/// </summary>
/// <param name="application">The input application instance to run.</param>
/// <param name="applicationName">Name of the input application instance to run.</param>
/// <param name="windowTitle">The title to use for the window being opened.</param>
/// <returns>The exit code for the application.</returns>
public static int Run(Win32Application application)
public static int Run(Win32Application application, string applicationName, string windowTitle)
{
Win32ApplicationRunner.application = application;
HMODULE hInstance = Windows.GetModuleHandleW(null);
fixed (char* name = Assembly.GetExecutingAssembly().FullName)
fixed (char* windowTitle = application.GetType().ToString())
fixed (char* name = applicationName)
fixed (char* title = windowTitle)
{
// Initialize the window class
WNDCLASSEXW windowClassEx = new()
@@ -79,7 +80,7 @@ internal static unsafe class Win32ApplicationRunner
hwnd = Windows.CreateWindowExW(
0,
windowClassEx.lpszClassName,
(ushort*)windowTitle,
(ushort*)title,
WS.WS_OVERLAPPEDWINDOW,
Windows.CW_USEDEFAULT,
Windows.CW_USEDEFAULT,
@@ -162,7 +163,7 @@ internal static unsafe class Win32ApplicationRunner
}
/// <summary>
/// Processes incoming messages for a window.
/// Processes incoming messages for a window.
/// </summary>
/// <param name="hwnd">A handle to the window.</param>
/// <param name="uMsg">The message.</param>
+1 -1
ファイルの表示
@@ -61,7 +61,7 @@ class Program
Console.WriteLine();
Console.WriteLine($"Starting {Samples[index].ShaderName}...");
_ = Win32ApplicationRunner.Run(Samples[index].Application);
_ = Win32ApplicationRunner.Run(Samples[index].Application, "ComputeSharp.SwapChain", Samples[index].ShaderName);
}
}
while (index >= 0 && index < Samples.Length);
+1 -1
ファイルの表示
@@ -41,7 +41,7 @@
<!-- Shared project with .NET Standard 2.0 polyfills -->
<Import Condition="'$(TargetFramework)' == 'netstandard2.0'" Project="..\ComputeSharp.NetStandard\ComputeSharp.NetStandard.projitems" Label="Shared" />
<!-- Shared project with TerraFX.Interop.Windows fork -->
<Import Condition="'$(TargetFramework)' == 'netstandard2.0'" Project="..\TerraFX.Interop.Windows\TerraFX.Interop.Windows.projitems" Label="Shared" />