-
-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Closed
Description
Version/Branch of Dear ImGui:
Version imgui-1.91.9b.zip
Back-ends:
example_win32_directx12
Compiler, OS:
Windows 11 + MSVC 2022
Full config/build information:
No response
Details:
I'm new to Dear ImGui and tried running the example program from the release version imgui-1.91.9b.zip.
As shown in the screenshot below, GPU usage is around 8% when the window is focused.
However, GPU usage increases to around 16% when the window is minimized.
I also tried running the example_win32_opengl3
sample, which doesn't have this issue.
Then I modified the DirectX12 version based on the OpenGL version, as shown below.
// Handle window screen locked
if (g_SwapChainOccluded && g_pSwapChain->Present(0, DXGI_PRESENT_TEST) == DXGI_STATUS_OCCLUDED
|| ::IsIconic(hwnd))
{
::Sleep(10);
continue;
}
g_SwapChainOccluded = false;
I'm not sure if using ::IsIconic(hwnd)
is appropriate for DirectX, but it seems to resolve the GPU usage issue.
Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code:
No response
Metadata
Metadata
Assignees
Labels
No labels