Now loads GL and Glu functions.

This commit is contained in:
the_fiddler 2007-10-15 11:14:41 +00:00
parent e257702212
commit 9504ea7ad2

View file

@ -29,7 +29,7 @@ namespace OpenTK.Platform.Windows
private IntPtr renderContext; private IntPtr renderContext;
static private IntPtr opengl32Handle; static private IntPtr opengl32Handle;
private const string opengl32Name = "OPENGL32.DLL"; private const string opengl32Name = "OPENGL32.DLL";
private WindowInfo windowInfo = new WindowInfo(); private WindowInfo windowInfo;
private DisplayMode mode; private DisplayMode mode;
private bool vsync_supported; private bool vsync_supported;
@ -38,20 +38,10 @@ namespace OpenTK.Platform.Windows
#region --- Contructors --- #region --- Contructors ---
internal WinGLContext()
: this(new DisplayMode(640, 480))
{
}
internal WinGLContext(DisplayMode mode)
{
//Trace.WriteLine(String.Format("Creating opengl context (driver: {0})", this.ToString()));
this.mode = mode;
}
public WinGLContext(DisplayMode mode, IWindowInfo info) public WinGLContext(DisplayMode mode, IWindowInfo info)
{ {
this.windowInfo = info as WindowInfo; //this.windowInfo = info is Platform.WindowInfo ? (WindowInfo)(Platform.WindowInfo)info : (WindowInfo)info;
this.windowInfo = new WindowInfo(info);
this.mode = mode; this.mode = mode;
} }
@ -232,6 +222,8 @@ namespace OpenTK.Platform.Windows
} }
Wgl.Imports.MakeCurrent(deviceContext, renderContext); Wgl.Imports.MakeCurrent(deviceContext, renderContext);
Wgl.LoadAll(); Wgl.LoadAll();
GL.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") ||