Ok so im trying to use Im gui on a hook in EndScene, i can assure that lpdevice is the real draw device and the hook is correct, but i cant draw with imgui, so i guess im doing a mistake with the use of the header. Can someone give me a little bit of help?
`
HMODULE hmodule;
LPDIRECT3DDEVICE9 lpdevice = 0;
HRESULT __stdcall hkEndScene(LPDIRECT3DDEVICE9 lpDevice)
{
ImGui_ImplDX9_NewFrame();
ImGui::Text("Hello World");
return OriginalEndScene(lpdevice);
}
void mainz()
{
DX9Hook::EnableVmtHookWithDetour(&lpdevice, hkEndScene);
D3DDEVICE_CREATION_PARAMETERS cParam;
lpdevice->GetCreationParameters(&cParam);
ImGui_ImplDX9_Init(cParam.hFocusWindow, lpdevice);
}
bool WINAPI DllMain(HINSTANCE hinstdll, DWORD fdwReason, LPVOID lpReserved)
{
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
hmodule = hinstdll;
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)mainz, 0, 0, 0);
break;
}
return true;
}
`
You missed ImGui::Render(). It should be last ImGui function called in frame.
thanks thedmd, i'm feeling like an idiot right now lmao.
Most helpful comment
You missed ImGui::Render(). It should be last ImGui function called in frame.