Well, i know it's ok 'cause it does what supposed, but there's other way to doit?, 'cause for 1 different texture for each face of a cube will be pretty large
![](smile.gif)
...I HATE my english!!
int LoadGLTextures()
{
int Status=FALSE;
AUX_RGBImageRec *TextureImage[2];
memset(TextureImage,0,sizeof(void *)*1);
if((TextureImage[0]=LoadBMP("Data/NeHe.bmp")) && (TextureImage[1]=LoadBMP("Data/enya.bmp")))
{
Status=TRUE;
//Create 2 Textures
glGenTextures(2,&texture[0]);
//Process the first texture
glBindTexture(GL_TEXTURE_2D,texture[0]);
glTexImage2D(GL_TEXTURE_2D,0,3,TextureImage[0]->sizeX,TextureImage[0]->sizeY,0,
GL_RGB,GL_UNSIGNED_BYTE,TextureImage[0]->data);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
//Process the second Texture
glBindTexture(GL_TEXTURE_2D,texture[1]);
glTexImage2D(GL_TEXTURE_2D,0,3,TextureImage[1]->sizeX,TextureImage[1]->sizeY,0,
GL_RGB,GL_UNSIGNED_BYTE,TextureImage[1]->data);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
}
if((TextureImage[0]) && (TextureImage[1]))
{
if((TextureImage[0]->data) && (TextureImage[1]->data))
{
free(TextureImage[0]->data);
free(TextureImage[1]->data);
}
free(TextureImage[0]);
free(TextureImage[1]);
}
return Status;
}
"I stole the colour of night,to get out of your sight.I am the Visionaire, follow me if you dare..."
Edited by - BlackStorm on 7/16/00 11:01:04 PM
Edited by - BlackStorm on 7/16/00 11:05:13 PM
"I stole the colour of night,to get out of your sight.I am the Visionaire, follow me if you dare..."