glGetString(GL_VERSION) version detect problem.

Anyone got a clue why glGetString(GL_VERSION) would be sending back a single “0” instead of the version it should be? This is on WinXP Home Edition. Everything works, I just wanted to put some detection in for systems that do not support 1.2 and above.

Thanks,

Do you have a rendering context?

Sorry I don’t understand?
What I want to do is determine the OpenGL level supported on a machine before the main program starts.

For any OpenGL-function to work, you need to have a rendering context. You usually create a rendering contex when you create a window. So in short, you need to create a window before you can call glGetString.

You can’t. You must have a rendering context and it must be current for gl functions not to error.

Ok, Understood. This means that I’ll have to create the context then do the test to see which verision is supported.

thanks,

Thanks, guys now all I get is the number
“1767548376”. I’m doing this under VB.
As always your help is appreciated.

Thanks,

Show a little code snippet of the context creation through the call to glGetString.

The function returns a string not a number.

[This message has been edited by shinpaughp (edited 03-17-2003).]

Thanks fella’s but I finally got it. All of a sudden the light in the fridge came on. The number that is returned is the pointer to the string. So I just used a couple of apis to retrive and converts the pointer to a VB string and <Bam> got the string I needed.

Thanks again,