From 384c393e16cdd12d380fbf16fe6c52ef616514fd Mon Sep 17 00:00:00 2001 From: connellpaxton Date: Mon, 29 Jan 2024 16:28:38 -0500 Subject: [PATCH] Updated CMake --- CMakeLists.txt | 1 + pléascach.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c877e0..d70c85e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,7 @@ endif() file(GLOB SOURCES pléascach.cpp */*.cpp + include/imgui/*.cpp ) add_executable (pleascach ${SOURCES}) diff --git a/pléascach.cpp b/pléascach.cpp index 2c35f42..75dc39d 100644 --- a/pléascach.cpp +++ b/pléascach.cpp @@ -19,7 +19,7 @@ int main(int argc, char* argv[]) { while (in->queue.size()) { /* take event from front of queue, then process it */ - auto event = in->queue.front(); + const auto& event = in->queue.front(); in->queue.pop(); switch (event.tag) { case InputEvent::Tag::RESIZE: @@ -42,7 +42,10 @@ int main(int argc, char* argv[]) { ren.draw(); ren.present(); - Log::debug("Frame: %.2lf milliseconds (60fps ~ 16.67)\r", frame_timer.stop()); + Log::debug("Frame: %.2lf milliseconds (60fps ~ 16.67)\r", frame_timer.read()); + + while (frame_timer.read() < 16.60) + ; } } catch (const std::string& e) {