Unofficial OpenGL Software Development Kit
0.5.0
|
Helper functions for tracking down and understanding OpenGL errors.
These functions help deal with errors in two ways. The glutil::RegisterDebugOutput function will automatically output all errors through the ARB/KHR_debug_output extension. They can be filed to standard out or standard error, as you see fit. This function requires that GL Load has been successfully initialized.
OpenGL errors come as error codes; simple numbers. If you need to understand the meaning of an OpenGL error message, these functions can convert them either into the standard OpenGL error enumerator or a text description of what that enumerator means.
This also includes functions for translating framebuffer completeness failures error codes into text.
None of the error translation functions need GL Load to have been initialized.
Enumerations | |
enum | glutil::OutputLocation { glutil::STD_OUT, glutil::STD_ERR } |
Possible locations for debug outputs. More... | |
Debug Output Piping | |
bool | glutil::RegisterDebugOutput (OutputLocation eLoc) |
Registers a function for automatically outputting debug messages. More... | |
Error Codes | |
These functions are used to convert OpenGL error codes into human-readable strings. | |
std::string | glutil::ErrorCodeToEnumString (GLenum errorCode) |
Generates the enumerator string for an OpenGL error code. More... | |
std::string | glutil::ErrorCodeToDescription (GLenum errorCode) |
Generates a string description for an OpenGL error code. More... | |
std::string | glutil::FramebufferToEnumString (GLenum framebufferStatus) |
Generates the enumerator string for an OpenGL framebuffer status code. More... | |
std::string | glutil::FramebufferToDescription (GLenum framebufferStatus) |
Generates a description for an OpenGL framebuffer status code. More... | |
std::string glutil::ErrorCodeToDescription | ( | GLenum | errorCode | ) |
Generates a string description for an OpenGL error code.
This is a relatively short (sentence or two) length description of the meaning of an OpenGL error code.
std::string glutil::ErrorCodeToEnumString | ( | GLenum | errorCode | ) |
Generates the enumerator string for an OpenGL error code.
std::string glutil::FramebufferToDescription | ( | GLenum | framebufferStatus | ) |
Generates a description for an OpenGL framebuffer status code.
This is a relatively short (sentence or two) length description of the meaning of an OpenGL framebuffer status code.
std::string glutil::FramebufferToEnumString | ( | GLenum | framebufferStatus | ) |
Generates the enumerator string for an OpenGL framebuffer status code.
This will generate a string representing the OpenGL enumerator for the status returned by glCheckFramebufferStatus
.
bool glutil::RegisterDebugOutput | ( | OutputLocation | eLoc | ) |
Registers a function for automatically outputting debug messages.
GL Load must have been successfully initialized for this function to work.
This function works with ARB_debug_output, KHR_debug_output, or GL 4.3. If the are not available, the function will return false. If you have registered a function before calling this one, then the registered function will pass the function through, including your void* argument.
eLoc | The destination where errors or other debug messages will be printed. |