2016-08-17 18:33:10 +00:00
|
|
|
#ifndef __GL_DEBUG_H
|
|
|
|
#define __GL_DEBUG_H
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
#include "gl/system/gl_interface.h"
|
|
|
|
#include "c_cvars.h"
|
|
|
|
#include "r_defs.h"
|
|
|
|
|
|
|
|
class FGLDebug
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void Update();
|
|
|
|
|
2018-04-14 08:40:11 +00:00
|
|
|
static void LabelObject(GLenum type, GLuint handle, const char *name);
|
|
|
|
static void LabelObjectPtr(void *ptr, const char *name);
|
2016-08-17 21:18:47 +00:00
|
|
|
|
|
|
|
static void PushGroup(const FString &name);
|
|
|
|
static void PopGroup();
|
|
|
|
|
2016-08-22 17:25:13 +00:00
|
|
|
static bool HasDebugApi() { return (gl.flags & RFL_DEBUG) != 0; }
|
|
|
|
|
2016-08-17 18:33:10 +00:00
|
|
|
private:
|
|
|
|
void SetupBreakpointMode();
|
|
|
|
void UpdateLoggingLevel();
|
|
|
|
void OutputMessageLog();
|
|
|
|
|
2016-08-18 00:10:54 +00:00
|
|
|
static bool IsFilteredByDebugLevel(GLenum severity);
|
2016-08-17 18:33:10 +00:00
|
|
|
static void PrintMessage(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message);
|
|
|
|
|
|
|
|
static void APIENTRY DebugCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *userParam);
|
|
|
|
|
|
|
|
static FString SourceToString(GLenum source);
|
|
|
|
static FString TypeToString(GLenum type);
|
|
|
|
static FString SeverityToString(GLenum severity);
|
|
|
|
|
|
|
|
GLenum mCurrentLevel = 0;
|
|
|
|
bool mBreakpointMode = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|