// Ghulam Mujtaba
#include <windows.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
static GLuint w=800,h=600;
void init( void)
{
glShadeModel (GL_SMOOTH);
glClearColor (1.0f, 1.0f, 1.0f, 1.0f);
glClearDepth(1.0f);
glEnable(GL_DEPTH_TEST);
}
void display(void){
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
//glPushMatrix();
glLoadIdentity();
glTranslatef(0.0,0.0,0.0);
// glRotatef(0.0,0.0,0.0,0.0);
//glScalef(0.0,0.0,0.0);
glColor3f (1.0f, 0.0f, 1.0f);
glutWireTeapot(1.0);//glutSolidTeapote(.25);
glFlush();
glutSwapBuffers();
}
void reshape (int w, int h)
{
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
gluPerspective(90.0, (GLfloat) w/(GLfloat) h, 1.0, 50.0);
//glFrustum (-2.0, 2.0, -2.0, 2.0, 1.5, 20.0);
glMatrixMode (GL_MODELVIEW);
glLoadIdentity();
//gluLookAt(0.0,0.0,15.0,0.0,-2.0,0.0,0.0,1.0,0.0);
}
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH);
glutInitWindowSize (w, h);
glutInitWindowPosition (100, 100);
glutCreateWindow ("TEAPOT");
init ();
//glutKeyboardFunc(key);
glutDisplayFunc(display);
glutIdleFunc(display);
glutReshapeFunc(reshape);
glutMainLoop();
return 0;
}