polyadvent

A game engine from scratch in C
git clone git://jb55.com/polyadvent
Log | Files | Refs | README

debug.h (560B)


      1 
      2 #ifndef POLYADVENT_DEBUG_H
      3 #define POLYADVENT_DEBUG_H
      4 
      5 #include "gl.h"
      6 
      7 #include <stdio.h>
      8 
      9 void show_shader_info_log(GLuint shader);
     10 void show_program_info_log(int program);
     11 
     12 // rtassert exists in release builds, use sparingly
     13 #define rtassert(cond, msg) if (!cond) { \
     14         fprintf(stderr, "FATAL %s:%d %s\n", __FILE__, __LINE__, msg); \
     15         exit(1); \
     16     }
     17 
     18 #define unusual(...) fprintf(stderr, "UNUSUAL: " __VA_ARGS__)
     19 
     20 #ifdef DEBUG
     21 #define debug(...) fprintf(stderr, __VA_ARGS__)
     22 #else
     23 #define debug(...)
     24 #endif
     25 
     26 
     27 #endif /* POLYADVENT_DEBUG_H */