X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fglsl%2Fbuiltin.cpp;h=217509a20b74c61e83091feda6dc856dd9a3cfcc;hp=83e480e5cf417b5943abb7841ebcb32256f8136e;hb=e2ed3de4cbbc682ff490a3b0b760b8a45260f611;hpb=02918a66cd589e3f73810a51f8cd62e7441e310d diff --git a/source/glsl/builtin.cpp b/source/glsl/builtin.cpp index 83e480e5..217509a2 100644 --- a/source/glsl/builtin.cpp +++ b/source/glsl/builtin.cpp @@ -1,3 +1,4 @@ +#include #include #include #include "builtin.h" @@ -9,7 +10,7 @@ namespace Msp { namespace GL { namespace SL { -void add_builtin_type(Stage &stage, const std::string &name, BasicTypeDeclaration::Kind kind, unsigned size, unsigned sign) +void add_builtin_type(Stage &stage, const string &name, BasicTypeDeclaration::Kind kind, unsigned size, unsigned sign) { RefPtr type = new BasicTypeDeclaration; type->source = BUILTIN_SOURCE; @@ -62,10 +63,8 @@ const Stage *get_builtins(Stage::Type type) if(type==Stage::SHARED) return &module->shared; - for(list::iterator i=module->stages.begin(); i!=module->stages.end(); ++i) - if(i->type==type) - return &*i; - return 0; + auto i = find_member(module->stages, type, &Stage::type); + return (i!=module->stages.end() ? &*i : 0); } } // namespace SL