O'Reilly logo

Beginning 3D Game Programming by Tom Miller

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required