From 33899b7c351fda77bed6dee5e5d02e31c2f7e0e5 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Sat, 16 Oct 2004 01:16:54 +0000 Subject: 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. --- progs/demos/readpix.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'progs') 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); -- cgit v1.2.3