r300g: remove dead r300_get_texture_buffer function
[mesa.git] / progs / tests / manytex.c
index 61a1519ae6b61601c7862e8de0c53b2cc88e2d61..52e7e1de44a9f6e457bec43317ca82023ea0f99e 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id: manytex.c,v 1.5 2005/09/15 01:58:39 brianp Exp $ */
 
 /*
  * test handling of many texture maps
@@ -14,6 +13,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <math.h>
+#include <GL/glew.h>
 #include <GL/glut.h>
 
 
@@ -30,6 +30,7 @@ static GLboolean LinearFilter = GL_FALSE;
 static GLboolean RandomSize = GL_FALSE;
 static GLint Rows, Columns;
 static GLint LowPriorityCount = 0;
+static GLint Win;
 
 
 static void Idle( void )
@@ -128,6 +129,14 @@ static int RandomInt(int min, int max)
 }
 
 
+static void DeleteTextures(void)
+{
+   glDeleteTextures(NumTextures, TextureID);
+   free(TextureID);
+   TextureID = NULL;
+}
+
+
 
 static void Init( void )
 {
@@ -306,9 +315,12 @@ static void Key( unsigned char key, int x, int y )
          Zrot += step;
          break;
       case ' ':
+         DeleteTextures();
          Init();
          break;
       case 27:
+         DeleteTextures();
+         glutDestroyWindow(Win);
          exit(0);
          break;
    }
@@ -324,7 +336,8 @@ int main( int argc, char *argv[] )
    glutInitWindowPosition( 0, 0 );
    glutInitWindowSize( WinWidth, WinHeight );
    glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
-   glutCreateWindow(argv[0]);
+   Win = glutCreateWindow(argv[0]);
+   glewInit();
    glutReshapeFunc( Reshape );
    glutKeyboardFunc( Key );
    glutDisplayFunc( Display );