Some Texture problems

Hello!!

First at all, im not english so sorry for my wrongs.

I read nehe tutorials and now im trying to get my own programs. But i get a problem. All nehe examples use images that have 128128, 256256 pixels. If i try to change images the programs dont show image, all appear black.

In my program i need to get textures from images for diferent pixels…1616, 2424, 640480, 1632…

Please, can someone say me how get texture from this images, and get my rogram draw the imagen on my screen??

Thank you very much, and sorry for my mistakes, my english dont really good ^^;

Your english is not so bad, I understood your question :wink:

About GL textures : you need to use ‘power of two’ sizes in x and y.
Ie you can have a 1664 texture, but not a 640480. For such cases either scale your image so that it fits in a 512512 texture, or fill the lower left corner of a 1024512 texture, and use adequate texture coordinates.
(this limitation can be removed with some GL extensions, but I will keep it simple for now)

About nehe code, I think it should work for all power of two resolutions. Are you sure you can’t make it work with a 16*64 image ?

Hello!!

Thank you very much, you answer very fast.

Really i dont try using 16*64…i need another dimensions and dont try it, but thanks.

Another question that i have now…hoy can a get a texture from a part of image??

For example, i get image 256256 for multiple sub-images 1616…how can i get a texture from a subimage??

From first question i thing i will redimension it to 512512, and redimension to 640480 in-time.

Thank you :slight_smile: