//! (static) Factory Util::Reference<ColorAttributeAccessor> ColorAttributeAccessor::create(MeshVertexData & _vData, Util::StringIdentifier name) { const VertexAttribute & attr = assertAttribute(_vData, name); if(attr.getNumValues() >= 4 && attr.getDataType() == GL_FLOAT) { return new ColorAttributeAccessor4f(_vData, attr); } else if(attr.getNumValues() >= 3 && attr.getDataType() == GL_FLOAT) { return new ColorAttributeAccessor3f(_vData, attr); } else if(attr.getNumValues() >= 4 && attr.getDataType() == GL_UNSIGNED_BYTE) { return new ColorAttributeAccessor4ub(_vData, attr); } else { throw std::invalid_argument(unimplementedFormatMsg + name.toString() + '\''); } }