3dphotoshoot

annotate src/opengl.c @ 11:ad49e1f9b627

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 31 May 2015 06:02:08 +0300
parents
children
rev   line source
nuclear@11 1 #include "opengl.h"
nuclear@11 2
nuclear@11 3 static const char *errstr[] = {
nuclear@11 4 "GL_INVALID_ENUM",
nuclear@11 5 "GL_INVALID_VALUE",
nuclear@11 6 "GL_INVALID_OPERATION",
nuclear@11 7 "GL_STACK_OVERFLOW",
nuclear@11 8 "GL_STACK_UNDERFLOW",
nuclear@11 9 "GL_OUT_OF_MEMORY"
nuclear@11 10 };
nuclear@11 11
nuclear@11 12 const char *glerrstr(int err)
nuclear@11 13 {
nuclear@11 14 if(!err) {
nuclear@11 15 return "no error";
nuclear@11 16 }
nuclear@11 17 if(err < GL_INVALID_ENUM || err > GL_OUT_OF_MEMORY) {
nuclear@11 18 return "unknown error";
nuclear@11 19 }
nuclear@11 20 return errstr[err - GL_INVALID_ENUM];
nuclear@11 21 }