Example #1
0
        public KinectInterface(KinectManager manager, int mode)
        {
            _manager = manager;
            _mode = mode;
            _status = STATUS_NO_KINECT;
            handPositions = new Vector2[2]{
                new Vector2(0, 0),
                new Vector2(0, 0)
            };

            _manager.SensorChanged += new KinectManager.StatusChangedEventHandler(SensorChanged);
            StartSensor();
        }
Example #2
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // Set graphic options
            _graphicsDevice.PreferredBackBufferWidth = SCREEN_WIDTH;
            _graphicsDevice.PreferredBackBufferHeight = SCREEN_HEIGHT;
            _graphicsDevice.IsFullScreen = FULLSCREEN_ENABLED;
            _graphicsDevice.ApplyChanges();

            // Managers (singleton static classes)
            RenderManager.Initialize(GraphicsDevice);
            ResourceManager.Initialize(Content,GraphicsDevice);
            AudioManager.Initialize(Content);

            // Initialize Kinect and its interface
            _kinectsManager = new KinectManager();
            _gameInput = new KinectInterface(_kinectsManager, KinectInterface.MODE_HANDS);

            _sceneManager = new SceneManager(this,_gameInput);
            base.Initialize();
        }