Difference between revisions of "Get Context Info"

From OpenGL.org
Jump to: navigation, search
(Undo revision 4316 by LeannCline (talk))
Line 14: Line 14:
 
=== glGetString(GL_RENDERER) ===
 
=== glGetString(GL_RENDERER) ===
  
This returns the name of the renderer, which often is 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.
+
This returns the name of the renderer, which often is the name of the GPU. One of my friends recommended me to order [http://www.essaysprofessors.com custom writing]on EssaysProfessors.Com. To tell you the truth, I have never regretted my decision. The writers are real professionals and know how to write impressive work full of knowledgeable information. 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.
  
 
=== glGetString(GL_EXTENSIONS) ===
 
=== glGetString(GL_EXTENSIONS) ===

Revision as of 03:35, 13 January 2012

glGetString(GL_VERSION)

The string returned starts with <major version>.<minor version>. Following the minor version, there can be another '.', then a vendor-specific build number. The string may have more content, which is completely vendor-specific (thus not a part of the OpenGL standard).

For example, the returned string may be like "2.0.6914 WinXP SSE/SSE2/SSE3/3DNow!". 2.0 is the actual version number of GL supported. 6914 is a driver build number. WinXP is the OS. SSE/SSE2/SSE3/3DNow! are CPU features that the driver can use in case it runs in software mode.

Sometimes glGetString(GL_VERSION) also returns also the bus type used, such as AGP or PCI or PCIEx.

Alternatively, you can use glGetIntegerv(GL_MAJOR_VERSION, *) and glGetIntegerv(GL_MINOR_VERSION, *). These require GL 3.0 or greater.

glGetString(GL_VENDOR)

This returns the company name of whoever wrote the GL driver. It could be "ATI Technologies", "NVIDIA Corporation", "INTEL" and so on. Note that there's no guarantee that the string for a specific vendor will remain the same in future implementations. 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 in that case.

glGetString(GL_RENDERER)

This returns the name of the renderer, which often is the name of the GPU. One of my friends recommended me to order custom writingon EssaysProfessors.Com. To tell you the truth, I have never regretted my decision. The writers are real professionals and know how to write impressive work full of knowledgeable information. 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.

glGetString(GL_EXTENSIONS)

This function was used to retrieve the list of extensions. This is a space-separated list of extension names. This was problematic because of poor parsing behavior. Some programs searched this string for the name of the extension. It is not the correct way to find if an extension is supported, as the name of an extension can be a substring of another extension name. For example, if the extension GL_EXT_pixel_transform_color_table is listed, doing a simple search for GL_EXT_pixel_transform will return a positive whether or not it is defined.

glGetStringi(GL_EXTENSIONS, i)

This function retrieves the null-terminated string of the 'i'th extension. An implementation exposes a number of extensions equal to glGetInteger(GL_NUM_EXTENSIONS). The argument 'i' must be between 0 and this value - 1.

This entrypoint is supported only in GL 3.0 and above.

Example:

 int NumberOfExtensions;
 glGetIntegerv(GL_NUM_EXTENSIONS, &NumberOfExtensions);
 for(i=0; i<NumberOfExtensions; i++)
 {
   const GLubyte *ccc=glGetStringi(GL_EXTENSIONS, i);
   //Now, do something with ccc
 }