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 :)

I fixed it :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.