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_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_float_array(GLuint glsl_program_num, const std::string &prefix, const std::string &key, const float *values, size_t num_values);
29 void set_uniform_vec2(GLuint glsl_program_num, const std::string &prefix, const std::string &key, const float *values);
30 void set_uniform_vec3(GLuint glsl_program_num, const std::string &prefix, const std::string &key, const float *values);
34 virtual bool needs_linear_light() const { return true; }
35 virtual bool needs_srgb_primaries() const { return true; }
36 virtual bool needs_many_samples() const { return false; }
37 virtual bool needs_mipmaps() const { return false; }
39 virtual std::string output_convenience_uniforms() const;
40 virtual std::string output_fragment_shader() = 0;
42 virtual void set_uniforms(GLuint glsl_program_num, const std::string& prefix, unsigned *sampler_num);
44 // Neither of these take ownership.
45 bool set_int(const std::string&, int value);
46 bool set_float(const std::string &key, float value);
47 bool set_vec2(const std::string &key, const float *values);
48 bool set_vec3(const std::string &key, const float *values);
51 // Neither of these take ownership.
52 void register_int(const std::string &key, int *value);
53 void register_float(const std::string &key, float *value);
54 void register_vec2(const std::string &key, float *values);
55 void register_vec3(const std::string &key, float *values);
56 void register_1d_texture(const std::string &key, float *values, size_t size);
57 void invalidate_1d_texture(const std::string &key);
67 std::map<std::string, int *> params_int;
68 std::map<std::string, float *> params_float;
69 std::map<std::string, float *> params_vec2;
70 std::map<std::string, float *> params_vec3;
71 std::map<std::string, Texture1D> params_tex_1d;
74 #endif // !defined(_EFFECT_H)