From e6a15decac22912900d2cbd2e5525229b92bb55a Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 27 Oct 2021 09:47:44 +0800 Subject: *gl error handle --- Runtime/Graphics/OpenGL.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'Runtime/Graphics/OpenGL.h') diff --git a/Runtime/Graphics/OpenGL.h b/Runtime/Graphics/OpenGL.h index dcecb6d..69755e1 100644 --- a/Runtime/Graphics/OpenGL.h +++ b/Runtime/Graphics/OpenGL.h @@ -2,7 +2,23 @@ #define OPENGL_H #include "glad/glad.h" +#include +#include //http://docs.gl/gl3/glClear +#define CheckGLError(action)\ +if(true){ \ + GLenum error; \ + while ((error = glGetError()) != GL_NO_ERROR) { \ + action \ + } \ +} + +class GLException : std::exception +{ +}; + +extern std::string g_sharedGLErrorMsg; + #endif -- cgit v1.1-26-g67d0