UINT LoadBMP(char * FileName)
{
UINT texture = 0;
if(!FileName)
return NULL;
AUX_RGBImageRec *pImage;
FILE *pFile = fopen(FileName, "rb");
if(!pFile)
return NULL;
pImage = auxDIBImageLoad(FileName);
if(!pImage)
{
return NULL;
}
texture = GenerateInternalTexture(pImage->data, 3, pImage->sizeX, pImage->sizeY, GL_RGB);
if (pImage)
{
if (pImage->data)
{
free(pImage->data);
}
free(pImage);
}
return texture;
}
LOADBMP (RGB) 模式
最新推荐文章于 2021-05-21 22:16:49 发布