CompileTimeSettings.hh 2.27 KB
Newer Older
Robert Menzel's avatar
Robert Menzel committed
1
2
3
4
////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2011, Computer Graphics Group RWTH Aachen University         //
// All rights reserved.                                                       //
////////////////////////////////////////////////////////////////////////////////
Robert Menzel's avatar
Robert Menzel committed
5
 
Robert Menzel's avatar
Robert Menzel committed
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef COMPILETIMESETTINGS_HH
#define COMPILETIMESETTINGS_HH

/*
 * OpenGL error checking
 *
 * By default, only critical errors will get checked in release build
 * and critical&common in debug build.
 *
 * This can get overwritten with a compile flag define:
 *  -DACGL_CHECK_NO_GL_ERRORS
 *    No error checking at all
 *  -DACGL_CHECK_CRITICAL_GL_ERRORS
 *    Places will get checked where errors like out of memory can occur.
 *    This will detect runtime errors which can happen even if the program
 *    is bug free.
 *    Switching this on shouldn't be a performance hit.
 *  -DACGL_CHECK_COMMON_GL_ERRORS
 *    Problems that happen more often while developing like typos in uniform
 *    names. All placed where strings are used to call OpenGL objects etc.
 *  -DACGL_CHECK_RARE_GL_ERRORS
 *    Most likely bugs in ACGL itself or wrong usage. If there are strange errors
 *    switch this on to find the reason more quickly. Even normal development
 *    should work without this. Results in a lot of glGetError!
 *
 * Note that all error levels also include the higher ones (COMMON also adds CRITICAL).
 */


#ifndef ACGL_CHECK_NO_GL_ERRORS
# ifndef ACGL_CHECK_CRITICAL_GL_ERRORS
#  ifndef ACGL_CHECK_COMMON_GL_ERRORS
#   ifndef ACGL_CHECK_RARE_GL_ERRORS
//   if nothing is defined, use defaults:
#    ifdef DEBUG
#     define ACGL_CHECK_COMMON_GL_ERRORS
#    else
#     define ACGL_CHECK_CRITICAL_GL_ERRORS
#    endif
#   endif
#  endif
# endif
#endif


// if rare is set, set also common:
#ifdef ACGL_CHECK_RARE_GL_ERRORS
# ifndef ACGL_CHECK_COMMON_GL_ERRORS
#  define ACGL_CHECK_COMMON_GL_ERRORS
# endif
#endif

// if common is set, set also critical:
#ifdef ACGL_CHECK_COMMON_GL_ERRORS
# ifndef ACGL_CHECK_CRITICAL_GL_ERRORS
#  define ACGL_CHECK_CRITICAL_GL_ERRORS
# endif
#endif

// if critical is set, NO must not be set:
#ifdef ACGL_CHECK_CRITICAL_GL_ERRORS
# ifdef ACGL_CHECK_NO_GL_ERRORS
#  undef ACGL_CHECK_NO_GL_ERRORS
# endif
#endif



#endif // COMPILETIMESETTINGS_HH
Robert Menzel's avatar
Robert Menzel committed
75