From a987a5daf635034f929ee8c07dbc1d7ffecd572b Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Sun, 5 Aug 2007 16:44:31 +0000 Subject: [PATCH] Overrode ToString in WindowInfo implementations. Debugging NRE in X11Keyboard constructor. --- Source/OpenTK/Platform/Windows/WindowInfo.cs | 7 +++++++ Source/OpenTK/Platform/X11/WindowInfo.cs | 6 ++++++ Source/OpenTK/Platform/X11/X11Keyboard.cs | 3 ++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Source/OpenTK/Platform/Windows/WindowInfo.cs b/Source/OpenTK/Platform/Windows/WindowInfo.cs index c2d2a463..21b800c8 100644 --- a/Source/OpenTK/Platform/Windows/WindowInfo.cs +++ b/Source/OpenTK/Platform/Windows/WindowInfo.cs @@ -28,5 +28,12 @@ namespace OpenTK.Platform.Windows } #endregion + + public override string ToString() + { + return String.Format("Windows.WindowInfo: Handle {0}{1} Parent {2}", + this.Handle, System.Environment.NewLine, this.Parent.ToString()); + } + } } diff --git a/Source/OpenTK/Platform/X11/WindowInfo.cs b/Source/OpenTK/Platform/X11/WindowInfo.cs index c2427102..39ae7b46 100644 --- a/Source/OpenTK/Platform/X11/WindowInfo.cs +++ b/Source/OpenTK/Platform/X11/WindowInfo.cs @@ -31,5 +31,11 @@ namespace OpenTK.Platform.X11 public IntPtr Handle { get { return handle; } internal set { handle = value; } } public IWindowInfo Parent { get { return parent; } internal set { parent = value as WindowInfo; } } + + public override string ToString() + { + return String.Format("X11.WindowInfo: Display {0}, Screen {1}, Handle {2}{3} Parent {4}", + this.Display, this.Screen, this.Handle, System.Environment.NewLine, this.Parent.ToString()); + } } } diff --git a/Source/OpenTK/Platform/X11/X11Keyboard.cs b/Source/OpenTK/Platform/X11/X11Keyboard.cs index 585ffa50..2a138f5f 100644 --- a/Source/OpenTK/Platform/X11/X11Keyboard.cs +++ b/Source/OpenTK/Platform/X11/X11Keyboard.cs @@ -100,6 +100,7 @@ namespace OpenTK.Platform.X11 internal X11Keyboard(WindowInfo window) { + /* this.window = window; Initialize(); @@ -112,7 +113,7 @@ namespace OpenTK.Platform.X11 //keysyms = (IntPtr[])Marshal.PtrToStructure(keysym_ptr, typeof(IntPtr[])); API.Free(keysym_ptr); - + */ Keyboard kb = new Keyboard(); kb.Description = "Default X11 keyboard"; kb.NumberOfKeys = lastKeyCode - firstKeyCode + 1;