GPUdefs.h 1.01 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
/*
 *	(c) LSIIT, UMR CNRS/UdS
 *	Authors: F. Larue.
 *
 *	See licence.txt for additional information.
 */


#include <GL/glew.h>
#ifdef _WIN32
    #include <windows.h>
#endif
#include <GL/gl.h>
14 15 16 17 18 19 20 21 22 23 24 25 26


#ifdef NDEBUG

#define gpuAssert( expression ) expression

#else

#include <assert.h>
#include <stdio.h>

#define gpuAssert( expression )                                 \
{                                                               \
27
    glGetError();                                               \
28 29 30 31 32 33 34 35 36 37 38
    expression;                                                 \
    GLenum err = glGetError();                                  \
    if( err != GL_NO_ERROR )                                    \
    {                                                           \
        const GLubyte* errStr = glewGetErrorString( err );      \
        printf( "gpuAssert( %s ): %s\n", #expression, errStr ); \
        assert( err == GL_NO_ERROR );                           \
    }                                                           \
}

#endif