Hi guys,
I'm brushing up (aka relearning OpenGL) and for some reason my line will not draw, but my triangle does (I added the triangle to make sure I could render things, the line is not hidden because of the triangle).
Here is my code:
My code reaches the "test" line that writes to the console, but the line will not render. Any ideas?
I'm brushing up (aka relearning OpenGL) and for some reason my line will not draw, but my triangle does (I added the triangle to make sure I could render things, the line is not hidden because of the triangle).
Here is my code:
Code:
void RenderScene()
{
glClearColor(0.0f, 0.0f, 1.0f, 0.0f);
glClear(GL_COLOR_BUFFER_BIT);
glLoadIdentity();
//glTranslatef(0.0f,0.0f,-6.0f);
glColor3f(1.0f, 0.0f, 0.0f);
//Load up line (THIS DOESN"T WORK)
glBegin(GL_LINES);
glVertex3f(180, 15, 0);
glVertex3f(10, 45, 0);
cout << "TEST" << endl;
glEnd();
//(THIS DOES)
glBegin(GL_TRIANGLES);
glVertex3f( 0.0f, 1.0f, 0.0f); // Top
glVertex3f(-1.0f,-1.0f, 0.0f); // Bottom Left
glVertex3f( 1.0f,-1.0f, 0.0f); // Bottom Right
glEnd(); // Finished Drawing The Triangle
//glFlush();
glutSwapBuffers();
}
My code reaches the "test" line that writes to the console, but the line will not render. Any ideas?