X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=util.h;h=a6ca0e8dc080185094e5fd01efa3908002c36e7e;hp=0d499453048d2e9bebb2ea50c8d56fd75c01c67d;hb=4f8d4ab8bd84bfbe7329a1afae3034ec2937bbb5;hpb=02d19b8323a1b626acd9d3b4f08bb63f51149cf3 diff --git a/util.h b/util.h index 0d49945..a6ca0e8 100644 --- a/util.h +++ b/util.h @@ -1,7 +1,23 @@ #ifndef _UTIL_H #define _UTIL_H 1 +#include +#include + +#include + +#include + // assumes h in [0, 2pi> or [-pi, pi> void hsv2rgb(float h, float s, float v, float *r, float *g, float *b); +std::string read_file(const std::string &filename); +GLhandleARB compile_shader(const std::string &shader_src, GLenum type); + +#ifdef NDEBUG +#define check_error() +#else +#define check_error() { int err = glGetError(); if (err != GL_NO_ERROR) { printf("GL error 0x%x at line %d\n", err, __LINE__); exit(1); } } +#endif + #endif // !defined(_UTIL_H)