Greetings,
After binding a texture, is it possible to free the image memory and still be able to use the texture? For example:
int LoadGLTextures() // Load Bitmaps And Convert To Textures
{
int Status=FALSE; // Status Indicator
// Load The Bitmap, Check For Errors.
if (LoadTGA(&texture[0], "Data/Uncompressed.tga") &&
LoadTGA(&texture[1], "Data/Compressed.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
glGenTextures(1, &texture[loop].texID); // Create The Texture
glBindTexture(GL_TEXTURE_2D, texture[loop].texID);
glTexImage2D(GL_TEXTURE_2D, 0, texture[loop].bpp / 8, texture[loop].width, texture[loop].height, 0, texture[loop].type, 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
{
free(texture[loop].imageData); // Free The Texture Image Memory
}
}
}
return Status; // Return The Status
}