| globjects 1.0.0.000000000000 Strict OpenGL objects wrapper.

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