CS 455
Syllabus
Policies
Projects
Calendar
Slides
 
Project Overview
   Project 1
   Project 2
   Project 3
   Project 4
   Project 5
 
Old Quizzes
 
 

An Introduction to OpenGL Extensions

OpenGL allows individual manufacturers to add additional functionality to OpenGL with the idea that eventually these custom methods will be incorporated into the general OpenGL specification. These extensions are documented in the OpenGL Extension Registry, which is unforunately a bit hard to read. Each extension is given a name consisting of “GL_[mfg]_name_in_lower_case”, where [mfg] is ARB for well-accepted extensions that are candidates for inclusion in the general spec, EXT for widely-available extensions, or an abreviation of the manufacturer that came up with the extension (eg, NV, ATI, SGI, etc).

Sometimes a version of OpenGL will include definitions of extension methods and enumerative types that are not actually implemented on the machine. To find out if a method is supported you can call glGetString(GL_EXTENSIONS), which returns a C-string (that is, a const unsigned char *) which is a null-terminated space-separated list of all supported extensions. If you want to check for a specific extension, include <string.h> and call, e.g., strstr(glGetString(GL_EXTENSIONS), "GL_3DFX_texture_compression_FXT1").

If you choose to add implementations of OpenGL extensions to your code, you may choose to provide a version of the glGetString method as well, or not as you see fit. It is good practice to check for extensions your code might use in the initialization phase of your application (e.g., before anything is drawn).

Because not all extensions you decide to implement are necessarily going to be defined on the platform you are using, descriptions of extensions include the int values of enumerative types and the like.


E-mail: leemhoward@gmail.com