diff options
author | Brian Paul <[email protected]> | 2006-03-30 14:24:58 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2006-03-30 14:24:58 +0000 |
commit | 693a66aea94c9a043e9c056395cd4f6c29bee9e7 (patch) | |
tree | ec6164d151e93d6f0051a7e6ef68c737dc60fe1b /progs/demos | |
parent | 8ea3353ec3fa29f0eb2269b54fff6834f97a8c08 (diff) |
press '0' for glDrawBuffer(GL_NONE)
Diffstat (limited to 'progs/demos')
-rw-r--r-- | progs/demos/reflect.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/progs/demos/reflect.c b/progs/demos/reflect.c index ce0239211ff..0bec0663bc2 100644 --- a/progs/demos/reflect.c +++ b/progs/demos/reflect.c @@ -302,11 +302,21 @@ DrawWindow(void) GLfloat dist = 20.0; GLfloat eyex, eyey, eyez; - glDrawBuffer(w->drawBuffer); - glReadBuffer(w->drawBuffer); + if (w->drawBuffer == GL_NONE) { + glDrawBuffer(GL_BACK); + glReadBuffer(GL_BACK); + } + else { + glDrawBuffer(w->drawBuffer); + glReadBuffer(w->drawBuffer); + } glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); + if (w->drawBuffer == GL_NONE) { + glDrawBuffer(GL_NONE); + } + eyex = dist * cos(w->yrot * DEG2RAD) * cos(w->xrot * DEG2RAD); eyez = dist * sin(w->yrot * DEG2RAD) * cos(w->xrot * DEG2RAD); eyey = dist * sin(w->xrot * DEG2RAD); @@ -376,10 +386,10 @@ DrawWindow(void) ShowAlphaBuffer(w->width, w->height); } - if (w->drawBuffer == GL_BACK) - glutSwapBuffers(); - else + if (w->drawBuffer == GL_FRONT) glFinish(); + else + glutSwapBuffers(); /* calc/show frame rate */ { @@ -460,6 +470,10 @@ Key(unsigned char key, int x, int y) w->drawBuffer = GL_FRONT; glutPostRedisplay(); break; + case '0': + w->drawBuffer = GL_NONE; + glutPostRedisplay(); + break; case ' ': w->anim = !w->anim; w->t0 = -1; |