From 86c1bc8b9b5d8ad5fbfef85f34658c1da73baa1f Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 10 Nov 2022 11:38:04 +0100 Subject: run draw first, then update --- editor/draw.cpp | 2 +- editor/update.cpp | 1 - main/draw.cpp | 3 +-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/editor/draw.cpp b/editor/draw.cpp index ad634815..72919794 100644 --- a/editor/draw.cpp +++ b/editor/draw.cpp @@ -2,7 +2,6 @@ #include "floormat/main.hpp" #include "floormat/settings.hpp" #include "shaders/tile.hpp" -#include #include namespace floormat { @@ -41,6 +40,7 @@ void app::draw_msaa() void app::draw() { + draw_ui(); render_menu(); } diff --git a/editor/update.cpp b/editor/update.cpp index 53915908..506022d5 100644 --- a/editor/update.cpp +++ b/editor/update.cpp @@ -100,7 +100,6 @@ void app::apply_commands(const key_set& keys) void app::update(float dt) { - draw_ui(); apply_commands(keys); do_camera(dt, keys, get_key_modifiers()); clear_non_repeated_keys(); diff --git a/main/draw.cpp b/main/draw.cpp index 2249d703..386ea960 100644 --- a/main/draw.cpp +++ b/main/draw.cpp @@ -159,8 +159,6 @@ void main_impl::do_update() void main_impl::drawEvent() { - do_update(); - _shader.set_tint({1, 1, 1, 1}); { @@ -183,6 +181,7 @@ void main_impl::drawEvent() } app.draw(); + do_update(); swapBuffers(); redraw(); -- cgit v1.2.3