Imagination PowerVR SDK Blog

Load texture file from file


If TexTool user manual to load texture from file constructor is used:

CPVRTexture cTexture(filePath);

Is there any way to find out if texture loading was successful or not?

There are methods
bool privateLoadPVRFile(FILE* pTextureFile);
bool privateLoadKTXFile(FILE* pTextureFile);
bool privateLoadDDSFile(FILE* pTextureFile);
wich return bool but they all in private section.


Hi JekaS,

You can find out if a texture load has been successful by querying the texture’s data size ( getDataSize() ) after creation. If it has a size of zero, then the load was unsuccessful. FYI, I plan to change file loading so that it uses factory functions in a future version of the API so that it can actually return proper error codes.