示例#1
0
        public ExEnEmTouchGameView(Game game, GraphicsDeviceManager gdm)
            : base(UIScreen.MainScreen.Bounds)
        {
            // Setup iPhoneOSGameView:
            LayerRetainsBacking = false;
            LayerColorFormat = EAGLColorFormat.RGBA8;

            // Setup UIView:
            MultipleTouchEnabled = true;
            AutoResize = false;

            // Setup members:
            this.game = game;
            this.gdm = gdm;

            // Display size:
            ScreenBoundary = UIScreen.MainScreen.Bounds;
            game.Window.DoClientSizeChange(new Rectangle(0, 0, (int)ScreenBoundary.Width, (int)ScreenBoundary.Height));

            // Game loop and timing:
            updateGameTime = new GameTime();
            drawGameTime = new GameTime();
            gameLoop = new GameLoop();
            gameLoop.Update = DoUpdate;
        }
示例#2
0
文件: Game.cs 项目: mikairi/SoshiLand
        void InitializeGameLoop()
        {
            if(gameLoop == null)
            {
                gameLoop = new GameLoop();
                gameLoop.Update = gameLoop_Update;
                gameLoop.Draw = gameLoop_Draw;
                gameLoop.ForcePump = ForceDrawPump;

                lastUpdate = DateTime.Now;
                renderingEvent = new EventHandler(CompositionTarget_Rendering);
                CompositionTarget.Rendering += renderingEvent;
            }
        }