-#include <assert.h>
-#include "effect.h"
-#include "effect_chain.h"
-#include "util.h"
-
-#include <GL/gl.h>
-#include <GL/glext.h>
-
-GLint get_uniform_location(GLuint glsl_program_num, const std::string &prefix, const std::string &key)
-{
- std::string name = prefix + "_" + key;
- return glGetUniformLocation(glsl_program_num, name.c_str());
-}
-
-void set_uniform_int(GLuint glsl_program_num, const std::string &prefix, const std::string &key, int value)
-{
- GLint location = get_uniform_location(glsl_program_num, prefix, key);
- if (location == -1) {
- return;
- }
- check_error();
- glUniform1i(location, value);
- check_error();
-}
-
-void set_uniform_float(GLuint glsl_program_num, const std::string &prefix, const std::string &key, float value)
-{
- GLint location = get_uniform_location(glsl_program_num, prefix, key);
- if (location == -1) {
- return;
- }
- check_error();
- glUniform1f(location, value);
- check_error();
-}