0

I am using OpenGL and i am trying to get this simple program to work, here is my code;

void DrawScene ( void )
{
	glClear ( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );

	glMatrixMode ( GL_MODELVIEW );
	glLoadIdentity ( );
    
	//Triangle
	glPushMatrix ( );
	glTranslatef ( -1.0f, 1.0f, 0.0f ); 
    glBegin ( GL_TRIANGLES );
    
    glVertex3f ( 0.5f, -0.5f, 0.0f );
    glVertex3f ( 0.0f, 0.5f, 0.0f );
    glVertex3f ( -0.5f, -0.5f, 0.0f );
    
    glEnd();
	glPopMatrix ( ); 
	//end of triangle

	glutSwapBuffers ( );
}

I dont get any errors, the triangle just doesnt show up.

any help would be greatly appreciated :)

1
Contributor
1
Reply
2
Views
8 Years
Discussion Span
Last Post by tomtetlaw
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.