Chapter 7. Display Lists and Fonts


It is a capital mistake to theorize before one has data.

 --Sherlock Holmes

Caching OpenGL Commands

In chapter 6 we created a stock background for our default OpenGL view. Although we can easily generate a background for our model, it’s time consuming to go through all those calculations every time we need to rerender the scene. After all, the stock scene doesn’t change from frame to frame. Only the viewpoint or the model will change. If we have to rerender something that doesn’t change, there should be a method of optimizing our program by caching those OpenGL commands. Well, there is, and it’s called display lists, the subject of this chapter.

The limited commands that are acceptable between a glBegin()/glEnd() ...

Get OpenGL Programming for Windows 95 and Windows NT now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.