diff options
author | Stefano Bonicatti <smjert@gmail.com> | 2017-12-08 17:58:28 +0100 |
---|---|---|
committer | Stefano Bonicatti <smjert@gmail.com> | 2017-12-09 01:43:23 +0100 |
commit | c067cf2c6a81172d28cf522d281ec94ff608a48d (patch) | |
tree | caa1f532469c73ba70071105451e6df138c3d4c0 /core/os/os.h | |
parent | 146bdf031d053d2af771622aa15f70ad04b0720a (diff) | |
download | redot-engine-c067cf2c6a81172d28cf522d281ec94ff608a48d.tar.gz |
Fixes vsync setting ignored when using a separate thread for rendering
Setting the vsync in the main thread, after the rendering thread starts
and takes the OpenGL context fails, so we need to do that before.
Also, for some reason, the main thread cannot make current the context
anymore.
Fixes #13447
Diffstat (limited to 'core/os/os.h')
-rw-r--r-- | core/os/os.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/os/os.h b/core/os/os.h index 4f968020cc..979ad7e92a 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -92,14 +92,16 @@ public: bool resizable; bool borderless_window; bool maximized; + bool use_vsync; float get_aspect() const { return (float)width / (float)height; } - VideoMode(int p_width = 1024, int p_height = 600, bool p_fullscreen = false, bool p_resizable = true, bool p_borderless_window = false, bool p_maximized = false) { + VideoMode(int p_width = 1024, int p_height = 600, bool p_fullscreen = false, bool p_resizable = true, bool p_borderless_window = false, bool p_maximized = false, bool p_use_vsync = false) { width = p_width; height = p_height; fullscreen = p_fullscreen; resizable = p_resizable; borderless_window = p_borderless_window; maximized = p_maximized; + use_vsync = p_use_vsync; } }; |