Пример #1
0
        /// <summary>
        /// The Direct3D device has been reset; re-initialize information related to
        /// DirectX.
        /// </summary>
        protected void OnDeviceReset( object sender, EventArgs e )
        {
            ResetCamera();

            try
            {
                _mouse = new Mouse( _parent );
                _keyboard = new Keyboard( _parent );

                foreach ( Effect fx in _effects )
                    fx.CreateEffect( _device );
            }
            catch ( DirectXException exc )
            {
                ThrowException( exc, true );

                if ( _mouse != null )
                {
                    _mouse.Dispose();
                    _mouse = null;
                }

                if ( _keyboard != null )
                {
                    _keyboard.Dispose();
                    _keyboard = null;
                }
            }
        }