1
0
mirror of synced 2024-11-12 02:00:52 +01:00

Added FPS display

This commit is contained in:
WerWolv 2020-11-11 09:22:55 +01:00
parent 434bb3494a
commit 6f59955c92
6 changed files with 17 additions and 5 deletions

View File

@ -34,8 +34,8 @@ namespace hex {
void deinitImGui();
GLFWwindow* m_window;
std::vector<View*> m_views;
bool m_fpsVisible = false;
};
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();