Files
se-launcher/CringeLauncher/Patches/RenderHookPatch.cs
pas2704 530e05875f
All checks were successful
Build / Compute Version (push) Successful in 6s
Build / Build Nuget package (CringeBootstrap.Abstractions) (push) Successful in 3m57s
Build / Build Nuget package (NuGet) (push) Successful in 3m21s
Build / Build Nuget package (CringePlugins) (push) Successful in 4m8s
Build / Build Nuget package (SharedCringe) (push) Successful in 2m57s
Build / Build Launcher (push) Successful in 5m39s
minor cleanup
2024-11-24 02:28:57 -05:00

24 lines
617 B
C#

using Windows.Win32.Foundation;
using HarmonyLib;
using SharpDX.DXGI;
using VRage.Platform.Windows.Forms;
using SharpDX.Windows;
using System.Reflection;
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);
}
}