Avoid accessing OpenTK.Graphics.OpenGL from platform-specific code. Reduces coupling and code-duplication.

This commit is contained in:
the_fiddler 2009-10-21 10:16:32 +00:00
parent 25c646639b
commit bdfa5fc9ec
3 changed files with 5 additions and 4 deletions

View file

@ -379,7 +379,7 @@ namespace OpenTK.Platform.MacOS
public override void LoadAll()
{
new OpenTK.Graphics.OpenGL.GL().LoadAll();
base.LoadAll();
}
private const string Library = "libdl.dylib";

View file

@ -205,10 +205,10 @@ namespace OpenTK.Platform.Windows
public override void LoadAll()
{
Wgl.LoadAll();
new GL().LoadAll();
vsync_supported = Wgl.Arb.SupportsExtension(this, "WGL_EXT_swap_control") &&
Wgl.Load("wglGetSwapIntervalEXT") && Wgl.Load("wglSwapIntervalEXT");
base.LoadAll();
}
#endregion

View file

@ -269,10 +269,11 @@ namespace OpenTK.Platform.X11
public override void LoadAll()
{
new OpenTK.Graphics.OpenGL.GL().LoadAll();
new Glx().LoadAll();
vsync_supported = this.GetAddress("glXSwapIntervalSGI") != IntPtr.Zero;
Debug.Print("Context supports vsync: {0}.", vsync_supported);
base.LoadAll();
}
#endregion