PresentFn oPresent;
long __stdcall Hooks::Present(IDirect3DDevice9* pDevice, const RECT* pSourceRect, const RECT* pDestRect, HWND hDestWindowOverride, const RGNDATA* pDirtyRegion)
{
if (!G::d3dinit)
GUI_Init(pDevice);
H::D3D9->ReHook();
ImGui::GetIO().MouseDrawCursor = Vars.Menu.Opened;
DWORD dwOld_D3DRS_COLORWRITEENABLE;
pDevice->GetRenderState(D3DRS_COLORWRITEENABLE, &dwOld_D3DRS_COLORWRITEENABLE);
pDevice->SetRenderState(D3DRS_COLORWRITEENABLE, 0xffffffff);
ImGui_ImplDX9_NewFrame();
//menu
ImGui::Render();
pDevice->SetRenderState(D3DRS_COLORWRITEENABLE, dwOld_D3DRS_COLORWRITEENABLE);
return oPresent(pDevice, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
}