The glGetString function returns a string describing the current OpenGL connection.
const GLubyte * glGetString(
GLenum name
);
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 by such platform recognition algorithms.
The format and contents of the string that glGetString returns depend on the implementation, except that:
If an error is generated, glGetString returns zero.
The following are the error codes generated and their conditions.
Error Code | Condition |
---|---|
GL_INVALID_ENUM | name was not an accepted value. |
GL_INVALID_OPERATION | glGetString was called between a call to glBegin and the corresponding call to glEnd. |
Windows NT: Use version 3.5 and later.
Windows: Use Windows 95 and later.
Windows CE: Unsupported.
Header: Declared in gl.h.
Import Library: Link with opengl32.lib.