Warum gibt glGetString (GL_VERSION) anstelle der OpenGL-Version null / null zurück?

Ich bin auf Linux Mint 13 XFCE. Mein Problem ist, dass wenn ich im Terminal den Befehl ausführen:

glxinfo | grep "OpenGL version"

Ich erhalte folgende Ausgabe:

OpenGL version string: 3.3.0 NVIDIA 295.40

Aber wenn ich das laufen lasseglGetString(GL_VERSION) in meiner anwendung ist das ergebnis dann null. Warum erhält dieser Code nicht diegl_version?

#include <stdio.h>
#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include <GL/glext.h>

int main(int argc, char **argv) {

    glutInit(&argc, argv);
    glewInit();

    printf("OpenGL version supported by this platform (%s): \n",
        glGetString(GL_VERSION));
}

Antworten auf die Frage(2)

Ihre Antwort auf die Frage