]> git.tdb.fi Git - libs/gl.git/blobdiff - source/program.h
Generalize VertexBuffer into Buffer with support for other types as well
[libs/gl.git] / source / program.h
index f007fb3a5d3636b72820ffb9b6656e7860172977..ad37fb65bfca60d51094e741732faf274da7e1ef 100644 (file)
@@ -10,8 +10,8 @@ Distributed under the LGPL
 
 #include <list>
 #include <string>
-#include <GL/gl.h>
 #include <msp/datafile/loader.h>
+#include "gl.h"
 #include "types.h"
 
 namespace Msp {
@@ -27,7 +27,7 @@ private:
        bool del_shaders;
        bool linked;
 
-       static Program *cur_prog;
+       static const Program *cur_prog;
 
 public:
        class Loader: public DataFile::Loader
@@ -37,34 +37,32 @@ public:
 
        public:
                Loader(Program &);
-               ~Loader();
 
        private:
                void vertex_shader(const std::string &);
                void fragment_shader(const std::string &);
+               void attribute(uint, const std::string &);
+               virtual void finish();
        };
 
        Program();
        Program(const std::string &, const std::string &);
+private:
+       void init();
+public:
        virtual ~Program();
 
        void attach_shader(Shader &shader);
        void detach_shader(Shader &shader);
        const std::list<Shader *> &get_shaders() const { return shaders; }
        void set_del_shaders(bool);
-       void bind_attribute(int, const std::string &);
-       bool link();
+       void bind_attribute(uint, const std::string &);
+       void link();
        int get_param(GLenum param) const;
        bool get_linked() const { return linked; }
        std::string get_info_log() const;
-       void bind();
+       void bind() const;
        int get_uniform_location(const std::string &) const;
-       void uniform(int, int);
-       void uniform(int, float);
-       void uniform(int, float, float);
-       void uniform(int, float, float, float);
-       void uniform(int, float, float, float, float);
-       void uniform_matrix4(int, const float *);
 
        static void unbind();