### PVRTextureLoader ###
This application illustrates how to load a PVR texture file using the included PVRTexture class and then display it using OpenGL ES.
The sample image, encoded as an xcode project build phase, is rendered on a rotatable and scalable quad. Controls are provided for experimenting with various texture compression and filter settings.
Further details are given as comments in the code.
iOS 4.0 SDK
iPhone OS 3.2 or later
The PVRTexture class is responsible for loading the pvr files generated by texturetool. The class handles loading mipmapped and non-mipmapped pvr files.
The method calls to create a PVRTexture object will also generate a GL texture name and upload as many texture levels as are present.
The OpenGL ES code that is responsible for displaying the encoded pvr data.
These are the pvr files generated from the Brick.png image by the "Encode Images" build phase.
CHANGES FROM PREVIOUS VERSIONS:
- Changed deployment target back to iPhone OS 3.2 and added CFBundleIconFiles in Info.plist.
- Upgraded project to build with the iOS 4 SDK.
- Modified the script so that it works regardless of where texturetool is installed.
- Check for availablility of any GL extensions used. Disable UI if extensions aren't present.
- Set proper min filter param depending on if texture is going to be mipmapped or not. This provides a hint to GL in order to help decrease memory usage.
- Use calloc instead of malloc when allocating memory for use in texture generation. We need to guarantee that our memory is zero filled for the cases where the
dimensions of the cg image might be smaller than the cg bitmap context. Set the kCGBlendModeCopy flag since we don't care about the previous contents of memory.
- Quote instances of $SRCROOT variable in the encode shell script to handle paths with spaces.
- First version.
Copyright (C) 2008-2010 Apple Inc. All rights reserved.
© 2010 Apple Inc. All Rights Reserved. (Last updated: 2010-06-25)