From: Mikko Rasa Date: Thu, 29 Dec 2016 09:39:23 +0000 (+0200) Subject: Add a method to set the texture filter of RenderTarget textures X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=fce91f4eda14f5f9e9a7490835b7e62c05243572;p=libs%2Fgl.git Add a method to set the texture filter of RenderTarget textures --- diff --git a/source/rendertarget.cpp b/source/rendertarget.cpp index f575670a..8a53e66d 100644 --- a/source/rendertarget.cpp +++ b/source/rendertarget.cpp @@ -155,6 +155,15 @@ RenderTarget::~RenderTarget() } } +void RenderTarget::set_texture_filter(TextureFilter filt) +{ + if(!samples) + { + for(vector::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()) diff --git a/source/rendertarget.h b/source/rendertarget.h index 0181365e..35b2f00d 100644 --- a/source/rendertarget.h +++ b/source/rendertarget.h @@ -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 &);