feature: first
All checks were successful
Build / Compute Version (push) Successful in 4s
Build / Build Nuget package (CringeBootstrap.Abstractions) (push) Successful in 2m47s
Build / Build Nuget package (CringePlugins) (push) Successful in 5m31s
Build / Build Nuget package (NuGet) (push) Successful in 6m2s
Build / Build Nuget package (SharedCringe) (push) Successful in 7m25s
Build / Build Launcher (push) Successful in 9m11s
All checks were successful
Build / Compute Version (push) Successful in 4s
Build / Build Nuget package (CringeBootstrap.Abstractions) (push) Successful in 2m47s
Build / Build Nuget package (CringePlugins) (push) Successful in 5m31s
Build / Build Nuget package (NuGet) (push) Successful in 6m2s
Build / Build Nuget package (SharedCringe) (push) Successful in 7m25s
Build / Build Launcher (push) Successful in 9m11s
This commit is contained in:
22
CringeLauncher/Patches/RenderHookPatch.cs
Normal file
22
CringeLauncher/Patches/RenderHookPatch.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Windows.Win32.Foundation;
|
||||
using HarmonyLib;
|
||||
using SharpDX.DXGI;
|
||||
using VRage.Platform.Windows.Forms;
|
||||
|
||||
namespace CringeLauncher.Patches;
|
||||
|
||||
[HarmonyPatch]
|
||||
public class RenderHookPatch
|
||||
{
|
||||
[HarmonyPrefix, HarmonyPatch(typeof(SwapChain), nameof(SwapChain.Present))]
|
||||
private static void PresentPrefix()
|
||||
{
|
||||
ImGuiHandler.Instance?.DoRender();
|
||||
}
|
||||
|
||||
[HarmonyPostfix, HarmonyPatch(typeof(MyGameForm), "OnLoad")]
|
||||
private static void LoadPostfix(MyGameForm __instance)
|
||||
{
|
||||
ImGuiHandler.Instance?.HookWindow((HWND)__instance.Handle);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user