Get Context Info

From OpenGL.org
Revision as of 20:09, 5 April 2009 by Dark Photon (Talk | contribs)

Jump to: navigation, search

glGetString(GL_VERSION)

This returns a string which may look something like "2.0.6914 WinXP SSE/SSE2/SSE3/3DNow!"

2.0 is the actual version number of GL supported. All the rest depends on what information the IHV wants to convey and is not part of the GL standard. 6914 would be the driver version. WinXP is the OS. SSE/SSE2/SSE3/3DNow! are CPU features that the driver can use in case it runs in software mode.

In glhlib http://www.geocities.com/vmelkon/glhlibrary.html

glhGetIntegerv(GLH_OPENGL_VERSION, version) can return the major and minor version. That is to say, version[0] would be an integer (2) and version[1] is an integer (0). This is a utility library similar to GLU to make programming easier.

Also note that at times glGetString(GL_VERSION) returns also the bus type used such as AGP or PCI or PCIEx.

glGetString(GL_VENDOR)

This returns the company name of whoever wrote the GL driver. It could be "ATI Technologies", "NVIDIA", "INTEL" and so on.

On Windows, if it says "Microsoft" then you are using the Windows software renderer or the Windows Direct3D wrapper. You probably haven't installed the graphics drivers yet.

glhIdentifyVendor() returns a token value based on this information to identify the company who made the driver/GPU.

glGetString(GL_RENDERER)

This returns the name of the renderer, which would be the name of the GPU. In the case of Mesa, the software renderer, it would be "Mesa" or "MESA". It might even say "Direct3D" if the Windows Direct3D wrapper is being used.

glhGetIntegerv(GLH_OPENGL_HARDWAREACCELERATION, &xxx) returns 0 or 1 based on this info.

glGetString(GL_EXTENSIONS)

This returns the very long list of extensions. Each extension name is separated by spaces. Quite a lot of programs search this string for the extensions that they need. These days, the list has gotten huge for ATI/AMD and nVidia. They list over 100 extensions.

Normally, an extension is not removed from the list.