Debug.hh 1.45 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/***********************************************************************
 * Copyright 2013 Computer Graphics Group RWTH Aachen University.      *
 * All rights reserved.                                                *
 * Distributed under the terms of the MIT License (see LICENSE.TXT).   *
 **********************************************************************/

#pragma once

#include <ACGL/ACGL.hh>
#include <ACGL/OpenGL/GL.hh>

namespace ACGL{
namespace OpenGL{

15
16
17
18
19
20
21
22
23
24
25
26
27
/*
 * Pushes the message onto the debug message stack from KHR_debug
 * and pops it when the scope ends (== this object gets destroyed).
 *
 * Will be visible in debuggers.
 */
class GLDebugAnnotation
{
public:
    GLDebugAnnotation( const char *_message );
    ~GLDebugAnnotation();
};

28
29
30
31
32
33
34
35
36
37
//! converts a KHR debug source enum to a human readable string
const char *debugSourceName( GLenum _source );

//! converts a KHR debug type enum to a human readable string
const char *debugTypeName( GLenum _type );

//! converts a KHR debug severity enum to a human readable string
const char *debugSeverityName( GLenum _type );

//! tries to register the default debug callback:
Robert Menzel's avatar
Robert Menzel committed
38
//! applications can register alternative callbacks with glDebugMessageCallback !
39
40
41
void ACGLRegisterDefaultDebugCallback();

//! default debug callback
42
void APIENTRY ACGL_KHR_default_debug_callback( GLenum _source, GLenum _type, GLuint _id, GLenum _severity, GLsizei _length, const GLchar *_message, void *_userParam);
43
44
45
46
47
48
49

} // OpenGL
} // ACGL