Opengl 2.1 files

Started by
5 comments, last by V-man 13 years, 9 months ago
I can't seem to find the header files and the lib for opengl 2.1 anywhere. I installed the NVidia SDK hoping it will be there( and it wasn't). Can anyone post a link to those files (and not to opengl.org/sdk because I can't find it there either). Help will be much appreciated.


~Justin12343
Advertisement
there is no official library for that, you can use a thirdpart lib like glew or get the extensions you want manually.
On windows you just use the original GL header/lib that comes with your compiler, then as explained above, you use something like glew/glee to access the new 2.1 functions.
not just windows, any other platform should work just fine.
http://glew.sourceforge.net
The headers that you find at http://www.opengl.org/registry/ (which you didn't want) are exactly what you need.

Everything up to OpenGL 1.2 is included in the normal import library that comes with your compiler, under every platform. Which means you link with opengl32.lib and it'll just work.
Everything beyond version 1.2 (on some platforms, version 1.3), and all extensions, you must load yourself.

If you don't want to use something like GLEW or glee (because of size, there is really no other reason), then you need to do the following:
1. declare a global PFNWHATEVERFUNCTIONNAMEGL glWhateverFunctionName; function pointer in a header
2. define a global PFNWHATEVERFUNCTIONNAMEGL glWhateverFunctionName = 0; in a source file
3. check for the GL version
4. if applicable, check the extension string
5. use wglGetProcAddress under Windows and glXGetProcAddress under Unix to assign valid addresses to your function pointers
6. check that these are not null_ptr before calling them

GLEW and glee do all that with one function call. Surely at the expense of a few hundred kB of program size, but so what... :-)
Just a quick "correction":
Quote:1. declare a global PFNWHATEVERFUNCTIONNAMEGL glWhateverFunctionName; function pointer in a header

1. declare a global extern PFNWHATEVERFUNCTIONNAMEGL glWhateverFunctionName; function pointer in a header
Of course! Stupid mistake of mine, sorry.
Read this
http://www.opengl.org/wiki/Getting_started
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

This topic is closed to new replies.

Advertisement