Imagination PowerVR SDK Blog

PVRTexlib - Error reporting



I’ve been desperately trying to get the error messages from the pvrtexlib library output somewhere but it seems to me that they are simply completely stripped out the library. I first had a quick look at PVRTError.h and thought: “Cool, I just have to route the calls to OutputDebugStringA when building in DEBUG”. So I tried to get the OutputDebugStringA messages by hooking up to the kernel calls using sysinternal’s WinDebug but couldn’t catch any messages. Then I looked at the definition of PVRTERROR_OUTPUT_DEBUG(A) again and realized that it’s the configuration PVRTexLib was built with that mattered

So there is no error reporting at all ?
All I have is the bool returned value ?
Am I missing something ? If yes, could you point me in the right direction ?
If no, would it be possible to have access to a debug version of the lib so that I get the reasons why some calls are failing ?

Perhaps you should allow the developer to hook a function pointer for error reporting.

Best Regards,



<span =“Apple-tab-span” style=“white-space:pre”> #if defined(_DEBUG) || defined(DEBUG)
<span =“Apple-tab-span” style=“white-space:pre”> #if defined(SYMBIAN32)
<span =“Apple-tab-span” style=“white-space:pre”> #define PVRTERROR_OUTPUT_DEBUG(A) RDebug::Printf(A);
<span =“Apple-tab-span” style=“white-space:pre”> #elif defined(BADA)
<span =“Apple-tab-span” style=“white-space:pre”> #define PVRTERROR_OUTPUT_DEBUG(A) AppLog(A);
<span =“Apple-tab-span” style=“white-space:pre”> #elif defined(ANDROID)
<span =“Apple-tab-span” style=“white-space:pre”> #define PVRTERROR_OUTPUT_DEBUG(A) __android_log_print(ANDROID_LOG_INFO, “PVRTools”, A);
<span =“Apple-tab-span” style=“white-space:pre”> #elif defined(_WIN32) && !defined(UNDER_CE)
<span =“Apple-tab-span” style=“white-space:pre”> #define PVRTERROR_OUTPUT_DEBUG(A) OutputDebugStringA(A);
<span =“Apple-tab-span” style=“white-space:pre”> #else
<span =“Apple-tab-span” style=“white-space:pre”> #define PVRTERROR_OUTPUT_DEBUG(A) fprintf(stderr,A);
<span =“Apple-tab-span” style=“white-space:pre”> #endif
<span =“Apple-tab-span” style=“white-space:pre”> #else
<span =“Apple-tab-span” style=“white-space:pre”> #define PVRTERROR_OUTPUT_DEBUG(A)
<span =“Apple-tab-span” style=“white-space:pre”> #endif


Hi Micha,

Yes unfortunately there was no time to add proper error reporting functionality to the last version of texlib so I’m afraid all you currently have to go on is the boolean value - typically there’s no reason for a failure except for incorrect texture set-up though, so if you could post an example of how things are failing I’ll be more than happy to point you in the right direction.

PVRTError.h is currently only included because it is needed by PVRTMap.h which is used by the library. A future version will hook proper error messages back into the library.



Hi Tobias,

Thanks for your answer. Yeahh... That's what I figured out. You probably saw my other post, the resize / mipmap issue was indeed ... a format issueWacko. Everything is starting to work as expected and running windows and mac osx smoothly under a mono/.NET assets cached batch conversion engine. Happy to see the lib seems to behave well and make efficient use of the logical cores available now. On All platforms.
I only have a dxt compression issue to resolve. Will make a separate post if necessary.