How to load a .pvr texture?


I am making an iOS app and have converted my .png textures to .pvr to take advantage of the memory savings of .pvr.

How can i load them into a cinder Texture class?

I get a exception when i try to do it the way i do for .png files…Texture::create/loadImage/loadAsset

To my knowledge there isn’t native support in Cinder for pvr surfaces. There is however other sources to allow for the decompress of the pvr, here for instance.

there is this enum…


used in …

void TextureBase::getInternalFormatInfo( GLint internalFormat, GLenum *outDataFormat, GLenum *outDataType, bool *outAlpha, bool *outCompressed, bool *outSrgb )

Which i think means Cinder can detect the internal format of a .pvr?

How much work would it be to have Cinder load .pvr files? Considering the great work being done on the Android/Linux branch of Cinder, optimised textures for mobile would a very appealing feature.

Hey, thanks for this, will look into cocos2d-x codebase to see if there is anything i can use. Would be cool if Cinder supported this though as its a recommended by Apple.

I actually didn’t realize that the link i submitted had a dead link to the sample code of that. You could probably try here, an Apple PVR Texture Loader sample. They should have a sliver of code that should help with the loading. If I get a sec this weekend, I’ll see how hard it would be to integrate it.

Oh great, i will have a look. It would be great if after loading the pvr texture i could create a Cinder texture from it. Will play around with this and report back.