I’m actually working on a 3D version of Pong, using OpenGL via SDL and coding in C++ under my linux Ubuntu.
This simple game is a great exercise and I’m using it to develop some common routines such as a mesh loader for .x files and related mesh renderer. So I’m having the opportunity to face a serious performance issue.
My scene is composed of about 2500 polys (a plane, 2 rackets and the ball), really low count, but enough to reduce my frames per second (fps) to 3 or 4. Ugh! My ball is moving really bad.
But OpenGL is fast! where is all the power? Well, the reason lays in my way to render polys.
My utility was rendering all the scene’s polys, one a time, between glBegin(…) and glEnd() commands.
This way, I was invoking glBegin() one time for every poly. Definitely not good.
What I did was change my rendering routine in order to use Display Lists. This gave me a real boost of performances!
Now my fps are about 1000 and I have to face the opposite issue: too fast! But the real message is that OpenGL’s display lists works!


