Now uses GLContext directly, instead of WinGLContext.

This commit is contained in:
the_fiddler 2008-01-11 20:24:20 +00:00
parent ba36c8ba3a
commit f50c0b06c2

View file

@ -23,7 +23,7 @@ namespace OpenTK.Platform.Windows
/// Drives GameWindow on Windows. /// Drives GameWindow on Windows.
/// This class supports OpenTK, and is not intended for use by OpenTK programs. /// This class supports OpenTK, and is not intended for use by OpenTK programs.
/// </summary> /// </summary>
sealed class WinGLNative : System.Windows.Forms.NativeWindow, INativeGLWindow internal sealed class WinGLNative : System.Windows.Forms.NativeWindow, INativeGLWindow
{ {
#region --- Fields --- #region --- Fields ---
@ -34,7 +34,7 @@ namespace OpenTK.Platform.Windows
private bool disposed; private bool disposed;
private bool isExiting; private bool isExiting;
private bool exists; private bool exists;
private WindowInfo window; private WindowInfo window = new WindowInfo();
private int top, bottom, left, right; private int top, bottom, left, right;
private ResizeEventArgs resizeEventArgs = new ResizeEventArgs(); private ResizeEventArgs resizeEventArgs = new ResizeEventArgs();
@ -276,9 +276,9 @@ namespace OpenTK.Platform.Windows
#endregion #endregion
#region public void CreateWindow(DisplayMode mode) #region public void CreateWindow(DisplayMode mode, GLContext context)
public void CreateWindow(DisplayMode windowMode) public void CreateWindow(DisplayMode windowMode, GLContext context)
{ {
Debug.Print("Creating native window with mode: {0}", windowMode.ToString()); Debug.Print("Creating native window with mode: {0}", windowMode.ToString());
Debug.Indent(); Debug.Indent();
@ -323,7 +323,10 @@ namespace OpenTK.Platform.Windows
if (this.Handle != IntPtr.Zero) if (this.Handle != IntPtr.Zero)
{ {
Debug.WriteLine("Window creation was succesful."); Debug.WriteLine("Window creation succesful.");
//context.Info = new OpenTK.Platform.WindowInfo(this);
//context.CreateContext();
//Debug.WriteLine("Context creation successful.");
exists = true; exists = true;
} }
else throw new ApplicationException(String.Format( else throw new ApplicationException(String.Format(
@ -341,7 +344,10 @@ namespace OpenTK.Platform.Windows
public void OnCreate(EventArgs e) public void OnCreate(EventArgs e)
{ {
this.window = new WindowInfo(this); this.window.Handle = this.Handle;
this.window.Parent = null;
//this.window = new WindowInfo(this);
//driver = new WinRawInput(this.window); // Disabled until the mouse issues are resolved. //driver = new WinRawInput(this.window); // Disabled until the mouse issues are resolved.
driver = new WMInput(this.window); driver = new WMInput(this.window);