]> git.tdb.fi Git - libs/gl.git/blobdiff - source/vertexarray.cpp
Fix an index mismatch between setting attribute array pointers and enabling the arrays
[libs/gl.git] / source / vertexarray.cpp
index de343bf7065a07aa573377a6e49be8114dd60356..6740818e794228e78ebedbbc880855aa3abcb33c 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
 */
 
@@ -108,7 +108,7 @@ void VertexArray::apply() const
                                glColorPointer(sz, GL_FLOAT, bpv, base+offset);
                        break;
                default:
-                       glVertexAttribPointerARB(t-3, sz, GL_FLOAT, false, bpv, base+offset);
+                       glVertexAttribPointerARB(t-4, sz, GL_FLOAT, false, bpv, base+offset);
                        break;
                }
                found|=1<<t;
@@ -120,7 +120,7 @@ void VertexArray::apply() const
        set_array(GL_TEXTURE_COORD_ARRAY, found&4, 4);
        set_array(GL_COLOR_ARRAY, found&8, 8);
        for(unsigned i=4; i<32; ++i)
-               set_array(i-3, (found>>i)&1, 1<<i);
+               set_array(i-4, (found>>i)&1, 1<<i);
 
        if(vbuf)
                VertexBuffer::unbind();