- glVertexAttribPointer(t, sz, GL_FLOAT, false, stride, ptr);
- glEnableVertexAttribArray(t);
- ptr += sz;
+ {
+ if(*c==COLOR4_UBYTE)
+ glVertexAttribPointer(t, 4, GL_UNSIGNED_BYTE, true, stride, reinterpret_cast<unsigned char *>(offset));
+ else
+ glVertexAttribPointer(t, sz, GL_FLOAT, false, stride, reinterpret_cast<float *>(offset));
+ if(ARB_instanced_arrays)
+ glVertexAttribDivisor(t, divisor);
+ glEnableVertexAttribArray(t);
+ }
+ offset += sz*sizeof(float);