Skip to content

Commit

Permalink
example_glfw_dx11/main.cpp: add clear color
Browse files Browse the repository at this point in the history
  • Loading branch information
sonoro1234 committed Jun 12, 2024
1 parent b68f772 commit eda20c3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend_test/example_glfw_dx11/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ int main(int argc, char *argv[])
clearColor.y = 0.55f;
clearColor.z = 0.60f;
clearColor.w = 1.00f;

// main event loop
bool quit = false;
while (!glfwWindowShouldClose(window))
Expand Down Expand Up @@ -162,6 +162,9 @@ int main(int argc, char *argv[])

// render
igRender();
const float clear_color_with_alpha[4] = { clearColor.x * clearColor.w, clearColor.y * clearColor.w, clearColor.z * clearColor.w, clearColor.w };
g_pd3dDeviceContext->OMSetRenderTargets(1, &g_mainRenderTargetView, nullptr);
g_pd3dDeviceContext->ClearRenderTargetView(g_mainRenderTargetView, clear_color_with_alpha);
ImGui_ImplDX11_RenderDrawData(igGetDrawData());
#ifdef IMGUI_HAS_DOCK
if (ioptr->ConfigFlags & ImGuiConfigFlags_ViewportsEnable)
Expand Down

0 comments on commit eda20c3

Please sign in to comment.