2 * A skeleton/template GLUT program
4 * Written by Brian Paul and in the public domain.
14 static int WinWidth
= 400, WinHeight
= 400;
15 static GLfloat Xrot
= 0, Yrot
= 0, Zrot
= 0;
16 static GLboolean Anim
= GL_FALSE
;
32 glClear(GL_COLOR_BUFFER_BIT
| GL_DEPTH_BUFFER_BIT
);
35 glRotatef(Xrot
, 1, 0, 0);
36 glRotatef(Yrot
, 0, 1, 0);
37 glRotatef(Zrot
, 0, 0, 1);
48 Reshape(int width
, int height
)
52 glViewport(0, 0, width
, height
);
53 glMatrixMode(GL_PROJECTION
);
55 glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
56 glMatrixMode(GL_MODELVIEW
);
58 glTranslatef(0.0, 0.0, -15.0);
63 Key(unsigned char key
, int x
, int y
)
65 const GLfloat step
= 3.0;
83 glutDestroyWindow(Win
);
92 SpecialKey(int key
, int x
, int y
)
94 const GLfloat step
= 3.0;
118 /* setup lighting, etc */
119 glEnable(GL_DEPTH_TEST
);
120 glEnable(GL_LIGHTING
);
126 main(int argc
, char *argv
[])
128 glutInit(&argc
, argv
);
129 glutInitWindowSize(WinWidth
, WinHeight
);
130 glutInitDisplayMode(GLUT_RGB
| GLUT_DOUBLE
| GLUT_DEPTH
);
131 Win
= glutCreateWindow(argv
[0]);
132 glutReshapeFunc(Reshape
);
133 glutKeyboardFunc(Key
);
134 glutSpecialFunc(SpecialKey
);
135 glutDisplayFunc(Draw
);