   Lesson 33 (TGA loading function)
  This code works perfectly for me (except for 32 bit files) and when I try and load more than two files...the code for loading is here;    int LoadGLTextures()// Load Bitmaps And Convert To Textures{int Status=FALSE;// Status Indicator// Load The Bitmap, Check For Errors.if (LoadTGA(&texture[0], "land.tga") &&    LoadTGA(&texture[1], "tree.tga")){Status=TRUE;// Set The Status To TRUEfor (int loop=0; loop<2; loop++)// Loop Through Both Textures{// Typical Texture Generation Using Data From The TGA ( CHANGE )glGenTextures(1, &texture[loop].texID);// Create The Texture ( CHANGE )glBindTexture(GL_TEXTURE_2D, texture[loop].texID);glTexImage2D(GL_TEXTURE_2D, 0, 3, texture[loop].width, texture[loop].height, 0, GL_RGB, GL_UNSIGNED_BYTE, texture[loop].imageData);glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);if (texture[loop].imageData)// If Texture Image Exists ( CHANGE ){free(texture[loop].imageData);// Free The Texture Image Memory ( CHANGE )}}}return Status;// Return The Status}So I tried to load 3 textures, by changing the code at the beginning;Texture texture[2]toTexture texture[3](where Texture is a struct with size,width,data etc)and also the code in the LoadTGA function to;if (LoadTGA(&texture[0], "land.tga") &&LoadTGA(&texture[1], "tree.tga") &&LoadTGA(&texture[2], "stats.tga"))andfor (int loop=0; loop<3; loop++)I presumed this would make an array of three texture spaces, and loop through the code 3 times loading each one. There are no errors in compilation, but the texture is just white, it doesn't load. Also for some reason, the glPrint calls no longer function, when I try and load 3+ textures.  The top left of the screen flickers as if it were refreshing the FPS (always used to flicker) but..there's no font there, even with a glDisable(GL_TEXTURE_2D) before the glPrint calls.If I comment out the third texture load (LoadTGA(&texture[2]) the font works fine. But I don't see what TGA loading has got to do with using bitmap fonts..there is no 'reserved' variable called texture[2], so it shouldn't interfere.I also tried creating another array of textures using the same struct, 'texture2nd[2]', then c&ping the whole TGAloading code twice, so it runs once loading the texture array, and then again with the texture2nd array, and it STILL didn't work, and the bitmap font still suddenly disapeared!kinda stumped on this one...getting desperate now..[edited by - Squalion on August 2, 2003 8:34:29 AM]
  ok, but your doing it the wrong way. int LoadGLTextures(char filename[60]){int Status=FALSE;if (LoadTGA(&texture[0], filename)){   Status=TRUE;   glGenTextures(1, &texture[0].texID);glBindTexture(GL_TEXTURE_2D, texture[0].texID);glTexImage2D(GL_TEXTURE_2D, 0, 3, texture[0].width, texture[0].height, 0, GL_RGB, GL_UNSIGNED_BYTE, texture[0].imageData);   glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);   glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);if (texture[0].imageData){    free(texture[0].imageData);}}else return 0;return texture[0].texID;}Perhaps this will clear things up a bit, just load every texture separatly and put the result in an array of int's and your set. Then whenever you are going to use the texture just call glBindTexture(GL_TEXTURE_2D, textures[0]);If your array is caled textures and you want to load the first texture [edited by - lc_overlord on August 2, 2003 1:29:34 PM];  edit - I see what you mean, loltried this; int LoadGLTextures(char filename[60]);// Load Bitmaps And Convert To Textures{int Status=FALSE;// Status Indicator// Load The Bitmap, Check For Errors.if (LoadTGA(&texture[f], filename)){Status=TRUE;// Set The Status To TRUE// Typical Texture Generation Using Data From The TGA ( CHANGE )glGenTextures(1, &texture[f].texID);// Create The Texture ( CHANGE )glBindTexture(GL_TEXTURE_2D, texture[f].texID);glTexImage2D(GL_TEXTURE_2D, 0, 3, texture[f].width, texture[f].height, 0, GL_RGB, GL_UNSIGNED_BYTE, texture[f].imageData);glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);if (texture[f].imageData)// If Texture Image Exists ( CHANGE ){free(texture[f].imageData);// Free The Texture Image Memory ( CHANGE )}}else return 0;// Return The Statureturn texture[f].texID}and  int InitGL(GLvoid)// OpenGL Setup{LoadGLTextures("land.tga");// Jump To Texture Loading Routine ( Nf = 1;LoadGLTextures("tree.tga");f = 2;LoadGLTextures("stats.tga");So, it loads texture[0] (f is set to 0 earlier on), then changes f to 1, and loads 'tree' to texture[1], then sets f to 2, and loads 'stats' as texture[2]....supposedly lolbut I get this error..MapTest.cpp(221) : error C2447: missing function header (old-style formal list?)    [edited by - Squalion on August 2, 2003 5:50:41 PM] [edited by - Squalion on August 2, 2003 5:51:39 PM] [edited by - Squalion on August 2, 2003 5:52:44 PM];  use it more like this.f[0]=LoadGLTextures("land.tga");f[1]=LoadGLTextures("tree.tga");f[2]=LoadGLTextures("stats.tga");about the error, check your .h files for typos and errors. 