Unofficial OpenGL SDK / glutil / include / glutil / Debug.h

#ifndef DEBUG_UTIL_H
#define DEBUG_UTIL_H

#include <string>
#include <vector>

/**
\file
\brief Includes a function for attaching to ARB_debug_output and printing error messages automatically. This header must be included after an OpenGL header.
**/

namespace glutil
{
	///\addtogroup module_glutil_debug
	///@{

	///Possible locations for debug outputs.
	enum OutputLocation
	{
		STD_OUT,	///<Output to standard out.
		STD_ERR,	///<Output to standard error.
	};

	/**
	\brief Registers a function for automatically outputting debug messages.

	This function only works with ARB_debug_output. If this extension is 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.
	
	\param eLoc The destination where errors or other debug messages will be printed.
	\return true if the function was registered.
	**/
	bool RegisterDebugOutput(OutputLocation eLoc);

	/**
	\brief Generates the enumerator string for an OpenGL error code.

	\returns The enumerator string for an error code. If \a errorCode is not an actual,
	valid OpenGL error code, it will return an empty string.
	**/
	std::string ErrorCodeToEnumString(GLenum errorCode);

	/**
	\brief 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 \a errorCode is not an
	actual, valid OpenGL error code, it will return an empty string.
	**/
	std::string ErrorCodeToDescription(GLenum errorCode);

	/**
	\brief Generates the enumerator string for an OpenGL framebuffer status code.

	This will generate a string representing the OpenGL enumerator for the status returned
	by <tt>glCheckFramebufferStatus</tt>.

	\returns The enumerator string for the framebuffer status. If \a framebufferStatus is not
	an actual, valid framebuffer status code, it will return an empty string.
	**/
	std::string FramebufferToEnumString(GLenum framebufferStatus);

	/**
	\brief 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 \a errorCode is not an actual, valid framebuffer status code, it will return an empty string.
	**/
	std::string FramebufferToDescription(GLenum framebufferStatus);
	///@}
}


#endif //DEBUG_UTIL_H
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.