From 5e3bb0e961dff8869e71bfe274120fc2a325955a Mon Sep 17 00:00:00 2001 From: Orange Date: Wed, 8 Jul 2026 18:34:38 +0300 Subject: [PATCH] fix stuff --- examples/example_dx11_hook/dllmain.cpp | 16 ++++++---------- examples/example_dx9_hook/dllmain.cpp | 4 ++-- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/examples/example_dx11_hook/dllmain.cpp b/examples/example_dx11_hook/dllmain.cpp index 1a94b99..0e45036 100644 --- a/examples/example_dx11_hook/dllmain.cpp +++ b/examples/example_dx11_hook/dllmain.cpp @@ -18,6 +18,7 @@ namespace ID3D11DeviceContext* g_context = nullptr; ID3D11RenderTargetView* g_render_target_view = nullptr; + [[nodiscard]] bool create_render_target(IDXGISwapChain* swap_chain) { ID3D11Texture2D* back_buffer = nullptr; @@ -58,9 +59,9 @@ namespace g_device->GetImmediateContext(&g_context); DXGI_SWAP_CHAIN_DESC desc{}; - swap_chain->GetDesc(&desc); + std::ignore = swap_chain->GetDesc(&desc); - create_render_target(swap_chain); + std::ignore = create_render_target(swap_chain); ImGui::CreateContext(); ImGui::StyleColorsDark(); @@ -73,7 +74,7 @@ namespace auto& mgr = omath::hooks::HooksManager::get(); mgr.set_on_wnd_proc( - [](HWND h, UINT msg, WPARAM wp, LPARAM lp) -> std::optional + [](const HWND h, const UINT msg, const WPARAM wp, const LPARAM lp) -> std::optional { if (ImGui_ImplWin32_WndProcHandler(h, msg, wp, lp)) return 0; @@ -107,12 +108,7 @@ namespace ImGui_ImplWin32_NewFrame(); ImGui::NewFrame(); - ImGui::SetNextWindowSize({300.f, 80.f}, ImGuiCond_Once); - ImGui::SetNextWindowPos({10.f, 10.f}, ImGuiCond_Once); - ImGui::Begin("omath | DX11 hook"); - ImGui::Text("Hook active"); - ImGui::Text("FPS: %.1f", ImGui::GetIO().Framerate); - ImGui::End(); + ImGui::ShowDemoWindow(); ImGui::Render(); ImGui_ImplDX11_RenderDrawData(ImGui::GetDrawData()); @@ -134,7 +130,7 @@ namespace } } // namespace -BOOL WINAPI DllMain(HINSTANCE h_instance, DWORD reason, LPVOID) +BOOL WINAPI DllMain(const HINSTANCE h_instance, const DWORD reason, LPVOID) { if (reason == DLL_PROCESS_ATTACH) { diff --git a/examples/example_dx9_hook/dllmain.cpp b/examples/example_dx9_hook/dllmain.cpp index 1d4820e..5e4961b 100644 --- a/examples/example_dx9_hook/dllmain.cpp +++ b/examples/example_dx9_hook/dllmain.cpp @@ -36,7 +36,7 @@ namespace return 0; return std::nullopt; }); - mgr.hook_wnd_proc(params.hFocusWindow); + std::ignore = mgr.hook_wnd_proc(params.hFocusWindow); g_initialized = true; } @@ -86,7 +86,7 @@ BOOL WINAPI DllMain(HINSTANCE h_instance, DWORD reason, LPVOID) auto& mgr = omath::hooks::HooksManager::get(); mgr.set_on_dx9_present(on_present); mgr.set_on_dx9_reset(on_reset); - mgr.hook_dx9(); + std::ignore = mgr.hook_dx9(); return 0; }, nullptr, 0, nullptr); }