diff options
author | Patric Stout <truebrain@openttd.org> | 2021-04-10 14:53:26 +0200 |
---|---|---|
committer | Patric Stout <github@truebrain.nl> | 2021-04-11 14:26:00 +0200 |
commit | f0f20730067ef79dd87fd24b5a670ef3f38c0b88 (patch) | |
tree | f11a3f4093d92ebc80b8a8e6d2fda603ab94ff53 /src/video/video_driver.hpp | |
parent | 56f982fa7f6da6134cff0d81040ebdf39b72ea2d (diff) | |
download | openttd-f0f20730067ef79dd87fd24b5a670ef3f38c0b88.tar.xz |
Feature: allow a toggle to enable/disable vsync
Vsync should be off by default, as for most players it will be
better to play without vsync. Exception exist, mainly people who
play in fullscreen mode.
Diffstat (limited to 'src/video/video_driver.hpp')
-rw-r--r-- | src/video/video_driver.hpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/video/video_driver.hpp b/src/video/video_driver.hpp index 7a859565a..f143b61a8 100644 --- a/src/video/video_driver.hpp +++ b/src/video/video_driver.hpp @@ -28,6 +28,7 @@ extern std::vector<Dimension> _resolutions; extern Dimension _cur_resolution; extern bool _rightclick_emulate; extern bool _video_hw_accel; +extern bool _video_vsync; /** The base of all video drivers. */ class VideoDriver : public Driver { @@ -67,6 +68,12 @@ public: virtual bool ToggleFullscreen(bool fullscreen) = 0; /** + * Change the vsync setting. + * @param vsync The new setting. + */ + virtual void ToggleVsync(bool vsync) {} + + /** * Callback invoked after the blitter was changed. * @return True if no error. */ |