Horizon
gl_util.hpp
1 #include <epoxy/gl.h>
2 
3 namespace horizon {
4 // GLuint gl_create_shader (int type, char *src);
5 GLuint gl_create_program_from_resource(const char *vertex_resource, const char *fragment_resource,
6  const char *geometry_resource);
7 #define GET_LOC(d, loc) \
8  do { \
9  d->loc##_loc = glGetUniformLocation(d->program, #loc); \
10  } while (0);
11 
12 #define GET_LOC2(d, loc) \
13  do { \
14  (d).loc##_loc = glGetUniformLocation((d).program, #loc); \
15  } while (0);
16 
17 #define GL_CHECK_ERROR \
18  if (int e = glGetError()) { \
19  std::cout << "gl error " << e << " in " << __FILE__ << ":" << __LINE__ << std::endl; \
20  abort(); \
21  }
22 } // namespace horizon
Definition: block.cpp:7