#ifndef MAIN_H #define MAIN_H typedef struct { float x, y, z; } vec3; #ifndef M_PI #define M_PI 3.14159265358979323846 #endif /* Function declarations */ void rotateMatrix(double angle, double x, double y, double z, float *R); void perspectiveMatrix(double fovy, double aspect, double znear, double zfar, float *P); void multiplyMatrix(float *A, float *B, float *C); char *loadShader(char *sFilename); void processShader(GLuint *shader, char *file, GLint type); Window CreateXWindow(const char *title, int width, int height, Display* display, EGLDisplay sEGLDisplay, EGLConfig FBConfig, Colormap *pColormap, XVisualInfo **ppVisual); /* Defines */ #define DEBUG0(x) #define DEBUG1(x,a) #define VERT_FILE "shader.vert" #define FRAG_FILE "shader.frag" #define VERT_FILE1 "default_textured.vert" #define FRAG_FILE1 "default_textured.frag" #define GL_CHECK(x) \ x; \ { \ GLenum glError = glGetError(); \ if(glError != GL_NO_ERROR) { \ fprintf(stderr, "glGetError() = %i (0x%.8x) at line %i\n", glError, glError, __LINE__); \ exit(1); \ } \ } #define EGL_CHECK(x) \ x; \ { \ EGLint eglError = eglGetError(); \ if(eglError != EGL_SUCCESS) { \ fprintf(stderr, "eglGetError() = %i (0x%.8x) at line %i\n", eglError, eglError, __LINE__); \ exit(1); \ } \ } #endif /* MAIN_H */