]> git.tdb.fi Git - libs/gl.git/blobdiff - source/programdata.h
Check the flat qualifier from the correct member
[libs/gl.git] / source / programdata.h
diff --git a/source/programdata.h b/source/programdata.h
deleted file mode 100644 (file)
index f51ad78..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-#ifndef MSP_GL_PROGRAMDATA_H_
-#define MSP_GL_PROGRAMDATA_H_
-
-#include <map>
-#include <msp/datafile/objectloader.h>
-#include "program.h"
-#include "vector.h"
-
-namespace Msp {
-namespace GL {
-
-class Buffer;
-class Matrix;
-class Uniform;
-class UniformBlock;
-struct Color;
-
-/**
-Stores uniform variables for shader programs.  The uniforms are stored in a
-program-independent way, and UniformBlocks are created to match the uniform
-layouts of different programs.  If multiple programs have the same layout, the
-same block is used for them.
-
-The class is optimized for an access pattern where the set of uniforms and
-programs stays constants, with only the values changing.
-*/
-class ProgramData
-{
-public:
-       class Loader: public DataFile::ObjectLoader<ProgramData>
-       {
-       public:
-               Loader(ProgramData &);
-       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:
-       enum Changes
-       {
-               NO_CHANGES,
-               VALUES_CHANGED,
-               KEYS_CHANGED
-       };
-
-       struct Block
-       {
-               Changes changes;
-               UniformBlock *block;
-               std::map<unsigned, const Uniform *const *> uniforms;
-
-               Block();
-       };
-
-       typedef std::map<std::string, Uniform *> UniformMap;
-       typedef std::map<unsigned, Block> BlockMap;
-
-       // XXX All these mutables are a bit silly, but I'm out of better ideas
-       UniformMap uniforms;
-       mutable BlockMap blocks;
-       mutable UniformBlock *last_block;
-       mutable Buffer *buffer;
-       mutable Changes changes;
-
-public:
-       ProgramData();
-       ProgramData(const ProgramData &);
-       ProgramData &operator=(const ProgramData &);
-       ~ProgramData();
-
-private:
-       void uniform(const std::string &, Uniform *);
-public:
-       void uniform(const std::string &, int);
-       void uniform(const std::string &, float);
-       void uniform(const std::string &, float, float);
-       void uniform2(const std::string &, const float *);
-       void uniform(const std::string &, float, float, float);
-       void uniform(const std::string &, const Vector3 &);
-       void uniform3(const std::string &, const float *);
-       void uniform(const std::string &, float, float, float, float);
-       void uniform(const std::string &, const Vector4 &);
-       void uniform(const std::string &, const Color &);
-       void uniform4(const std::string &, const float *);
-       void uniform_matrix2(const std::string &, const float *);
-       void uniform_matrix3(const std::string &, const float *);
-       void uniform(const std::string &, const Matrix &);
-       void uniform_matrix4(const std::string &, const float *);
-       void uniform1_array(const std::string &, unsigned, const float *);
-       void uniform2_array(const std::string &, unsigned, const float *);
-       void uniform3_array(const std::string &, unsigned, const float *);
-       void uniform4_array(const std::string &, unsigned, const float *);
-       void uniform_matrix4_array(const std::string &, unsigned, const float *);
-
-private:
-       void find_uniforms_for_block(Block &, const Program::UniformBlockInfo &) const;
-       UniformBlock *create_block(const Program::UniformBlockInfo &) const;
-       const UniformBlock *get_block(const Program &, const Program::UniformBlockInfo *) const;
-
-public:
-       /** Returns a UniformBlock matching the program's layout.  If name is empty,
-       uniforms for the default uniform block (outside any uniform block
-       declarations) are returned. */
-       const UniformBlock *get_block(const Program &prog, const std::string &name) const;
-
-       /// Creates blocks for the currently bound program and applies them.
-       void apply() const;
-};
-
-} // namespace GL
-} // namespace Msp
-
-#endif