I was having a problem with a very short program that draws a bitmap and a pixel image.
For the bitmap, I would set the raster position, set the color, then draw the bitmap 3 times in a row, to get three light blue-green letter F’s in the lower left corner.
For the pixel image, I would draw it centered over the mouse location. If the pixel image is going over the edge of the bottom or left sides, some extra work is performed so that only the part that fits on the screen is copied, so the raster position is always on the screen.
I found that when the pixel image started to slide off the bottom or left side, when the extra steps are taken, the bitmap would appear in white, even if I picked a different color.
I also found that it didn’t matter if I executed the bitmap code before or after the pixel image code - the bitmap would still be white.
Note that nowhere in my code did I ever set the color to white.
I eventually discovered that by setting the bitmap color first, THEN setting the raster position and drawing it, the problem went away - the bitmap always appears in the desired color, regardless of what the pixel image is doing.
Is this something that occurs a lot in OpenGL - needing to find the correct magic sequence of operations?
Does this kind of thing depend on the video card, OpenGL driver, and/or operating system?
Is there any site with some general advice about what sort og gotchas to look out for?
I’m using OS X.
Tx.
