Sorry to do this to all of you but I cant understand why this code wont draw a simple triangle. If someone could explain what is going on I would really appreciate it.
Here is the code:
#include<glut.h>
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0,0.0,0.0);
glBegin(GL_TRIANGLES);
glVertex3f(0.0,25.0,0.25);
glEnd();
glFlush();
}
void init()
{
glClearColor(0.0,0.0,0.0,0.0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-50.0,50.0,-50.0,50.0,-1.0,1.0);
}
int main(int argc, char** argv)
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
glutInitWindowSize(250,250);
glutInitWindowPosition(200,200);
glutCreateWindow(“Program1”);
init();
glutDisplayFunc(display);
glutMainLoop();
return 0;
}