BambooIsland: C:/Users/easterbunny/Desktop/Echtzeitgraphik-LU/trunk/src/common_gl.h Source File

BambooIsland Abgabe 2

- Main Page
- Related Pages
- Classes
- Files

- File List

# C:/Users/easterbunny/Desktop/Echtzeitgraphik-LU/trunk/src/common_gl.h

    00001 #ifndef __COMMON_OPENGL_HEADER
    00002 #define __COMMON_OPENGL_HEADER
    00003
    00004 //include extension wrapper - important: necessary to include BEFORE glfw to prevent compile errors
    00005 #include <GL/glew.h>
    00006
    00007 //include glfw
    00008 #define GLFW_NO_GLU
    00009 #include <GL/glfw.h>
    00010
    00011 //to detect unallowed use of old opengl-functions (functions which are NOT in the core profile), we had an own header which redefines the function calls to emit compile errors
    00012 #include "prevent_old_opengl.h"
    00013
    00014 //helper function for translating glerrors to char*
    00015 inline const char *translateGLerror(GLenum error)
    00016 {
    00017     switch (error)
    00018     {
    00019     case GL_INVALID_ENUM:
    00020         return "GL_INVALID_ENUM";
    00021         break;
    00022     case GL_INVALID_VALUE:
    00023         return "GL_INVALID_VALUE";
    00024         break;
    00025     case GL_INVALID_OPERATION:
    00026         return "GL_INVALID_OPERATION";
    00027         break;
    00028     case GL_STACK_OVERFLOW:
    00029         return "GL_STACK_OVERFLOW";
    00030         break;
    00031     case GL_STACK_UNDERFLOW:
    00032         return "GL_STACK_UNDERFLOW";
    00033         break;
    00034     case GL_OUT_OF_MEMORY:
    00035         return "GL_OUT_OF_MEMORY";
    00036         break;
    00037     case GL_TABLE_TOO_LARGE:
    00038         return "GL_TABLE_TOO_LARGE";
    00039         break;
    00040     default:
    00041         return "unknown GL error";
    00042         break;
    00043     }
    00044 };
    00045
    00046 #endif

All Classes Functions Variables Enumerations Enumerator