Files Class List

Detailed Description

OpenGL debug callback class.

For this class to work, you may need to initialize the OpenGL context in debug mode. This class registers an OpenGL debug callback function, which is called when there is an OpenGL generates a debug message. The class has no local storage, so it can be safely deleted. Deleting an object of this class, however, does not automatically disable the debug callbacks.

#include <cyGL.h>

Public Member Functions

 GLDebugCallback (bool registerCallback=false, bool ignoreNotifications=false, std::ostream *outStream=&std::cout)
 Constructor can register the callback, but only if the OpenGL context is created before the constructor is called. If the regsiterCallback argument is false, the other arguments are ignored.
 
void Register (std::ostream *outStream=&std::cout)
 Registers the debug callback function. The callback function outputs the debug data to the given stream. Note that if the OpenGL context is not created in debug mode, OpenGL may not call the callback function. If there is a previously registered callback function, calling this function overwrites the previous callback registration.
 
void Unregister ()
 Unregisters the OpenGL debug callback function.
 
void SetIgnoredTypes (bool deprecated_behavior, bool portability, bool performance, bool other)
 Sets which type of non-critical debug messages should be ignored. By default, no debug message type is ignored.
 
void IgnoreNotifications (bool ignore=true)
 Sets weather notification messages should be ignored.
 

Static Protected Member Functions

static void Callback (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, GLchar const *message, void const *userParam)
 This callback function that is called by OpenGL whenever there is a debug message. See the OpenGL documentation for glDebugMessageCallback for details. Placing the break point in this function allows easily identifying the OpenGL call that triggered the debug message (using the call stack).