oculus1

annotate 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
rev   line source
nuclear@8 1 #include "opengl.h"
nuclear@8 2
nuclear@8 3 void init_opengl()
nuclear@8 4 {
nuclear@8 5 #ifdef __GLEW_H__
nuclear@8 6 glewInit();
nuclear@8 7 #endif
nuclear@8 8 }
nuclear@8 9
nuclear@8 10 const char *strglerr(int err)
nuclear@8 11 {
nuclear@8 12 static const char *errnames[] = {
nuclear@8 13 "GL_INVALID_ENUM",
nuclear@8 14 "GL_INVALID_VALUE",
nuclear@8 15 "GL_INVALID_OPERATION",
nuclear@8 16 "GL_STACK_OVERFLOW",
nuclear@8 17 "GL_STACK_UNDERFLOW",
nuclear@8 18 "GL_OUT_OF_MEMORY",
nuclear@8 19 "GL_INVALID_FRAMEBUFFER_OPERATION"
nuclear@8 20 };
nuclear@8 21
nuclear@8 22 if(!err) {
nuclear@8 23 return "GL_NO_ERROR";
nuclear@8 24 }
nuclear@8 25 if(err < GL_INVALID_ENUM || err > GL_OUT_OF_MEMORY) {
nuclear@8 26 return "<invalid gl error>";
nuclear@8 27 }
nuclear@8 28 return errnames[err - GL_INVALID_ENUM];
nuclear@8 29 }