summaryrefslogtreecommitdiff
path: root/progs
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2004-10-16 01:16:54 +0000
committerIan Romanick <idr@us.ibm.com>2004-10-16 01:16:54 +0000
commit33899b7c351fda77bed6dee5e5d02e31c2f7e0e5 (patch)
tree4bd56b79459db045b187e6aabc5027f359f80721 /progs
parent83c74b72792928b5a5ac540eeef65fca3145ddb6 (diff)
Add support for OES_read_format. As soon as glext.h is updated with the
enums for this extension, the changes to gl.h can be removed.
Diffstat (limited to 'progs')
-rw-r--r--progs/demos/readpix.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/progs/demos/readpix.c b/progs/demos/readpix.c
index 784e4c88d7..fc322f2e81 100644
--- a/progs/demos/readpix.c
+++ b/progs/demos/readpix.c
@@ -207,6 +207,8 @@ Key( unsigned char key, int x, int y )
static void
Init( GLboolean ciMode )
{
+ GLboolean have_read_format = GL_FALSE;
+
printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
@@ -234,6 +236,20 @@ Init( GLboolean ciMode )
}
}
+#ifdef GL_OES_read_format
+ if ( glutExtensionSupported( "GL_OES_read_format" ) ) {
+ glGetIntegerv( GL_IMPLEMENTATION_COLOR_READ_TYPE_OES, & ReadType );
+ glGetIntegerv( GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES, & ReadFormat );
+
+ have_read_format = GL_TRUE;
+ }
+#endif
+
+ printf( "GL_OES_read_format %ssupported. "
+ "Using type / format = 0x%04x / 0x%04x\n",
+ (have_read_format) ? "" : "not ",
+ ReadType, ReadFormat );
+
printf("Loaded %d by %d image\n", ImgWidth, ImgHeight );
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);