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; }
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; } }