summaryrefslogtreecommitdiff
path: root/progs/tests/texwrap.c
diff options
context:
space:
mode:
authorChia-I Wu <olvaffe@gmail.com>2009-09-15 14:16:22 +0800
committerChia-I Wu <olvaffe@gmail.com>2009-09-15 14:16:22 +0800
commite2ba90a9cc762cf00a168f0a59d31e7dc52fc42e (patch)
treefe3206d7602ad935296884742980f3c4d30bd867 /progs/tests/texwrap.c
parent11a4292d4eb515813b82b8d688a318adef66b3e6 (diff)
parentb4b8800315637d9218a81c76f09df7d601710d29 (diff)
Merge commit 'eee/mesa-es' into android
Diffstat (limited to 'progs/tests/texwrap.c')
-rw-r--r--progs/tests/texwrap.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/progs/tests/texwrap.c b/progs/tests/texwrap.c
index 8143256f8a..92c8a2f14c 100644
--- a/progs/tests/texwrap.c
+++ b/progs/tests/texwrap.c
@@ -8,10 +8,10 @@
*/
-#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -258,8 +258,26 @@ static void Init( void )
}
glBindTexture(GL_TEXTURE_2D, BORDER_TEXTURE);
+#ifdef TEST_PBO_DLIST
+ /* test fetching teximage from PBO in display list */
+ {
+ GLuint b = 42, l = 10;
+
+ glBindBufferARB(GL_PIXEL_UNPACK_BUFFER, b);
+ glBufferDataARB(GL_PIXEL_UNPACK_BUFFER, sizeof(BorderImage),
+ BorderImage, GL_STREAM_DRAW);
+
+ glNewList(l, GL_COMPILE);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, SIZE+2, SIZE+2, 1,
+ GL_RGBA, GL_UNSIGNED_BYTE, (void *) 0/* BorderImage*/);
+ glEndList();
+ glCallList(l);
+ glBindBufferARB(GL_PIXEL_UNPACK_BUFFER, 0);
+ }
+#else
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, SIZE+2, SIZE+2, 1,
GL_RGBA, GL_UNSIGNED_BYTE, (void *) BorderImage);
+#endif
for (i = 0; i < SIZE; i++) {
for (j = 0; j < SIZE; j++) {
@@ -294,6 +312,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 1000, 270 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );