OpenGL 3.2+ context for linux with glx

Started by
2 comments, last by Nairou 12 years, 2 months ago
I follow this tutorial http://www.opengl.org/wiki/Tutorial:_OpenGL_3.0_Context_Creation_%28GLX%29
but i'm not sure in his propriety
Advertisement
in the same topic
how i can check context version after his creation in linux (glx)
in windows i use
glGetIntegerv(GL_MAJOR_VERSION, &glVersion[0]); // Get back the OpenGL MAJOR version we are using
glGetIntegerv(GL_MINOR_VERSION, &glVersion[1]);
(glew)
but in glx this dont work
You have to create a GL context with glXCreateContextAttribsARB as the example shows.

If you want to make gl function calls, then you need to have a context current. Call them after the glXMakeCurrent call.
That is the way it is on all platforms (Windows, Apple, Mac and even on GL ES systems).
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);
Or you could just use GLFW.

This topic is closed to new replies.

Advertisement