X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fprogram.h;h=af506fe8c57b1128a5354e1515c20059bcccdb1e;hb=f17794d55923d4fb4f63e9d082d8d84a735a04e8;hp=fde4d85439a2cfe9e7cb82a62aebd965f111d082;hpb=dc1d1159a61f378bda11e5989ad694a86b9a3c77;p=libs%2Fgl.git diff --git a/source/program.h b/source/program.h index fde4d854..af506fe8 100644 --- a/source/program.h +++ b/source/program.h @@ -10,9 +10,8 @@ Distributed under the LGPL #include #include -#include +#include #include "gl.h" -#include "types.h" namespace Msp { namespace GL { @@ -22,26 +21,23 @@ class Shader; class Program { private: - uint id; + unsigned id; std::list shaders; bool del_shaders; bool linked; - static Program *cur_prog; + 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,12 +52,12 @@ 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();