Files
se-launcher/CringeLauncher/Patches/RenderHookPatch.cs
pas2704 ed8d307843 Work on handling inputs
We still need to intercept SharpDX inputs
2024-11-09 03:41:25 -05:00

24 lines
620 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 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);
}
}