OpenGL points drawn disappear, draw call and swap buffer issue? c++ : I cannot figure out what I have done wrong here...I am wanting to draw points on screen from the vertex data already sent to the GPU using GL_POINTS. At the moment they are drawn for a split second and then disappear. I am using a time-dependent loop as I want the points to appear sequentially...

    		if (currentTime > insertionRateTime)
			{
				cout << "insertionRateTime = " << insertionRateTime << "index" << index << endl;
				insertionRateTime += insertionRate;
				glDrawArrays(GL_POINTS, index, 1); 
				index += 1;
			}

		    glfwSwapBuffers(window);
		    glfwPollEvents();

Can anybody shed any light here? If I place the glDrawArrays outside of the if statement then the points drawn remain until the next point is drawn :(

Thanks,