diff options
author | Nicolai Hähnle <nhaehnle@gmail.com> | 2009-09-21 13:26:50 +0200 |
---|---|---|
committer | Nicolai Hähnle <nhaehnle@gmail.com> | 2009-09-21 13:26:50 +0200 |
commit | 81c7561d9d3faf70ac22c6a5f3fbea18f53eed92 (patch) | |
tree | 5ec097e0e1fe99804104d3a56923c16edf1533aa /progs/demos/copypix.c | |
parent | f02f63997ce65530788a6dfcb28f11790a14d938 (diff) | |
parent | 3083ba38f4c884b32cd0460607b5064b6b7008d2 (diff) |
Merge branch 'master' into r300-compiler
There were additional non-textual conflicts.
Conflicts:
src/gallium/drivers/r300/r300_tgsi_to_rc.c
src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c
src/mesa/drivers/dri/r300/compiler/radeon_program.c
src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c
Diffstat (limited to 'progs/demos/copypix.c')
-rw-r--r-- | progs/demos/copypix.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/progs/demos/copypix.c b/progs/demos/copypix.c index 51435acfa0..a13339ea62 100644 --- a/progs/demos/copypix.c +++ b/progs/demos/copypix.c @@ -26,6 +26,7 @@ static int Scissor = 0; static float Xzoom, Yzoom; static GLboolean DrawFront = GL_FALSE; static GLboolean Dither = GL_TRUE; +static GLboolean Invert = GL_FALSE; static void Reset( void ) @@ -59,6 +60,15 @@ static void Display( void ) if (Scissor) glEnable(GL_SCISSOR_TEST); + if (Invert) { + glPixelTransferf(GL_RED_SCALE, -1.0); + glPixelTransferf(GL_GREEN_SCALE, -1.0); + glPixelTransferf(GL_BLUE_SCALE, -1.0); + glPixelTransferf(GL_RED_BIAS, 1.0); + glPixelTransferf(GL_GREEN_BIAS, 1.0); + glPixelTransferf(GL_BLUE_BIAS, 1.0); + } + /* draw copy */ glPixelZoom(Xzoom, Yzoom); glWindowPos2iARB(Xpos, Ypos); @@ -67,6 +77,15 @@ static void Display( void ) glDisable(GL_SCISSOR_TEST); + if (Invert) { + glPixelTransferf(GL_RED_SCALE, 1.0); + glPixelTransferf(GL_GREEN_SCALE, 1.0); + glPixelTransferf(GL_BLUE_SCALE, 1.0); + glPixelTransferf(GL_RED_BIAS, 0.0); + glPixelTransferf(GL_GREEN_BIAS, 0.0); + glPixelTransferf(GL_BLUE_BIAS, 0.0); + } + if (DrawFront) glFinish(); else @@ -105,6 +124,9 @@ static void Key( unsigned char key, int x, int y ) else glDisable(GL_DITHER); break; + case 'i': + Invert = !Invert; + break; case 's': Scissor = !Scissor; break; |