From: Brian Date: Wed, 20 Feb 2008 18:58:33 +0000 (-0700) Subject: Test calling glTexSubImage2D mid-way through a frame. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=52e4c8d702e15bdf13a61db0a01c5ca2abb9d040;p=mesa.git Test calling glTexSubImage2D mid-way through a frame. --- diff --git a/progs/tests/Makefile b/progs/tests/Makefile index 00e58a53ce8..8196c1b348f 100644 --- a/progs/tests/Makefile +++ b/progs/tests/Makefile @@ -62,6 +62,7 @@ SOURCES = \ sharedtex.c \ stencilwrap.c \ stencil_wrap.c \ + subtex \ subtexrate.c \ tex1d.c \ texcompress2.c \ diff --git a/progs/tests/subtex.c b/progs/tests/subtex.c new file mode 100644 index 00000000000..81ceb085aaf --- /dev/null +++ b/progs/tests/subtex.c @@ -0,0 +1,223 @@ +/* + * Test glTexSubImage mid-way through a frame. + * + * The same texture is used for both quads but it gets redefined + * with glTexSubImage (or glTexImage) after the first quad. + */ + + +#include +#include +#include +#include "GL/glut.h" + +static GLuint Window = 0; +static GLboolean Anim = GL_FALSE; +static GLfloat Angle = 0.0f; + + + +static void +first_texture(void) +{ + static int width=8, height=8; + static GLubyte tex1[] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 1, 1, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 1, 1, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 }; + + GLubyte tex[64][3]; + GLint i, j; + + /* red on white */ + for (i=0;i