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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.