Hi, I don’t know if this is the right way to be doing this, well, I guess not, because it doesn’t work. I successfully render an image to the single-buffered window, and wish to redraw it when glut calls the refresh callback. So I do this:
GLubyte screenPixels = (GLubyte) calloc
(4glutGet(GLUT_WINDOW_WIDTH)
glutGet(GLUT_WINDOW_HEIGHT), sizeof(GLfloat));
glReadPixels
(0,0,glutGet(GLUT_WINDOW_WIDTH), glutGet(GLUT_WINDOW_HEIGHT),
GL_RGBA, GL_UNSIGNED_BYTE, screenPixels);
glClear(GL_COLOR_BUFFER_BIT);
glDrawPixels
(glutGet(GLUT_WINDOW_WIDTH), glutGet(GLUT_WINDOW_HEIGHT),
GL_RGBA , GL_UNSIGNED_BYTE , screenPixels);
When the DrawPixels finishes, my screen is white. It seems to be that the glReadPixels is not functioning correctly, because it reads all zeros, ones or 255’s depending on what format and type I use. glGetError reports no errors. I do have the correct buffer as current.
I’m using OpenGL on IRIX 6.5 (SGI).
any ideas? I don’t care how I get it working, if DrawPixels is wrong, I’m open to ideas. Looking at the GL pipeline, I don’t see how glReadPixels can really get that confused.
thx, Cc: by mail if possible, great!
[This message has been edited by wealthychef (edited 11-29-2000).]
[This message has been edited by wealthychef (edited 11-29-2000).]