Original Post
Hey guys!!
I have a question for you ppl....
Well, let''s say I have a texture that represents the background of a 2D game.
Also, let''s say that this background remains there for the entire duration of the game.
During the game, I just draw some quads over the background.
I don''t want to draw all the time the background(because it''s time consuming), so I only draw it once, the first time, and I don''t clear the color and depth buffer bit...
So, in order to do that, I need to display a new quad on top of the one I have drawn over the background that fits/looks exactly like the background...
So, my problem is a simple one: How can I split the background texture (a texture) in a number of quads (pieces)?
For loading the textures I use the NeHe_IPicture code...
I know that if I have a pointer(*a) to height*width bytes, I can acces the (x,y) byte with: a+x*width+y if I start with x,y from 0 to height-1 and width-1
So, what is the format of the IPicture data?
For my problem there are 2 solutions (or more):
1. I could make lots of textures when I load the file
2. I could display from the background only that part when drawing
So, what should I do? And how should I do it ?