LOADBMP (RGB) 模式

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;
}

你可能感兴趣的:(load)