Issue Using glTexCoordPointer()

Hi, fairly new to OpenGL (and GLSL) and I have an issue using glTexCoordPointer().

I have the texture loaded in and it is rendering on the object correct (a single quad) but I also get another quad appearing which is a single colour not a part of the loaded texture.

The arrays are defined as follows:

static const GLfloat obj_vert_buf[] = {
-1, 0, -1,
-1, 0, 1,
1, 0, 1,
1, 0, -1
static const GLfloat obj_tex_buf[] = {
0, 0,
0, 1,
1, 1,
1, 0

And the relevant excerpt from the draw function:


glGenBuffers(1, &obj_id);

glTexCoordPointer(2, GL_FLOAT, 0, obj_tex_buf);
glVertexPointer(3, GL_FLOAT, 0, obj_vert_buf);
glDrawArrays(GL_QUADS, 0, sizeof(obj_vert_buf) / sizeof(GLfloat));


To my understanding glTexCoordPointer()'s first argument specifies the number of elements per vertex which would be two as in:

	glTexCoord2f(0.0, 0.0);

The second argument is the type, GLfloat.

The third argument is the offset between each set of elements pertaining to each vertex, so zero after the two stated before (I have also tried it with 2 * sizeof(GLfloat) to no change).

And the fourth argument is a pointer to the start of the data, i.e. obj_tex_buf.

The quad renders and the texture is drawn on it correctly, but I get another random shape coming off from its centre and textured incorrectly, any thoughts would be great.

The last parameter to glDrawArrays() should be the number of vertices (4), not the number of floats (12).