GLEW names tokens for extensions by de?¬?ning a
companion token to the extension of interest in which the GLEW pre?¬?x replaces
the GL pre?¬?x. For instance, as per our earlier shader example, GLEW de-
?¬?nes GLEW ARB fragment shader to correspond to the GL ARB fragment
shader extension. If this token exists, a user is able to use all the functionality
that this extension provides.
GLEW also provides all the basic compile-time de?¬?nitions needed for an
application??”for example, the tokens de?¬?ned by a particular extension. At runtime,
when the library is initialized, GLEW resolves the symbols for each of the
functions de?¬?ned by a particular extension. It does so by exploiting the same
Core foundation methods that we used to do this task ourselves earlier. However,
GLEW does this for each and every extension known in the universe (or at
least known to GLEW as of the version you??™re using).
In summary, GLEW de?¬?nes all aspects of the extensions known to it at the
time the library was created, including both extension tokens and extension
functional bindings. That??™s a fair bit of complexity, but it??™s nicely wrapped, and
using the library to query extensions is very straightforward.
270 Chapter 13: OpenGL Extensions
To use GLEW in an application, there are several ways of accomplishing the
same tasks. We??™ll look at one approach that??™s a close analog of the way we previously
investigated shader support in an earlier example.
Pages:
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393