]> git.tdb.fi Git - libs/gl.git/commitdiff
Add a method to set the texture filter of RenderTarget textures
authorMikko Rasa <tdb@tdb.fi>
Thu, 29 Dec 2016 09:39:23 +0000 (11:39 +0200)
committerMikko Rasa <tdb@tdb.fi>
Thu, 29 Dec 2016 09:39:23 +0000 (11:39 +0200)
source/rendertarget.cpp
source/rendertarget.h

index f575670ad3e581b574f89dfc41522385f5095b36..8a53e66d2bac06b7adead7bebac9c7d3104f26ef 100644 (file)
@@ -155,6 +155,15 @@ RenderTarget::~RenderTarget()
        }
 }
 
+void RenderTarget::set_texture_filter(TextureFilter filt)
+{
+       if(!samples)
+       {
+               for(vector<TargetBuffer>::iterator i=buffers.begin(); i!=buffers.end(); ++i)
+                       i->texture->set_filter(filt);
+       }
+}
+
 const Texture2D &RenderTarget::get_target_texture(unsigned i) const
 {
        if(i>=buffers.size())
index 0181365e0c0b8ea4b916ef7255aa0ad3f171c5ac..35b2f00d205877b57bad08147a1058f8ae9d6a63 100644 (file)
@@ -74,6 +74,7 @@ public:
 
        const RenderTargetFormat &get_format() const { return format; }
        Framebuffer &get_framebuffer() { return fbo; }
+       void set_texture_filter(TextureFilter);
        const Texture2D &get_target_texture(unsigned) const;
        const Texture2D &get_target_texture(RenderOutput) const;
        void blit_from(const RenderTarget &);