CG_Labs  2021.2
Functions
utils::opengl::debug Namespace Reference

Functions

bool isSupported ()
 
std::string getStringForType (GLenum type)
 
std::string getStringForSource (GLenum source)
 
std::string getStringForSeverity (GLenum severity)
 
void beginDebugGroup (std::string const &message, GLuint id=0u)
 Start a new debug group. More...
 
void endDebugGroup ()
 End the most recently-started debug group. More...
 
void nameObject (GLenum type, GLuint id, std::string const &label)
 Label an OpenGL object with a custon string. More...
 
void opengl_error_callback (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei, GLchar const *msg, void const *)
 

Function Documentation

◆ beginDebugGroup()

void utils::opengl::debug::beginDebugGroup ( std::string const &  message,
GLuint  id = 0u 
)

This will allow tools like RenderDoc or Nsight Graphics, or the debug messages, to group all the commands issued within this newly defined scope under the specified name/ message.

The call will be ignored if OpenGL debug facilities are not available.

Parameters
[in]messagemessage or name for the new group to create
[in]idAn ID for the current message, which could be used for filtering some messages out but is currently unused

◆ endDebugGroup()

void utils::opengl::debug::endDebugGroup ( )

The call will be ignored if OpenGL debug facilities are not available.

◆ getStringForSeverity()

std::string utils::opengl::debug::getStringForSeverity ( GLenum  severity)

◆ getStringForSource()

std::string utils::opengl::debug::getStringForSource ( GLenum  source)

◆ getStringForType()

std::string utils::opengl::debug::getStringForType ( GLenum  type)

◆ isSupported()

bool utils::opengl::debug::isSupported ( )

◆ nameObject()

void utils::opengl::debug::nameObject ( GLenum  type,
GLuint  id,
std::string const &  label 
)

This will allow tools like RenderDoc or Nsight Graphics, or the debug messages, to display those strings rather than the object ID, making it easier to quickly find a given object.

The call will be ignored if OpenGL debug facilities are not available.

Parameters
[in]typethe type of the object to name, like GL_BUFFER, GL_TEXTURE
[in]idthe ID of the OpenGL object to name
[in]labelthe label to associate to the given object

◆ opengl_error_callback()

void utils::opengl::debug::opengl_error_callback ( GLenum  source,
GLenum  type,
GLuint  id,
GLenum  severity,
GLsizei  ,
GLchar const *  msg,
void const *   
)