From bdfa5fc9eccee316c866ebd15031452b91d5ece4 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Wed, 21 Oct 2009 10:16:32 +0000 Subject: [PATCH] Avoid accessing OpenTK.Graphics.OpenGL from platform-specific code. Reduces coupling and code-duplication. --- Source/OpenTK/Platform/MacOS/AglContext.cs | 2 +- Source/OpenTK/Platform/Windows/WinGLContext.cs | 4 ++-- Source/OpenTK/Platform/X11/X11GLContext.cs | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Source/OpenTK/Platform/MacOS/AglContext.cs b/Source/OpenTK/Platform/MacOS/AglContext.cs index 55dd8d0f..8b98de1f 100644 --- a/Source/OpenTK/Platform/MacOS/AglContext.cs +++ b/Source/OpenTK/Platform/MacOS/AglContext.cs @@ -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"; diff --git a/Source/OpenTK/Platform/Windows/WinGLContext.cs b/Source/OpenTK/Platform/Windows/WinGLContext.cs index fdf1024f..9933d653 100644 --- a/Source/OpenTK/Platform/Windows/WinGLContext.cs +++ b/Source/OpenTK/Platform/Windows/WinGLContext.cs @@ -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 diff --git a/Source/OpenTK/Platform/X11/X11GLContext.cs b/Source/OpenTK/Platform/X11/X11GLContext.cs index 4642ccb2..312133a2 100644 --- a/Source/OpenTK/Platform/X11/X11GLContext.cs +++ b/Source/OpenTK/Platform/X11/X11GLContext.cs @@ -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