diff --git a/Source/OpenTK/Input/IMouseDriver.cs b/Source/OpenTK/Input/IMouseDriver.cs index e4f1b755..bd69edbf 100644 --- a/Source/OpenTK/Input/IMouseDriver.cs +++ b/Source/OpenTK/Input/IMouseDriver.cs @@ -6,6 +6,6 @@ namespace OpenTK.Input { public interface IMouseDriver { - IList Mouse { get; } + IList Mouse { get; } } } diff --git a/Source/OpenTK/InputDriver.cs b/Source/OpenTK/InputDriver.cs index 9f29ec0d..43e2630a 100644 --- a/Source/OpenTK/InputDriver.cs +++ b/Source/OpenTK/InputDriver.cs @@ -17,9 +17,14 @@ namespace OpenTK { inputDriver = new OpenTK.Platform.Windows.WinRawInput(parentHandle); } + else if (Environment.OSVersion.Platform == PlatformID.Unix) + { + inputDriver = new OpenTK.Platform.X11.X11Input(parentHandle); + } else { - throw new PlatformNotSupportedException("Input is not implemented for platforms prior to Windows XP, yet."); + throw new PlatformNotSupportedException( + "Input handling is not supported on the current platform. Please report the problem to http://opentk.sourceforge.net"); } } @@ -35,9 +40,9 @@ namespace OpenTK get { return inputDriver.Keyboard; } } - public IList Mouse + IList IMouseDriver.Mouse { - get { throw new NotImplementedException(); } + get { return inputDriver.Mouse; } } #endregion diff --git a/Source/OpenTK/Platform/Windows/WinRawInput.cs b/Source/OpenTK/Platform/Windows/WinRawInput.cs index c1e741cf..7e0fe386 100644 --- a/Source/OpenTK/Platform/Windows/WinRawInput.cs +++ b/Source/OpenTK/Platform/Windows/WinRawInput.cs @@ -18,7 +18,7 @@ using OpenTK.Input; namespace OpenTK.Platform.Windows { - internal class WinRawInput : NativeWindow, Input.IInputDriver + internal class WinRawInput : NativeWindow, IInputDriver { /// /// Input event data. @@ -164,5 +164,14 @@ namespace OpenTK.Platform.Windows } #endregion + + #region IMouseDriver Members + + IList IMouseDriver.Mouse + { + get { throw new Exception("The method or operation is not implemented."); } + } + + #endregion } } diff --git a/Source/OpenTK/Platform/X11/API.cs b/Source/OpenTK/Platform/X11/API.cs index aee31ba8..ba100edf 100644 --- a/Source/OpenTK/Platform/X11/API.cs +++ b/Source/OpenTK/Platform/X11/API.cs @@ -561,18 +561,15 @@ XF86VidModeGetGammaRampSize( internal int min_width, min_height; internal int max_width, max_height; internal int width_inc, height_inc; - internal struct min_aspect - { - internal int x; /* numerator */ - internal int y; /* denominator */ - } - internal struct max_aspect - { - internal int x; /* numerator */ - internal int y; /* denominator */ - } + internal Rectangle min_aspect, max_aspect; internal int base_width, base_height; internal int win_gravity; + internal struct Rectangle + { + internal int x; /* numerator */ + internal int y; /* denominator */ + private void stop_the_compiler_warnings() { x = y = 0; } + } /* this structure may be extended in the future */ } diff --git a/Source/OpenTK/Platform/X11/X11GLNative.cs b/Source/OpenTK/Platform/X11/X11GLNative.cs index 642e3f49..d3b9e069 100644 --- a/Source/OpenTK/Platform/X11/X11GLNative.cs +++ b/Source/OpenTK/Platform/X11/X11GLNative.cs @@ -183,6 +183,7 @@ namespace OpenTK.Platform.X11 Trace.WriteLine("Our shiny new context is now current - ready to rock 'n' roll!"); Trace.Unindent(); + created = true; } #endregion diff --git a/Source/OpenTK/Platform/X11/X11Input.cs b/Source/OpenTK/Platform/X11/X11Input.cs new file mode 100644 index 00000000..0a77d098 --- /dev/null +++ b/Source/OpenTK/Platform/X11/X11Input.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Text; + +using OpenTK.Input; + +namespace OpenTK.Platform.X11 +{ + public class X11Input : IInputDriver + { + public X11Input(IntPtr windowHandle) + { + } + + #region --- IInputDriver Members --- + + #region public IList InputDevices + + public IList InputDevices + { + get { throw new Exception("The method or operation is not implemented."); } + } + + #endregion + + #region public IList Keyboard + + public IList Keyboard + { + get { throw new Exception("The method or operation is not implemented."); } + } + + #endregion + + #region public IList Mouse + + public IList Mouse + { + get { throw new Exception("The method or operation is not implemented."); } + } + + #endregion + + #endregion + } +} diff --git a/Source/OpenTK/Platform/X11/X11Keyboard.cs b/Source/OpenTK/Platform/X11/X11Keyboard.cs new file mode 100644 index 00000000..cbafc248 --- /dev/null +++ b/Source/OpenTK/Platform/X11/X11Keyboard.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Text; + +using OpenTK.Input; + +namespace OpenTK.Platform.X11 +{ + public class X11Keyboard : IKeyboardDriver + { + #region --- IKeyboardDriver Members --- + + public IList Keyboard + { + get { throw new Exception("The method or operation is not implemented."); } + } + + #endregion + } +} diff --git a/Source/OpenTK/Platform/X11/X11Mouse.cs b/Source/OpenTK/Platform/X11/X11Mouse.cs new file mode 100644 index 00000000..4a777f80 --- /dev/null +++ b/Source/OpenTK/Platform/X11/X11Mouse.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenTK.Platform.X11 +{ + class X11Mouse + { + } +}