PDA

View Full Version : OpenGL version



vbovio
11-30-2006, 07:34 AM
Hi,

I have a very basic question: how can I know which version of OpenGL I'm using ??
also is the version 2.1 available now for XCode ?

Thanks.

arekkusu
11-30-2006, 10:23 AM
After you create a context and make it current:
printf("%s %s\n", glGetString(GL_RENDERER), glGetString(GL_VERSION));
That gives you the OpenGL core version of the renderer that is driving your context.

Most functionality is exposed in OpenGL via extensions, so you also want to try
printf("%s\n", glGetString(GL_EXTENSIONS));

Note that a renderer can only claim an OpenGL core version if it supports ALL of the functionality required by that version. In some cases a renderer may be missing one function, but have many other capabilities. For example, on an Intel MacBook or Mac Mini, the GMA 950 will tell you OpenGL 1.2, because it does not support ARB_multisample. But it does support many extensions that are part of 1.3, 1.4, 1.5, and 2.0. You need to look at the both the core version and the extension string to see if the particular functionality you care about is present (see manpage for gluCheckExtension.)

For reference, I have a GLInfo table of all supported functionality (http://homepage.mac.com/arekkusu/bugs/GLInfo.html) for all renderers up to Mac OS X 10.4.3. (Not updated for 10.4.8 yet...)

OpenGL 2.1 is not yet available on Mac OS X.

ZbuffeR
11-30-2006, 11:56 AM
http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getstring.html

edit : oops, I am late