]> git.tdb.fi Git - libs/gl.git/commitdiff
Allow setting uniform values using a Uniform object
authorMikko Rasa <tdb@tdb.fi>
Thu, 26 Apr 2018 16:34:02 +0000 (19:34 +0300)
committerMikko Rasa <tdb@tdb.fi>
Thu, 26 Apr 2018 16:34:02 +0000 (19:34 +0300)
source/programdata.cpp
source/programdata.h

index ca6ae5ba44dbae3ee8b5ee992b6c85ff785fde5f..9a531be2fecefb28dfb38de3375b8dc00c7f6249 100644 (file)
@@ -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));
index fe907d5cb65e21cfecbd5b01f3ec5bb2286f1c4a..0851f5f6a007396ab5a37a9c5968490ab31b5d10 100644 (file)
@@ -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);