Thanks ... actually the glPixelStorei(GL_PACK_ALIGNMENT, 1) seems to
have helped (well that and I realized that I didnt actually have a
current GL context, oooops).
kkonaka@xxxxxxxxxxxx wrote:
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;
part; maybe it's not necessary at all :p)
My guess is you were doing red/green 3-d glasses stuff.
Kevin
|