From: Mikko Rasa Date: Fri, 24 Aug 2012 07:48:32 +0000 (+0300) Subject: Move Program::bind to its proper place X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=3137e87b72823bc4227d4382c157867b19aacb49;p=libs%2Fgl.git Move Program::bind to its proper place --- diff --git a/source/program.cpp b/source/program.cpp index f07b2015..8ca8e336 100644 --- a/source/program.cpp +++ b/source/program.cpp @@ -271,17 +271,6 @@ string Program::get_info_log() const return log; } -void Program::bind() const -{ - if(!linked) - throw invalid_operation("Program::bind"); - - if(!set_current(this)) - return; - - glUseProgramObjectARB(id); -} - int Program::get_uniform_location(const string &n) const { UniformMap::const_iterator i = uniforms.find(n); @@ -307,6 +296,17 @@ int Program::get_uniform_location(const string &n) const return i->second.location; } +void Program::bind() const +{ + if(!linked) + throw invalid_operation("Program::bind"); + + if(!set_current(this)) + return; + + glUseProgramObjectARB(id); +} + void Program::unbind() { if(!set_current(0)) diff --git a/source/program.h b/source/program.h index ddfc828c..7e9676d3 100644 --- a/source/program.h +++ b/source/program.h @@ -87,14 +87,17 @@ private: static std::string process_standard_source(const char **, const std::string &); public: const ShaderList &get_shaders() const { return shaders; } + void bind_attribute(unsigned, const std::string &); + void link(); bool is_linked() const { return linked; } std::string get_info_log() const; - void bind() const; + unsigned get_uniform_layout_hash() const { return uniform_layout_hash; } int get_uniform_location(const std::string &) const; + void bind() const; static void unbind(); };