From 133fe7352831197c9ec59f923c1126651d80edcb Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 26 Apr 2018 19:34:02 +0300 Subject: [PATCH] Allow setting uniform values using a Uniform object --- source/programdata.cpp | 5 +++++ source/programdata.h | 1 + 2 files changed, 6 insertions(+) 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); -- 2.45.2