glClearColor(0.0,0.0,0.0,0.0);
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
glEnable(GL_DEPTH_TEST);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glPushMatrix();
glRotated((double)r,0.0,1.0,0.0);
cube();
glPopMatrix();
glDisable(GL_LIGHT0);
glDisable(GL_LIGHTING);
glDisable(GL_DEPTH_TEST);
auxSwapBuffers();
if(++r>=360) r=0;
}
GLvoid CALLBACK resize(GLsizei w,GLsizei h)
{
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glViewport(0,0,w,h);
gluPerspective(30.0,1.0,1.0,10.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
gluLookAt(3.0,4.0,5.0,0.0,0.0,0.0,0.0,1.0,0.0);
}
int main(int argc, char *argv[])
{
auxInitPosition(200,100,512,512);
auxInitDisplayMode(AUX_RGBA|AUX_DOUBLE|AUX_DEPTH);
auxInitWindow(argv[0]);