diff options
author | Brian Paul <[email protected]> | 2010-03-10 14:35:57 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2010-03-10 14:37:05 -0700 |
commit | c7be039fad6d93911d1142fc5dea18d0c2684143 (patch) | |
tree | fba4c39192cf23223dd2fc560a2ec4307330774e /progs/trivial/clear-fbo-scissor.c | |
parent | d5ccbea63cb9ba96cd4c0e2f40824ec1939c806c (diff) |
progs/trivial: use -c option to use glCopyPixels()
Otherwise we use glRead/DrawPixels to copy the off-screen FBO image
into the window.
Looks like NVIDIA's broken when using -c (the image is upside down),
but OK with -c -t.
Diffstat (limited to 'progs/trivial/clear-fbo-scissor.c')
-rw-r--r-- | progs/trivial/clear-fbo-scissor.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/progs/trivial/clear-fbo-scissor.c b/progs/trivial/clear-fbo-scissor.c index 28c613ccfba..6a605e16a8b 100644 --- a/progs/trivial/clear-fbo-scissor.c +++ b/progs/trivial/clear-fbo-scissor.c @@ -17,6 +17,7 @@ static int Width = 512, Height = 512; static GLuint MyFB, MyRB; static GLboolean UseTex = GL_FALSE; +static GLboolean UseCopyPix = GL_FALSE; #define CheckError() \ @@ -110,7 +111,6 @@ static void Draw(void) { GLboolean scissor = GL_TRUE; - GLboolean copyPix = GL_FALSE; /* draw to user framebuffer */ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB); @@ -171,7 +171,7 @@ Draw(void) glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0); glDrawBuffer(GL_BACK); - if (copyPix) { + if (UseCopyPix) { glWindowPos2i(0, 0); glCopyPixels(0, 0, Width, Height, GL_COLOR); } @@ -211,6 +211,8 @@ main(int argc, char *argv[]) for (i = 1; i < argc; i++) { if (strcmp(argv[i], "-t") == 0) UseTex = GL_TRUE; + else if (strcmp(argv[i], "-c") == 0) + UseCopyPix = GL_TRUE; } if (UseTex) |