Jump to content

  • Log In with Google      Sign In   
  • Create Account

[GLEW] Check available OpenGL version


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Jan2go   Members   -  Reputation: 810

Like
0Likes
Like

Posted 19 May 2014 - 10:22 AM

The GLEW documentation states that you can check the available OpenGL version like this:

if (GLEW_VERSION_1_3)
{
  /* Yay! OpenGL 1.3 is supported! */
}

So, as my code is using OpenGL 3.0 i used GLEW_VERSION_3_0 to see if the computer can run the program. However, when I tested it on an Thinkpad which uses an integrated Intel graphics card with support only up to OpenGL 2.1. GLEW_VERSION_3_0 was for some reason evaluated as true. Querying GL_MAJOR_VERSION and GL_MINOR_VERSION as well as GL_VERSION show the correct result (OpenGL 2.1).

I tested other GLEW_VERSION_X_X macros on this computer, you can see the results in the attached file.

 

Has anybody else experienced this before? It's not a big deal to create a workaround for it but I wonder what might cause it and if it happens on other graphic cards as well.

Attached Thumbnails

  • glew.jpg


Sponsor:

#2 h3xl3r   Members   -  Reputation: 162

Like
0Likes
Like

Posted 19 May 2014 - 11:08 AM

Try using

glewIsSupported("GL_VERSION_3_0");

etc, instead of checking the version macros directly.

 

Querying GL_MAJOR_VERSION, GL_MINOR_VERSION, GL_VERSION will not give you available OpenGL versions in the driver but the version of the context you already created. Also GL_MAJOR_VERSION and GL_MINOR_VERSION were introduced in OpenGL 3.0 as far as I know, so they might not be a good way of checking the version on contexts created with earlier GL versions.

 

You could also try to run another OpenGL capabilities viewer like http://www.realtech-vr.com/glview/ to compare results.



#3 Jan2go   Members   -  Reputation: 810

Like
0Likes
Like

Posted 20 May 2014 - 12:24 AM

Using glewIsSupported gives the same results als GLEW_VERSION_X_X. However, if GL_MAJOR_VERSION and GL_MINOR_VERSION return the OpenGL version of the created context, i could use that information the exit the program, if the created context is not at least of version 3.0.

 

I will try the Extension Viewer later, the download is via FTP and for some reason FTP is blocked here.



#4 h3xl3r   Members   -  Reputation: 162

Like
0Likes
Like

Posted 20 May 2014 - 01:22 AM

There seem to be two sets of defines for GL versions in GLEW, a bit confusing really:

"GLEW_VERSION_x_x" vs. "GL_VERSION_x_x"

 

In my code I am using the "GL_VERSION_x_x" ones with "glewIsSupported" and so far haven't had any problems on multiple test machines.

 

At least according to this post on Stackoverflow the "GL_VERSION_x_x" ones seem to work better indeed (for whatever reason)

http://stackoverflow.com/questions/21644230/what-is-the-difference-between-glew-version-x-x-and-gl-version-x-x

 

I guess your idea to just try to create contexts of a certain version and see if it succeeds or fails seems like a good way to check as well. Just on intel (and maybe other vendors) I've seen situations where it would create the context just fine but then not actually support the full GL spec for that particular version. Good times :)



#5 Jan2go   Members   -  Reputation: 810

Like
1Likes
Like

Posted 20 May 2014 - 07:57 AM

Ok, I downloaded and installed the extension viewer. Not very usefull on this computer though, it crashes during the "Loading extensions..." part. :D






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS