3 This file is part of libmspgl
4 Copyright © 2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #include "vertexarray.h"
9 #include "vertexarraybuilder.h"
14 VertexArrayBuilder::VertexArrayBuilder(VertexArray &a, std::vector<float> &d):
19 VertexArrayBuilder::~VertexArrayBuilder()
24 void VertexArrayBuilder::vertex_(float x, float y, float z, float w)
26 for(uint fmt=array.get_format(); fmt; fmt>>=4)
34 if(size>=3) data.push_back(z);
35 if(size>=4) data.push_back(w);
44 if(size>=2) data.push_back(tt);
45 if(size>=3) data.push_back(tr);
46 if(size>=4) data.push_back(tq);
51 union { ubyte c[4]; float f; } u;
52 u.c[0]=(ubyte)(cr*255);
53 u.c[1]=(ubyte)(cg*255);
54 u.c[2]=(ubyte)(cb*255);
55 u.c[3]=(ubyte)(ca*255);
63 if(size>=4) data.push_back(ca);