Files
se-launcher/CringeLauncher/Patches/RenderHookPatch.cs
zznty ae16f3a038
All checks were successful
Build / Compute Version (push) Successful in 6s
Build / Build Nuget package (CringeBootstrap.Abstractions) (push) Successful in 4m1s
Build / Build Nuget package (CringePlugins) (push) Successful in 4m1s
Build / Build Nuget package (SharedCringe) (push) Successful in 3m59s
Build / Build Launcher (push) Successful in 5m3s
Build / Build Nuget package (NuGet) (push) Successful in 8m58s
cleanup
2025-06-03 04:23:36 +07:00

22 lines
569 B
C#

using Windows.Win32.Foundation;
using HarmonyLib;
using SharpDX.DXGI;
using VRage.Platform.Windows.Forms;
namespace CringeLauncher.Patches;
[HarmonyPatch]
public static 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.HookWindow((HWND)__instance.Handle);
}
}