X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Ftechnique.cpp;h=09799acee8841ac3eefe9d3fe1cfb5fa08801283;hb=bec07999d95b76f4b47cffcc564d0cd0afc0435e;hp=d6ec7115f6e703a5b215803952a27716f934e468;hpb=72a13418cc19e750abf3f8d8a52aea5e1abe4983;p=libs%2Fgl.git diff --git a/source/technique.cpp b/source/technique.cpp index d6ec7115..09799ace 100644 --- a/source/technique.cpp +++ b/source/technique.cpp @@ -28,6 +28,12 @@ const RenderPass &Technique::get_pass(const Tag &tag) const return get_item(passes, tag); } +const RenderPass *Technique::find_pass(const Tag &tag) const +{ + PassMap::const_iterator i = passes.find(tag); + return (i!=passes.end() ? &i->second : 0); +} + bool Technique::replace_texture(const string &slot, const Texture &tex) { bool replaced = false; @@ -129,6 +135,9 @@ void Technique::Loader::pass(const string &n) else load_sub(p); + if(!p.get_shader_program()) + throw logic_error("no shader program in pass"); + insert_unique(obj.passes, n, p); }