X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fmesh.cpp;h=508054a521346ac45e394848fb0c7ec11f0fe799;hp=0e58aa269a1bbdb7679aa36737f0a79ecdb95663;hb=43c6495ff3d14a85ee5de169a80fdacf13b7147e;hpb=40c364b04084d11573a9ff9f7be6f1c4cc521f4b diff --git a/source/mesh.cpp b/source/mesh.cpp index 0e58aa26..508054a5 100644 --- a/source/mesh.cpp +++ b/source/mesh.cpp @@ -130,9 +130,15 @@ Mesh::Loader::Loader(Mesh &m): add("winding", &Loader::winding); } -void Mesh::Loader::vertices(VertexFormat f) +void Mesh::Loader::vertices(const vector &c) { - obj.vertices.reset(f); + if(c.empty()) + throw invalid_argument("No vertex components"); + + VertexFormat fmt; + for(vector::const_iterator i=c.begin(); i!=c.end(); ++i) + fmt = (fmt, *i); + obj.vertices.reset(fmt); load_sub(obj.vertices); }