Hi,
I’m trying to draw something to the GL_BACK_RIGHT buffer, but for some reason it keeps going to my GL_BACK buffer instead - is this right?
I’m drawing a black square to GL_BACK_RIGHT, and an orange one to GL_BACK, but when I call SwapBuffers(), I see both of my squares on the screen. I thought the back right one would still be hidden as it has been drawn to a different buffer…?
Here’s my code:
// use GL_BACK_RIGHT buffer
glDrawBuffer(GL_BACK_RIGHT);
glClearColor(1.0f, 1.0f, 1.0f, 0.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
glLoadIdentity();
glTranslatef(0.0f,0.0f,-10.0f);
// draw a black square
glColor3b(0,0,0);
glBegin(GL_POLYGON);
glVertex3f(1,1,1);
glVertex3f(-1,1,1);
glVertex3f(-1,-1,1);
glVertex3f(1,-1,1);
glEnd();
// now switch to GL_BACK buffer
glDrawBuffer(GL_BACK);
glLoadIdentity();
glTranslatef(0.0f,0.0f,-10.0f);
// draw an orange square
glColor3b(100,50,0);
glBegin(GL_POLYGON);
glVertex3f(2,2,1);
glVertex3f(0,2,1);
glVertex3f(0,0,1);
glVertex3f(2,0,1);
glEnd();
// swap back buffer to front
SwapBuffers(hDC);
Many thanks for any help in advance.
Daz.