cocos2d-iphone  2.1
Improved Cocos2D API Reference (iOS version) for www.kobold2d.com developers
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Defines
CCTexturePVR Class Reference

#import <CCTexturePVR.h>

+ Collaboration diagram for CCTexturePVR:

List of all members.

Public Member Functions

(id) - initWithContentsOfFile:
(id) - initWithContentsOfURL:

Static Public Member Functions

(id) + pvrTextureWithContentsOfFile:
(id) + pvrTextureWithContentsOfURL:

Protected Attributes

struct CCPVRMipmap _mipmaps [CC_PVRMIPMAP_MAX]
NSUInteger _numberOfMipmaps
uint32_t _width
uint32_t _height
GLuint _name
BOOL _hasAlpha
BOOL _hasPremultipliedAlpha
BOOL _forcePremultipliedAlpha
BOOL _retainName
CCTexture2DPixelFormat _format
const ccPVRTexturePixelFormatInfo_pixelFormatInfo

Properties

GLuint name
uint32_t width
uint32_t height
BOOL hasAlpha
BOOL hasPremultipliedAlpha
BOOL forcePremultipliedAlpha
NSUInteger numberOfMipmaps
BOOL retainName
CCTexture2DPixelFormat format

Detailed Description

CCTexturePVR

Object that loads PVR images.

Supported PVR formats:

  • RGBA8888
  • BGRA8888
  • RGBA4444
  • RGBA5551
  • RGB565
  • A8
  • I8
  • AI88
  • PVRTC 4BPP
  • PVRTC 2BPP

Limitations: Pre-generated mipmaps, such as PVR textures with mipmap levels embedded in file, are only supported if all individual sprites are of square size. To use mipmaps with non-square textures, instead call generateMipmap (CCTexture2D) on the sheet texture itself (and to save space, save the PVR sprite sheet without mip maps included).


Member Function Documentation

- (id) initWithContentsOfFile: (NSString *)  path

initializes a CCTexturePVR with a path

- (id) initWithContentsOfURL: (NSURL *)  url

initializes a CCTexturePVR with an URL

+ (id) pvrTextureWithContentsOfFile: (NSString *)  path

creates and initializes a CCTexturePVR with a path

+ (id) pvrTextureWithContentsOfURL: (NSURL *)  url

creates and initializes a CCTexturePVR with an URL


Property Documentation

- (BOOL) forcePremultipliedAlpha [read, assign]

whether or not the texture should use hasPremultipliedAlpha instead of global default

- (BOOL) hasAlpha [read, assign]

whether or not the texture has alpha

- (BOOL) hasPremultipliedAlpha [read, assign]

whether or not the texture has premultiplied alpha

- (uint32_t) height [read, assign]

texture height

- (GLuint) name [read, assign]

texture id name

- (NSUInteger) numberOfMipmaps [read, assign]

how many mipmaps the texture has. 1 means one level (level 0

- (uint32_t) width [read, assign]

texture width


The documentation for this class was generated from the following file: