goat3d

view src/opengl.cc @ 1:e46529a5d057

some progress
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 17 Aug 2013 23:51:24 +0300
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 }