26.1. Linking to OpenGL

To use OpenGL, you link your executable to the special OpenGL libraries and include some special OpenGL headers. Typically you do the ‘linking’ by adding 536these additional libraries to your project: opengl32.lib and glu32.lib. (You can see Appendix C for how to add libraries to a Visual Studio project.) And you do the ‘including’ by putting lines like the following into any files that mention the OpenGL functions. (In particular, the Pop framework has these lines in its graphicsopengl.h header.)

#include “gl\gl.h” 
#include “gl\glu.h” 

Once your code is linked up, you can make OpenGL function calls in your code. The OpenGL functions begin with one of the prefixes gl or glu. We usually put the scope resolution operator ...

Get Software Engineering and Computer Games now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.