Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool init_ = false;
- bool init__ = true;
- long __fastcall hooks::present(IDirect3DDevice9* thisptr, const RECT* src, const RECT* dst, HWND hwnd, const RGNDATA* rgn)
- {
- if (!init_)
- {
- ImGui::CreateContext();
- ImGui::GetIO().DeltaTime = 1.f / 60.f;
- ImGui::GetIO().ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange;
- ImGui::GetIO().IniFilename = "C:\\CBT_NEW\\settings.imgui";
- ImGui_ImplDX9_Init(thisptr);
- ImGui_ImplWin32_Init(FindWindow("Valve001", NULL));
- ImGui_ImplDX9_CreateDeviceObjects();
- init_ = true;
- }
- thisptr->SetRenderState(D3DRS_SRGBWRITEENABLE, false);
- if (init__ && !bInframe)
- {
- ImGui::Render();
- ImGui_ImplDX9_RenderDrawData(ImGui::GetDrawData());
- }
- return o_present(thisptr, src, dst, hwnd, rgn);
- }
- void __fastcall hooks::paint(IEngineVGui* thisptr, PaintMode_t mode)
- {
- if (!init_)
- return o_paint(thisptr, mode);
- if (g::screen_shot)
- return o_paint(thisptr, mode);
- ImGui_ImplDX9_NewFrame();
- ImGui_ImplWin32_NewFrame();
- ImGui::NewFrame();
- bInframe=true;
- visuals::render();
- gui::think();
- ImGui::EndFrame();
- bInframe=false;
- drawing = false;
- if(!init__)
- init__ = true;
- return o_paint(thisptr, mode);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement