3dphotoshoot
diff src/opengl.c @ 11:ad49e1f9b627
foo
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 31 May 2015 06:02:08 +0300 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/opengl.c Sun May 31 06:02:08 2015 +0300 1.3 @@ -0,0 +1,21 @@ 1.4 +#include "opengl.h" 1.5 + 1.6 +static const char *errstr[] = { 1.7 + "GL_INVALID_ENUM", 1.8 + "GL_INVALID_VALUE", 1.9 + "GL_INVALID_OPERATION", 1.10 + "GL_STACK_OVERFLOW", 1.11 + "GL_STACK_UNDERFLOW", 1.12 + "GL_OUT_OF_MEMORY" 1.13 +}; 1.14 + 1.15 +const char *glerrstr(int err) 1.16 +{ 1.17 + if(!err) { 1.18 + return "no error"; 1.19 + } 1.20 + if(err < GL_INVALID_ENUM || err > GL_OUT_OF_MEMORY) { 1.21 + return "unknown error"; 1.22 + } 1.23 + return errstr[err - GL_INVALID_ENUM]; 1.24 +}