Loading...
Searching...
No Matches
DebugMessage.h
Go to the documentation of this file.
#pragma once
#include <string>
#include <vector>
#include <glbinding/gl/types.h>
#include <globjects/globjects_api.h>
namespace globjects
{
class GLOBJECTS_API DebugMessage
{
public:
enum class Implementation
{
DebugKHR
, Legacy
};
static void hintImplementation(Implementation impl);
public:
using Callback = std::function<void(const DebugMessage &)>;
DebugMessage(gl::GLenum source, gl::GLenum type, gl::GLuint id, gl::GLenum severity, const std::string & message);
gl::GLenum source() const;
gl::GLenum type() const;
gl::GLuint id() const;
gl::GLenum severity() const;
const std::string & message() const;
virtual std::string toString() const;
protected:
gl::GLenum m_source;
gl::GLenum m_type;
gl::GLuint m_id;
gl::GLenum m_severity;
std::string m_message;
std::string severityString() const;
std::string sourceString() const;
std::string typeString() const;
public:
static void enable(bool synchronous = true);
static void disable();
static void setCallback(Callback callback);
static void setSynchronous(bool synchronous);
static void insertMessage(gl::GLenum source, gl::GLenum type, gl::GLuint id, gl::GLenum severity, gl::GLsizei length, const char * message);
static void insertMessage(gl::GLenum source, gl::GLenum type, gl::GLuint id, gl::GLenum severity, const std::string & message);
static void insertMessage(const DebugMessage & message);
static void enableMessage(gl::GLenum source, gl::GLenum type, gl::GLenum severity, gl::GLuint id);
static void enableMessages(gl::GLenum source, gl::GLenum type, gl::GLenum severity, gl::GLsizei count, const gl::GLuint * ids);
static void enableMessages(gl::GLenum source, gl::GLenum type, gl::GLenum severity, const std::vector<gl::GLuint> & ids);
static void disableMessage(gl::GLenum source, gl::GLenum type, gl::GLenum severity, gl::GLuint id);
static void disableMessages(gl::GLenum source, gl::GLenum type, gl::GLenum severity, gl::GLsizei count, const gl::GLuint * ids);
static void disableMessages(gl::GLenum source, gl::GLenum type, gl::GLenum severity, const std::vector<gl::GLuint> & ids);
static void controlMessages(gl::GLenum source, gl::GLenum type, gl::GLenum severity, gl::GLsizei count, const gl::GLuint * ids, gl::GLboolean enabled);
static bool isFallbackImplementation();
};
} // namespace globjects
globjects::DebugMessage
Definition DebugMessage.h:17
globjects::DebugMessage::Callback
std::function< void(const DebugMessage &)> Callback
Definition DebugMessage.h:28
globjects::DebugMessage::setSynchronous
static void setSynchronous(bool synchronous)
globjects::DebugMessage::disableMessage
static void disableMessage(gl::GLenum source, gl::GLenum type, gl::GLenum severity, gl::GLuint id)
globjects::DebugMessage::Implementation
Implementation
Definition DebugMessage.h:20
globjects::DebugMessage::type
gl::GLenum type() const
globjects::DebugMessage::isFallbackImplementation
static bool isFallbackImplementation()
globjects::DebugMessage::message
const std::string & message() const
globjects::DebugMessage::disableMessages
static void disableMessages(gl::GLenum source, gl::GLenum type, gl::GLenum severity, const std::vector< gl::GLuint > &ids)
globjects::DebugMessage::severity
gl::GLenum severity() const
globjects::DebugMessage::setCallback
static void setCallback(Callback callback)
globjects::DebugMessage::severityString
std::string severityString() const
globjects::DebugMessage::DebugMessage
DebugMessage(gl::GLenum source, gl::GLenum type, gl::GLuint id, gl::GLenum severity, const std::string &message)
globjects::DebugMessage::enableMessage
static void enableMessage(gl::GLenum source, gl::GLenum type, gl::GLenum severity, gl::GLuint id)
globjects::DebugMessage::enableMessages
static void enableMessages(gl::GLenum source, gl::GLenum type, gl::GLenum severity, const std::vector< gl::GLuint > &ids)
globjects::DebugMessage::hintImplementation
static void hintImplementation(Implementation impl)
globjects::DebugMessage::m_type
gl::GLenum m_type
Definition DebugMessage.h:42
globjects::DebugMessage::m_severity
gl::GLenum m_severity
Definition DebugMessage.h:44
globjects::DebugMessage::id
gl::GLuint id() const
globjects::DebugMessage::disable
static void disable()
globjects::DebugMessage::typeString
std::string typeString() const
globjects::DebugMessage::insertMessage
static void insertMessage(const DebugMessage &message)
globjects::DebugMessage::m_message
std::string m_message
Definition DebugMessage.h:45
globjects::DebugMessage::insertMessage
static void insertMessage(gl::GLenum source, gl::GLenum type, gl::GLuint id, gl::GLenum severity, gl::GLsizei length, const char *message)
globjects::DebugMessage::source
gl::GLenum source() const
globjects::DebugMessage::enable
static void enable(bool synchronous=true)
globjects::DebugMessage::insertMessage
static void insertMessage(gl::GLenum source, gl::GLenum type, gl::GLuint id, gl::GLenum severity, const std::string &message)
globjects::DebugMessage::controlMessages
static void controlMessages(gl::GLenum source, gl::GLenum type, gl::GLenum severity, gl::GLsizei count, const gl::GLuint *ids, gl::GLboolean enabled)
globjects::DebugMessage::enableMessages
static void enableMessages(gl::GLenum source, gl::GLenum type, gl::GLenum severity, gl::GLsizei count, const gl::GLuint *ids)
globjects::DebugMessage::m_source
gl::GLenum m_source
Definition DebugMessage.h:41
globjects::DebugMessage::toString
virtual std::string toString() const
globjects::DebugMessage::sourceString
std::string sourceString() const
globjects::DebugMessage::m_id
gl::GLuint m_id
Definition DebugMessage.h:43
globjects::DebugMessage::disableMessages
static void disableMessages(gl::GLenum source, gl::GLenum type, gl::GLenum severity, gl::GLsizei count, const gl::GLuint *ids)
globjects
Contains all the classes that wrap OpenGL functionality.