private void OnDraw() { IDrawingSession ds = this.swapChain.CreateDrawingSession(); var eventArgs = new AnimatedDrawEventArgs(ds, null); this.Draw?.Invoke(this, eventArgs); ds.Close(); }
public static T CreateGame <T>(IDrawingSession dc, IKeyboard keyboard, IMouse mouse) where T : Game, new() { var game = new T { spriteBatch = dc, Keyboard = keyboard, Mouse = mouse }; game.curGame = game; return(game); }
public void Run() { while (!this.isClosed) { if (this.isVisible) { this.platformWindow.ProcessEvents(); using (IDrawingSession ds = this.graphicsDevice.CreateDrawingSession()) { ds.Clear(Colors.Black); ds.DrawText("Hello GameFramework", new Vector2(0, 0), Colors.White); } this.graphicsDevice.Present(); } else { this.platformWindow.ProcessEvents(); } } }
private void Draw(GameTime gameTime, IDrawingSession drawingSession) { this.game.Draw(gameTime, drawingSession); }
public AnimatedDrawEventArgs(IDrawingSession drawingSession, GameTime gameTime) { this.DrawingSession = drawingSession; this.TimingInfo = gameTime; }
public virtual void Draw(GameTime gameTime, IDrawingSession drawingSession) { }
private AnimatedDrawEventArgs CreateDrawEventArgs(IDrawingSession drawingSession, bool isRunningSlowly) { return(new AnimatedDrawEventArgs(drawingSession, new GameTime { IsRunningSlowly = isRunningSlowly })); }