Archived

This topic is now archived and is closed to further replies.

stefu

Big Background Picture

Recommended Posts

How do you draw big background (800x600px)? glDrawPixels is slow (according to old posts). And max texture size is 256x256. I found something about creating one tmptexture, then using glTexSubImage2D to copy portion of image to texture and then render a textured qued. This the way to go? edit: Damn, got it totally wrong this time. I am mixing images and textures and everything [edited by - stefu on August 14, 2003 1:59:07 PM]

Share this post


Link to post
Share on other sites
Try using several small textured quads instead of just one big?
This is the way Resident Evil was made. =)

"Game Maker For Life, probably never professional thou." =)

Share this post


Link to post
Share on other sites
This way?

Image image; // 800x600 image read from file


vector<Image> subimages;
image.sub(256,256,subimages); // Create 256x256 sized sub images


GLuint texture; // existing 256x256 sized texture

glBindTexture(texture);

for each img in subimages:
glTexSubImage2D(texture, 0, 0, 0, 256, 256, img.buffer());
render quad with correct coordinates



[edited by - stefu on August 14, 2003 2:24:47 PM]

Share this post


Link to post
Share on other sites