Some ImGui tweaks for the game window (#2183)

* Remove window border
* Remove window rounding
* Set background color to black
This commit is contained in:
Quang Ngô 2025-01-19 19:03:15 +07:00 committed by GitHub
parent 746f2e091d
commit ec0dfb32b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -825,6 +825,9 @@ void Presenter::Present(Frame* frame, bool is_reusing_frame) {
{ // Draw the game { // Draw the game
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2{0.0f}); ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2{0.0f});
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 0.0f);
ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.0f);
ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0.0f, 0.0f, 0.0f, 1.0f));
ImGui::SetNextWindowDockID(dockId, ImGuiCond_Once); ImGui::SetNextWindowDockID(dockId, ImGuiCond_Once);
ImGui::Begin("Display##game_display", nullptr, ImGuiWindowFlags_NoNav); ImGui::Begin("Display##game_display", nullptr, ImGuiWindowFlags_NoNav);
@ -840,7 +843,8 @@ void Presenter::Present(Frame* frame, bool is_reusing_frame) {
static_cast<float>(imgRect.extent.height), static_cast<float>(imgRect.extent.height),
}); });
ImGui::End(); ImGui::End();
ImGui::PopStyleVar(); ImGui::PopStyleVar(3);
ImGui::PopStyleColor();
} }
ImGui::Core::Render(cmdbuf, swapchain_image_view, swapchain.GetExtent()); ImGui::Core::Render(cmdbuf, swapchain_image_view, swapchain.GetExtent());