1 #ifndef _MOVIT_EFFECT_UTIL_H
2 #define _MOVIT_EFFECT_UTIL_H 1
4 // Utilities that are often useful for implementing Effect instances,
5 // but don't need to be included from effect.h.
22 // Convenience functions that deal with prepending the prefix.
23 // Note that using EffectChain::register_uniform_*() is more efficient
24 // than calling these from set_gl_state().
25 GLint get_uniform_location(GLuint glsl_program_num, const std::string &prefix, const std::string &key);
26 void set_uniform_int(GLuint glsl_program_num, const std::string &prefix, const std::string &key, int value);
27 void set_uniform_float(GLuint glsl_program_num, const std::string &prefix, const std::string &key, float value);
28 void set_uniform_vec2(GLuint glsl_program_num, const std::string &prefix, const std::string &key, const float *values);
29 void set_uniform_vec3(GLuint glsl_program_num, const std::string &prefix, const std::string &key, const float *values);
30 void set_uniform_vec4(GLuint glsl_program_num, const std::string &prefix, const std::string &key, const float *values);
31 void set_uniform_vec2_array(GLuint glsl_program_num, const std::string &prefix, const std::string &key, const float *values, size_t num_values);
32 void set_uniform_vec4_array(GLuint glsl_program_num, const std::string &prefix, const std::string &key, const float *values, size_t num_values);
33 void set_uniform_mat3(GLuint glsl_program_num, const std::string &prefix, const std::string &key, const Eigen::Matrix3d &matrix);
37 #endif // !defined(_MOVIT_EFFECT_UTIL_H)