From 52e4c8d702e15bdf13a61db0a01c5ca2abb9d040 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 20 Feb 2008 11:58:33 -0700 Subject: Test calling glTexSubImage2D mid-way through a frame. --- progs/tests/subtex.c | 223 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 223 insertions(+) create mode 100644 progs/tests/subtex.c (limited to 'progs/tests/subtex.c') diff --git a/progs/tests/subtex.c b/progs/tests/subtex.c new file mode 100644 index 0000000000..81ceb085aa --- /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