]> git.sesse.net Git - movit/blob - util.h
Output convenience uniforms per effect. Also, do not rely on the preprocessor support...
[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 #include <GL/gl.h>
10
11 // assumes h in [0, 2pi> or [-pi, pi>
12 void hsv2rgb(float h, float s, float v, float *r, float *g, float *b);
13
14 std::string read_file(const std::string &filename);
15 GLhandleARB compile_shader(const std::string &shader_src, GLenum type);
16
17 #ifdef NDEBUG
18 #define check_error()
19 #else
20 #define check_error() { int err = glGetError(); if (err != GL_NO_ERROR) { printf("GL error 0x%x at line %d\n", err, __LINE__); exit(1); } }
21 #endif
22
23 #endif // !defined(_UTIL_H)