]> git.tdb.fi Git - libs/gl.git/commitdiff
Enable vsync in the OpenGL backend
authorMikko Rasa <tdb@tdb.fi>
Sat, 9 Sep 2023 14:12:34 +0000 (17:12 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 9 Sep 2023 14:12:34 +0000 (17:12 +0300)
Since there's multiple backends now, applications should not touch the
context directly.  The Vulkan backend already uses vsync.  I may make it
an option on the Device in the future.

source/backends/opengl/device_backend.cpp

index 1b2ad57a19576e24c976445d04094da88b578160..d8b75011c633791a7a0e0327d283b45b161d589a 100644 (file)
@@ -26,7 +26,9 @@ namespace GL {
 
 OpenGLDevice::OpenGLDevice(Graphics::Window &wnd, const Graphics::GLOptions &opts):
        context(wnd, opts)
-{ }
+{
+       context.set_swap_interval(1);
+}
 
 Graphics::GLOptions OpenGLDevice::create_default_options()
 {