3dphotoshoot

diff src/opengl.h @ 11:ad49e1f9b627

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 31 May 2015 06:02:08 +0300
parents c71c477521ca
children
line diff
     1.1 --- a/src/opengl.h	Sun May 31 00:40:26 2015 +0300
     1.2 +++ b/src/opengl.h	Sun May 31 06:02:08 2015 +0300
     1.3 @@ -9,4 +9,24 @@
     1.4  #include <GL/glew.h>
     1.5  #endif
     1.6  
     1.7 +#define CHECK_GLERROR \
     1.8 +	do { \
     1.9 +		int err = glGetError(); \
    1.10 +		if(err) { \
    1.11 +			fprintf(stderr, "%s:%d: OpenGL error %d: %s\n", __FILE__, __LINE__, err, glerrstr(err)); \
    1.12 +			abort(); \
    1.13 +		} \
    1.14 +	} while(0)
    1.15 +
    1.16 +#ifdef __cplusplus
    1.17 +extern "C" {
    1.18 +#endif
    1.19 +
    1.20 +const char *glerrstr(int err);
    1.21 +
    1.22 +#ifdef __cplusplus
    1.23 +}
    1.24 +#endif
    1.25 +
    1.26 +
    1.27  #endif	/* OPENGL_H_ */