Draw() 공개 메소드

This method renders the current state.
public Draw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime The elapsed game time.
리턴 void
예제 #1
0
        // Called when the game should draw itself
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.Black);
            water.PreDraw(camera, gameTime);

            GraphicsDevice.Clear(Color.Black);

            sky.Draw(camera.View, camera.Projection, ((FreeCamera)camera).Position);

            foreach (CModel model in models)
            {
                if (camera.BoundingVolumeIsInView(model.BoundingSphere))
                {
                    model.Draw(camera.View, camera.Projection, ((FreeCamera)camera).Position);
                }
            }

            terrain.Draw(camera.View, camera.Projection, ((FreeCamera)camera).Position);

            water.Draw(camera.View, camera.Projection, ((FreeCamera)camera).Position);

            trees.Draw(camera.View, camera.Projection, ((FreeCamera)camera).Up,
                       ((FreeCamera)camera).Right);

            grass.Draw(camera.View, camera.Projection, ((FreeCamera)camera).Up,
                       ((FreeCamera)camera).Right);

            clouds.Draw(camera.View, camera.Projection, ((FreeCamera)camera).Up,
                        ((FreeCamera)camera).Right);

            base.Draw(gameTime);
        }
예제 #2
0
        // Called when the game should draw itself
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            foreach (CModel model in models)
            {
                if (camera.BoundingVolumeIsInView(model.BoundingSphere))
                {
                    model.Draw(camera.View, camera.Projection, ((FreeCamera)camera).Position);
                }
            }

            trees.Draw(camera.View, camera.Projection);
            clouds.Draw(camera.View, camera.Projection, ((FreeCamera)camera).Up, ((FreeCamera)camera).Right);

            base.Draw(gameTime);
        }