]> git.tdb.fi Git - libs/gl.git/commitdiff
Move Program::bind to its proper place
authorMikko Rasa <tdb@tdb.fi>
Fri, 24 Aug 2012 07:48:32 +0000 (10:48 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 24 Aug 2012 07:48:32 +0000 (10:48 +0300)
source/program.cpp
source/program.h

index f07b2015c8c459bd36d480d9cc655d7da15d7c01..8ca8e336c0d18dc3f0efb08b31914824570f36c4 100644 (file)
@@ -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))
index ddfc828c5ceddcbbc6e2758318ca78ec0e3512be..7e9676d36548972c2c30f10d143843f45666d6db 100644 (file)
@@ -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();
 };