]> git.tdb.fi Git - libs/gl.git/commitdiff
Add sampler parameter to RenderPass::set_texture
authorMikko Rasa <tdb@tdb.fi>
Sun, 21 Feb 2021 21:28:02 +0000 (23:28 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 21 Feb 2021 21:28:02 +0000 (23:28 +0200)
source/materials/renderpass.cpp
source/materials/renderpass.h

index 561eab6a7045f9f5448701398737cf370b4c1af6..fb092624b756c06ff463cdb34097b458cdd15158 100644 (file)
@@ -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
index e01b872daf56c2a0af7ec8a1e2d8bcfae7d017d4..96b892dff07295275b4f1cd66e17f071a5d8f1a3 100644 (file)
@@ -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);