faster wakeup

This commit is contained in:
Green Sky 2024-01-06 15:13:45 +01:00
parent 5a0651eaf0
commit 92b58cbfa9
No known key found for this signature in database

View File

@ -106,6 +106,12 @@ bool MainScreen::handleEvent(SDL_Event& e) {
if (event_renderer != nullptr && event_renderer == renderer) { if (event_renderer != nullptr && event_renderer == renderer) {
if (_window_hidden_ts <= e.window.timestamp) { if (_window_hidden_ts <= e.window.timestamp) {
_window_hidden_ts = e.window.timestamp; _window_hidden_ts = e.window.timestamp;
if (_window_hidden) {
// if window was previously hidden, we shorten the wait for the next frame
_render_interval = 1.f/60.f;
}
_window_hidden = false; _window_hidden = false;
//std::cout << "TOMAT: window shown " << e.window.timestamp << "\n"; //std::cout << "TOMAT: window shown " << e.window.timestamp << "\n";
} }