Light::unbind_from(i);
}
+const Light *Lighting::get_attached_light(unsigned i) const
+{
+ return i<lights.size() ? lights[i] : 0;
+}
+
void Lighting::update_shader_data(ProgramData &shdata, const Matrix &view_matrix) const
{
shdata.uniform("ambient_color", ambient);
/** Detaches a light source. */
void detach(unsigned);
+ /** Returns an attached light. If no light is attached at that index, null
+ is returned. */
+ const Light *get_attached_light(unsigned) const;
+
/** Updates a ProgramData object with the uniforms for the Lighting,
including all attached light sources. A view matrix must be passed in. */
void update_shader_data(ProgramData &, const Matrix &) const;
void set_technique(unsigned, const Technique *);
const Technique *get_technique(unsigned = 0) const;
+ unsigned get_n_lods() const { return lods.size(); }
virtual const Geometry::BoundingSphere<float, 3> *get_bounding_sphere() const { return &bounding_sphere; }
void attach_shader(Shader &shader);
void attach_shader_owned(Shader *shader);
void detach_shader(Shader &shader);
- const ShaderList &get_shaders() const { return shaders; }
+ const ShaderList &get_attached_shaders() const { return shaders; }
void bind_attribute(unsigned, const std::string &);
void bind_attribute(VertexComponent, const std::string &);
bind_attachment(attch);
}
+const Texture *Texturing::get_attached_texture(unsigned i) const
+{
+ return i<attachments.size() ? attachments[i] : 0;
+}
+
void Texturing::bind_attachment(unsigned i) const
{
if(const Texture *tex = attachments[i])
void detach(unsigned);
private:
void set_attachment(unsigned, const Texture *);
+public:
+ const Texture *get_attached_texture(unsigned) const;
+
+private:
void bind_attachment(unsigned) const;
static void unbind_attachment(unsigned);