OpenGL version


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 ?


After you create a context and make it current:
printf("%s %s
", 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
", 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 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.

edit : oops, I am late

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.