]> git.tdb.fi Git - libs/gl.git/blobdiff - source/program.h
Check the flat qualifier from the correct member
[libs/gl.git] / source / program.h
diff --git a/source/program.h b/source/program.h
deleted file mode 100644 (file)
index 2906fc1..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-#ifndef MSP_GL_PROGRAM_H_
-#define MSP_GL_PROGRAM_H_
-
-#include <string>
-#include <vector>
-#include <msp/datafile/objectloader.h>
-#include "bindable.h"
-#include "gl.h"
-#include "programbuilder.h"
-#include "vertexformat.h"
-
-namespace Msp {
-namespace GL {
-
-class Shader;
-
-/**
-A complete shader program.  Programs can be assembled of individual Shaders or
-generated with a set of standard features.
-*/
-class Program: public Bindable<Program>
-{
-public:
-       class Loader: public DataFile::ObjectLoader<Program>
-       {
-       public:
-               Loader(Program &);
-
-       private:
-               virtual void finish();
-
-               void attribute(unsigned, const std::string &);
-               void fragment_shader(const std::string &);
-               void geometry_shader(const std::string &);
-               void standard();
-               void vertex_shader(const std::string &);
-       };
-
-       typedef unsigned LayoutHash;
-       struct UniformBlockInfo;
-
-       struct UniformInfo
-       {
-               std::string name;
-               const UniformBlockInfo *block;
-               unsigned location;
-               unsigned size;
-               unsigned array_stride;
-               unsigned matrix_stride;
-               GLenum type;
-       };
-
-       struct UniformBlockInfo
-       {
-               std::string name;
-               unsigned data_size;
-               int bind_point;
-               std::vector<const UniformInfo *> uniforms;
-               LayoutHash layout_hash;
-       };
-
-       struct AttributeInfo
-       {
-               std::string name;
-               unsigned location;
-               unsigned size;
-               GLenum type;
-       };
-
-       typedef std::vector<Shader *> ShaderList;
-       typedef std::map<std::string, UniformInfo> UniformMap;
-       typedef std::map<std::string, UniformBlockInfo> UniformBlockMap;
-       typedef std::map<std::string, AttributeInfo> AttributeMap;
-
-private:
-       unsigned id;
-       ShaderList shaders;
-       ShaderList owned_data;
-       bool linked;
-       UniformBlockMap uniform_blocks;
-       UniformMap uniforms;
-       LayoutHash uniform_layout_hash;
-       AttributeMap attributes;
-
-public:
-       /// Constructs an empty Program with no Shaders attached.
-       Program();
-
-       /// Constructs a Program with standard features.
-       DEPRECATED Program(const ProgramBuilder::StandardFeatures &);
-
-       /// Constructs a Program from unified source code using ProgramCompiler.
-       Program(const std::string &);
-
-       /// Constructs a Program from vertex and fragment shader source code.
-       Program(const std::string &, const std::string &);
-
-private:
-       void init();
-public:
-       virtual ~Program();
-
-       void attach_shader(Shader &shader);
-       void attach_shader_owned(Shader *shader);
-       void detach_shader(Shader &shader);
-       const ShaderList &get_attached_shaders() const { return shaders; }
-
-       void bind_attribute(unsigned, const std::string &);
-       void bind_attribute(VertexComponent, const std::string &);
-       void bind_fragment_data(unsigned, const std::string &);
-
-       void link();
-private:
-       static void require_type(GLenum);
-       void query_uniforms();
-       void query_uniform_blocks(const std::vector<UniformInfo *> &);
-       void query_attributes();
-       static LayoutHash compute_layout_hash(const std::vector<const UniformInfo *> &);
-       static bool uniform_location_compare(const UniformInfo *, const UniformInfo *);
-public:
-       bool is_linked() const { return linked; }
-       std::string get_info_log() const;
-
-       LayoutHash get_uniform_layout_hash() const { return uniform_layout_hash; }
-       const UniformBlockMap &get_uniform_blocks() const { return uniform_blocks; }
-       const UniformBlockInfo &get_uniform_block_info(const std::string &) const;
-       const UniformMap &get_uniforms() const { return uniforms; }
-       const UniformInfo &get_uniform_info(const std::string &) const;
-       int get_uniform_location(const std::string &) const;
-       const AttributeMap &get_attributes() const { return attributes; }
-       const AttributeInfo &get_attribute_info(const std::string &) const;
-       int get_attribute_location(const std::string &) const;
-
-       void bind() const;
-       static void unbind();
-};
-
-} // namespace GL
-} // namespace Msp
-
-#endif