Ejemplo n.º 1
0
        /// <summary>
        /// Main drawing function
        /// </summary>

        public override void Draw(GameTime gameTime)
        {
            RenderTarget2D output = null;

            // Draw the final image
            if (currentRenderProfile != null)
            {
                currentRenderProfile.Draw(gameTime);
                output = currentRenderProfile.Output;

                graphicsDevice.SetRenderTarget(null);
                graphicsDevice.Clear(Color.Transparent);

                spriteBatch.Begin(0, BlendState.AlphaBlend, SamplerState.LinearClamp,
                                  DepthStencilState.None, RasterizerState.CullCounterClockwise);
                spriteBatch.Draw(output, new Rectangle(0, 0,
                                                       (int)targetWidth, (int)targetHeight), Color.White);
                spriteBatch.End();

                /// Setup for bounding boxes
                sceneRenderer.DrawBoundingBoxes(currentScene, this.currentCamera);
            }

            if (rtIndex == 1)
            {
                DrawDebugData();
            }

            if (debugText == true)
            {
                DrawDebugText(renderStats.frameRate, (int)renderStats.totalFrames);
            }

            base.Draw(gameTime);
            renderStats.Finish();
        }