[Win] Corrected GetRawInputData invocation
authorStefanos A <stapostol@gmail.com>
Sat, 18 Jan 2014 15:53:17 +0000 (16:53 +0100)
committerthefiddler <stapostol@gmail.com>
Thu, 11 Sep 2014 10:51:47 +0000 (12:51 +0200)
Source/OpenTK/Platform/Windows/WinRawInput.cs

index d262e4b..69d1236 100644 (file)
@@ -94,17 +94,10 @@ namespace OpenTK.Platform.Windows
                 switch (message)
                 {
                     case WindowMessage.INPUT:
-                        int size = 0;
-
-#if false
-                        // Get the size of the input buffer
-                        Functions.GetRawInputData(lParam, GetRawInputDataEnum.INPUT,
-                            IntPtr.Zero, ref size, API.RawInputHeaderSize);
-
-                        void* data_ptr = stackalloc byte[size];
-                        RawInput* data = (RawInput*)data_ptr;
-#endif
+                        int size = BlittableValueType<RawInput>.Stride;
                         RawInput data;
+
+                        //RawInput data;
                         // Read the actual raw input structure
                         if (size == Functions.GetRawInputData(lParam, GetRawInputDataEnum.INPUT,
                             out data, ref size, API.RawInputHeaderSize))