[EDIT]"no-one" posted while I was typing. i'll leave this here anyway though.
your code generates 1 texture, because your only loading 1 texture. if you were loading 3 textures, you would generate 3 textures.
My JPEG loading code (still applies):
Code:
void CreateTexture(UINT textureArray[], LPSTR strFileName, int textureID)
{
if(!strFileName)
return;
tImageJPG *pImage = LoadJPG(strFileName);
if(pImage == NULL)
exit(0);
glGenTextures(1, &textureArray[textureID]);
glBindTexture(GL_TEXTURE_2D, textureArray[textureID]);
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGB8, pImage->sizeX, pImage->sizeY, GL_RGB, GL_UNSIGNED_BYTE, pImage->data);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR_MIPMAP_LINEAR);
if (pImage)
{
if (pImage->data)
{
free(pImage->data);
}
free(pImage);
}
}
This code generates and loads 1 texture at a time. the texture is determined by the texture ID. your code is loading a hard-coded texture ID, so in your case, you would need to generate more than 1 to allow for more textureIDs.
If you don't understand what I'm trying to say, just give another post, and i'll try and elabourate a little more.
-psychopath