示例#1
0
文件: Game.cs 项目: MarcStan/renderer
        protected override void Initialize()
        {
            Window.Title = "TerrainSample - Esc to quit";
            base.Initialize();
            IsMouseVisible  = false;
            IsFixedTimeStep = false;

            _terrainScene = new TerrainScene(_graphicsDeviceManager, Content);
            Mouse.SetPosition(GraphicsDevice.Viewport.Width / 2, GraphicsDevice.Viewport.Height / 2);
        }
示例#2
0
文件: Game.cs 项目: MarcStan/renderer
        protected override void Initialize()
        {
            base.Initialize();

            // must be initialized. required by Content loading and rendering (will add itself to the Services)
            _graphicsDeviceManager = new WpfGraphicsDeviceService(this);

            // wpf and keyboard need reference to the host control in order to receive input
            // this means every WpfGame control will have it's own keyboard & mouse manager which will only react if the mouse is in the control
            _keyboard = new WpfKeyboard(this);
            _mouse    = new WpfMouse(this);

            _terrainScene = new TerrainScene(_graphicsDeviceManager, Content);
        }