X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fprogramdata.cpp;h=65e660f038949aa41353eb287382901a28918f25;hb=d147aa8f56e6a60d80f628ffeedf16bc99b588d3;hp=563ccfbbbdb6bb79e69978f0745778732765d59f;hpb=b152e4f63170e8ccd6c9fb9397964c628fb6efeb;p=libs%2Fgl.git diff --git a/source/programdata.cpp b/source/programdata.cpp index 563ccfbb..65e660f0 100644 --- a/source/programdata.cpp +++ b/source/programdata.cpp @@ -21,6 +21,7 @@ ProgramData::ProgramData(): // Blocks are intentionally left uncopied ProgramData::ProgramData(const ProgramData &other): + uniform_slots(other.uniform_slots), uniforms(other.uniforms), last_block(0), buffer(0), @@ -36,6 +37,7 @@ ProgramData &ProgramData::operator=(const ProgramData &other) delete *i; uniforms.clear(); + uniform_slots = other.uniform_slots; for(vector::const_iterator i=other.uniforms.begin(); i!=other.uniforms.end(); ++i) uniforms.push_back((*i)->clone()); @@ -145,11 +147,21 @@ void ProgramData::uniform4(const string &name, const float *v) uniform(name, new Uniform4f(v)); } +void ProgramData::uniform(const string &name, const LinAl::Matrix &m) +{ + uniform_matrix2(name, &m(0, 0)); +} + void ProgramData::uniform_matrix2(const string &name, const float *v) { uniform(name, new UniformMatrix2x2f(v)); } +void ProgramData::uniform(const string &name, const LinAl::Matrix &m) +{ + uniform_matrix3(name, &m(0, 0)); +} + void ProgramData::uniform_matrix3(const string &name, const float *v) { uniform(name, new UniformMatrix3x3f(v));