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