Best overlay

This commit is contained in:
Xphalnos 2024-09-29 12:20:29 +02:00
commit 85497fcd04
2 changed files with 6 additions and 6 deletions

View file

@ -29,7 +29,7 @@ static float frame_graph_height = 50.0f;
static void DrawSimple() { static void DrawSimple() {
const auto io = GetIO(); const auto io = GetIO();
Text("Frame time: %.3f ms (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate); Text("FPS: %.1f (%.3f ms)", io.Framerate, 1000.0f / io.Framerate);
} }
static void DrawAdvanced() { static void DrawAdvanced() {
@ -38,7 +38,7 @@ static void DrawAdvanced() {
const auto& window = *ctx.CurrentWindow; const auto& window = *ctx.CurrentWindow;
auto& draw_list = *window.DrawList; auto& draw_list = *window.DrawList;
Text("Frame time: %.3f ms (%.1f FPS)", io.DeltaTime * 1000.0f, io.Framerate); Text("Frame time: %.3f ms (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate);
SeparatorText("Frame graph"); SeparatorText("Frame graph");
const float full_width = GetContentRegionAvail().x; const float full_width = GetContentRegionAvail().x;
@ -108,13 +108,13 @@ void Layers::VideoInfo::Draw() {
if (show) { if (show) {
if (show_advanced) { if (show_advanced) {
if (Begin("Video debug info", &show, 0)) { if (Begin("Video Debug Info", nullptr,
ImGuiWindowFlags_NoDecoration)) {
DrawAdvanced(); DrawAdvanced();
} }
} else { } else {
if (Begin("Video Info", nullptr, if (Begin("Video Info", nullptr,
ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoDecoration)) {
ImGuiWindowFlags_AlwaysAutoResize)) {
DrawSimple(); DrawSimple();
} }
} }

View file

@ -51,7 +51,7 @@ void Initialize(const ::Vulkan::Instance& instance, const Frontend::WindowSDL& w
io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad;
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable; io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;
io.DisplaySize = ImVec2((float)window.getWidth(), (float)window.getHeight()); io.DisplaySize = ImVec2((float)window.getWidth(), (float)window.getHeight());
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 5.0f); // Makes the window edges rounded ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 6.0f); // Makes the window edges rounded
auto path = config_path.u8string(); auto path = config_path.u8string();
char* config_file_buf = new char[path.size() + 1](); char* config_file_buf = new char[path.size() + 1]();