prevent blending with BMP tile
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:
Loaded BMP:
This isn't bad except when the blue (sky) tiles are next to eachother:
[Edited by - RedDragon0509 on June 6, 2005 8:50:33 AM]
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:
so i just moved the blue tile to the beginning of the image... so now i have a clear blue sky:
though i should figure out how to code it right so i dont have to re-arrange my tilesets
so i just moved the blue tile to the beginning of the image... so now i have a clear blue sky:
though i should figure out how to code it right so i dont have to re-arrange my tilesets
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement