]> git.tdb.fi Git - libs/gl.git/blobdiff - source/programdata.h
Inherit Loaders from the ObjectLoader classes
[libs/gl.git] / source / programdata.h
index 495ea22f3a5be143fe498c1d9ce8ae7ee5bb91d3..591ffee347f7dfe6bf97a3e1ef9b9772f87c101a 100644 (file)
@@ -9,6 +9,7 @@ Distributed under the LGPL
 #define MSP_GL_PROGRAMDATA_H_
 
 #include <map>
+#include <msp/datafile/objectloader.h>
 
 namespace Msp {
 namespace GL {
@@ -16,8 +17,27 @@ namespace GL {
 class Program;
 class Uniform;
 
+/**
+Stores uniform variables for a shader program.
+*/
 class ProgramData
 {
+public:
+       class Loader: public DataFile::ObjectLoader<ProgramData>
+       {
+       private:
+               Program &prog;
+
+       public:
+               Loader(ProgramData &, Program &);
+       private:
+               void uniform1i(const std::string &, int);
+               void uniform1f(const std::string &, float);
+               void uniform2f(const std::string &, float, float);
+               void uniform3f(const std::string &, float, float, float);
+               void uniform4f(const std::string &, float, float, float, float);
+       };
+
 private:
        std::map<int, Uniform *> data;