From fce91f4eda14f5f9e9a7490835b7e62c05243572 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 29 Dec 2016 11:39:23 +0200 Subject: [PATCH] Add a method to set the texture filter of RenderTarget textures --- source/rendertarget.cpp | 9 +++++++++ source/rendertarget.h | 1 + 2 files changed, 10 insertions(+) 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 &); -- 2.45.2