What lib/ header files do I include for OpenGL 3?

Started by
3 comments, last by NicoG 13 years ago
I made an OpenGL project a long time ago but I barely remember how it works. Now I'm trying to use OpenGL 3 but I can't seem to figure out which lib and header files I need to include. I saw a project which claimed to use OpenGL 3 that included gl\gl.h and gl\glew.h then linked opengl32.lib and glew32.lib but I don't understand how that would be anything other than version 1.1? Please tell me what files to include and link.
Advertisement
gl.h and opengl32.lib provides OpenGL 1.1 and an interface to load additional functions from the graphics driver. glew.h and glew32.lib provides the interface for everything newer than OpenGL 1.1, and loads those functions using the interface provided by gl.h and opengl32.lib so you can actually call them in your code.

Note that glew is just one of many libraries to load additional functions. You can even do it yourself if you want. It's all in the Forum FAQ.
http://www.opengl.org/wiki/Getting_started#Accessing_OpenGL_functions
http://www.opengl.org/wiki/Getting_started#OpenGL_3.0_and_Above
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);

gl.h and opengl32.lib provides OpenGL 1.1 and an interface to load additional functions from the graphics driver. glew.h and glew32.lib provides the interface for everything newer than OpenGL 1.1, and loads those functions using the interface provided by gl.h and opengl32.lib so you can actually call them in your code.

Note that glew is just one of many libraries to load additional functions. You can even do it yourself if you want. It's all in the Forum FAQ.


Oh! That's kinda good and bad i guess. I only have one more question. What is GLU32.lib for? I'm not sure if I need to link to it or not?

EDIT: Never mind, I found it on google.
Use GLew. That solves a lot of problems and spares some work.
If you say "pls", because it is shorter than "please", I will say "no", because it is shorter than "yes"
http://nightlight2d.de/

This topic is closed to new replies.

Advertisement