Skip to main content
gamedev.net
🔒 Locked

Background

Started by cavendish 4 replies 600+ views
Original Post
cavendish
cavendish
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 ?
--------Whatever
cavendish
cavendish
Sorry about that... I just wanted to make sure....
--------Whatever
cavendish
cavendish
Raduprv, I noticed that there is little improvement on W2k, but on Win XP the improvemet was huge... So what's with this thing? XP goes like 5 times slower then W2k... What's that all about? (On the same machine offcourse an with the same hardware )

Ok, so you don't like the way I pose the question....
What if I want to make a puzzle game and I need to have a number of textures built up from a big texture.... How do I do that?

[edited by - cavendish on November 30, 2002 3:34:47 PM]
--------Whatever

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.