From: Mikko Rasa Date: Thu, 26 Apr 2018 16:34:02 +0000 (+0300) Subject: Allow setting uniform values using a Uniform object X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=133fe7352831197c9ec59f923c1126651d80edcb;p=libs%2Fgl.git Allow setting uniform values using a Uniform object --- diff --git a/source/programdata.cpp b/source/programdata.cpp index ca6ae5ba..9a531be2 100644 --- a/source/programdata.cpp +++ b/source/programdata.cpp @@ -104,6 +104,11 @@ void ProgramData::uniform(const string &name, Uniform *uni) } } +void ProgramData::uniform(const string &name, const Uniform &u) +{ + uniform(name, u.clone()); +} + void ProgramData::uniform(const string &name, int v) { uniform(name, new Uniform1i(v)); diff --git a/source/programdata.h b/source/programdata.h index fe907d5c..0851f5f6 100644 --- a/source/programdata.h +++ b/source/programdata.h @@ -141,6 +141,7 @@ public: private: void uniform(const std::string &, Uniform *); public: + void uniform(const std::string &, const Uniform &); void uniform(const std::string &, int); void uniform(const std::string &, float); void uniform(const std::string &, int, int);