From c067cf2c6a81172d28cf522d281ec94ff608a48d Mon Sep 17 00:00:00 2001 From: Stefano Bonicatti Date: Fri, 8 Dec 2017 17:58:28 +0100 Subject: 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 --- core/os/os.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'core/os/os.h') 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; } }; -- cgit v1.2.3