I'm having some trouble drawing in OpenGL. I have a skybox working correctly, and I'm trying to get a triangle to draw - for some reason it fails, and I just see a skybox with nothing in front.
The code I'm using is:
/* Clear the buffers. */
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
/* Draw the skybox if necessary. */
if(m_skyBox)
m_skyBox->draw();
gluLookAt(
0.0f, 0.0f, 0.0f,
0.0f, 0.0f, 10.0f,
0.0f, 1.0f, 0.0f);
// static Mesh mesh("enemy.mesh");
// Zero the model/view matrix
glLoadIdentity();
// Translate the triangle to 0, 0, 10
glTranslatef(0.0f, 0.0f, 10.0f);
// Draw all white
glColor3f(1.0f, 1.0f, 1.0f);
// Draw the triangle vertices.
glBegin(GL_TRIANGLES); // Drawing Using Triangles
glVertex3f( 1.0f, 0.0f, 0.0f);
glVertex3f( 0.0f, 0.0f, 0.0f);
glVertex3f( 0.0f, 1.0f, 0.0f);
glEnd();
SwapBuffers(m_windowContext);
I must be doing something wrong... Any help would be appreciated!