using Quicktime and glDrawPixels

kingofsquirrels
Unregistered
 
Post: #1
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.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
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.
Quote this message in a reply
kingofsquirrels
Unregistered
 
Post: #3
Thanks!
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  transparency and color with glDrawPixels belthaczar 1 4,167 Feb 16, 2005 12:46 PM
Last Post: OneSadCookie
  SDL & Quicktime DM6 4 3,368 Jul 4, 2004 08:22 AM
Last Post: Steven