Fixed GLContext creation on Windows.

This commit is contained in:
the_fiddler 2008-01-14 22:38:09 +00:00
parent 023e794385
commit b82bf0a073
3 changed files with 7 additions and 6 deletions

View file

@ -57,6 +57,9 @@ namespace OpenTK
default: default:
throw new PlatformNotSupportedException("Your platform is not supported currently. Please, refer to http://www.opentk.com for more information."); throw new PlatformNotSupportedException("Your platform is not supported currently. Please, refer to http://www.opentk.com for more information.");
} }
(this as IGLContextCreationHack).SetWindowHandle(window.Handle);
(this as IGLContextCreationHack).SelectDisplayMode(mode, window);
} }
#endregion #endregion

View file

@ -203,6 +203,8 @@ namespace OpenTK
// specific depth for the DisplayMode - we let the driver select one instead. // specific depth for the DisplayMode - we let the driver select one instead.
display_mode.Color = new ColorMode(0); display_mode.Color = new ColorMode(0);
context = new GLContext(display_mode, info); context = new GLContext(display_mode, info);
(context as IGLContextCreationHack).SetWindowHandle(info.Handle);
(context as IGLContextCreationHack).SelectDisplayMode(display_mode, info);
context.CreateContext(true, null); context.CreateContext(true, null);
idle = new PlatformIdle(info); idle = new PlatformIdle(info);
} }

View file

@ -125,8 +125,6 @@ namespace OpenTK
"Your platform is not supported currently. Please, refer to http://opentk.sourceforge.net for more information."); "Your platform is not supported currently. Please, refer to http://opentk.sourceforge.net for more information.");
} }
glWindow.Destroy += new DestroyEvent(glWindow_Destroy);
CreateWindow(mode, title); CreateWindow(mode, title);
//this.vsync = VSyncMode.Adaptive; //this.vsync = VSyncMode.Adaptive;
@ -381,8 +379,6 @@ namespace OpenTK
{ {
glWindow.CreateWindow(mode, glContext); glWindow.CreateWindow(mode, glContext);
glContext = new GLContext(mode, glWindow.WindowInfo); glContext = new GLContext(mode, glWindow.WindowInfo);
(glContext as IGLContextCreationHack).SetWindowHandle(glWindow.WindowInfo.Handle);
(glContext as IGLContextCreationHack).SelectDisplayMode(mode, glWindow.WindowInfo);
glContext.CreateContext(); glContext.CreateContext();
this.Title = title; this.Title = title;
} }
@ -1221,7 +1217,7 @@ namespace OpenTK
} }
*/ */
#endregion #endregion
#if false // TODO: 0.3.15 (Linux support missing)
#region PointToClient #region PointToClient
/// <summary> /// <summary>
@ -1251,7 +1247,7 @@ namespace OpenTK
} }
#endregion #endregion
#endif
#region --- IDisposable Members --- #region --- IDisposable Members ---
/// <summary> /// <summary>