From 3c5797b15c7c93e62f674531ac348514103c34d6 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Sun, 5 Aug 2007 18:51:07 +0000 Subject: [PATCH] Added visual for InputOnly window X11Input --- Source/OpenTK/Platform/Windows/WinRawInput.cs | 3 +-- Source/OpenTK/Platform/X11/WindowInfo.cs | 2 ++ Source/OpenTK/Platform/X11/X11GLContext.cs | 4 +++- Source/OpenTK/Platform/X11/X11GLNative.cs | 2 +- Source/OpenTK/Platform/X11/X11Input.cs | 9 ++------- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Source/OpenTK/Platform/Windows/WinRawInput.cs b/Source/OpenTK/Platform/Windows/WinRawInput.cs index e93449e9..f80f0750 100644 --- a/Source/OpenTK/Platform/Windows/WinRawInput.cs +++ b/Source/OpenTK/Platform/Windows/WinRawInput.cs @@ -141,10 +141,9 @@ namespace OpenTK.Platform.Windows public void ProcessEvents() { - // Do nothing, the WndProc is automatically notified of new events. + // Do nothing, the WndProc is automatically notified of new events (sub-classing magic). } - #endregion #region IMouseDriver Members diff --git a/Source/OpenTK/Platform/X11/WindowInfo.cs b/Source/OpenTK/Platform/X11/WindowInfo.cs index 859b1c30..9059b2c3 100644 --- a/Source/OpenTK/Platform/X11/WindowInfo.cs +++ b/Source/OpenTK/Platform/X11/WindowInfo.cs @@ -23,11 +23,13 @@ namespace OpenTK.Platform.X11 private IntPtr rootWindow, handle, topLevelWindow, display; private int screen; private WindowInfo parent; + private VisualInfo visinfo; internal IntPtr RootWindow { get { return rootWindow; } set { rootWindow = value; } } internal IntPtr TopLevelWindow { get { return topLevelWindow; } set { topLevelWindow = value; } } internal IntPtr Display { get { return display; } set { display = value; } } internal int Screen { get { return screen; } set { screen = value; } } + internal VisualInfo VisualInfo { get { return visinfo; } set { visinfo = value; } } public IntPtr Handle { get { return handle; } internal set { handle = value; } } public IWindowInfo Parent { get { return parent; } internal set { parent = value as WindowInfo; } } diff --git a/Source/OpenTK/Platform/X11/X11GLContext.cs b/Source/OpenTK/Platform/X11/X11GLContext.cs index fc0e40c1..fac29f7f 100644 --- a/Source/OpenTK/Platform/X11/X11GLContext.cs +++ b/Source/OpenTK/Platform/X11/X11GLContext.cs @@ -184,7 +184,7 @@ namespace OpenTK.Platform.X11 #region public void CreateVisual() - public void CreateVisual() + internal VisualInfo CreateVisual() { Debug.WriteLine("Creating visual."); Debug.Indent(); @@ -244,6 +244,8 @@ namespace OpenTK.Platform.X11 Debug.Print("done! (id: {0})", x11context); Debug.Unindent(); + + return visualInfo; } #endregion diff --git a/Source/OpenTK/Platform/X11/X11GLNative.cs b/Source/OpenTK/Platform/X11/X11GLNative.cs index 3de7ebe2..5f17cf7a 100644 --- a/Source/OpenTK/Platform/X11/X11GLNative.cs +++ b/Source/OpenTK/Platform/X11/X11GLNative.cs @@ -99,7 +99,7 @@ namespace OpenTK.Platform.X11 ); glContext = new X11GLContext(info, mode); - glContext.CreateVisual(); + info.VisualInfo = glContext.CreateVisual(); // Create a window on this display using the visual above Debug.Write("Creating output window... "); diff --git a/Source/OpenTK/Platform/X11/X11Input.cs b/Source/OpenTK/Platform/X11/X11Input.cs index b372a84d..6ec05e0a 100644 --- a/Source/OpenTK/Platform/X11/X11Input.cs +++ b/Source/OpenTK/Platform/X11/X11Input.cs @@ -56,14 +56,9 @@ namespace OpenTK.Platform.X11 window.Parent.Handle, 0, 0, 1, 1, - 0, - //glxVisualInfo.depth, - //glContext.XVisualInfo.depth, - 0, + 0, 0, Constants.InputOnly, - //glxVisualInfo.visual, - //glContext.XVisualInfo.visual, - IntPtr.Zero, + window.VisualInfo.visual, cw_mask, wnd_attributes );