using Quicktime and glDrawPixels
I'm trying to use glDrawPixels() to draw a background in my 2D game. The code I use to load a texture (based on NeHe's TGA loading code) can only load 24 or 32 bit uncompressed TGA files, but an 800x600 uncompressed TGA file takes up a lot of disk space. I was thinking of switching to Quicktime, so I could load more optimal formats (such as PNG), or use 8-bit TGA files or something.
However, because of the way Quicktime loads images, the image data appears backwards and upside down when interpreted by OpenGL. In the past I solved this by changing the texture coordinates of a texture-mapped quad (or by manipulating the texture matrix, which is basically the same thing). As far as I know, no such mechanism exists for doing this using glDrawPixels().
What should I do? Any help is greatly appreciated.
However, because of the way Quicktime loads images, the image data appears backwards and upside down when interpreted by OpenGL. In the past I solved this by changing the texture coordinates of a texture-mapped quad (or by manipulating the texture matrix, which is basically the same thing). As far as I know, no such mechanism exists for doing this using glDrawPixels().
What should I do? Any help is greatly appreciated.
If you're using a Graphics Importer, you can tell it to draw the image upside-down into your GWorld (ie right-way-up for OpenGL) by swapping top and bottom in its bounds rectangle.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| transparency and color with glDrawPixels | belthaczar | 1 | 3,735 |
Feb 16, 2005 12:46 PM Last Post: OneSadCookie |
|

