From: Mikko Rasa Date: Sun, 21 Feb 2021 21:28:02 +0000 (+0200) Subject: Add sampler parameter to RenderPass::set_texture X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=12342e01c014137b72546c1e3a54181063e69415;p=libs%2Fgl.git Add sampler parameter to RenderPass::set_texture --- 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);