From 2e61d136c27b9c740190643668f1e3509ce609dc Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Sat, 24 Jan 2009 16:39:49 +0000 Subject: progs: Port most of the demos to glew. A couple of test weren't ported due to glew breakage -- it undefines GLAPIENTRY. --- progs/demos/copypix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'progs/demos/copypix.c') diff --git a/progs/demos/copypix.c b/progs/demos/copypix.c index 15001e851b..51435acfa0 100644 --- a/progs/demos/copypix.c +++ b/progs/demos/copypix.c @@ -6,11 +6,10 @@ */ -#define GL_GLEXT_PROTOTYPES - #include #include #include +#include #include #include "readtex.h" @@ -234,6 +233,7 @@ int main( int argc, char *argv[] ) glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE); glutCreateWindow(argv[0]); + glewInit(); Init(ciMode, filename); Usage(); -- cgit v1.2.3 From 079ae4c38cf8155f7aa039f6f4374fe5d351ef4f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 8 Sep 2009 16:45:07 -0600 Subject: progs/demos: added RGB invert option --- progs/demos/copypix.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'progs/demos/copypix.c') 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; -- cgit v1.2.3