]> git.tdb.fi Git - libs/gl.git/blobdiff - source/vertexformat.cpp
Allow generic vertex attribute 0, since OpenGL 3.0 does not support any fixed-functio...
[libs/gl.git] / source / vertexformat.cpp
index 232690ede2f99f2c7d1ebb8411d9ad442c68dffa..91084bcc273e0bff6524746b22372a10d7b88eee 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of libmspgl
-Copyright © 2007  Mikko Rasa, Mikkosoft Productions
+Copyright © 2007-2009  Mikko Rasa, Mikkosoft Productions
 Distributed under the LGPL
 */
 
@@ -87,9 +87,9 @@ VertexFormat operator,(const VertexFormat &f, unsigned i)
        if(*c<ATTRIB1)
                throw InvalidState("Last component is not a generic attribute");
        // VertexArray uses an unsigned to store flags for enabled arrays
-       if(i<1 || i>28)
+       if(i>=28)
                throw InvalidParameterValue("Generic attribute index out of range");
-       *c+=(i-1)*4;
+       *c+=i*4;
 
        return r;
 }