comparison Orchestland/Assets/LeapMotion+OVR/SystemWipe/SystemWipeRecognizerNative.cs @ 1:f7675884f2a1

Add Orchestland project
author Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp>
date Fri, 17 Jul 2015 23:09:20 +0900
parents
children
comparison
equal deleted inserted replaced
0:347d21cdfc22 1:f7675884f2a1
1 using System;
2 using System.Runtime.InteropServices;
3
4 namespace Leap.Util
5 {
6 public enum Direction : int { Invalid, Up, Down };
7 public enum Status : int { Invalid, ErrorCannotAccessImages, Idle, SwipeBegin, SwipeUpdate, SwipeComplete, SwipeAbort, InfoQueueEmpty };
8
9 [StructLayout(LayoutKind.Sequential)]
10 public struct SystemWipeInfo
11 {
12 public Direction Direction;
13 public Status Status;
14 public float Progress;
15 }
16
17 public class SystemWipeRecognizerNative
18 {
19 # if UNITY_STANDALONE_OSX
20 const CallingConvention LeapCallingConvention = CallingConvention.Cdecl;
21 # else
22 const CallingConvention LeapCallingConvention = CallingConvention.StdCall;
23 # endif
24
25 [UnmanagedFunctionPointer(LeapCallingConvention)]
26 public delegate void CallbackSystemWipeInfoDelegate(SystemWipeInfo systemWipeInfo);
27
28 [DllImport("SystemWipeRecognizerDll", CallingConvention = LeapCallingConvention)]
29 public static extern void SetSystemWipeRecognizerCallback(IntPtr property);
30
31 [DllImport("SystemWipeRecognizerDll", CallingConvention = LeapCallingConvention)]
32 public static extern void EnableSystemWipeRecognizer();
33
34 [DllImport("SystemWipeRecognizerDll", CallingConvention = LeapCallingConvention)]
35 public static extern void DisableSystemWipeRecognizer();
36
37 [DllImport("SystemWipeRecognizerDll", CallingConvention = LeapCallingConvention)]
38 public static extern bool WasLastImageAccessOk();
39
40 [DllImport("SystemWipeRecognizerDll", CallingConvention = LeapCallingConvention)]
41 public static extern int GetFrameCount();
42
43 [DllImport("SystemWipeRecognizerDll", CallingConvention = LeapCallingConvention)]
44 public static extern SystemWipeInfo GetNextSystemWipeInfo();
45 }
46 }