Archived

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

Deadman55

Texture problem :(

Recommended Posts

The JPG and TGA textures won''t show up on the 2D quad I render. The BMP will. If I just blit the JPG or TGA texture to the screen they show up. What is this? Has it something to do with the quad''s dimensions? The texturing is done the same for all file formats so something is weird. Thanks!

Share this post


Link to post
Share on other sites
There are difference between a LoadBMP function and a LoadTGA or jpg function... well those i''ve see. If your sure your function can load both bmp and jpg/tga file i don''t what''s the problem but check this.

Hope this will help ya.

-------------------------
Knowledge Is For Everyone

SnowKing3k
SnowKing3k@hotmail.com

Share this post


Link to post
Share on other sites
I have three different functions loading each format of course. The thing is, using glDrawPixels() to blit the texture directly to the screen, all textures show up the way I want them to. But if I texture map a simple 2D quad only the BMP will show up AT ALL! Trying with a JPG or TGA the quad goes white. The loading returns true.

Share this post


Link to post
Share on other sites
You are setting your textures up incorrectly, the images load correctly, but white means something is wrong with your gl code. Check the code around your glTexImage2D() call, you have to at the very least generate the tex id first, bind it, specify min and mag filters, set the envmode, maybe the s and t wrap modes, and then glTexImage2D(), and before you draw make sure your texture is currently bound, make sure texturing is enabled, and make sure your vertices have texcoords.

------------
- outRider -

Share this post


Link to post
Share on other sites
But my texture setup function is the same for all formats!! (Generating texture IDs and everything).

Of course I setup correct texture coords, they work for the BMP! I use the SAME code, just altering what picture to load and it screws up! The pictures DO exist, too!

Got any clues?

Share this post


Link to post
Share on other sites
Never mind, I got it lol. The quad itself was smaller than the jpg/tga textures so I had to generate mip maps to make it work. Is this sane? :D

Share this post


Link to post
Share on other sites