]> git.tdb.fi Git - libs/gl.git/blobdiff - source/renderpass.cpp
Use RefPtrs in Object
[libs/gl.git] / source / renderpass.cpp
index 93e2bc479b2d7197c3f9f8fe3bc59703c04d3579..b9a2cb83a05a09cbaab1ec3f6ea674a1fec707ac 100644 (file)
@@ -42,6 +42,7 @@ RenderPass::~RenderPass()
 void RenderPass::set_material(const Material *mat)
 {
        material = mat;
+       material.keep();
 }
 
 void RenderPass::set_texture(unsigned index, const Texture *tex)
@@ -54,7 +55,9 @@ void RenderPass::set_texture(unsigned index, const Texture *tex)
                        return;
                }
 
-       throw KeyError("No texture slot for that unit", lexical_cast(index));
+       textures.push_back(TextureSlot(index));
+       textures.back().texture = tex;
+       textures.back().texture.keep();
 }
 
 void RenderPass::bind() const