diff options
author | Patric Stout <truebrain@openttd.org> | 2021-02-24 15:04:41 +0100 |
---|---|---|
committer | Patric Stout <github@truebrain.nl> | 2021-03-08 19:18:55 +0100 |
commit | 4610aa7ae3db6cf561e156ba011de3c7b516876d (patch) | |
tree | c2e998494f5ed9f1a037b3a493f8919d8287ae57 /src/video/video_driver.hpp | |
parent | 56911a86ea2fad84383729ece63c837dc012f14d (diff) | |
download | openttd-4610aa7ae3db6cf561e156ba011de3c7b516876d.tar.xz |
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.
Diffstat (limited to 'src/video/video_driver.hpp')
-rw-r--r-- | src/video/video_driver.hpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/video/video_driver.hpp b/src/video/video_driver.hpp index 58802efab..9a3ec6a36 100644 --- a/src/video/video_driver.hpp +++ b/src/video/video_driver.hpp @@ -242,11 +242,6 @@ protected: virtual void Paint() {} /** - * Thread function for threaded drawing. - */ - virtual void PaintThread() {} - - /** * Process any pending palette animation. */ virtual void CheckPaletteAnim() {} @@ -258,10 +253,11 @@ protected: virtual bool PollEvent() { return false; }; /** - * Run the game for a single tick, processing boththe game-tick and draw-tick. - * @returns True if the driver should redraw the screen. + * Give the video-driver a tick. + * It will process any potential game-tick and/or draw-tick, and/or any + * other video-driver related event. */ - bool Tick(); + void Tick(); /** * Sleep till the next tick is about to happen. |