In this case, the server is a different machine than the host. When running OpenGL programs remotely to another machine on the network, it is especially important to cache commands in a display list. You would need to set the modelview matrix appropriately each time before executing the list to calculate the correct size and location for the wheels. An efficient way to render the wheels on the tricycle would be to store the geometry for one wheel in a display list then execute the list three times. The front wheel is larger than the back wheels and also in a different location. The two wheels on the back are the same size but are offset from each other. To see how you can use display lists to store geometry just once, consider drawing a tricycle. Using display lists, you can define the geometry and/or state changes once and execute them multiple times. It is often a good idea to cache commands in a display list if you plan to redraw the same geometry multiple times, or if you have a set of state changes that need to be applied multiple times.
"Display-List Design Philosophy" explains why certain design choices were made (such as making display lists uneditable) and what performance optimizations you might expect to see when using display lists."An Example of Using a Display List" gives a brief example, showing the basic commands for using display lists."Why Use Display Lists?" explains when to use display lists.This chapter discusses what display lists are and how best to use them.
The programming examples you've seen so far have used immediate mode. You can freely mix immediate-mode programming and display lists within a single program. Most OpenGL commands can be either stored in a display list or issued in immediate mode, which causes them to be executed immediately.
When a display list is invoked, the commands in it are executed in the order in which they were issued. Maximize performance by knowing how and when to use display listsĪ display list is a group of OpenGL commands that have been stored for later execution.Understand how display lists can be used along with commands in immediate mode to organize your data and improve performance.After reading this chapter, you'll be able to do the following: