X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fprogram.h;h=63d43e0f800f65b9ac58b7df6017c6bf7b51588f;hb=249ce48a66074d0f0b6e23caeb77fad7c3d238ae;hp=818e72be1174d4a0464bc91b5a691d8f54efd602;hpb=927a1aa0a3a27e463ec0efc08bd08e7c4e969909;p=libs%2Fgl.git diff --git a/source/program.h b/source/program.h index 818e72be..63d43e0f 100644 --- a/source/program.h +++ b/source/program.h @@ -11,24 +11,22 @@ Distributed under the LGPL #include #include #include +#include "bindable.h" #include "gl.h" -#include "types.h" namespace Msp { namespace GL { class Shader; -class Program +class Program: public Bindable { private: - uint id; + unsigned id; std::list shaders; bool del_shaders; bool linked; - static const Program *cur_prog; - public: class Loader: public DataFile::ObjectLoader { @@ -38,7 +36,7 @@ public: private: void vertex_shader(const std::string &); void fragment_shader(const std::string &); - void attribute(uint, const std::string &); + void attribute(unsigned, const std::string &); virtual void finish(); }; @@ -53,7 +51,7 @@ public: void detach_shader(Shader &shader); const std::list &get_shaders() const { return shaders; } void set_del_shaders(bool); - void bind_attribute(uint, const std::string &); + void bind_attribute(unsigned, const std::string &); void link(); int get_param(GLenum param) const; bool get_linked() const { return linked; } @@ -62,9 +60,6 @@ public: int get_uniform_location(const std::string &) const; static void unbind(); - -private: - void maybe_bind(); }; } // namespace GL