From a40139bef6e41ed940e41bc0a802bb7ff3154d12 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 12 Feb 2021 23:42:11 +0100 Subject: Do not display window if not needed for images --- src/QuickMedia.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index 5ef47a7..6eb81c7 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -2365,9 +2365,11 @@ namespace QuickMedia { auto text_bounds = chapter_text.getLocalBounds(); chapter_text.setPosition(std::floor(window_size.x * 0.5f - text_bounds.width * 0.5f), std::floor(window_size.y - background_height * 0.5f - font_height * 0.5f)); window.draw(chapter_text); - } - window.display(); + window.display(); + } else { + std::this_thread::sleep_for(std::chrono::milliseconds(50)); + } } end_of_images_page: -- cgit v1.2.3