diff options
author | chai <chaifix@163.com> | 2021-10-27 09:47:44 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-10-27 09:47:44 +0800 |
commit | e6a15decac22912900d2cbd2e5525229b92bb55a (patch) | |
tree | 16462535a26bdb9aa08c0604bdfd42f81933ad83 /Runtime/Graphics/OpenGL.h | |
parent | 0035e0d47bbce8311d3a4e559e74b8cdc5209d47 (diff) |
*gl error handle
Diffstat (limited to 'Runtime/Graphics/OpenGL.h')
-rw-r--r-- | Runtime/Graphics/OpenGL.h | 16 |
1 files changed, 16 insertions, 0 deletions
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 <string> +#include <exception> //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 |