vrshoot

annotate src/opengl.h @ 2:334d17aed7de

visual studio project files
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 02 Feb 2014 18:36:38 +0200
parents
children
rev   line source
nuclear@0 1 #ifndef OPENGL_H_
nuclear@0 2 #define OPENGL_H_
nuclear@0 3
nuclear@0 4 #include <stdlib.h>
nuclear@0 5
nuclear@0 6 #ifdef __APPLE__
nuclear@0 7 #include "TargetConditionals.h"
nuclear@0 8
nuclear@0 9 #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
nuclear@0 10 /* iOS */
nuclear@0 11 #include <OpenGLES/ES2/gl.h>
nuclear@0 12 #include <OpenGLES/ES2/glext.h>
nuclear@0 13
nuclear@0 14 #define GL_CLAMP GL_CLAMP_TO_EDGE
nuclear@0 15 #define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES
nuclear@0 16
nuclear@0 17 #undef USE_OLDGL
nuclear@0 18
nuclear@0 19 #define GL_WRITE_ONLY GL_WRITE_ONLY_OES
nuclear@0 20 #define glMapBuffer glMapBufferOES
nuclear@0 21 #define glUnmapBuffer glUnmapBufferOES
nuclear@0 22
nuclear@0 23 #else
nuclear@0 24 /* MacOS X */
nuclear@0 25 #include <GL/glew.h>
nuclear@0 26 #include <GLUT/glut.h>
nuclear@0 27
nuclear@0 28 #define USE_OLDGL
nuclear@0 29 #endif
nuclear@0 30
nuclear@0 31 #else
nuclear@0 32 /* UNIX or Windows */
nuclear@0 33 #include <GL/glew.h>
nuclear@0 34 #include <GL/glut.h>
nuclear@0 35
nuclear@0 36 #define USE_OLDGL
nuclear@0 37 #endif
nuclear@0 38
nuclear@0 39 #ifndef GL_RGB16F
nuclear@0 40 #define GL_RGB16F 0x881b
nuclear@0 41 #endif
nuclear@0 42 #ifndef GL_RGBA16F
nuclear@0 43 #define GL_RGBA16F 0x881a
nuclear@0 44 #endif
nuclear@0 45 #ifndef GL_RGB32F
nuclear@0 46 #define GL_RGB32F 0x8815
nuclear@0 47 #endif
nuclear@0 48 #ifndef GL_RGBA32F
nuclear@0 49 #define GL_RGBA32F 0x8814
nuclear@0 50 #endif
nuclear@0 51 #ifndef GL_LUMINANCE16F
nuclear@0 52 #define GL_LUMINANCE16F 0x881e
nuclear@0 53 #endif
nuclear@0 54 #ifndef GL_LUMINANCE32F
nuclear@0 55 #define GL_LUMINANCE32F 0x8818
nuclear@0 56 #endif
nuclear@0 57
nuclear@0 58 #define CHECKGLERR \
nuclear@0 59 do { \
nuclear@0 60 int err = glGetError(); \
nuclear@0 61 if(err) { \
nuclear@0 62 fprintf(stderr, "%s:%d: OpenGL error 0x%x: %s\n", __FILE__, __LINE__, err, strglerr(err)); \
nuclear@0 63 abort(); \
nuclear@0 64 } \
nuclear@0 65 } while(0)
nuclear@0 66
nuclear@0 67 void init_opengl();
nuclear@0 68
nuclear@0 69 const char *strglerr(int err);
nuclear@0 70
nuclear@0 71 #endif // OPENGL_H_