OpenGL version?

Started by
2 comments, last by V-man 12 years, 11 months ago
I want to start using the OpenGL version 3.1+ using the core Profile

So far Ive added the glew library, but when adding the gl and glu headers I feel those ones are the ones embedded on my OS

so how do I know which Opengl version Im targeting?


EDIT:

looking through glew I found this

[color=#007800]if (GLEW_VERSION_3_1)
[color=#007800]{
[color=#007800] 3.1 supported
[color=#007800]}
[color=#007800]

but currently in my project this macro just fails as I suspected


how can I fix this? (And yes I have proper hardware)
Advertisement

I want to start using the OpenGL version 3.1+ using the core Profile

So far Ive added the glew library, but when adding the gl and glu headers I feel those ones are the ones embedded on my OS

so how do I know which Opengl version Im targeting?


EDIT:

looking through glew I found this

[color="#007800"]if (GLEW_VERSION_3_1)
[color="#007800"]{
[color="#007800"] 3.1 supported
[color="#007800"]}

but currently in my project this macro just fails as I suspected


how can I fix this? (And yes I have proper hardware)


It basically boils down to whether the library you are using to handle windowing/user input (glut, SDL, etc) supports creating a 3.x context or not. I know for a fact SDL 1.3 (which is still in alpha) supports creating a 3.x context. Not sure about the rest.
nvm Im good

the problem was that I was only taking care of SDL initialization routines while leaving GLEW unattended

now Ive checked and my system supports up to 4.0


thanks
For checking the version, the modern way is
glGetIntegerv(GL_MAJOR_VERSION, &OpenGLVersion[0]);
and
glGetIntegerv(GL_MINOR_VERSION, &OpenGLVersion[1]);

http://www.opengl.org/wiki/Tutorial1:_Rendering_shapes_with_glDrawRangeElements,_VAO,_VBO,_shaders_%28C%2B%2B_/_freeGLUT%29
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