The pros...
-
You don't need to care about GetProcAddress anymore.
-
You don't need to parse the extensions string anymore (because you'll have
a glaf_IsXXXXXSupported() function for each XXXXX feature).
-
You don't need to check for extensions at compile time. You can even compile
in a OpenGL 1.0 system and run the application in a 1.3 system.
-
You don't need to develop different code for different OpenGL versions.
-
High performance. Calling GLAF functions just adds an extra call with a
pointer indirection (pointers initialization is done just once when you
create each context; then, each context's pointers are cached and reused
later, which means nearly-zero performance hit after contexts are initialized).
An exception is when some feature needs extra work for the sake of compatibility
(for example, a conversion in the polygon offset arguments when running
in OpenGL 1.0 only).
-
Automatic management of context-dependent extensions availability. GLAF
checks feature availability per-context, and stores pointers to functions
per-context (GLAF could even be able to honor a different OpenGL version
in each context).
-
You can choose from two different sets of function names: If you want to
use GLAF names (in order to avoid confusion and for making clear what you're
actually doing), substitute the 'gl' prefix by 'glaf_' and
eliminate any extensions suffixes if they exist (for example, glaf_BindTexture).
The other option is to include "gl2glaf.h" in your code, which lets
you use OpenGL naming (for example, "gl2glaf.h" defines glBindTexture
as glaf_BindTexture).
-
It comes with a "How To Extend GLAF" mini-guide, that lets you easily add
support for more features into GLAF.
...and the cons
-
You need to notify GLAF whenever you create a new context or make a context
current. However, you're not required to do it immediately: It suffices
if you do such notification before using GLAF calls in that context.
-
Only OpenGL features are supported at this time. There're plans to support
WGL/GLX/AGL... features in the near future, but it's not yet ready.
-
The list of supported features is still limited, but you can add support
for your own, as said above. Also, the feature list is likely to grow in
future releases.
|