예제 #1
0
 void CallStartupNPClientFunctions(TrackIRDll dll, IntPtr freePieWindowHandle, short data, short profileId)
 {
     Log("Calling dll with the following values - WindowHandle: " + freePieWindowHandle + " Data: " + data + " ProfileId: " + profileId);
     dll.GetSignature();
     dll.QueryVersion();
     dll.RegisterWindowHandle(freePieWindowHandle);
     dll.RequestData(data);
     dll.RegisterProgramProfileId(profileId);
     dll.StopCursor();
     dll.StartDataTransmission();
 }
예제 #2
0
        TrackIRDll SetupRealTrackIRDll(string realDllPath, IntPtr freePieWindowHandle)
        {
            TrackIRDll dll = null;

            if (realDllPath != null)
            {
                Log("Loading trackir dll: " + realDllPath);
                dll = new TrackIRDll(realDllPath, Log);
                CallStartupNPClientFunctions(dll, freePieWindowHandle, Data, ProgramProfileId);
            }
            else
            {
                Log("Not loading trackir dll - not found");
            }

            return(dll);
        }
예제 #3
0
        protected override void DoExecute(IEnumerable <string> arguments)
        {
            var args = arguments.ToList();

            doLog = args.Count == 3 && bool.Parse(args[2]);

            if (dll == null)
            {
                dll = SetupRealTrackIRDll(args[0], new IntPtr(long.Parse(args[1])));
            }

            dll.GetPosition(headposeData);

            var data = (TrackIRHeadposeData)Marshal.PtrToStructure(headposeData, typeof(TrackIRHeadposeData));

            WriteData(data);

            Thread.Sleep(1);
        }