This repository has been archived on 2022-10-27. You can view files and clone it, but cannot push or open issues or pull requests.
InfinitShoot/hazel/glhelper.h

20 lines
426 B
C
Raw Normal View History

2022-07-31 22:27:19 +08:00
#ifndef __HAZEL_GLHELPER_H__
#define __HAZEL_GLHELPER_H__
#include "glad/glad.h"
#define TRY_GET_GL_ERROR_MAX_LOOP 10000
const char* GLGetErrorString(GLenum);
void GLClearError();
#define GL_CALL(statement) do { \
GLClearError(); \
statement; \
GLenum ___err_inner_use = glGetError(); \
if (___err_inner_use != GL_NO_ERROR) { GL_LOG_ERROR("%s", GLGetErrorString(___err_inner_use)); } \
} while(0)
#endif