Advertisement

Help needed: Textures (Tutorial 6)

Started by January 08, 2003 10:54 AM
5 comments, last by nemeziz 22 years, 1 month ago
I have a problem with my textures. I''ve made a bmp file. I saved it in the same folder as my program. But when I run the program all I see is a complete white cube. I went through the code again and compared it with the original, but I can''t find anything. Does anybody know what could be wrong? Another question: If I want to load a picture in another format (BMP uses quite much memory), what changes do I have to do in the code? Thanks!
Personally I use TGA''s, because you can use alpha channels. Anyways, you may want to paste code.

Make sure in your initialize code you add this

glEnable(GL_TEXTURE_2D);
or
glEnable(GL_TEXTURES_2D);

dont remember which

IT Administrator / Software Engineere
http://drdsoftware.cjb.net
Dustin DavisOwner / CEOProgrammers Unlimitedwww.Programmers-Unlimited.com
Advertisement
look at NeHe''s iPicture code, it can load many types of pictures.
The problem is fixed... I changed the size of the picture to 64x64 and now it''s working fine!

Question:
If I want to use TGA, do I have to make any changes in the code?
Unless you''re using mipmaps, textures sizes have to be a multiple of two. 64, 128, 256, 512, 1024, 2096

TGA''s require a different loading code. Both NeHe and www.gametutorials.com have tutorials for them.

------------
MSN: nmaster42@hotmail.com, AIM: LockePick42, ICQ: 74128155
"It''s all part of the conspiracy of conspirators conspiring to conspire their own conspiracies..."
_______________________________________Pixelante Game Studios - Fowl Language
quote:
Original post by LockePick
Unless you''re using mipmaps, textures sizes have to be a multiple of two. 64, 128, 256, 512, 1024, 2096



Textures must be a power of two if you are using mipmaps. If you want a non-mipmapped texture that is not a power of 2, then use the NV_texture_rectangle extension ( can''t remember if there''s an ARB version ).


Death of one is a tragedy, death of a million is just a statistic.
If at first you don't succeed, redefine success.
Advertisement
One last Question:
If I choose to run the program in Fullscreen mode, my texture looks bad.
Why?

It dosen''t looks bad when I''m running it in windowed. Even if I maxmize the window it looks OK.

This topic is closed to new replies.

Advertisement