]> git.tdb.fi Git - libs/gl.git/blobdiff - source/primitivebuilder.cpp
Support multiple sets of texture coordinates in VertexArrays
[libs/gl.git] / source / primitivebuilder.cpp
index e032a441c00603062e750eb9367c2025c4023e1c..22106a344a828326c7329c5f482bc2a230e56a92 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of libmspgl
-Copyright © 2007  Mikko Rasa, Mikkosoft Productions
+Copyright © 2008, 2010  Mikko Rasa, Mikkosoft Productions
 Distributed under the LGPL
 */
 
@@ -55,11 +55,12 @@ PrimitiveType PrimitiveBuilder::get_type() const
 
 void PrimitiveBuilder::vertex_(float x, float y, float z, float w)
 {
-       vab.texcoord(ts, tt, tr, tq);
-       vab.color(cr, cg, cb, ca);
-       vab.normal(nx, ny, nz);
-       for(std::map<unsigned, Attrib>::iterator i=av.begin(); i!=av.end(); ++i)
-               vab.attrib(i->first, i->second.x, i->second.y, i->second.z, i->second.w);
+       vab.color(col);
+       vab.normal(nor);
+       for(std::map<unsigned, Vector4>::iterator i=texc.begin(); i!=texc.end(); ++i)
+               vab.multitexcoord(i->first, i->second);
+       for(std::map<unsigned, Vector4>::iterator i=attr.begin(); i!=attr.end(); ++i)
+               vab.attrib(i->first, i->second);
        vab.vertex(x, y, z, w);
 
        if(in_batch)