goat3dgfx

view src/opengl.cc @ 31:3ba80928b530

fixed the build
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 02 Mar 2014 04:20:00 +0200
parents 1873dfd13f2d
children
line source
1 #include "opengl.h"
3 using namespace goatgfx;
5 namespace goatgfx {
7 void init_opengl()
8 {
9 #ifdef __GLEW_H__
10 glewInit();
11 #endif
12 }
14 const char *strglerr(int err)
15 {
16 static const char *errnames[] = {
17 "GL_INVALID_ENUM",
18 "GL_INVALID_VALUE",
19 "GL_INVALID_OPERATION",
20 "GL_STACK_OVERFLOW",
21 "GL_STACK_UNDERFLOW",
22 "GL_OUT_OF_MEMORY",
23 "GL_INVALID_FRAMEBUFFER_OPERATION"
24 };
26 if(!err) {
27 return "GL_NO_ERROR";
28 }
29 if(err < GL_INVALID_ENUM || err > GL_OUT_OF_MEMORY) {
30 return "<invalid gl error>";
31 }
32 return errnames[err - GL_INVALID_ENUM];
33 }
35 } // namespace goatgfx