vrshoot

view src/opengl.cc @ 0:b2f14e535253

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 01 Feb 2014 19:58:19 +0200
parents
children
line source
1 #include "opengl.h"
3 void init_opengl()
4 {
5 #ifdef __GLEW_H__
6 glewInit();
7 #endif
8 }
10 const char *strglerr(int err)
11 {
12 static const char *errnames[] = {
13 "GL_INVALID_ENUM",
14 "GL_INVALID_VALUE",
15 "GL_INVALID_OPERATION",
16 "GL_STACK_OVERFLOW",
17 "GL_STACK_UNDERFLOW",
18 "GL_OUT_OF_MEMORY",
19 "GL_INVALID_FRAMEBUFFER_OPERATION"
20 };
22 if(!err) {
23 return "GL_NO_ERROR";
24 }
25 if(err < GL_INVALID_ENUM || err > GL_OUT_OF_MEMORY) {
26 return "<invalid gl error>";
27 }
28 return errnames[err - GL_INVALID_ENUM];
29 }