Beispiel #1
0
        static void Main(string[] args)
        {
            ClientContext.PreloadNativeLibraries();
            using (ServerAutoStarter serverAutoStarter = new ServerAutoStarter())
                using (OSVR.ClientKit.ClientContext context = new OSVR.ClientKit.ClientContext("com.osvr.exampleclients.managed.Location2D"))
                {
#if NET20
                    using (var location2D = Location2DInterface.GetInterface(context, Path))
#else
                    using (var location2D = context.GetLocation2DInterface(Path))
#endif
                    {
                        location2D.StateChanged += location2D_StateChanged;
                        // Pretend that this is your application's main loop
                        for (int i = 0; i < 1000000; ++i)
                        {
                            context.update();
                            var location2DState = location2D.GetState();
                            Console.WriteLine("Location2DState: {0}", FormatLocation2DReport(location2DState.Value));
                        }

                        Console.WriteLine("Library shut down; exiting.");
                    }
                }
        }
 public Location2D(ClientContext context, String path)
 {
     location2DInterface = context.GetLocation2DInterface(path);
     location2DInterface.StateChanged += Location2DInterface_StateChanged;
 }
Beispiel #3
0
 public Location2D(ClientContext context, String path)
 {
     location2DInterface = context.GetLocation2DInterface(path);
     location2DInterface.StateChanged += Location2DInterface_StateChanged;
 }