2D images

djohnson
Unregistered
 
Post: #1
Ok, I am trying to create a simple background image in a window. How would I go about doing this if the image of 640 x 480? I have tried texture mapping, but no luck there unless it is a direct multiple of 64 x 64... If you know of a good tutorial that does not go into 3D like nehe, please share! Thanks.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
multiple of 64 is irrelevant, it's power-of-two that's important.

You have two options here. One is to put your 640x480 image into the bottom left of a 1024x512 texture, and just draw the bit you care about. The other is to use the EXT_texture_rectangle extension, which allows non-power-of-two textures (but won't work on the Rage 128).
Quote this message in a reply
djohnson
Unregistered
 
Post: #3
Ortho view is what I think I need. I am reading up on tutorial 21 on nehe. Some how I missed it the first time I was going through the tutorials.... Thanks for the help.
Quote this message in a reply
djohnson
Unregistered
 
Post: #4
For now I will use a 512 x 512 background. In order to scroll the background, I can have 2 textures and then move 2 quads and alternate between the images... Here is what I figured out how to do tonight:

Display the 512 x 512 background in a same sized window.
Display another quad on top of the background.
Allow L,R,U,D arrow keys to move the top quad and detect the walls.
Fire a missle from the current position of the 2nd quad and stop when it hits the top.

Pretty good for one night of really trying out OpenGL.
Quote this message in a reply
Member
Posts: 469
Joined: 2002.10
Post: #5
For a static background there's always the option to do glBitmap with no constraint on size other than the max unpack line width (usually 1024 for rage128 and 2048 for newer cards).

---Kelvin--
15.4" MacBook Pro revA
1.83GHz/2GB/250GB
Quote this message in a reply
Post Reply