Book Image

Lua Game Development Cookbook

By : Mario Kasuba, Mário Kašuba
Book Image

Lua Game Development Cookbook

By: Mario Kasuba, Mário Kašuba

Overview of this book

Table of Contents (16 chapters)
Lua Game Development Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Using display lists


Display lists present a way to duplicate scene objects. They use a block structure such as the gl.Begin and gl.End function pairs. Almost every OpenGL call is stored into display list except those that manipulate with buffers and memory content. Display lists were intensively used and misused in the past to make scene rendering faster. However, they are now deprecated in relation to vertex buffers, which offer superior performance.

Getting ready

Before using the display list, you need to generate the display list object with the gl.GenLists(range) function. This function accepts one argument that represents the number of continuous display lists to be generated. It returns an identifier of the first display list.

The included sample code will assume that the dl_id variable contains a valid display list identifier.

How to do it…

The display list can be filled with instructions in a block that is enclosed by the gl.NewList and gl.EndList commands. The gl.NewList function has...