From 4610aa7ae3db6cf561e156ba011de3c7b516876d Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Wed, 24 Feb 2021 15:04:41 +0100 Subject: Remove: [Video] no longer draw in a thread Drawing in a thread is a bit odd, and often leads to surprising issues. For example, OpenGL would only allow it if you move the full context to the thread. Which is not always easily done on all OSes. In general, the advise is to handle system events and drawing from the main thread, and do everything else in other threads. So, let's be more like other games. Additionally, putting the drawing routine in a thread was only done for a few targets. Upcoming commit will move the GameLoop in a thread, which will work for all targets. --- src/video/video_driver.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/video/video_driver.cpp') diff --git a/src/video/video_driver.cpp b/src/video/video_driver.cpp index cb81f857d..49337c03a 100644 --- a/src/video/video_driver.cpp +++ b/src/video/video_driver.cpp @@ -19,7 +19,7 @@ bool _video_hw_accel; ///< Whether to consider hardware accelerated video drivers. -bool VideoDriver::Tick() +void VideoDriver::Tick() { auto cur_ticks = std::chrono::steady_clock::now(); @@ -66,12 +66,10 @@ bool VideoDriver::Tick() ::InputLoop(); UpdateWindows(); - this->CheckPaletteAnim(); - return true; + this->CheckPaletteAnim(); + this->Paint(); } - - return false; } void VideoDriver::SleepTillNextTick() -- cgit v1.2.3-54-g00ecf