conworlds

diff src/opengl.h @ 0:b326d53321f7

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 25 Apr 2014 05:20:53 +0300
parents
children c814f77d177e
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/opengl.h	Fri Apr 25 05:20:53 2014 +0300
     1.3 @@ -0,0 +1,29 @@
     1.4 +#ifndef OPENGL_H_
     1.5 +#define OPENGL_H_
     1.6 +
     1.7 +#include <GL/glew.h>
     1.8 +
     1.9 +#ifndef __APPLE__
    1.10 +#include <GL/glut.h>
    1.11 +#else
    1.12 +#include <GLUT/glut.h>
    1.13 +#endif
    1.14 +
    1.15 +#define CHECKGLERR	\
    1.16 +	do { \
    1.17 +		int err = glGetError(); \
    1.18 +		if(err) { \
    1.19 +			fprintf(stderr, "%s:%d: OpenGL error 0x%x: %s\n", __FILE__, __LINE__, err, strglerr(err)); \
    1.20 +			abort(); \
    1.21 +		} \
    1.22 +	} while(0)
    1.23 +
    1.24 +
    1.25 +class Matrix4x4;
    1.26 +
    1.27 +void load_matrix(const Matrix4x4 &m);
    1.28 +void mult_matrix(const Matrix4x4 &m);
    1.29 +
    1.30 +const char *strglerr(int err);
    1.31 +
    1.32 +#endif	/* OPENGL_H_ */