glGetString function

The glGetString function returns a string describing the current OpenGL connection.

Syntax

const GLubyte* WINAPI glGetString(
   GLenum name
);

Parameters

name

One of the following symbolic constants.

Value Meaning
GL_VENDOR
Returns the company responsible for this OpenGL implementation. This name does not change from release to release.
GL_RENDERER
Returns the name of the renderer. This name is typically specific to a particular configuration of a hardware platform. It does not change from release to release.
GL_VERSION
Returns a version or release number.
GL_EXTENSIONS
Returns a space-separated list of supported extensions to OpenGL.

Error codes

The following error codes can be retrieved by the glGetError function.

Name Meaning
GL_INVALID_ENUM
name was not an accepted value.
GL_INVALID_OPERATION
The function was called between a call to glBegin and the corresponding call to glEnd.

Remarks

The glGetString function returns a pointer to a static string describing some aspect of the current OpenGL connection.

Because OpenGL does not include queries for the performance characteristics of an implementation, it is expected that some applications will be written to recognize known platforms and will modify their OpenGL usage based on known performance characteristics of these platforms. The strings GL_VENDOR and GL_RENDERER together uniquely specify a platform, and will not change from release to release. They should be used as such by platform recognition algorithms.

The format and contents of the string that glGetString returns depend on the implementation, except that:

  • Extension names will not include space characters and will be separated by space characters in the GL_EXTENSIONS string.

  • The GL_VERSION string begins with a version number. The version number uses one of these forms:

    major_number.minor_number

    major_number.minor_number.release_number

  • Vendor-specific information may follow the version number. Its format depends on the implementation, but a space always separates the version number and the vendor-specific information.

  • All strings are null-terminated.

If an error is generated, glGetString returns zero.

Requirements

Requirement Value
Minimum supported client
Windows 2000 Professional [desktop apps only]
Minimum supported server
Windows 2000 Server [desktop apps only]
Header
Gl.h
Library
Opengl32.lib
DLL
Opengl32.dll

See also

glBegin

glEnd