From 7ea114eb59839646fe4c0c1cff99d780e7fd17e4 Mon Sep 17 00:00:00 2001 From: Stepland <10530295-Buggyroom@users.noreply.gitlab.com> Date: Tue, 25 Jul 2023 00:02:48 +0200 Subject: [PATCH] just use setVerticalSync and USE IT RIGHT --- src/main.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index f855e49..65869b5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -52,11 +52,9 @@ int main() { config::Config config{settings_folder}; const auto video_mode = sf::VideoMode{config.windows.main_window_size.x, config.windows.main_window_size.y}; - sf::RenderWindow window; + sf::RenderWindow window{video_mode, "F.E.I.S"}; window.setVerticalSyncEnabled(true); - window.setFramerateLimit(60); window.setKeyRepeatEnabled(false); - window.create(video_mode, "F.E.I.S"); ImGui::SFML::Init(window, false); @@ -814,6 +812,12 @@ int main() { } } ImGui::EndMainMenuBar(); + + if (ImGui::Begin("Debug")) { + ImGui::TextUnformatted(fmt::format("frame time : {}ms", delta.asMilliseconds()).c_str()); + ImGui::TextUnformatted(fmt::format("{:.0f} fps", 1.0f / delta.asSeconds()).c_str()); + } + ImGui::End(); ImGui::SFML::Render(window); window.display(); markers.update();