oculus1

view src/opengl.cc @ 8:3265970a7315

added xcode project
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 18 Sep 2013 22:15:04 +0300
parents
children b66b54a68dfd
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 }