]> git.sesse.net Git - movit/blob - util.h
Move slurping of files into its own function.
[movit] / util.h
1 #ifndef _UTIL_H
2 #define _UTIL_H 1
3
4 #include <stdio.h>
5 #include <stdlib.h>
6
7 #include <string>
8
9 // assumes h in [0, 2pi> or [-pi, pi>
10 void hsv2rgb(float h, float s, float v, float *r, float *g, float *b);
11
12 std::string read_file(const std::string &filename);
13
14 #ifdef NDEBUG
15 #define check_error()
16 #else
17 #define check_error() { int err = glGetError(); if (err != GL_NO_ERROR) { printf("GL error 0x%x at line %d\n", err, __LINE__); exit(1); } }
18 #endif
19
20 #endif // !defined(_UTIL_H)