nuclear@1: #include "opengl.h" nuclear@1: nuclear@1: void init_opengl() nuclear@1: { nuclear@1: #ifdef __GLEW_H__ nuclear@1: glewInit(); nuclear@1: #endif nuclear@1: } nuclear@1: nuclear@1: const char *strglerr(int err) nuclear@1: { nuclear@1: static const char *errnames[] = { nuclear@1: "GL_INVALID_ENUM", nuclear@1: "GL_INVALID_VALUE", nuclear@1: "GL_INVALID_OPERATION", nuclear@1: "GL_STACK_OVERFLOW", nuclear@1: "GL_STACK_UNDERFLOW", nuclear@1: "GL_OUT_OF_MEMORY", nuclear@1: "GL_INVALID_FRAMEBUFFER_OPERATION" nuclear@1: }; nuclear@1: nuclear@1: if(!err) { nuclear@1: return "GL_NO_ERROR"; nuclear@1: } nuclear@1: if(err < GL_INVALID_ENUM || err > GL_OUT_OF_MEMORY) { nuclear@1: return ""; nuclear@1: } nuclear@1: return errnames[err - GL_INVALID_ENUM]; nuclear@1: }