X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fprogramdata.cpp;h=68820c59cc9fd0fd829792ebf547190d23c0fe9f;hb=4af69ec90120a0be828a1ae475a38674087110b5;hp=e279635f876116d1e40fce3064423e05c1e597c3;hpb=41368577ab4c4091e19d4e9cbbf8fbf2cfbdddca;p=libs%2Fgl.git diff --git a/source/programdata.cpp b/source/programdata.cpp index e279635f..68820c59 100644 --- a/source/programdata.cpp +++ b/source/programdata.cpp @@ -34,6 +34,23 @@ ProgramData::ProgramData(const ProgramData &other): 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::const_iterator i=other.uniforms.begin(); i!=other.uniforms.end(); ++i) + tied_program->get_uniform_info(i->name); + } + + uniforms = other.uniforms; + for(vector::iterator i=uniforms.begin(); i!=uniforms.end(); ++i) + i->value = i->value->clone(); +} + ProgramData &ProgramData::operator=(const ProgramData &other) { tied_program = other.tied_program; @@ -404,6 +421,12 @@ const Uniform &ProgramData::get_uniform(const string &name) const return *uniforms[i].value; } +const Uniform *ProgramData::find_uniform(const string &name) const +{ + int i = find_uniform_index(name); + return (i>=0 ? uniforms[i].value : 0); +} + bool ProgramData::uniform_name_compare(const NamedUniform &nu, const string &name) { return nu.name