Fixed GLContext creation on Windows.

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

View file

@ -57,6 +57,9 @@ namespace OpenTK
default:
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

View file

@ -203,6 +203,8 @@ namespace OpenTK
// specific depth for the DisplayMode - we let the driver select one instead.
display_mode.Color = new ColorMode(0);
context = new GLContext(display_mode, info);
(context as IGLContextCreationHack).SetWindowHandle(info.Handle);
(context as IGLContextCreationHack).SelectDisplayMode(display_mode, info);
context.CreateContext(true, null);
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.");
}
glWindow.Destroy += new DestroyEvent(glWindow_Destroy);
CreateWindow(mode, title);
//this.vsync = VSyncMode.Adaptive;
@ -381,8 +379,6 @@ namespace OpenTK
{
glWindow.CreateWindow(mode, glContext);
glContext = new GLContext(mode, glWindow.WindowInfo);
(glContext as IGLContextCreationHack).SetWindowHandle(glWindow.WindowInfo.Handle);
(glContext as IGLContextCreationHack).SelectDisplayMode(mode, glWindow.WindowInfo);
glContext.CreateContext();
this.Title = title;
}
@ -1221,7 +1217,7 @@ namespace OpenTK
}
*/
#endregion
#if false // TODO: 0.3.15 (Linux support missing)
#region PointToClient
/// <summary>
@ -1251,7 +1247,7 @@ namespace OpenTK
}
#endregion
#endif
#region --- IDisposable Members ---
/// <summary>