i->value = i->value->clone();
}
+ProgramData::ProgramData(const ProgramData &other, const Program *p):
+ tied_program(p),
+ last_block(0),
+ buffer(0),
+ dirty(0)
+{
+ if(tied_program)
+ {
+ for(vector<NamedUniform>::const_iterator i=other.uniforms.begin(); i!=other.uniforms.end(); ++i)
+ tied_program->get_uniform_info(i->name);
+ }
+
+ uniforms = other.uniforms;
+ for(vector<NamedUniform>::iterator i=uniforms.begin(); i!=uniforms.end(); ++i)
+ i->value = i->value->clone();
+}
+
ProgramData &ProgramData::operator=(const ProgramData &other)
{
tied_program = other.tied_program;
public:
ProgramData(const Program * = 0);
ProgramData(const ProgramData &);
+ ProgramData(const ProgramData &, const Program *);
ProgramData &operator=(const ProgramData &);
~ProgramData();
void RenderPass::Loader::init()
{
- add("shader", &RenderPass::shprog);
+ add("shader", &Loader::shader);
add("material", &Loader::material_inline);
add("material", &Loader::material);
add("material_slot", &RenderPass::material_slot);
obj.finalize_material();
}
+void RenderPass::Loader::shader(const string &n)
+{
+ obj.shprog = &get_collection().get<Program>(n);
+ if(obj.shdata)
+ obj.shdata = new ProgramData(*obj.shdata, obj.shprog);
+ if(obj.material)
+ obj.finalize_material();
+}
+
void RenderPass::Loader::texunit(unsigned i)
{
if(!obj.texturing)
void material_inline();
void material(const std::string &);
+ void shader(const std::string &);
void texunit(unsigned);
void texunit_auto(const std::string &);
void texunit_named(unsigned, const std::string &);