+ else if(attr>=RAW_ATTRIB1 && attr<=RAW_ATTRIB4)
+ base &= 7;
+ else if(attr<GENERIC1 || attr>GENERIC4)
+ throw invalid_argument("make_indexed_attribute");
+
+ static int max_attribs = -1;
+ if(max_attribs<0)
+ max_attribs = get_i(GL_MAX_VERTEX_ATTRIBS);
+
+ if(static_cast<int>((base>>3)+index)>=max_attribs)
+ throw out_of_range("make_indexed_attribute");
+
+ return static_cast<VertexAttribute>(base+index*8);
+}
+
+
+bool convert_attribute(const string &str, const char *name, int min_size, int max_size, VertexAttribute &attr, VertexAttribute base_attr)
+{
+ string::const_iterator i = str.begin();
+ for(; *name; ++name, ++i)
+ if(*i!=*name)
+ return false;
+ if(i==str.end() || *i<'0'+min_size || *i>'0'+max_size)
+ return false;
+ VertexAttribute result = static_cast<VertexAttribute>(base_attr+(*i-'0'-min_size));
+
+ if(++i!=str.end())