static struct object Objects[NUM_OBJECTS];
static GLuint NumObjects;
+static GLuint Win;
+
static GLfloat Xrot = 0, Yrot = 0, Zrot = 0;
static GLboolean Anim = GL_TRUE;
}
+static void FreeBuffers(void)
+{
+ int i;
+ for (i = 0; i < NUM_OBJECTS; i++)
+ glDeleteBuffersARB(1, &Objects[i].BufferID);
+}
+
+
static void Key( unsigned char key, int x, int y )
{
const GLfloat step = 3.0;
Zrot += step;
break;
case 27:
+ FreeBuffers();
+ glutDestroyWindow(Win);
exit(0);
break;
}
glutInitWindowPosition( 0, 0 );
glutInitWindowSize( 600, 300 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
- glutCreateWindow(argv[0]);
+ Win = glutCreateWindow(argv[0]);
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );