   Problem with textures, only one white...
  Hi, i'm using Nehe's code to load 5 bitmaps and textures.The problem that i'm getting is that the only texture that doesn't work properly is the one in position 2 (texture[1], Textureimage[1]).All textures appear correctly except the one that i set on that position. As you can see in my code, i tried loading the same image 5 times and i get the same problem. This texture works as long as i dont bind it using position 2...I can load any other textures on any of my objects correctly, but if i change the index of the texture loaded in glBindTexture(GL_TEXTURE_2D, texture[3]); I get a white object...Any help/ideas woudl be greatly appreciated.Thanks!Max//http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=06AUX_RGBImageRec *LoadBMP(char *Filename)// Loads A Bitmap Image{FILE *File=NULL;// File Handleif (!Filename)// Make Sure A Filename Was Given{return NULL;// If Not Return NULL}File=fopen(Filename,"r");// Check To See If The File Existsif (File)// Does The File Exist?{fclose(File);// Close The Handlereturn auxDIBImageLoad(Filename);// Load The Bitmap And Return A Pointer}return NULL;// If Load Failed Return NULL}//http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=06int LoadGLTextures()// Load Bitmaps And Convert To Textures{int Status=FALSE;// Status IndicatorAUX_RGBImageRec *TextureImage[5];// Create Storage Space For The Texturememset(TextureImage,0,sizeof(void *)*5); // Set The Pointer To NULL// Load The Bitmap, Check For Errors, If Bitmap's Not Found Quitif ((TextureImage[0]=LoadBMP("boardwood.bmp"))&&(TextureImage[1]=LoadBMP("boardwood.bmp"))&&(TextureImage[2]=LoadBMP("boardwood.bmp"))&&(TextureImage[3]=LoadBMP("boardwood.bmp"))&&(TextureImage[4]=LoadBMP("boardwood.bmp"))){Status=TRUE;// Set The Status To TRUEglGenTextures(5, &texture[0]);// Create The Texture// Typical Texture Generation Using Data From The Bitmapfor (int i=0;i<5;i++){glBindTexture(GL_TEXTURE_2D, texture);glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage->sizeX, TextureImage->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage->data);}}for (int i=0;i<5;i++){if (TextureImage)// If Texture Exists{if (TextureImage->data)// If Texture Image Exists{free(TextureImage->data);// Free The Texture Image Memory}free(TextureImage);// Free The Image Structure}}return Status;// Return The Status}
  DOH!nevermind, i'm an idiot!changed the declaration:GLuinttexture[1];toGLuinttexture[5];and surprise! it's working well now!Max   