]> git.tdb.fi Git - libs/gl.git/commitdiff
Move some member functions to more logical positions
authorMikko Rasa <tdb@tdb.fi>
Thu, 9 Aug 2012 19:34:23 +0000 (22:34 +0300)
committerMikko Rasa <tdb@tdb.fi>
Thu, 9 Aug 2012 19:34:23 +0000 (22:34 +0300)
source/framebuffer.cpp
source/framebuffer.h
source/texture2d.h

index 8806ea6c4956d980dafd2b72419050e78813c2d8..c4f714c64b7768e74989602ac023ce3e14655159 100644 (file)
@@ -106,6 +106,15 @@ void Framebuffer::check_size()
                }
 }
 
+unsigned Framebuffer::get_attachment_index(FramebufferAttachment attch)
+{
+       for(unsigned i=0; i<attachments.size(); ++i)
+               if(attachments[i].attachment==attch)
+                       return i;
+       attachments.push_back(Attachment(attch));
+       return attachments.size()-1;
+}
+
 void Framebuffer::attach(FramebufferAttachment attch, Renderbuffer &rbuf)
 {
        if(!id)
@@ -228,15 +237,6 @@ Framebuffer &Framebuffer::system()
        return sys_framebuf;
 }
 
-unsigned Framebuffer::get_attachment_index(FramebufferAttachment attch)
-{
-       for(unsigned i=0; i<attachments.size(); ++i)
-               if(attachments[i].attachment==attch)
-                       return i;
-       attachments.push_back(Attachment(attch));
-       return attachments.size()-1;
-}
-
 
 Framebuffer::Attachment::Attachment(FramebufferAttachment a):
        attachment(a),
index cf64b45c37ef28cb88394d6ecca86c3c0f1fd8e4..8a97222c5ffac91a9c852119467130c7c8f5caad 100644 (file)
@@ -107,6 +107,7 @@ public:
 private:
        void update_attachment(unsigned) const;
        void check_size();
+       unsigned get_attachment_index(FramebufferAttachment);
 public:
        void attach(FramebufferAttachment attch, Renderbuffer &rbuf);
        void attach(FramebufferAttachment attch, Texture2D &tex, unsigned level = 0);
@@ -141,8 +142,6 @@ public:
        static void unbind();
 
        static Framebuffer &system();
-private:
-       unsigned get_attachment_index(FramebufferAttachment);
 };
 
 inline BufferBits operator|(BufferBits a, BufferBits b)
index ff4d35b64b24685661f842b6f652604b0d4220a4..f81231d18466eebf8746cb2cb9a19d552513a3fc 100644 (file)
@@ -62,11 +62,14 @@ public:
        the image must be compatible with the defined storage. */
        void load_image(const std::string &fn);
 
+private:
+       void image(const Graphics::Image &);
+
+public:
        unsigned get_width() const  { return width; }
        unsigned get_height() const { return height; }
 
 private:
-       void image(const Graphics::Image &);
        void get_level_size(unsigned, unsigned &, unsigned &);
 };