1 #include "util/gl_inc.h"
9 GLuint gl_create_program_from_resource(
const char *vertex_resource,
const char *fragment_resource,
10 const char *geometry_resource);
12 void gl_show_error(
const std::string &s);
13 void gl_color_to_uniform_3f(GLuint loc,
const class Color &c);
14 void gl_color_to_uniform_4f(GLuint loc,
const class Color &c,
float alpha = 1);
15 GLint gl_clamp_samples(GLint samples);
17 void gl_mat3_to_array(std::array<float, 12> &dest,
const glm::mat3 &src);
18 std::array<float, 4> gl_array_from_color(
const Color &c);
20 #define GET_LOC(d, loc) \
22 d->loc##_loc = glGetUniformLocation(d->program, #loc); \
25 #define GET_LOC2(d, loc) \
27 (d).loc##_loc = glGetUniformLocation((d).program, #loc); \
30 #define GL_CHECK_ERROR \
31 if (int e = glGetError()) { \
32 std::stringstream ss; \
33 ss << "gl error " << e << " in " << __FILE__ << ":" << __LINE__; \
34 gl_show_error(ss.str()); \
Definition: common.hpp:267