PDA

View Full Version : Using bitmaps as texture



02-13-2002, 10:29 PM
I am haveing problems using bitmaps. It works fine if I apply texture to all my quads. However, as soon as I specify solid colours for other quads, the bitmap texture on the previous quads get blanked off. Also it seems to use the palette colour system from the bitmap to fill the remaining quads

JLawson
02-14-2002, 06:27 AM
To have the bitmap colors replace the existing colors of the object that you are applying the texture to, call

glTexEnvf(GL_TEXTURE_2D, GL_TEX_ENV, GL_REPLACE);

Be sure that if you are trying to repeat your texture (i.e. tiling or something) call

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);

And if you are trying to draw something without the texture, be sure to unbind the texture and call glDisable(GL_TEXTURE_2D);


Hope this helps,
~Jesse

Omaha
02-14-2002, 08:47 AM
Actually, you should call:

glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);