mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-30 12:10:09 +01:00
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.
This commit is contained in:
parent
d5ccbea63c
commit
c7be039fad
1 changed files with 4 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue