Otherwise, the user could call Context.SwapInterval directly, causing
the vsync property to fall out of sync.
bool is_running_slowly; // true, when UpdatePeriod cannot reach TargetUpdatePeriod
- VSyncMode vsync;
-
FrameEventArgs update_args = new FrameEventArgs();
FrameEventArgs render_args = new FrameEventArgs();
{
EnsureUndisposed();
GraphicsContext.Assert();
- return vsync;
+ if (Context.SwapInterval < 0)
+ {
+ return VSyncMode.Adaptive;
+ }
+ else if (Context.SwapInterval == 0)
+ {
+ return VSyncMode.Off;
+ }
+ else
+ {
+ return VSyncMode.On;
+ }
}
set
{
Context.SwapInterval = -1;
break;
}
- vsync = value;
}
}