From 3137e87b72823bc4227d4382c157867b19aacb49 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 24 Aug 2012 10:48:32 +0300 Subject: [PATCH] Move Program::bind to its proper place --- source/program.cpp | 22 +++++++++++----------- source/program.h | 5 ++++- 2 files changed, 15 insertions(+), 12 deletions(-) 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(); }; -- 2.45.2