dungeon_crawler

diff prototype/src/opengl.cc @ 18:5c41e6fcb300

- commandline arguments - stereoscopic rendering - FBO fixed
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 21 Aug 2012 03:17:48 +0300
parents 8fb37db44fd8
children
line diff
     1.1 --- a/prototype/src/opengl.cc	Mon Aug 20 06:11:58 2012 +0300
     1.2 +++ b/prototype/src/opengl.cc	Tue Aug 21 03:17:48 2012 +0300
     1.3 @@ -38,3 +38,24 @@
     1.4  	}
     1.5  #endif
     1.6  }
     1.7 +
     1.8 +const char *strglerr(int err)
     1.9 +{
    1.10 +	static const char *errnames[] = {
    1.11 +		"GL_INVALID_ENUM",
    1.12 +		"GL_INVALID_VALUE",
    1.13 +		"GL_INVALID_OPERATION",
    1.14 +		"GL_STACK_OVERFLOW",
    1.15 +		"GL_STACK_UNDERFLOW",
    1.16 +		"GL_OUT_OF_MEMORY",
    1.17 +		"GL_INVALID_FRAMEBUFFER_OPERATION"
    1.18 +	};
    1.19 +
    1.20 +	if(!err) {
    1.21 +		return "GL_NO_ERROR";
    1.22 +	}
    1.23 +	if(err < GL_INVALID_ENUM || err > GL_OUT_OF_MEMORY) {
    1.24 +		return "<invalid gl error>";
    1.25 +	}
    1.26 +	return errnames[err - GL_INVALID_ENUM];
    1.27 +}