RenderPass::~RenderPass()
{
delete texturing;
+ delete shdata;
}
void RenderPass::set_shader_program(const Program *prog, const ProgramData *data)
{
shprog = prog;
- shdata = data;
- shdata.keep();
+ delete shdata;
+ shdata = new ProgramData(*data);
}
void RenderPass::set_material(const Material *mat)
{
renderer.set_texturing(texturing);
renderer.set_material(material.get());
- renderer.set_shader_program(shprog, shdata.get());
+ renderer.set_shader_program(shprog, shdata);
renderer.set_reverse_winding(back_faces);
}
throw invalid_operation("RenderPass::Loader::uniforms");
RefPtr<ProgramData> shd = new ProgramData(obj.shprog);
load_sub(*shd);
- obj.shdata = shd;
+ obj.shdata = shd.release();
}
};
const Program *shprog;
- RefPtr<const ProgramData> shdata;
+ ProgramData *shdata;
RefPtr<const Material> material;
Texturing *texturing;
std::map<std::string, unsigned> tex_names;
void set_shader_program(const Program *, const ProgramData *);
const Program *get_shader_program() const { return shprog; }
- const ProgramData *get_shader_data() const { return shdata.get(); }
+ const ProgramData *get_shader_data() const { return shdata; }
void set_material(const Material *);
const Material *get_material() const { return material.get(); }
void set_texture(unsigned, const Texture *);