From cd89668d0c4fabeafe5b65223e58d652b6542519 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 27 Oct 2024 15:07:24 +0100 Subject: Reduce cpu usage when ui is not visible --- src/Overlay.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/Overlay.cpp') diff --git a/src/Overlay.cpp b/src/Overlay.cpp index ed5c3a7..f8148bf 100644 --- a/src/Overlay.cpp +++ b/src/Overlay.cpp @@ -279,20 +279,20 @@ namespace gsr { process_key_bindings(event); } - void Overlay::draw() { + bool Overlay::draw() { update_notification_process_status(); update_gsr_process_status(); if(!visible) - return; + return false; if(page_stack.empty()) { hide(); - return; + return false; } if(!window) - return; + return false; window->clear(); @@ -312,6 +312,8 @@ namespace gsr { page_stack.draw(*window, mgl::vec2f(0.0f, 0.0f)); window->display(); + + return true; } void Overlay::show() { -- cgit v1.2.3