]> git.tdb.fi Git - libs/gl.git/blobdiff - source/program.h
Move Program::bind to its proper place
[libs/gl.git] / source / program.h
index 4ff3f53a41c149a2e2d411d25cd52f4ae6873260..7e9676d36548972c2c30f10d143843f45666d6db 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of libmspgl
-Copyright © 2007 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #ifndef MSP_GL_PROGRAM_H_
 #define MSP_GL_PROGRAM_H_
 
@@ -50,17 +43,32 @@ public:
                bool specular;
                bool normalmap;
                bool shadow;
+               bool reflection;
+               bool transform;
 
                StandardFeatures();
 
                std::string create_flags() const;
        };
 
+       struct UniformInfo
+       {
+               std::string name;
+               int location;
+               int size;
+               GLenum type;
+       };
+
+       typedef std::list<Shader *> ShaderList;
+       typedef std::map<std::string, UniformInfo> UniformMap;
+
 private:
        unsigned id;
-       std::list<Shader *> shaders;
-       bool del_shaders;
+       ShaderList shaders;
+       ShaderList owned_data;
        bool linked;
+       UniformMap uniforms;
+       unsigned uniform_layout_hash;
 
 public:
        Program();
@@ -72,20 +80,24 @@ public:
        virtual ~Program();
 
        void attach_shader(Shader &shader);
+       void attach_shader_owned(Shader *shader);
        void detach_shader(Shader &shader);
        void add_standard_shaders(const StandardFeatures &);
 private:
        static std::string process_standard_source(const char **, const std::string &);
 public:
-       const std::list<Shader *> &get_shaders() const { return shaders; }
-       void set_del_shaders(bool);
+       const ShaderList &get_shaders() const { return shaders; }
+
        void bind_attribute(unsigned, const std::string &);
+
        void link();
        bool is_linked() const { return linked; }
        std::string get_info_log() const;
-       void bind() const;
+
+       unsigned get_uniform_layout_hash() const { return uniform_layout_hash; }
        int get_uniform_location(const std::string &) const;
 
+       void bind() const;
        static void unbind();
 };