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)
64 for(std::map<unsigned, Vector4>::iterator i=texc.begin(); i!=texc.end(); ++i)
65 vab.multitexcoord(i->first, i->second);
66 for(std::map<unsigned, Vector4>::iterator i=attr.begin(); i!=attr.end(); ++i)
67 vab.attrib(i->first, i->second);
71 element_(array.size()-1);