globjects  1.0.0.000000000000
Strict OpenGL objects wrapper.
Loading...
Searching...
No Matches
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
12namespace globjects
13{
14
15
16class GLOBJECTS_API DebugMessage
17{
18public:
19 enum class Implementation
20 {
21 DebugKHR
22 , Legacy
23 };
24
26
27public:
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
40protected:
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
51public:
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
74};
75
76
77} // namespace globjects
Definition DebugMessage.h:17
std::function< void(const DebugMessage &)> Callback
Definition DebugMessage.h:28
static void setSynchronous(bool synchronous)
static void disableMessage(gl::GLenum source, gl::GLenum type, gl::GLenum severity, gl::GLuint id)
Implementation
Definition DebugMessage.h:20
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:42
gl::GLenum m_severity
Definition DebugMessage.h:44
gl::GLuint id() const
std::string typeString() const
static void insertMessage(const DebugMessage &message)
std::string m_message
Definition DebugMessage.h:45
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:41
virtual std::string toString() const
std::string sourceString() const
gl::GLuint m_id
Definition DebugMessage.h:43
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.