Display Lists Tutorial
Display Lists are about performance. It is a simple way of enhancing your OpenGL application making it run faster. In order to follow this tutorial you should know the basics of GLUT and OpenGL. If there is anything that is not quite clear please let me know and I'll try to improve it. Your feedback is important.
I hope you enjoy this tutorial.
What is a DL
At a first glance a display list can be seen just as a function in a computer program. You define it once and can use it as many times as you want. A display list stores a group of OpenGL commands so that they can be used repeatedly just by calling the display list.
Consider for instance that you're modeling a car. You can define a wheel in a display list and then call it four times with the appropriate translations.
However a Display List does something more, when you create a Display List the OpenGL commands within are "precompiled" and, if possible, stored in the graphics card memory. Therefore, in general the execution of a Display List is faster than the execution of the commands contained in it. The commands included in a display list can be optimized by the driver, namely some geometric transformations can be pre computed. Furthermore the display lists are stored in the graphics card memory. How much faster depends on your hardware and driver. Some graphics cards are designed to take full advantage of display lists, whereas others may show no significant gain in performance.
In order to wet your appetite here are the frames per second achieved in a simple application with roughly 36.000 polygons, no texturing or lighting, running on a PIII at 450 Mhz and a GeForce with 32MB DDR.
With display lists: 153 fps
without: 55 fps
Please note that the fps values should only be used for reference within the tutorial. Many factors affect the performance of an application and there was no effort at all to optimize this particular appliction. There are huge differences in hardware architectures and even software installations. Nevertheless the performance difference is very important because the only difference between the two versions is the inclusion of display lists.