Added tech ENABLE_OPENGL_ERROR_LOGGING -> log opengl errors when SLIC3R_LOGLEVEL=5

This commit is contained in:
enricoturri1966 2020-06-04 14:48:52 +02:00
parent 6f4d24ab95
commit ad7e7ae1cd
3 changed files with 37 additions and 0 deletions

View file

@ -10,6 +10,12 @@
#include <functional>
#if ENABLE_OPENGL_ERROR_LOGGING
extern void glAssertRecentCallImpl(const char* file_name, unsigned int line, const char* function_name);
inline void glAssertRecentCall() { glAssertRecentCallImpl(__FILE__, __LINE__, __FUNCTION__); }
#define glsafe(cmd) do { cmd; glAssertRecentCallImpl(__FILE__, __LINE__, __FUNCTION__); } while (false)
#define glcheck() do { glAssertRecentCallImpl(__FILE__, __LINE__, __FUNCTION__); } while (false)
#else
#ifndef NDEBUG
#define HAS_GLSAFE
#endif
@ -24,6 +30,7 @@ inline void glAssertRecentCall() { }
#define glsafe(cmd) cmd
#define glcheck()
#endif
#endif // ENABLE_OPENGL_ERROR_LOGGING
namespace Slic3r {
namespace GUI {