Opengl version trouble glew.h
Asked Answered
F

4

6

I am developing an OpenGL application and need to use the glew library. I am using Visual Studio C++ 2008 Express.

I compiled a program using gl.h, glu.h, and glut.h just fine and it does what it's supposed to do. But after including glew.h it still compiles just fine, but when I try:

glewInit();
if (glewIsSupported("GL_VERSION_2_0"))
    printf("Ready for OpenGL 2.0\n");
else {
    printf("OpenGL 2.0 not supported\n");
}

It keeps printing:

"OpenGL 2.0 not supported".

I tried to change it to glewIsSupported("GL_VERSION_1_3") or even glewIsSupported("GL_VERSION_1_0") and it still returns false meaning that it does not support OpenGL version whatever.

I have a Radeon HD 5750 so, it should support OpenGL 3.1 and some of the features of 3.2. I know that all the device drivers are installed properly since I was able to run all the programs in the Radeon sdk provided by ATI.

I also installed Opengl Extensions Viewer 3.15 and it says OpenGL Version 3.1 Ati Driver 6.14.10.9116. I tired all of them GLEW_VERSION_1_1, GLEW_VERSION_1_2, GLEW_VERSION_1_3, GLEW_VERSION_2_0, GLEW_VERSION_2_1, GLEW_VERSION_3_0 and all of these return false.

Any other suggestioms? I even tried GLEW_ARB_vertex_shader && GLEW_ARB_fragment_shader and this is returning false as well.

Flycatcher answered 30/12, 2009 at 20:53 Comment(0)
E
9

glewIsSupported is meant to check and see if the specific features are supported. You want something more like...

if (GLEW_VERSION_1_3)
{
    /* Yay! OpenGL 1.3 is supported! */
}
Ethelyn answered 30/12, 2009 at 20:57 Comment(2)
As the OP said, it does not work, doesn't matter how you use it. This always has its value set to false, I have the same problem here with my OpenGL on linux.Ruthenious
I believe the OP was passing the string to the glewIsSupported function. My point was that it is not a string but a global variable in the glew header files. Which version of GLEW are you using?Ethelyn
D
2

there may be some lack of necessary initialization. I encounter the same question. And here is how I solve the question: you need to include the glCreateWindow() ahead. Include this function and try again.

Deductive answered 4/6, 2013 at 11:21 Comment(0)
L
0

Firstly, you should check whether glew has initialized properly:

 if(glewInit() != GLEW_OK)
 { // something is wrong };

Secondly, you need to create the context before calling glewInit()

Thirdly, you can also try:

  glewExperimental=true;

Before calling glewInit()

Linalinacre answered 2/7, 2015 at 11:39 Comment(0)
S
0

I encountered the same problem when running a program through windows RDP, then I noticed that my video card may not working properly when using RDP, so I tried teamviewer instead, both glewinfo.exe and my program start to work normally then.

The OP's problem may be solved for a long time, just for others' infomation.

Sphygmomanometer answered 30/3, 2016 at 16:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.