LOADBMP (RGB) 模式

xiaoxiao2021-02-28  97

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

转载请注明原文地址: https://www.6miu.com/read-72875.html

最新回复(0)