X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fmaterials%2Frenderpass.cpp;h=810b3673e584671423c95795a0eaab5cdd9c5e93;hb=fe980fbd898645eba1ac06a5061b3a48db4638b0;hp=561eab6a7045f9f5448701398737cf370b4c1af6;hpb=dccad64b2ec82249d850b9745614042171499972;p=libs%2Fgl.git diff --git a/source/materials/renderpass.cpp b/source/materials/renderpass.cpp index 561eab6a..810b3673 100644 --- a/source/materials/renderpass.cpp +++ b/source/materials/renderpass.cpp @@ -77,7 +77,7 @@ void RenderPass::maybe_create_material_shader(DataFile::Collection *coll) shprog.keep(); } else - shprog = material->create_compatible_shader(); + throw invalid_operation("no collection"); if(shdata) shdata = new ProgramData(*shdata, shprog.get()); @@ -117,19 +117,19 @@ const string &RenderPass::get_slotted_uniform_name(const string &slot) const return i->second; } -void RenderPass::set_material(const Material *mat) +void RenderPass::set_material(const Material *mat, DataFile::Collection *coll) { material = mat; material.keep(); - finalize_material(0); + finalize_material(coll); } -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