-/* $Id: glutskel.c,v 1.1 1999/08/19 00:55:42 jtg Exp $ */
+/* $Id: glutskel.c,v 1.2 2004/04/22 00:47:28 brianp Exp $ */
/*
* A skeleton/template GLUT program
/*
* $Log: glutskel.c,v $
- * Revision 1.1 1999/08/19 00:55:42 jtg
- * Initial revision
+ * Revision 1.2 2004/04/22 00:47:28 brianp
+ * minor clean-ups
+ *
+ * Revision 1.1.1.1 1999/08/19 00:55:42 jtg
+ * Imported sources
*
* Revision 1.2 1998/11/07 14:20:14 brianp
* added simple rotation, animation of cube
static GLboolean Anim = GL_FALSE;
-static void Idle( void )
+static void
+Idle(void)
{
Xrot += 3.0;
Yrot += 4.0;
}
-static void Display( void )
+static void
+Draw(void)
{
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glRotatef(Xrot, 1, 0, 0);
}
-static void Reshape( int width, int height )
+static void
+Reshape(int width, int height)
{
- glViewport( 0, 0, width, height );
- glMatrixMode( GL_PROJECTION );
+ glViewport(0, 0, width, height);
+ glMatrixMode(GL_PROJECTION);
glLoadIdentity();
- glFrustum( -1.0, 1.0, -1.0, 1.0, 5.0, 25.0 );
- glMatrixMode( GL_MODELVIEW );
+ glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
+ glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
- glTranslatef( 0.0, 0.0, -15.0 );
+ glTranslatef(0.0, 0.0, -15.0);
}
-static void Key( unsigned char key, int x, int y )
+static void
+Key(unsigned char key, int x, int y)
{
const GLfloat step = 3.0;
(void) x;
}
-static void SpecialKey( int key, int x, int y )
+static void
+SpecialKey(int key, int x, int y)
{
const GLfloat step = 3.0;
(void) x;
}
-static void Init( void )
+static void
+Init(void)
{
/* setup lighting, etc */
glEnable(GL_DEPTH_TEST);
}
-int main( int argc, char *argv[] )
+int
+main(int argc, char *argv[])
{
- glutInit( &argc, argv );
- glutInitWindowPosition( 0, 0 );
- glutInitWindowSize( 400, 400 );
- glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
+ glutInit(&argc, argv);
+ glutInitWindowPosition(0, 0);
+ glutInitWindowSize(400, 400);
+ glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow(argv[0]);
- glutReshapeFunc( Reshape );
- glutKeyboardFunc( Key );
- glutSpecialFunc( SpecialKey );
- glutDisplayFunc( Display );
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutSpecialFunc(SpecialKey);
+ glutDisplayFunc(Draw);
+ if (Anim)
+ glutIdleFunc(Idle);
Init();
glutMainLoop();
return 0;