summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2005-03-14 22:09:31 +0000
committerIan Romanick <idr@us.ibm.com>2005-03-14 22:09:31 +0000
commit7457a648d28a49a58d2f626dcbd82d30506c7679 (patch)
treebc3d7140efef65a8b6f81608c88b7c64ff91f78d
parentbd5bba84705fd96ebf11493130d54e547a83d0fc (diff)
If setting GL_PACK_INVERT_MESA results in a GL error, log it.
-rw-r--r--progs/tests/invert.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/progs/tests/invert.c b/progs/tests/invert.c
index 5f196c9817..750592ed79 100644
--- a/progs/tests/invert.c
+++ b/progs/tests/invert.c
@@ -56,6 +56,9 @@ PFNGLWINDOWPOS2IPROC win_pos_2i = NULL;
static void Display( void )
{
+ GLint err;
+
+
glClearColor(0.2, 0.2, 0.8, 0);
glClear( GL_COLOR_BUFFER_BIT );
@@ -67,11 +70,23 @@ static void Display( void )
glDrawPixels( img_width, img_height, img_format, GL_UNSIGNED_BYTE, image );
glPixelStorei( GL_PACK_INVERT_MESA, GL_FALSE );
+ err = glGetError();
+ if ( err != GL_NO_ERROR ) {
+ printf( "Setting PACK_INVERT_MESA to false generated an error (0x%04x).\n",
+ err );
+ }
+
glReadPixels( 5, 5, img_width, img_height, img_format, GL_UNSIGNED_BYTE, temp_image );
(*win_pos_2i)( 5 + 1 * (10 + img_width), 5 );
glDrawPixels( img_width, img_height, img_format, GL_UNSIGNED_BYTE, temp_image );
glPixelStorei( GL_PACK_INVERT_MESA, GL_TRUE );
+ err = glGetError();
+ if ( err != GL_NO_ERROR ) {
+ printf( "Setting PACK_INVERT_MESA to true generated an error (0x%04x).\n",
+ err );
+ }
+
glReadPixels( 5, 5, img_width, img_height, img_format, GL_UNSIGNED_BYTE, temp_image );
(*win_pos_2i)( 5 + 2 * (10 + img_width), 5 );
glDrawPixels( img_width, img_height, img_format, GL_UNSIGNED_BYTE, temp_image );