LibCarna Version 3.4.0
Loading...
Searching...
No Matches
glError.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010 - 2016 Leonid Kostrykin
3 *
4 * Chair of Medical Engineering (mediTEC)
5 * RWTH Aachen University
6 * Pauwelsstr. 20
7 * 52074 Aachen
8 * Germany
9 *
10 *
11 * Copyright (C) 2021 - 2025 Leonid Kostrykin
12 *
13 */
14
15#ifndef GLERROR_H_6014714286
16#define GLERROR_H_6014714286
17
25// ----------------------------------------------------------------------------------
26// GCC compatibility
27// ----------------------------------------------------------------------------------
28
29#ifndef __func__
30
35#define __func__ __FUNCTION__
36
37#endif
38
39
40
41// ----------------------------------------------------------------------------------
42// REPORT_GL_ERROR
43// ----------------------------------------------------------------------------------
44
45#ifndef NO_GL_ERROR_CHECKING
46
48
53 #define __REPORT_GL_ERROR_IMPL { \
54 const unsigned int err = glGetError(); \
55 LIBCARNA_ASSERT_EX( err == GL_NO_ERROR, "GL Error State in " \
56 << __func__ << ": " \
57 << std::string( reinterpret_cast< const char* >( gluErrorString( err ) ) ) \
58 << " [" << err << "] (" << __FILE__ << ":" << __LINE__ << ")" ); }
59#else
60
61 #define __REPORT_GL_ERROR_IMPL
62
63#endif
64
71#define REPORT_GL_ERROR __REPORT_GL_ERROR_IMPL
72
73
74
75#endif // GLERROR_H_6014714286
Defines LibCarna::base::LibCarnaException and LibCarna::base::AssertionFailure.