diff options
author | Chia-I Wu <olvaffe@gmail.com> | 2009-09-15 14:16:22 +0800 |
---|---|---|
committer | Chia-I Wu <olvaffe@gmail.com> | 2009-09-15 14:16:22 +0800 |
commit | e2ba90a9cc762cf00a168f0a59d31e7dc52fc42e (patch) | |
tree | fe3206d7602ad935296884742980f3c4d30bd867 /progs/tests/manytex.c | |
parent | 11a4292d4eb515813b82b8d688a318adef66b3e6 (diff) | |
parent | b4b8800315637d9218a81c76f09df7d601710d29 (diff) |
Merge commit 'eee/mesa-es' into android
Diffstat (limited to 'progs/tests/manytex.c')
-rw-r--r-- | progs/tests/manytex.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/progs/tests/manytex.c b/progs/tests/manytex.c index 74b06649f6..52e7e1de44 100644 --- a/progs/tests/manytex.c +++ b/progs/tests/manytex.c @@ -13,6 +13,7 @@ #include <stdlib.h> #include <string.h> #include <math.h> +#include <GL/glew.h> #include <GL/glut.h> @@ -29,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 ) @@ -127,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 ) { @@ -305,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; } @@ -323,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 ); |