gpu printed in debug window
parent
90fabf73ee
commit
b95ea49c93
|
@ -1,3 +1,6 @@
|
||||||
|
#include <glad/glad.h>
|
||||||
|
#include <GLFW/glfw3.h>
|
||||||
|
|
||||||
#include "debugwindow.hpp"
|
#include "debugwindow.hpp"
|
||||||
|
|
||||||
#include <imgui/imgui.h>
|
#include <imgui/imgui.h>
|
||||||
|
@ -62,13 +65,14 @@ namespace debug{
|
||||||
void show_debug_window(){
|
void show_debug_window(){
|
||||||
ImGui::Begin("Debug Window");
|
ImGui::Begin("Debug Window");
|
||||||
|
|
||||||
ImGui::PushItemWidth(ImGui::GetFontSize() * -12);
|
//ImGui::PushItemWidth(ImGui::GetFontSize() * -12);
|
||||||
|
|
||||||
try{
|
try{
|
||||||
if (ImGui::CollapsingHeader("Frametimes")){
|
if (ImGui::CollapsingHeader("Frametimes")){
|
||||||
ImGui::Text("FPS: %d", std::any_cast<int>(parameters.at("fps")));
|
ImGui::Text("FPS: %d", std::any_cast<int>(parameters.at("fps")));
|
||||||
ImGui::Text("Frametime (ms): %f",
|
ImGui::Text("Frametime (ms): %f",
|
||||||
std::any_cast<float>(parameters.at("frametime"))*1000);
|
std::any_cast<float>(parameters.at("frametime"))*1000);
|
||||||
|
ImGui::Text("GPU: %s %s", glGetString(GL_VENDOR), glGetString(GL_RENDERER));
|
||||||
//ImGui::PlotLines("Frame Times", arr, IM_ARRAYSIZE(arr);
|
//ImGui::PlotLines("Frame Times", arr, IM_ARRAYSIZE(arr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,6 +132,8 @@ namespace debug{
|
||||||
}
|
}
|
||||||
}catch(const std::bad_any_cast& e){
|
}catch(const std::bad_any_cast& e){
|
||||||
std::cout << e.what();
|
std::cout << e.what();
|
||||||
|
}catch(const std::out_of_range& e){
|
||||||
|
std::cout << e.what();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
|
|
|
@ -61,8 +61,6 @@ int main()
|
||||||
//glEnable(GL_FRAMEBUFFER_SRGB); //gamma correction done in fragment shader
|
//glEnable(GL_FRAMEBUFFER_SRGB); //gamma correction done in fragment shader
|
||||||
//glEnable(GL_CULL_FACE); //GL_BACK GL_CCW by default
|
//glEnable(GL_CULL_FACE); //GL_BACK GL_CCW by default
|
||||||
|
|
||||||
std::cout << "Using GPU: " << glGetString(GL_VENDOR) << " " << glGetString(GL_RENDERER) << "\n";
|
|
||||||
|
|
||||||
wireframe = false;
|
wireframe = false;
|
||||||
for(int i = 0; i < 360; i++){
|
for(int i = 0; i < 360; i++){
|
||||||
sines[i] = sin(3.14 / 180 * i);
|
sines[i] = sin(3.14 / 180 * i);
|
||||||
|
|
Loading…
Reference in New Issue