+VertexArray::ArrayMask::ArrayMask()
+{
+ for(unsigned i=0; i<N; ++i)
+ mask[i] = 0;
+}
+
+void VertexArray::ArrayMask::set(unsigned bit)
+{
+ mask[bit/B] |= 1<<(bit%B);
+}
+
+bool VertexArray::ArrayMask::is_set(unsigned bit) const
+{
+ return mask[bit/B]&(1<<(bit%B));
+}
+
+
+VertexArray::Loader::Loader(VertexArray &a):
+ VertexArrayBuilder(a)
+{
+ add("vertex2", static_cast<void (Loader::*)(float, float)>(&Loader::vertex));
+ add("vertex3", static_cast<void (Loader::*)(float, float, float)>(&Loader::vertex));
+ add("vertex4", static_cast<void (Loader::*)(float, float, float, float)>(&Loader::vertex));
+ add("normal3", static_cast<void (Loader::*)(float, float, float)>(&Loader::normal));
+ add("texcoord1", static_cast<void (Loader::*)(float)>(&Loader::texcoord));
+ add("texcoord2", static_cast<void (Loader::*)(float, float)>(&Loader::texcoord));
+ add("texcoord3", static_cast<void (Loader::*)(float, float, float)>(&Loader::texcoord));
+ add("texcoord4", static_cast<void (Loader::*)(float, float, float, float)>(&Loader::texcoord));
+ add("multitexcoord1", static_cast<void (Loader::*)(unsigned, float)>(&Loader::multitexcoord));
+ add("multitexcoord2", static_cast<void (Loader::*)(unsigned, float, float)>(&Loader::multitexcoord));
+ add("multitexcoord3", static_cast<void (Loader::*)(unsigned, float, float, float)>(&Loader::multitexcoord));
+ add("multitexcoord4", static_cast<void (Loader::*)(unsigned, float, float, float, float)>(&Loader::multitexcoord));
+ add("color3", static_cast<void (Loader::*)(float, float, float)>(&Loader::color));
+ add("color4", static_cast<void (Loader::*)(float, float, float, float)>(&Loader::color));
+ add("attrib1", static_cast<void (Loader::*)(unsigned, float)>(&Loader::attrib));
+ add("attrib2", static_cast<void (Loader::*)(unsigned, float, float)>(&Loader::attrib));
+ add("attrib3", static_cast<void (Loader::*)(unsigned, float, float, float)>(&Loader::attrib));
+ add("attrib4", static_cast<void (Loader::*)(unsigned, float, float, float, float)>(&Loader::attrib));
+}