summaryrefslogtreecommitdiff
path: root/src/video/win32_v.h
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-04-10 14:53:26 +0200
committerPatric Stout <github@truebrain.nl>2021-04-11 14:26:00 +0200
commitf0f20730067ef79dd87fd24b5a670ef3f38c0b88 (patch)
treef11a3f4093d92ebc80b8a8e6d2fda603ab94ff53 /src/video/win32_v.h
parent56f982fa7f6da6134cff0d81040ebdf39b72ea2d (diff)
downloadopenttd-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/win32_v.h')
-rw-r--r--src/video/win32_v.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/video/win32_v.h b/src/video/win32_v.h
index f6ca291f1..8c63aeedf 100644
--- a/src/video/win32_v.h
+++ b/src/video/win32_v.h
@@ -138,12 +138,13 @@ public:
bool HasAnimBuffer() override { return true; }
uint8 *GetAnimBuffer() override { return this->anim_buffer; }
+ void ToggleVsync(bool vsync) override;
+
const char *GetName() const override { return "win32-opengl"; }
protected:
HDC dc; ///< Window device context.
HGLRC gl_rc; ///< OpenGL context.
- bool vsync; ///< Enable VSync?
uint8 *anim_buffer; ///< Animation buffer from OpenGL back-end.
uint8 GetFullscreenBpp() override { return 32; } // OpenGL is always 32 bpp.