From 12342e01c014137b72546c1e3a54181063e69415 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 21 Feb 2021 23:28:02 +0200 Subject: [PATCH] Add sampler parameter to RenderPass::set_texture --- source/materials/renderpass.cpp | 4 ++-- source/materials/renderpass.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/materials/renderpass.cpp b/source/materials/renderpass.cpp index 561eab6a..fb092624 100644 --- a/source/materials/renderpass.cpp +++ b/source/materials/renderpass.cpp @@ -124,12 +124,12 @@ void RenderPass::set_material(const Material *mat) finalize_material(0); } -void RenderPass::set_texture(unsigned index, const Texture *tex) +void RenderPass::set_texture(unsigned index, const Texture *tex, const Sampler *samp) { if(!texturing) texturing = new Texturing; - texturing->attach(index, *tex, texturing->get_attached_sampler(index)); + texturing->attach(index, *tex, (samp ? samp : texturing->get_attached_sampler(index))); } int RenderPass::get_texture_index(const string &n) const diff --git a/source/materials/renderpass.h b/source/materials/renderpass.h index e01b872d..96b892df 100644 --- a/source/materials/renderpass.h +++ b/source/materials/renderpass.h @@ -90,7 +90,7 @@ public: void set_material(const Material *); const Material *get_material() const { return material.get(); } const std::string &get_material_slot_name() const { return material_slot; } - void set_texture(unsigned, const Texture *); + void set_texture(unsigned, const Texture *, const Sampler * = 0); const Texturing *get_texturing() const { return texturing; } int get_texture_index(const std::string &) const; void set_back_faces(bool); -- 2.43.0