X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fprogram.h;h=63d43e0f800f65b9ac58b7df6017c6bf7b51588f;hb=42ace9ac1350d3ae009bdd2fb335ac1e57d1b36b;hp=fde4d85439a2cfe9e7cb82a62aebd965f111d082;hpb=dc1d1159a61f378bda11e5989ad694a86b9a3c77;p=libs%2Fgl.git diff --git a/source/program.h b/source/program.h index fde4d854..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 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,18 +51,15 @@ 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; } std::string get_info_log() const; - void bind(); + void bind() const; int get_uniform_location(const std::string &) const; static void unbind(); - -private: - void maybe_bind(); }; } // namespace GL