hi,
I was reading the textured cube tutorial on NEHE.gamedev.net lesson 6
He shows you how to a single textured cube. I tried to extend this to have 2 textures but it’s not working. Only one texture works and the other faces of the cube are ‘white’.
Im almost positive that the trouble is w/ the texture binding. here’s a summary of what I did there.
#--------------
AUX_RGBImageRec *TextureImage[2]; // Storage space for our Texture
if ( TextureImage[0]=LoadBMP("data/crate.bmp"))
{
Status=TRUE;
//Here it looks like we are creating storage and type of texture then assigning the bitmap data to it.
glGenTextures(1, &texture[0]); // Create the texture
glBindTexture(GL_TEXTURE_2D, texture[0]); // Texture generation using data from the bitmap
glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage[0]->sizeX, TextureImage[0]->sizeY,0,GL_RGB,GL_UNSIGNED_BYTE, TextureImage[0]->data);
if( TextureImage[1]=LoadBMP("data/nehe.bmp") )
{
Status= TRUE;
glGenTextures(1, &texture[1]); // Create the texture
glBindTexture(GL_TEXTURE_2D, texture[1]); // Texture generation using data from the bitmap
glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage[1]->sizeX, TextureImage[1]->sizeY,0,GL_RGB,GL_UNSIGNED_BYTE, TextureImage[1]->data);
}
#-------
Can anyone see what’ going wrong here?