-/* $Id: renormal.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/*
* Test GL_EXT_rescale_normal extension
* Brian Paul January 1998 This program is in the public domain.
*/
-/*
- * $Id: renormal.c,v 1.1 1999/08/19 00:55:40 jtg Exp $
- */
-
-
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
static GLfloat Phi = 0.0;
-static void Idle(void)
+static void Idle( void )
{
- Phi += 0.1;
+ static double t0 = -1.;
+ double dt, t = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
+ if (t0 < 0.0)
+ t0 = t;
+ dt = t - t0;
+ t0 = t;
+ Phi += 3.0 * dt;
glutPostRedisplay();
}
glutPostRedisplay();
}
+static void
+key(unsigned char k, int x, int y)
+{
+ (void) x;
+ (void) y;
+ switch (k) {
+ case 27: /* Escape */
+ exit(0);
+ break;
+ default:
+ return;
+ }
+ glutPostRedisplay();
+}
int main( int argc, char *argv[] )
{
glutInit( &argc, argv );
+ glutInitWindowPosition(0, 0);
glutInitWindowSize( 400, 400 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutIdleFunc( Idle );
glutReshapeFunc( Reshape );
glutDisplayFunc( Display );
+ glutKeyboardFunc(key);
glutCreateMenu(ModeMenu);
glutAddMenuEntry("Unscaled", UNSCALED);