PDA

View Full Version : glPixelZoom oddities with glDrawPixels



brown12
10-30-2000, 12:03 PM
I'm using GLUT and GL in color index mode, and I have a rectangular array of pixels with a GLubyte per pixel as an index into a colortable. I set glPixelZoom(2,2) and then call
glDrawPixels(WIDTH, HEIGHT, GL_COLOR_INDEX, GL_UNSIGNED_BYTE, Pixels)
However, it does not actually zoom, and just leaves my rectangle at its original size.
If I replace GL_UNSIGNED_BYTE with GL_BYTE, it does perform the zoom -- however, then the DrawPixels takes 25 times as long, 0.2 seconds as opposed to 0.008, which is unacceptable in my application. Does anyone have any ideas as to why the zoom might be ignored?
Thanks,
Joel

mcraighead
10-30-2000, 09:33 PM
Color index mode? That's your problem. http://www.opengl.org/discussion_boards/ubb/smile.gif

It certainly sounds like a bug. Note that the reason GL_BYTE is so slow is probably that the GL_UNSIGNED_BYTE case is detected and optimized as requiring no special processing, whereas GL_BYTE is probably undergoing all sorts of crazy stuff behind your back...

- Matt