-
-
Notifications
You must be signed in to change notification settings - Fork 440
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Summary
Switching Window.WindowState inside Window.Update event ignores VSync setting defaulting to false.
Switching window state inside Window.Load event works properly.
This issue can be omitted in a hacky way by adding Window.VSync = Window.VSync after switching Window.WindowState
Steps to reproduce
- Platform: Desktop (Windows 11)
- Framework Version: .NET 8.0
- API: OpenGL
- API Version: OpenGL 3.3.0 Core Profile Context 24.2.1.240215
- Initialize window using
WindowOptionswithVSyncset to true - Assign Update event and inside the event change
WindowStateto Fullscreen.
This will result in fullscreen window that has vsync disabled, with Window.VSync still being set to true.
This issue seems to be present only when switching from any window state to fullscreen.
Minimal code sample reproducing the issue
using Silk.NET.Maths;
using Silk.NET.Windowing;
WindowOptions options = WindowOptions.Default;
options.Size = new Vector2D<int>(1280, 720);
options.Title = "Window Name";
options.VSync = true;
ulong frame = 0;
IWindow Window = Silk.NET.Windowing.Window.Create(options);
Window.Update += OnUpdate;
Window.Run();
void OnUpdate(double dt)
{
frame++;
if (frame == 100)
{
Window.WindowState = WindowState.Fullscreen;
// trick below solves the issue
//Window.VSync = Window.VSync;
}
}Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
Done