goat3dgfx

view src/opengl.cc @ 0:1873dfd13f2d

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 14 Nov 2013 05:27:09 +0200
parents
children 7d6b667821cf
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 }