diff --git a/src/board.cpp b/src/board.cpp index 48ec0dc..5adc9b4 100644 --- a/src/board.cpp +++ b/src/board.cpp @@ -361,6 +361,7 @@ void board::start(){ i = ++i % PANELS_LENGTH; OVERLAY->_title = PANELS[i]->_title; + OVERLAY->forceUpdate(); last_panel = start; } diff --git a/src/panel/panel.cpp b/src/panel/panel.cpp index 4ca639e..3abd45a 100644 --- a/src/panel/panel.cpp +++ b/src/panel/panel.cpp @@ -5,3 +5,13 @@ // #include "panel.hpp" + +using namespace dashboard::panel; + +void panel::forceUpdate(){ + if(_texture == nullptr) + initTexture(); + + update(); + update_texture(); +} diff --git a/src/panel/panel.hpp b/src/panel/panel.hpp index fa2a345..31699c0 100644 --- a/src/panel/panel.hpp +++ b/src/panel/panel.hpp @@ -25,6 +25,8 @@ namespace dashboard::panel { virtual ~panel() = default; virtual void draw() = 0; + + void forceUpdate(); //in milliseconds size_t _time_on_screen = 0;