Hi all. I am just getting started in OpenGL. I am running Fedora Core 5 and have an ATI 9800. I wrote a simple program to draw a PixMap to the screen using an 3d array of pixel data.
The following code is used to draw the pixels
Before I added the line glPixelStorei(GL_UNPACK_ALIGNMENT, 1) I got the the following result.Code :void Draw() { glClear(GL_COLOR_BUFFER_BIT); glRasterPos2f(-0.5, -.7); glPixelZoom(0.6, 0.6); glDrawPixels(1201, 1201, GL_RGB, GL_UNSIGNED_BYTE, checkImage); } void SetupRC(void) { glClearColor(0.0f, 0.0f, 1.0f, 1.0f); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); }
There is a “triangle” worth of pixels (from the lower right corner up about a third of the way over at the top) drawn in the wrong place. Almost like the Pixel row data is being wrapping in some strange way progressively more per row as they get to the top of the image. I learned that glPixelStore handles the alignment of pixel data in memory. What I don't get is why I would get results like this with every GL_UNPACK_ALIGNMENT setting except 1. I haven't got to test it on an NVIDIA card yet. I can't tell if this is specific to ATI or graphics card memory. Would this still happen if it was software rendered? If someone would be so kind as to educate me as to the reason this occurs I would appreciate it.
If my description doesn't help let me know, I'll have to try and find a place to put screen shots.



