PDA

View Full Version : GLEW and supported types problem



neoideo
05-16-2009, 01:41 PM
Hello,

i am running a Glew "Hello World" type aplication that only does this



#include <stdio.h>
#include <stdlib.h>
#include <GL/glew.h>
#include <GL/glut.h>


void main(int argc, char **argv) {
glutInit(&amp;argc, argv);
glewInit();
if (glewIsSupported("GL_VERSION_2_0")){
printf("Ready for OpenGL 2.0\n");
system("PAUSE");
}
else {
printf("OpenGL 2.0 not supported\n");
system("PAUSE");
exit(1);
}
//setShaders();
glutMainLoop();
}




it returns "OpenGL 2.0 not supported" and return that message to wahtever version of Opengl y ask for, also throws not supported for all Extensions.

BUT, if i run the glewinfo.exe i get that everything is OK from opengl 1.1 to 3.0 and a lot of extension are also OK. that means that it is supported i guess, the opengl version is what matters in my case.

so actually my card+driver does support opengl even up to 3.0 (i got Nvidia 9800gtx+ 512mb )
im runnning it on Windows 7 Beta with latest Nvidia driver released for windows 7

any help why on my app it shjows not supported?
how could the glewinfo.exe detect the supported types, is the glewIsSupported("GL_VERSION_2_0") the only way to check support?

PD: also tried with glewExperimental = GL_TRUE before glewInit() and same problem....

Heiko
05-16-2009, 03:15 PM
I think you might have to include <GL/gl.h> and <GL/glext.h> as well:


#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glext.h>
Not sure though... might be that glut also does that, but it might be the case that glut does not load glext.h.

Or what happens if you don't provide any arguments to glewInit()? I found an old piece of code, exactly the same as yours, except I didn't give any arguments to glewInit (and I included gl.h and glext.h). That code works fine for me.

You could also try using OpenGL functions to get the version:


glGetString(GL_VERSION);
The 9800gtx does indeed support all OpenGL versions up until version 3.0 (when using the beta drivers even version 3.1 is supported).

neoideo
05-16-2009, 07:30 PM
ok thanks :)
i will try those advices and will answer with news.

neoideo
05-17-2009, 11:45 AM
ok i realized,

first i managed to get my version of Opengl, which is 3.0.0
then, i asked other people about glew problem, and they told me that there is a bug when opengl 3.0.0 needs to be checked, which results on every version to be returned as not supported.