3dphotoshoot

view src/opengl.c @ 21:4ca4e3c5a754

port to C++ completed, shader programs now use the SdrProg class
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 11 Jun 2015 04:56:33 +0300
parents
children
line source
1 #include "opengl.h"
3 static const char *errstr[] = {
4 "GL_INVALID_ENUM",
5 "GL_INVALID_VALUE",
6 "GL_INVALID_OPERATION",
7 "GL_STACK_OVERFLOW",
8 "GL_STACK_UNDERFLOW",
9 "GL_OUT_OF_MEMORY"
10 };
12 const char *glerrstr(int err)
13 {
14 if(!err) {
15 return "no error";
16 }
17 if(err < GL_INVALID_ENUM || err > GL_OUT_OF_MEMORY) {
18 return "unknown error";
19 }
20 return errstr[err - GL_INVALID_ENUM];
21 }