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 /platform | |
parent | 146bdf031d053d2af771622aa15f70ad04b0720a (diff) |
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 'platform')
-rw-r--r-- | platform/haiku/os_haiku.cpp | 1 | ||||
-rw-r--r-- | platform/osx/os_osx.mm | 2 | ||||
-rw-r--r-- | platform/uwp/os_uwp.cpp | 1 | ||||
-rw-r--r-- | platform/windows/os_windows.cpp | 2 | ||||
-rw-r--r-- | platform/x11/os_x11.cpp | 2 |
5 files changed, 8 insertions, 0 deletions
diff --git a/platform/haiku/os_haiku.cpp b/platform/haiku/os_haiku.cpp index ef5a065107..f7196755af 100644 --- a/platform/haiku/os_haiku.cpp +++ b/platform/haiku/os_haiku.cpp @@ -105,6 +105,7 @@ void OS_Haiku::initialize(const VideoMode &p_desired, int p_video_driver, int p_ context_gl = memnew(ContextGL_Haiku(window)); context_gl->initialize(); context_gl->make_current(); + context_gl->set_use_vsync(current_video_mode.use_vsync); /* Port to GLES 3 rasterizer */ //rasterizer = memnew(RasterizerGLES2); diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 6cc8be250d..75d0bd1648 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -1089,6 +1089,8 @@ void OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_au [context makeCurrentContext]; + set_use_vsync(p_desired.use_vsync); + [NSApp activateIgnoringOtherApps:YES]; _update_window(); diff --git a/platform/uwp/os_uwp.cpp b/platform/uwp/os_uwp.cpp index 1655caf04b..659f162724 100644 --- a/platform/uwp/os_uwp.cpp +++ b/platform/uwp/os_uwp.cpp @@ -241,6 +241,7 @@ void OSUWP::initialize(const VideoMode &p_desired, int p_video_driver, int p_aud RasterizerGLES3::register_config(); RasterizerGLES3::make_current(); + gl_context->set_use_vsync(vm.use_vsync); visual_server = memnew(VisualServerRaster); // FIXME: Reimplement threaded rendering? Or remove? diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 79a760f055..41730d33af 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -1074,6 +1074,8 @@ void OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int RasterizerGLES3::register_config(); RasterizerGLES3::make_current(); + + gl_context->set_use_vsync(video_mode.use_vsync); #endif visual_server = memnew(VisualServerRaster); diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index c210a03688..263ff012d4 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -286,6 +286,8 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au RasterizerGLES3::make_current(); + context_gl->set_use_vsync(current_videomode.use_vsync); + #endif visual_server = memnew(VisualServerRaster); |