CPVRTexture sCompressedTexture(sHeader);
When i try to access data pointer of this texture using below code, i get null pointer.
void *p = sCompressedTexture.getDataPtr(0,0,0);
if(!p)
{
std::cout << "p is nulln";
}
Data pointer of texture is perfectly fine if i set u32MIPMapCount as 1 while creating CPVRTextureHeader object. But this will create top level plus one extra mipmap level.
Please confirm how can i get the correct data pointer for top level non-mip-mapped texture (u32MIPMapCount = 0).
The top level of a texture is included in the “number of mip maps”, so you actually want to set it to 1, rather than 0. 1 actually does just mean the top level, and no additional mip maps.
As per “PVRTexTool.User Manual.pdf” (section 5.4.1) - ‘u32MIPMapCount’ is the number of MIP-map sublevels present in addition to the top level: 0 means that only a top level non-MIP-mapped texture exists, 1 means the top level plus an extra MIP-map level, etc.
Have you tried setting the value of “u32MIPMapCount” to 1 as Tobias suggested? Tobias is the lead engineer for TexTool, so I suspect the documentation may have an error in it.
Sorry I was ill last week so didn’t get around to answering this - there is in fact a bug in the documentation as Joe suggested, not entirely sure how it got there but I’ll see that it gets fixed. What I said in my post is correct, the document is wrong.