]> git.tdb.fi Git - libs/gl.git/commitdiff
Mark some functions as const that by all rights should be
authorMikko Rasa <tdb@tdb.fi>
Tue, 6 Dec 2016 21:32:08 +0000 (23:32 +0200)
committerMikko Rasa <tdb@tdb.fi>
Wed, 7 Dec 2016 00:28:32 +0000 (02:28 +0200)
source/rendertarget.cpp
source/rendertarget.h

index 376af04877a4b324dd53518203b489c662b034c2..f575670ad3e581b574f89dfc41522385f5095b36 100644 (file)
@@ -59,7 +59,7 @@ RenderTargetFormat RenderTargetFormat::operator,(PixelFormat f) const
        return result;
 }
 
-int RenderTargetFormat::index(RenderOutput o)
+int RenderTargetFormat::index(RenderOutput o) const
 {
        unsigned type = get_output_type(o);
        unsigned i = 0;
@@ -155,7 +155,7 @@ RenderTarget::~RenderTarget()
        }
 }
 
-const Texture2D &RenderTarget::get_target_texture(unsigned i)
+const Texture2D &RenderTarget::get_target_texture(unsigned i) const
 {
        if(i>=buffers.size())
                throw out_of_range("RenderTarget::get_target_texture");
@@ -165,7 +165,7 @@ const Texture2D &RenderTarget::get_target_texture(unsigned i)
        return *buffers[i].texture;
 }
 
-const Texture2D &RenderTarget::get_target_texture(RenderOutput o)
+const Texture2D &RenderTarget::get_target_texture(RenderOutput o) const
 {
        int index = format.index(o);
        if(index<0)
index e38f6f51ad40589ab4321c958056b10258900121..0181365e0c0b8ea4b916ef7255aa0ad3f171c5ac 100644 (file)
@@ -31,7 +31,7 @@ public:
        bool empty() const { return !count; }
        const unsigned char *begin() const { return outputs; }
        const unsigned char *end() const { return outputs+count; }
-       int index(RenderOutput);
+       int index(RenderOutput) const;
 };
 
 inline RenderTargetFormat operator,(RenderOutput o1, RenderOutput o2)
@@ -74,8 +74,8 @@ public:
 
        const RenderTargetFormat &get_format() const { return format; }
        Framebuffer &get_framebuffer() { return fbo; }
-       const Texture2D &get_target_texture(unsigned);
-       const Texture2D &get_target_texture(RenderOutput);
+       const Texture2D &get_target_texture(unsigned) const;
+       const Texture2D &get_target_texture(RenderOutput) const;
        void blit_from(const RenderTarget &);
 };