2 #include "primitivebuilder.h"
9 PrimitiveBuilder::PrimitiveBuilder(VertexArray &a):
16 void PrimitiveBuilder::begin(PrimitiveType t)
19 throw invalid_operation("PrimitiveBuilder::begin");
27 void PrimitiveBuilder::end()
30 throw invalid_operation("PrimitiveBuilder::end");
37 void PrimitiveBuilder::offset(unsigned o)
40 throw out_of_range("PrimitiveBuilder::offset");
44 void PrimitiveBuilder::element(unsigned i)
47 throw invalid_operation("PrimitiveBuilder::element");
48 if(offs+i>=array.size())
49 throw out_of_range("PrimitiveBuilder::element");
53 PrimitiveType PrimitiveBuilder::get_type() const
56 throw invalid_operation("PrimitiveBuilder::get_type");
60 void PrimitiveBuilder::vertex_(const Vector4 &v)
62 for(VertexAttribute a: array.get_format())
64 unsigned sem = get_attribute_semantic(a);
66 vab.attrib(sem, attr[sem]);
71 element_(array.size()-1);