Original Post
When I call to load my textures I originaly use the mipmap building instead of the glTexImage2D, but when I use glTexImage2D it loads all of the textures but will only show me the first one loaded.
this is the glTexImage2d part of my code:
int LoadGLTextures() // Load Bitmaps And Convert To Textures
{
int Status=FALSE; // Status Indicator
// Load The Bitmap, Check For Errors.
if (LoadTGA(&texture[0], "cursortexture.tga") &&
LoadTGA(&texture[1], "player.tga"))
{
Status=TRUE; // Set The Status To TRUE
for (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
}