Exemple #1
0
        protected override void Draw(GameTime gameTime)
        {
            _graphics.PreferMultiSampling = true;
            GraphicsDevice.Clear(SceneColors.Background);

            _spriteBatch.Begin();
            if (_drawGrid)
            {
                _graphGrid.Draw(_spriteBatch, GraphicsDevice, _basicEffect.Projection, _basicEffect.View);
            }

            /*
             * _spriteBatch.DrawString(_font, "Easing Function: " + _easingFn.GetCurrent().Name, new Vector2(24,12), Color.DarkBlue);
             * _spriteBatch.DrawString(_font, "Animation Duration: " + _triangleAnimator.Duration, new Vector2(24,36), Color.DarkBlue);
             * _spriteBatch.DrawString(_font, "Inscribed Triangle, Theta: " + _inscribedTriangle.Theta, new Vector2(24,60), Color.DarkBlue);
             * foreach (var pair in new[]
             * {
             *  _inscribedTriangle.VertexA,
             *  _inscribedTriangle.VertexB,
             *  _inscribedTriangle.VertexC
             * }.Zip(Enumerable.Range(0,10), (v, i) => new {v,i}))
             * {
             *  _spriteBatch.DrawString(_font,
             *      string.Format("Inscribed Triangle, Vertex [{0},{1}]", pair.v.X, pair.v.Y),
             *      new Vector2(24, 84 + 24*pair.i),
             *      Color.DarkBlue);
             * }
             */

            GraphicsDevice.RasterizerState = _rasterizerState;

            foreach (var pass in _basicEffect.CurrentTechnique.Passes)
            {
                pass.Apply();
            }

            _triangle.Draw(_spriteBatch, GraphicsDevice, _basicEffect.Projection, _basicEffect.View);
            _inscribedTriangle.Draw(_spriteBatch, GraphicsDevice, _basicEffect.Projection, _basicEffect.View);

            _spriteBatch.End();

            base.Draw(gameTime);
        }