]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/program.h
Rename size to array_size in Program variable info structs
[libs/gl.git] / source / core / program.h
index 052236270d4b54b3d0ca2b29ebecc908f8f82ea5..33413eb01da23eb035fa0fc04e1fc5c488d7c323 100644 (file)
@@ -5,12 +5,14 @@
 #include <vector>
 #include <msp/datafile/objectloader.h>
 #include "bindable.h"
+#include "datatype.h"
 #include "gl.h"
 #include "vertexformat.h"
 
 namespace Msp {
 namespace GL {
 
+class GlslModule;
 class Module;
 class Shader;
 
@@ -63,10 +65,10 @@ public:
                std::string name;
                const UniformBlockInfo *block;
                unsigned location;
-               unsigned size;
+               unsigned array_size;
                unsigned array_stride;
                unsigned matrix_stride;
-               GLenum type;
+               DataType type;
        };
 
        struct UniformBlockInfo
@@ -82,8 +84,8 @@ public:
        {
                std::string name;
                unsigned location;
-               unsigned size;
-               GLenum type;
+               unsigned array_size;
+               DataType type;
        };
 
        typedef std::map<std::string, UniformInfo> UniformMap;
@@ -92,7 +94,7 @@ public:
 
 private:
        unsigned id;
-       std::vector<unsigned> shader_ids;
+       std::vector<unsigned> stage_ids;
        const Module *module;
        bool linked;
        UniformBlockMap uniform_blocks;
@@ -119,19 +121,23 @@ public:
        virtual ~Program();
 
        void add_stages(const Module &, const std::map<std::string, int> & = std::map<std::string, int>());
+private:
+       unsigned add_stage(GLenum);
+       void add_glsl_stages(const GlslModule &, const std::map<std::string, int> &);
+       void compile_glsl_stage(unsigned);
 
+public:
        DEPRECATED void attach_shader(Shader &shader);
        DEPRECATED void attach_shader_owned(Shader *shader);
        DEPRECATED void detach_shader(Shader &shader);
        DEPRECATED const std::vector<Shader *> &get_attached_shaders() const;
 
        DEPRECATED void bind_attribute(unsigned, const std::string &);
-       DEPRECATED void bind_attribute(VertexComponent, const std::string &);
+       DEPRECATED void bind_attribute(VertexAttribute, const std::string &);
        DEPRECATED 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();