diff Orchestland/Assets/LeapMotion+OVR/SystemWipe/SystemWipeRecognizerNative.cs @ 3:0030a1b971fb default tip

merge
author Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
date Fri, 17 Jul 2015 23:23:43 +0900
parents f7675884f2a1
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Orchestland/Assets/LeapMotion+OVR/SystemWipe/SystemWipeRecognizerNative.cs	Fri Jul 17 23:23:43 2015 +0900
@@ -0,0 +1,46 @@
+using System;
+using System.Runtime.InteropServices;
+
+namespace Leap.Util
+{
+  public enum Direction : int { Invalid, Up, Down };
+  public enum Status : int { Invalid, ErrorCannotAccessImages, Idle, SwipeBegin, SwipeUpdate, SwipeComplete, SwipeAbort, InfoQueueEmpty };
+
+  [StructLayout(LayoutKind.Sequential)]
+  public struct SystemWipeInfo
+  {
+    public Direction Direction;
+    public Status Status;
+    public float Progress;
+  }
+
+  public class SystemWipeRecognizerNative
+  {
+#   if UNITY_STANDALONE_OSX
+      const CallingConvention LeapCallingConvention = CallingConvention.Cdecl;
+#   else
+      const CallingConvention LeapCallingConvention = CallingConvention.StdCall;
+#   endif
+
+    [UnmanagedFunctionPointer(LeapCallingConvention)]
+    public delegate void CallbackSystemWipeInfoDelegate(SystemWipeInfo systemWipeInfo);
+
+    [DllImport("SystemWipeRecognizerDll", CallingConvention = LeapCallingConvention)]
+    public static extern void SetSystemWipeRecognizerCallback(IntPtr property);
+
+    [DllImport("SystemWipeRecognizerDll", CallingConvention = LeapCallingConvention)]
+    public static extern void EnableSystemWipeRecognizer();
+
+    [DllImport("SystemWipeRecognizerDll", CallingConvention = LeapCallingConvention)]
+    public static extern void DisableSystemWipeRecognizer();
+
+    [DllImport("SystemWipeRecognizerDll", CallingConvention = LeapCallingConvention)]
+    public static extern bool WasLastImageAccessOk();
+
+    [DllImport("SystemWipeRecognizerDll", CallingConvention = LeapCallingConvention)]
+    public static extern int GetFrameCount();
+
+    [DllImport("SystemWipeRecognizerDll", CallingConvention = LeapCallingConvention)]
+    public static extern SystemWipeInfo GetNextSystemWipeInfo();
+  }
+}