Why is every OpenGL call prefixed with a "q" in the Doom 3 source code? Are they custom functions or a different library, and if so, why use that over OpenGL? Any Google search comes up with the Qt OpenGL module, which I assume has nothing to do with it.
For reference - Doom3's qgl.h. OpenGL is an odd little API. You must often work with function pointers either because the standard implementation is missing new functionality or because you want to work with extensions. For instance, if you want to call Even if your development environment has a particular function the users' machines might not. And then a certain function can come in 2-3 forms (vendor extension, ARB extension, core function) and so you might have to search for a function under several different names. Many GL "loader" libraries (like GLEW) try to stick to the GL conventions. They create "fake" functions with the usual Other libraries put the functions in namespaces or otherwise vary a bit from the GL norm. id wrote their own loader, either because they didn't like the ones that existed or - more likely - Quake just predates any other library that id could have used (the The GL spec is written with this being a possibility. The spec is written without prefixes; it's the implementation of OpenGL that decides on which prefix to use ( Doom 3, being based on the Quake engine, is completely typical and justified in using a loader library to deal with the oddities of GL on multiple platforms and in choosing to use the |
|||||
|