From b95ea49c939791f6dcfb2cbce7a4964c1b1e07a0 Mon Sep 17 00:00:00 2001 From: EmaMaker Date: Tue, 3 Oct 2023 15:35:56 +0200 Subject: [PATCH] gpu printed in debug window --- src/debugwindow.cpp | 8 +++++++- src/main.cpp | 2 -- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/debugwindow.cpp b/src/debugwindow.cpp index 61add27..f00bc18 100644 --- a/src/debugwindow.cpp +++ b/src/debugwindow.cpp @@ -1,3 +1,6 @@ +#include +#include + #include "debugwindow.hpp" #include @@ -62,13 +65,14 @@ namespace debug{ void show_debug_window(){ ImGui::Begin("Debug Window"); - ImGui::PushItemWidth(ImGui::GetFontSize() * -12); + //ImGui::PushItemWidth(ImGui::GetFontSize() * -12); try{ if (ImGui::CollapsingHeader("Frametimes")){ ImGui::Text("FPS: %d", std::any_cast(parameters.at("fps"))); ImGui::Text("Frametime (ms): %f", std::any_cast(parameters.at("frametime"))*1000); + ImGui::Text("GPU: %s %s", glGetString(GL_VENDOR), glGetString(GL_RENDERER)); //ImGui::PlotLines("Frame Times", arr, IM_ARRAYSIZE(arr); } @@ -128,6 +132,8 @@ namespace debug{ } }catch(const std::bad_any_cast& e){ std::cout << e.what(); + }catch(const std::out_of_range& e){ + std::cout << e.what(); } ImGui::End(); diff --git a/src/main.cpp b/src/main.cpp index a6cbfed..98ff15b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -61,8 +61,6 @@ int main() //glEnable(GL_FRAMEBUFFER_SRGB); //gamma correction done in fragment shader //glEnable(GL_CULL_FACE); //GL_BACK GL_CCW by default - std::cout << "Using GPU: " << glGetString(GL_VENDOR) << " " << glGetString(GL_RENDERER) << "\n"; - wireframe = false; for(int i = 0; i < 360; i++){ sines[i] = sin(3.14 / 180 * i);