diff options
author | bubnikv <bubnikv@gmail.com> | 2019-01-31 11:37:27 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2019-01-31 11:37:27 +0300 |
commit | f1470966a53eb893c82b5e0d6f8abe62eac12a35 (patch) | |
tree | 67cbe6852f68c5b494770fa5198d5616a8430ab6 /src/slic3r/GUI/3DScene.hpp | |
parent | 3c78d35e3ccc9999f958c9d93b9bc46b4a835f25 (diff) |
glsafe macro to test for the glGetError in debug mode
Diffstat (limited to 'src/slic3r/GUI/3DScene.hpp')
-rw-r--r-- | src/slic3r/GUI/3DScene.hpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/slic3r/GUI/3DScene.hpp b/src/slic3r/GUI/3DScene.hpp index e9340bd6e..7430ff4aa 100644 --- a/src/slic3r/GUI/3DScene.hpp +++ b/src/slic3r/GUI/3DScene.hpp @@ -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; |