hi!
similar code I've written several years ago looks something
like this; I'm not sure if this really helps -- but anyway:
void readLeft(void *, SoAction *)
{
static int c;
unsigned char *p;
unsigned char *tail = (unsigned char *) ImageLeft + sizeof ImageLeft;
// printf("readframe_left_buffer %d\n", c);
glPushMatrix();
glReadBuffer(GL_FRONT);
glPixelStorei(GL_PACK_ALIGNMENT, 1);
glReadPixels(0, 0, IMAGEW, IMAGEH, GL_RGBA, GL_UNSIGNED_BYTE, ImageLeft);
for (p = (unsigned char *) ImageLeft; p < tail; )
*(p++) &= 0xf0;
glPopMatrix();
}
(actually I don't remember why I was doing
*(p++) &= 0xf0;