GlobeEngine
DebugLogger.h
Go to the documentation of this file.
1 //
2 // DebugLogger.h
3 //
4 // Created by Mathias Thöny on 27.12.11.
5 // Copyright (c) 2011 University of Zurich. All rights reserved.
6 //
7 
8 #ifndef GlobeEngine_DebugLogger_h
9 #define GlobeEngine_DebugLogger_h
10 
11 #include "OpenGL_Includes.h"
12 #include <string>
13 
14 namespace geUtil {
15 
16 #ifndef __APPLE__
17  #ifndef CALLBACK
18  #define CALLBACK
19  #endif
20 #endif
21 
23  {
24  public:
25  public:
26  DebugLogger();
27  ~DebugLogger();
28  void clear();
29  void create();
30 
31 #ifndef __APPLE__
32  void enableDebugOutput();
33  void disableDebugOutput();
36 
37  GLenum getSeverityForString(std::string _severity);
38  GLenum getSourceForString(std::string _source);
39  GLenum getTypeForString(std::string _type);
40 
41  static void printDebugLogLine(unsigned int source, unsigned int type, unsigned int id, unsigned int severity, const char* message);
42 
43 
44  static void CALLBACK debugCallback(GLenum source, GLenum type, GLuint id,
45  GLenum severity, GLsizei length, const GLchar* message, const void* userParam);
46 
47  void enableDebugMessage(std::string _source, std::string _type, std::string _severity, GLsizei _count, const GLuint* _ids);
48  void disableDebugMessage(std::string _source, std::string _type, std::string _severity, GLsizei _count, const GLuint* _ids);
49 
50  void insertDebugMessage(std::string _source, std::string _type, std::string _severity, std::string _message, GLuint _id);
51  void performTest();
52 
53  private:
54  void callMessageInsert(GLenum _source, GLenum _type, GLenum _severity, GLuint _id, std::string _message);
55  void callDebugMessageControl(GLenum _source, GLenum _type, GLenum _severity, GLsizei _count, const GLuint* _ids, bool _in);
56 
57 #endif
58 
59  };
60 }
61 #endif
void enableSynchronousDebugOutput()
Definition: DebugLogger.cpp:168
void disableDebugOutput()
Definition: DebugLogger.cpp:163
void insertDebugMessage(std::string _source, std::string _type, std::string _severity, std::string _message, GLuint _id)
Definition: DebugLogger.cpp:145
void performTest()
Definition: DebugLogger.cpp:178
GLenum getSourceForString(std::string _source)
Definition: DebugLogger.cpp:105
GLenum getTypeForString(std::string _type)
Definition: DebugLogger.cpp:86
Definition: DebugLogger.h:22
DebugLogger()
Definition: DebugLogger.cpp:5
void enableDebugOutput()
Definition: DebugLogger.cpp:158
void clear()
Definition: DebugLogger.cpp:15
static void CALLBACK debugCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *userParam)
Definition: DebugLogger.cpp:35
void create()
Definition: DebugLogger.cpp:20
GLenum getSeverityForString(std::string _severity)
Definition: DebugLogger.cpp:124
void disableSynchronousDebugOutput()
Definition: DebugLogger.cpp:173
Definition: DebugLogger.h:14
void disableDebugMessage(std::string _source, std::string _type, std::string _severity, GLsizei _count, const GLuint *_ids)
Definition: DebugLogger.cpp:141
void enableDebugMessage(std::string _source, std::string _type, std::string _severity, GLsizei _count, const GLuint *_ids)
Definition: DebugLogger.cpp:137
#define CALLBACK
Definition: DebugLogger.h:18
~DebugLogger()
Definition: DebugLogger.cpp:10
static void printDebugLogLine(unsigned int source, unsigned int type, unsigned int id, unsigned int severity, const char *message)
Definition: DebugLogger.cpp:41