Guest User

Untitled

a guest
Jan 23rd, 2020
111
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. bool init_ = false;
  2. bool init__ = true;
  3. long __fastcall hooks::present(IDirect3DDevice9* thisptr, const RECT* src, const RECT* dst, HWND hwnd, const RGNDATA* rgn)
  4. {
  5. if (!init_)
  6. {
  7. ImGui::CreateContext();
  8. ImGui::GetIO().DeltaTime = 1.f / 60.f;
  9. ImGui::GetIO().ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange;
  10. ImGui::GetIO().IniFilename = "C:\\CBT_NEW\\settings.imgui";
  11. ImGui_ImplDX9_Init(thisptr);
  12. ImGui_ImplWin32_Init(FindWindow("Valve001", NULL));
  13. ImGui_ImplDX9_CreateDeviceObjects();
  14. init_ = true;
  15. }
  16. thisptr->SetRenderState(D3DRS_SRGBWRITEENABLE, false);
  17.  
  18. if (init__ && !bInframe)
  19. {
  20. ImGui::Render();
  21. ImGui_ImplDX9_RenderDrawData(ImGui::GetDrawData());
  22. }
  23.  
  24. return o_present(thisptr, src, dst, hwnd, rgn);
  25. }
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36. void __fastcall hooks::paint(IEngineVGui* thisptr, PaintMode_t mode)
  37. {
  38. if (!init_)
  39. return o_paint(thisptr, mode);
  40.  
  41. if (g::screen_shot)
  42. return o_paint(thisptr, mode);
  43.  
  44. ImGui_ImplDX9_NewFrame();
  45. ImGui_ImplWin32_NewFrame();
  46. ImGui::NewFrame();
  47. bInframe=true;
  48.  
  49. visuals::render();
  50. gui::think();
  51.  
  52. ImGui::EndFrame();
  53. bInframe=false;
  54. drawing = false;
  55.  
  56. if(!init__)
  57. init__ = true;
  58.  
  59. return o_paint(thisptr, mode);
  60. }
RAW Paste Data