I am trying to create a line graph of a cosine curve along with the axes. The problem I am having is that the line_strip will continue drawing the axes after it has drawn the line (i.e. i expected the line to draw, stop, then for the axes to start drawing separately. What happens now is the line draws the line and the axes all as one line_strip). An even stranger thing which i down't understand is that even if i remove the lines:

//Draw axes glBindBuffer(GL_ARRAY_BUFFER, axesBufferObject); glEnableVertexAttribArray(0); glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, 0); glDrawArrays(GL_LINE_STRIP, 0, 2); // x axis glDrawArrays(GL_LINE_STRIP, 2, 2); // y axis glDrawArrays(GL_LINE_STRIP, 4, 2); // z axis glDisableVertexAttribArray(0);

which i thought would stop drawing the axes altogether, they are still drawn!!

The relevant code is shown below: