From 28f78b21c8d626fbc4cef348f61cd85a1693972a Mon Sep 17 00:00:00 2001 From: ThomasMiz <32400648+ThomasMiz@users.noreply.github.com> Date: Sun, 24 Mar 2024 16:15:47 -0300 Subject: [PATCH] Set swap interval on GLFW window creation --- src/Windowing/Silk.NET.Windowing.Glfw/GlfwWindow.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Windowing/Silk.NET.Windowing.Glfw/GlfwWindow.cs b/src/Windowing/Silk.NET.Windowing.Glfw/GlfwWindow.cs index d6aca425df..c43e031698 100644 --- a/src/Windowing/Silk.NET.Windowing.Glfw/GlfwWindow.cs +++ b/src/Windowing/Silk.NET.Windowing.Glfw/GlfwWindow.cs @@ -115,7 +115,7 @@ protected override void CoreReset() } } - protected override IGLContext? CoreGLContext => _glContext ??= new(_glfw, _glfwWindow, this); + protected override IGLContext CoreGLContext => _glContext ??= new(_glfw, _glfwWindow, this); protected override IVkSurface? CoreVkSurface { @@ -434,6 +434,8 @@ protected override void CoreInitialize(WindowOptions opts) _glfw.MakeContextCurrent(_glfwWindow); } + CoreGLContext.SwapInterval(opts.VSync ? 1 : 0); + GLFW.Glfw.ThrowExceptions(); }