Rendering the Particle System

There is only one more method to implement in the special effects class before you can hook it into the game engine and see the results of your work. If you guessed the Draw method, you are absolutely correct. See Listing 18.7.

Listing 18.7. Rendering the Particle System
 /// <summary> /// Renders the particles currently in use for the device /// </summary> public void Draw(GameEngine engine) { // Set the render states for using point sprites engine.RenderingDevice.RenderState.ZBufferWriteEnable = false; engine.RenderingDevice.RenderState.AlphaBlendEnable = true; engine.RenderingDevice.RenderState.SourceBlend = Blend.One; engine.RenderingDevice.RenderState.DestinationBlend = Blend.One; engine.RenderingDevice.RenderState.Lighting ...

Get Beginning 3D Game Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.