]> git.tdb.fi Git - libs/gl.git/blobdiff - source/program.h
Rework Bind and enable it to restore the old binding
[libs/gl.git] / source / program.h
index af506fe8c57b1128a5354e1515c20059bcccdb1e..63d43e0f800f65b9ac58b7df6017c6bf7b51588f 100644 (file)
@@ -11,6 +11,7 @@ Distributed under the LGPL
 #include <list>
 #include <string>
 #include <msp/datafile/objectloader.h>
+#include "bindable.h"
 #include "gl.h"
 
 namespace Msp {
@@ -18,7 +19,7 @@ namespace GL {
 
 class Shader;
 
-class Program
+class Program: public Bindable<Program>
 {
 private:
        unsigned id;
@@ -26,8 +27,6 @@ private:
        bool del_shaders;
        bool linked;
 
-       static const Program *cur_prog;
-
 public:
        class Loader: public DataFile::ObjectLoader<Program>
        {
@@ -61,9 +60,6 @@ public:
        int get_uniform_location(const std::string &) const;
 
        static void unbind();
-
-private:
-       void maybe_bind();
 };
 
 } // namespace GL