Added check to disable swap control, if the relevant extension is not supported.

This commit is contained in:
the_fiddler 2007-11-04 15:35:31 +00:00
parent b41ad63491
commit 31672f0303

View file

@ -225,9 +225,7 @@ namespace OpenTK.Platform.Windows
GL.LoadAll();
Glu.LoadAll();
vsync_supported =
(Wgl.ARB.SupportsExtension(this.deviceContext, "WGL_EXT_swap_control") ||
Wgl.EXT.SupportsExtension(this.deviceContext, "WGL_EXT_swap_control")) &&
vsync_supported = Wgl.Arb.SupportsExtension(this.deviceContext, "WGL_EXT_swap_control") &&
Wgl.Load("wglGetSwapIntervalEXT") && Wgl.Load("wglSwapIntervalEXT");
if (source != null)
@ -324,12 +322,12 @@ namespace OpenTK.Platform.Windows
{
get
{
//return vsync != 0;
return Wgl.EXT.GetSwapInterval() != 0;
return vsync_supported && Wgl.Ext.GetSwapInterval() != 0;
}
set
{
Wgl.EXT.SwapInterval(value ? 1 : 0);
if (vsync_supported)
Wgl.Ext.SwapInterval(value ? 1 : 0);
}
}