Getting the Project Rendering

I know you want to get to the fancy 3D graphics being rendered. Doesn't everyone? Even in the wonderful world of game development, you need to learn to walk before you can run (as they say). If you recall from earlier, you declared some variables to keep track of the amount of vertices and faces rendered. This part needs to be reset each frame, so add the code from Listing 11.5 to your OnFrameMove method.

Listing 11.5. The Heart of the "Game Loop"
#if (DEBUG)
// Reset the rendering variables in debug mode
numberVerts = 0;
numberFaces = 0;
#endif

if (FrameworkTimer.IsStopped)
    return; // Nothing to do

Notice that the first thing to do is reset your counters for the number of vertices and frames you've rendered. ...

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.