X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fprogram.h;h=63d43e0f800f65b9ac58b7df6017c6bf7b51588f;hb=249ce48a66074d0f0b6e23caeb77fad7c3d238ae;hp=ad37fb65bfca60d51094e741732faf274da7e1ef;hpb=76e338af116120d93d082ad247591ec9adad9233;p=libs%2Fgl.git diff --git a/source/program.h b/source/program.h index ad37fb65..63d43e0f 100644 --- a/source/program.h +++ b/source/program.h @@ -10,38 +10,33 @@ Distributed under the LGPL #include #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::Loader + class Loader: public DataFile::ObjectLoader { - private: - Program &prog; - public: Loader(Program &); 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(); }; @@ -56,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; } @@ -65,9 +60,6 @@ public: int get_uniform_location(const std::string &) const; static void unbind(); - -private: - void maybe_bind(); }; } // namespace GL