2012-03-24 23:39:19 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
2017-03-03 14:15:27 +01:00
|
|
|
#include <string>
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
|
2012-03-31 11:16:13 +02:00
|
|
|
// Utility to be able to liberally sprinkle GL error checks around your code
|
|
|
|
|
// and easily disable them all in release builds - just undefine DEBUG_OPENGL.
|
2012-03-24 23:39:19 +01:00
|
|
|
|
2017-03-03 14:15:27 +01:00
|
|
|
// #define DEBUG_OPENGL
|
2012-03-24 23:39:19 +01:00
|
|
|
|
|
|
|
|
#if defined(DEBUG_OPENGL)
|
|
|
|
|
|
2020-09-17 20:48:24 +02:00
|
|
|
bool CheckGLError(const char *file, int line);
|
|
|
|
|
#define CHECK_GL_ERROR_IF_DEBUG() if (!CheckGLError(__FILE__, __LINE__)) __debugbreak();
|
2012-03-24 23:39:19 +01:00
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
2017-03-03 14:15:27 +01:00
|
|
|
#define CHECK_GL_ERROR_IF_DEBUG()
|
2012-03-24 23:39:19 +01:00
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
2017-03-03 14:15:27 +01:00
|
|
|
std::string GLEnumToString(uint16_t value);
|