+VertexFormat VertexFormat::operator,(VertexComponent c) const
+{
+ VertexFormat r = *this;
+ if(r.data)
+ {
+ const unsigned char n = ++r.data[0];
+ if((n&7)==0)
+ {
+ unsigned char *newdt = new unsigned char[n+8];
+ copy(r.data, r.data+n, newdt);
+ delete r.data;
+ r.data = newdt;
+ }
+ r.data[n] = c;
+ }
+ else
+ {
+ r.data = new unsigned char[8];
+ r.data[0] = 1;
+ r.data[1] = c;
+ }
+
+ return r;
+}
+
+VertexFormat VertexFormat::operator,(unsigned i) const
+{
+ if(!data)
+ throw invalid_operation("VertexFormat::operator,");
+ VertexFormat r = *this;
+ unsigned char *c = r.data+r.data[0];
+ *c = make_indexed_component(static_cast<VertexComponent>(*c), i);
+
+ return r;
+}
+