prevent blending with BMP tile

Started by
3 comments, last by RedDragon0509 18 years, 10 months ago
I'm writing a 2D plateform game and im trying to draw an individual tile from a larger bmp, but a strip on the sides always blends with the tile next to it when the bmp is loaded (using nehe BMP to texture loader), I have turned blending off but it still happens. Is there any way around this? load the BMP: AUX_RGBImageRec *pBitMap = auxDIBImageLoad(strFileName); glGenTextures(1, &textureArray[ID]); glBindTexture(GL_TEXTURE_2D, textureArray[ID]); gluBuild2DMipmaps(GL_TEXTURE_2D, 3, pBitMap->sizeX, pBitMap->sizeY, GL_RGB, GL_UNSIGNED_BYTE, pBitMap->data); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); ----------------------------------------------- original BMP: Image Hosted by ImageShack.us Loaded BMP: Image Hosted by ImageShack.us This isn't bad except when the blue (sky) tiles are next to eachother: Image Hosted by ImageShack.us [Edited by - RedDragon0509 on June 6, 2005 8:50:33 AM]
When the world can't make you smile, program one that can
Advertisement
perhaps a screenie of whats going wrong would help us see the problem.
it the filtering you aply to the texture.
Try setting texture filtering to GL_NEAREST and warping to GL_CLAMP or GL_CLAMP_TO_EDGE.
You should never let your fears become the boundaries of your dreams.
well i tried changing the texture filtering to GL_NEAREST and warping to GL_CLAMP or GL_CLAMP_TO_EDGE but when i did this i still got:
Image Hosted by ImageShack.us

so i just moved the blue tile to the beginning of the image... so now i have a clear blue sky:
Image Hosted by ImageShack.us


though i should figure out how to code it right so i dont have to re-arrange my tilesets
When the world can't make you smile, program one that can

This topic is closed to new replies.

Advertisement