9 // Can alias on a float[2].
11 Point2D(float x, float y)
17 // Can alias on a float[3].
19 RGBTriplet(float r, float g, float b)
25 // Convenience functions that deal with prepending the prefix.
26 void set_uniform_float(GLuint glsl_program_num, const std::string &prefix, const std::string &key, float value);
27 void set_uniform_vec2(GLuint glsl_program_num, const std::string &prefix, const std::string &key, const float *values);
28 void set_uniform_vec3(GLuint glsl_program_num, const std::string &prefix, const std::string &key, const float *values);
32 virtual bool needs_linear_light() { return true; }
33 virtual bool needs_srgb_primaries() { return true; }
34 virtual bool needs_many_samples() { return false; }
35 virtual bool needs_mipmaps() { return false; }
37 virtual std::string output_convenience_uniforms();
38 virtual std::string output_vertex_shader();
39 virtual std::string output_fragment_shader() = 0;
41 virtual void set_uniforms(GLuint glsl_program_num, const std::string& prefix);
43 // Neither of these take ownership.
44 bool set_int(const std::string&, int value);
45 bool set_float(const std::string &key, float value);
46 bool set_vec2(const std::string &key, const float *values);
47 bool set_vec3(const std::string &key, const float *values);
50 // Neither of these take ownership.
51 void register_int(const std::string &key, int *value);
52 void register_float(const std::string &key, float *value);
53 void register_vec2(const std::string &key, float *values);
54 void register_vec3(const std::string &key, float *values);
57 std::map<std::string, int *> params_int;
58 std::map<std::string, float *> params_float;
59 std::map<std::string, float *> params_vec2;
60 std::map<std::string, float *> params_vec3;
63 #endif // !defined(_EFFECT_H)