From c26f3512c2b08b4a136ff386e9c4c1330910ff82 Mon Sep 17 00:00:00 2001 From: Sara Date: Fri, 15 Nov 2024 13:31:10 +0100 Subject: [PATCH] fix: window not rendering --- src/core/application.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/application.cpp b/src/core/application.cpp index aa8a68e..1e883d4 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -4,7 +4,7 @@ #include #ifndef PROJECTNAME -#define PROJECTNAME "application" +#define PROJECTNAME "Pass define for PROJECTNAME to change title" #endif Application::Application() { @@ -42,13 +42,14 @@ void Application::run() { while(stay_open) { // track frame time std::timespec_get(&this->frame_start_ts, TIME_UTC); - this->delta_time = double(this->last_frame_start_ts.tv_nsec - this->frame_start_ts.tv_nsec) / 1000000000.f; + this->delta_time = double(this->frame_start_ts.tv_nsec - this->last_frame_start_ts.tv_nsec) / 1000000000.f; // process events this->process_events(); // update application implementation if(this->delta_time > this->target_delta_time) { this->tick(this->delta_time); this->draw(render); + SDL_RenderPresent(this->render); this->last_frame_start_ts = this->frame_start_ts; } }