Jestem na Linux Mint 13 XFCE. Moim problemem jest to, że kiedy uruchomić w terminalu polecenie:Dlaczego funkcja glGetString (GL_VERSION) zwraca wartość zerową/zero zamiast wersji OpenGL?
glxinfo | grep "OpenGL version"
pojawia się następujący komunikat:
OpenGL version string: 3.3.0 NVIDIA 295.40
Ale kiedy uruchomić glGetString(GL_VERSION)
w mojej aplikacji następnie wynik jest zerowy. Dlaczego ten kod nie otrzymuje gl_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));
}
Qt Creator to IDE i ma bardzo niewiele wspólnego z Twoim problemem btw. (No cóż, nic naprawdę) – Bart
Nie musisz dodawać słowa "gl.h" lub "glu.h", jeśli dodasz 'glut.h' – Derek
Przyczynę tego samego źródła co: http://stackoverflow.com/questions/6594214/glgetintegerv-return-garbage-value –