This is a strange problem. I have a function:
void drawLines(std::vector<GLfloat> lines) {
glBindVertexArray(VAO2);
//positions
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(GLfloat), (void*)0);
glEnableVertexAttribArray(0);
//colors
glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(GLfloat), (void*)(3 * sizeof(GLfloat)));
glEnableVertexAttribArray(1);
glBindBuffer(GL_ARRAY_BUFFER, VBO2);
glBufferData(GL_ARRAY_BUFFER, sizeof(lines[0]) * lines.size(), &lines[0], GL_STATIC_DRAW);
glUseProgram(pShaderProgram);
glDrawArrays(GL_TRIANGLES, 0, lines.size() / 6);
}
It draws lines of a specified thickness (this is built into the data of lines which contains three floats for position and three floats for color, per point with over 200 points to mark line endings). Calling the function once does not yield any result, even after following with SwapBuffers(HDC) and glFlush(). However, when I call the function twice, then everything shows. I suspect there is some nuance that I am missing with pushing the buffers through the render pipeline, that might be activated by binding the buffer multiple times. I am unsure. Any thoughts?