mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-03-08 10:10:00 +00:00
[OpenTK] Query the driver for VSyncMode getter
Otherwise, the user could call Context.SwapInterval directly, causing the vsync property to fall out of sync.
This commit is contained in:
parent
3da459b316
commit
f2dc40abdd
|
@ -98,8 +98,6 @@ namespace OpenTK
|
||||||
|
|
||||||
bool is_running_slowly; // true, when UpdatePeriod cannot reach TargetUpdatePeriod
|
bool is_running_slowly; // true, when UpdatePeriod cannot reach TargetUpdatePeriod
|
||||||
|
|
||||||
VSyncMode vsync;
|
|
||||||
|
|
||||||
FrameEventArgs update_args = new FrameEventArgs();
|
FrameEventArgs update_args = new FrameEventArgs();
|
||||||
FrameEventArgs render_args = new FrameEventArgs();
|
FrameEventArgs render_args = new FrameEventArgs();
|
||||||
|
|
||||||
|
@ -884,7 +882,18 @@ namespace OpenTK
|
||||||
{
|
{
|
||||||
EnsureUndisposed();
|
EnsureUndisposed();
|
||||||
GraphicsContext.Assert();
|
GraphicsContext.Assert();
|
||||||
return vsync;
|
if (Context.SwapInterval < 0)
|
||||||
|
{
|
||||||
|
return VSyncMode.Adaptive;
|
||||||
|
}
|
||||||
|
else if (Context.SwapInterval == 0)
|
||||||
|
{
|
||||||
|
return VSyncMode.Off;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return VSyncMode.On;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
|
@ -904,7 +913,6 @@ namespace OpenTK
|
||||||
Context.SwapInterval = -1;
|
Context.SwapInterval = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
vsync = value;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue