summaryrefslogtreecommitdiff
path: root/progs/demos/readpix.c
diff options
context:
space:
mode:
Diffstat (limited to 'progs/demos/readpix.c')
-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);