globjects  2.0.0.4363356ae2ef
Strict OpenGL objects wrapper.
Loading...
Searching...
No Matches
DebugMessage.h
Go to the documentation of this file.
1
2#pragma once
3
4
5#include <string>
6#include <vector>
7
8#include <glbinding/gl/types.h>
9
10#include <globjects/globjects_api.h>
11
12
13namespace globjects
14{
15
16
17class GLOBJECTS_API DebugMessage
18{
19public:
20 enum class Implementation
21 {
22 Legacy,
23 DebugKHR
24 };
25
27
28
29public:
30 using Callback = std::function<void(const DebugMessage &)>;
31
32 DebugMessage(gl::GLenum source, gl::GLenum type, gl::GLuint id, gl::GLenum severity, const std::string & message);
33
34 gl::GLenum source() const;
35 gl::GLenum type() const;
36 gl::GLuint id() const;
37 gl::GLenum severity() const;
38 const std::string & message() const;
39
40 virtual std::string toString() const;
41
42
43protected:
44 gl::GLenum m_source;
45 gl::GLenum m_type;
46 gl::GLuint m_id;
47 gl::GLenum m_severity;
48 std::string m_message;
49
50 std::string severityString() const;
51 std::string sourceString() const;
52 std::string typeString() const;
53
54
55public:
56 static void enable(bool synchronous = true);
57 static void disable();
58 static bool isEnabled();
59
60 static void setCallback(Callback callback);
61
62 static void setSynchronous(bool synchronous);
63 static bool isSynchronous();
64
65 static void insertMessage(gl::GLenum source, gl::GLenum type, gl::GLuint id, gl::GLenum severity, gl::GLsizei length, const char * message);
66 static void insertMessage(gl::GLenum source, gl::GLenum type, gl::GLuint id, gl::GLenum severity, const std::string & message);
67 static void insertMessage(const DebugMessage & message);
68
69 static void enableMessage(gl::GLenum source, gl::GLenum type, gl::GLenum severity, gl::GLuint id);
70 static void enableMessages(gl::GLenum source, gl::GLenum type, gl::GLenum severity, gl::GLsizei count, const gl::GLuint * ids);
71 static void enableMessages(gl::GLenum source, gl::GLenum type, gl::GLenum severity, const std::vector<gl::GLuint> & ids);
72
73 static void disableMessage(gl::GLenum source, gl::GLenum type, gl::GLenum severity, gl::GLuint id);
74 static void disableMessages(gl::GLenum source, gl::GLenum type, gl::GLenum severity, gl::GLsizei count, const gl::GLuint * ids);
75 static void disableMessages(gl::GLenum source, gl::GLenum type, gl::GLenum severity, const std::vector<gl::GLuint> & ids);
76
77 static void controlMessages(gl::GLenum source, gl::GLenum type, gl::GLenum severity, gl::GLsizei count, const gl::GLuint * ids, gl::GLboolean enabled);
78
80};
81
82
83} // namespace globjects
Definition: DebugMessage.h:18
std::function< void(const DebugMessage &)> Callback
Definition: DebugMessage.h:30
static bool isEnabled()
static void setSynchronous(bool synchronous)
static void disableMessage(gl::GLenum source, gl::GLenum type, gl::GLenum severity, gl::GLuint id)
Implementation
Definition: DebugMessage.h:21
gl::GLenum type() const
static bool isFallbackImplementation()
const std::string & message() const
static void disableMessages(gl::GLenum source, gl::GLenum type, gl::GLenum severity, const std::vector< gl::GLuint > &ids)
gl::GLenum severity() const
static void setCallback(Callback callback)
std::string severityString() const
DebugMessage(gl::GLenum source, gl::GLenum type, gl::GLuint id, gl::GLenum severity, const std::string &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, const std::vector< gl::GLuint > &ids)
static void hintImplementation(Implementation impl)
gl::GLenum m_type
Definition: DebugMessage.h:45
gl::GLenum m_severity
Definition: DebugMessage.h:47
gl::GLuint id() const
std::string typeString() const
static void insertMessage(const DebugMessage &message)
std::string m_message
Definition: DebugMessage.h:48
static void insertMessage(gl::GLenum source, gl::GLenum type, gl::GLuint id, gl::GLenum severity, gl::GLsizei length, const char *message)
gl::GLenum source() const
static void enable(bool synchronous=true)
static void insertMessage(gl::GLenum source, gl::GLenum type, gl::GLuint id, gl::GLenum severity, const std::string &message)
static void controlMessages(gl::GLenum source, gl::GLenum type, gl::GLenum severity, gl::GLsizei count, const gl::GLuint *ids, gl::GLboolean enabled)
static void enableMessages(gl::GLenum source, gl::GLenum type, gl::GLenum severity, gl::GLsizei count, const gl::GLuint *ids)
gl::GLenum m_source
Definition: DebugMessage.h:44
static bool isSynchronous()
virtual std::string toString() const
std::string sourceString() const
gl::GLuint m_id
Definition: DebugMessage.h:46
static void disableMessages(gl::GLenum source, gl::GLenum type, gl::GLenum severity, gl::GLsizei count, const gl::GLuint *ids)
Contains all the classes that wrap OpenGL functionality.