X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Frenderpass.cpp;h=b9a2cb83a05a09cbaab1ec3f6ea674a1fec707ac;hb=cd446554e998204eaba22504b7b28227feb8edbb;hp=93e2bc479b2d7197c3f9f8fe3bc59703c04d3579;hpb=936a307eaf8dafd0874c74d211e991bd81a74387;p=libs%2Fgl.git diff --git a/source/renderpass.cpp b/source/renderpass.cpp index 93e2bc47..b9a2cb83 100644 --- a/source/renderpass.cpp +++ b/source/renderpass.cpp @@ -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