diff --git a/include/window.hpp b/include/window.hpp index 8ade17b98..950017c00 100644 --- a/include/window.hpp +++ b/include/window.hpp @@ -34,8 +34,8 @@ namespace hex { void deinitImGui(); GLFWwindow* m_window; - std::vector m_views; + bool m_fpsVisible = false; }; } \ No newline at end of file diff --git a/source/views/view_hashes.cpp b/source/views/view_hashes.cpp index feebfe43b..98bda40b2 100644 --- a/source/views/view_hashes.cpp +++ b/source/views/view_hashes.cpp @@ -122,7 +122,7 @@ namespace hex { } void ViewHashes::createMenu() { - if (ImGui::BeginMenu("Window")) { + if (ImGui::BeginMenu("View")) { ImGui::MenuItem("Hash View", "", &this->m_windowOpen); ImGui::EndMenu(); } diff --git a/source/views/view_hexeditor.cpp b/source/views/view_hexeditor.cpp index 1ae897f32..71d933f10 100644 --- a/source/views/view_hexeditor.cpp +++ b/source/views/view_hexeditor.cpp @@ -69,7 +69,7 @@ namespace hex { ImGui::EndMenu(); } - if (ImGui::BeginMenu("Window")) { + if (ImGui::BeginMenu("View")) { ImGui::MenuItem("Hex View", "", &this->m_memoryEditor.Open); ImGui::EndMenu(); } diff --git a/source/views/view_pattern.cpp b/source/views/view_pattern.cpp index f3568ee11..0ffc6085c 100644 --- a/source/views/view_pattern.cpp +++ b/source/views/view_pattern.cpp @@ -38,7 +38,7 @@ namespace hex { ImGui::EndMenu(); } - if (ImGui::BeginMenu("Window")) { + if (ImGui::BeginMenu("View")) { ImGui::MenuItem("Pattern View", "", &this->m_windowOpen); ImGui::EndMenu(); } diff --git a/source/views/view_pattern_data.cpp b/source/views/view_pattern_data.cpp index d8fc0d0f2..7aa4bdef2 100644 --- a/source/views/view_pattern_data.cpp +++ b/source/views/view_pattern_data.cpp @@ -53,7 +53,7 @@ namespace hex { } void ViewPatternData::createMenu() { - if (ImGui::BeginMenu("Window")) { + if (ImGui::BeginMenu("View")) { ImGui::MenuItem("Data View", "", &this->m_windowOpen); ImGui::EndMenu(); } diff --git a/source/window.cpp b/source/window.cpp index eb288a723..d66f638af 100644 --- a/source/window.cpp +++ b/source/window.cpp @@ -64,6 +64,18 @@ namespace hex { for (auto &view : this->m_views) view->createMenu(); + + if (ImGui::BeginMenu("View")) { + ImGui::MenuItem("Display FPS", "", &this->m_fpsVisible); + ImGui::EndMenu(); + } + + if (this->m_fpsVisible) { + ImGui::SameLine(ImGui::GetWindowWidth() - 80); + ImGui::Text("%.1f FPS", ImGui::GetIO().Framerate); + } + + ImGui::EndMenuBar(); ImGui::End();