Texture problem :(

Started by
5 comments, last by Deadman55 21 years, 1 month ago
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!
Advertisement
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
-------------------------Knowledge Is For EveryoneSnowKing3kSnowKing3k@hotmail.com
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.
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 -
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?
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
if the quad is smaller than the texture, it should still display it without having to explicity make mip maps

This topic is closed to new replies.

Advertisement