/// <summary> /// This is called when the game should draw itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(ClearOptions.Target | ClearOptions.DepthBuffer, Color.DarkSlateGray, 1.0f, 0); SetupRendering(); farseerManager.DrawPhysicsObjects(ref farseerView); // Draw sprites in farseer-space spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend, null, null, RasterizerState.CullNone, null, spriteBatchTransformation); ragdollManager.Draw(spriteBatch); // this will draw equipment effects powerupManager.Draw(spriteBatch); // this draws pickups hazardManager.Draw(spriteBatch); // this draws laser beams particleEffectManager.Draw(spriteBatchTransformation); spriteBatch.End(); // Draw sprites in screen-space spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend); toolbox.Draw(spriteBatch); farseerManager.DrawFrontEffects(spriteBatch); objectiveManager.Draw(spriteBatch); spriteBatch.End(); base.Draw(gameTime); }