Unofficial OpenGL Software Development Kit: Debug Output

Unofficial OpenGL Software Development Kit 0.5.0

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Enumerations
Debug Output
GL Util

##

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...

## Enumeration Type Documentation

enum glutil::OutputLocation

Possible locations for debug outputs.

Enumerator
STD_OUT | Output to standard out.
STD_ERR | Output to standard error.

## Function Documentation

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.

Returns
  A short (sentence or two) description of an OpenGL error code. If errorCode is not an actual, valid OpenGL error code, it will return an empty string.

std::string glutil::ErrorCodeToEnumString | ( | GLenum | errorCode | ) |

Generates the enumerator string for an OpenGL error code.

Returns
  The enumerator string for an error code. If errorCode is not an actual, valid OpenGL error code, it will return an empty string.

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.

Returns
  A short (sentence or two) description of a framebuffer status code. If errorCode is not an actual, valid framebuffer status code, it will return an empty string.

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`.

Returns
  The enumerator string for the framebuffer status. If framebufferStatus is not an actual, valid framebuffer status code, it will return an empty string.

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.

Parameters

  eLoc | The destination where errors or other debug messages will be printed.

Returns
  true if the function was registered.