glsafe macro to test for the glGetError in debug mode

This commit is contained in:
bubnikv 2019-01-31 09:37:27 +01:00
parent 3c78d35e3c
commit f1470966a5
2 changed files with 172 additions and 138 deletions

View file

@ -11,6 +11,19 @@
#include <functional>
#ifndef NDEBUG
#define HAS_GLSAFE
#endif
#ifdef HAS_GLSAFE
extern void glAssertRecentCallImpl();
inline void glAssertRecentCall() { glAssertRecentCallImpl(); }
#define glsafe(cmd) do { cmd; glAssertRecentCallImpl(); } while (false)
#else
inline void glAssertRecentCall() { }
#define glsafe(cmd) cmd
#endif
namespace Slic3r {
class Print;