VBO with colors

I know basics of VBO’s, right now i am rendering my game blocks with VBO, and i am using only vertex array and texture coord array. Right now i am trying to add colors array to VBO, but i am failing in here. Maybe somebody can edit this part of code:

...........           
            glEnableClientState(GL_VERTEX_ARRAY);
		      glEnableClientState(GL_TEXTURE_COORD_ARRAY);
		      glEnableClientState(GL11.GL_COLOR_ARRAY);
				glBindBuffer(GL_ARRAY_BUFFER, vboVertexID);
				
				glVertexPointer(2, GL_FLOAT, 7 << 2, 0); 
				glTexCoordPointer(2, GL_FLOAT, 7 << 2, 2 << 2); 
				GL11.glColorPointer(3, GL_FLOAT, 7 << 3,4 << 3);
				
				glBindTexture(GL_TEXTURE_2D, Main.texture.id);
				glDrawArrays(GL_QUADS, 0, 20*16*16);
...........

I want to use colors, please help me.

When interleaving data, your stride must be the same for every vertex attribute.

It seems you do not understand the bit-shifting. You basically never shift 3 bits, when pointing at primitive offsets in OpenGL (rarely should one use longs or doubles as vertex attributes).


int stride = (2 << 2) + (2 << 2) + (3 << 2);
int offset = 0;
glVertexPointer(2,   GL_FLOAT, stride, offset); 
offset += 2 << 2;
glTexCoordPointer(2, GL_FLOAT, stride, offset); 
offset += 2 << 2;
glColorPointer(3,    GL_FLOAT, stride, offset);
offset += 3 << 2;
// offset == stride

Thank you!