From: Mikko Rasa Date: Sat, 9 Sep 2023 14:12:34 +0000 (+0300) Subject: Enable vsync in the OpenGL backend X-Git-Url: https://git.tdb.fi/?a=commitdiff_plain;h=33779fe5e073f094e4ce8f4124c7a6e0fb1a7890;p=libs%2Fgl.git Enable vsync in the OpenGL backend 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. --- diff --git a/source/backends/opengl/device_backend.cpp b/source/backends/opengl/device_backend.cpp index 1b2ad57a..d8b75011 100644 --- a/source/backends/opengl/device_backend.cpp +++ b/source/backends/opengl/device_backend.cpp @@ -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() {