From f50c0b06c234a20e1ef5ae4330ad0c7fcf245eee Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Fri, 11 Jan 2008 20:24:20 +0000 Subject: [PATCH] Now uses GLContext directly, instead of WinGLContext. --- Source/OpenTK/Platform/Windows/WinGLNative.cs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Source/OpenTK/Platform/Windows/WinGLNative.cs b/Source/OpenTK/Platform/Windows/WinGLNative.cs index 8c3178dc..db5fa039 100644 --- a/Source/OpenTK/Platform/Windows/WinGLNative.cs +++ b/Source/OpenTK/Platform/Windows/WinGLNative.cs @@ -23,7 +23,7 @@ namespace OpenTK.Platform.Windows /// Drives GameWindow on Windows. /// This class supports OpenTK, and is not intended for use by OpenTK programs. /// - sealed class WinGLNative : System.Windows.Forms.NativeWindow, INativeGLWindow + internal sealed class WinGLNative : System.Windows.Forms.NativeWindow, INativeGLWindow { #region --- Fields --- @@ -34,7 +34,7 @@ namespace OpenTK.Platform.Windows private bool disposed; private bool isExiting; private bool exists; - private WindowInfo window; + private WindowInfo window = new WindowInfo(); private int top, bottom, left, right; private ResizeEventArgs resizeEventArgs = new ResizeEventArgs(); @@ -276,9 +276,9 @@ namespace OpenTK.Platform.Windows #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.Indent(); @@ -323,7 +323,10 @@ namespace OpenTK.Platform.Windows 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; } else throw new ApplicationException(String.Format( @@ -341,7 +344,10 @@ namespace OpenTK.Platform.Windows 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 WMInput(this.window);