Section B.4. Objects


B.4. Objects

Use glGenLists(), glGenBuffers(), and glGenTextures() to obtain unused display list, buffer object, and texture object identifiers.

When creating new display lists, buffer objects, or texture objects, OpenGL doesn't require you to pass in identifiers obtained from glGenLists(), glGenBuffers(), and glGenTextures(). As long as you use an unused identifier, OpenGL will behave as expected. You should resist the urge to assume that an identifier is unused and hard-code it, however, even during the development phase. If you fail to remedy this situation later, the robustness of your code will be compromised. The cost to obtain an unused identifier from glGenLists(), glGenBuffers(), and glGenTextures() is very small and greatly improves the reusability of your code.




OpenGL Distilled
OpenGL Distilled
ISBN: 0321336798
EAN: 2147483647
Year: 2007
Pages: 123
Authors: Paul Martz

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net