v2.0.2
Instance Methods | Class Methods | List of all members
CC3Texture2D Class Reference

#import <CC3Texture.h>

Inheritance diagram for CC3Texture2D:
Inheritance graph
[legend]

Instance Methods

(void) - replacePixels:withContent:
 
- Instance Methods inherited from CC3Texture
(CCTexture *) - __deprecated
 
(NSString *) - constructorDescription
 
(void) - drawWithVisitor:
 
(void) - generateMipmap
 
(id) - initCubeColoredForAxes
 
(id) - initCubeFromFilePattern:
 
(id) - initCubeFromFilesPosX:negX:posY:negY:posZ:negZ:
 
(id) - initCubeWithPixelFormat:andPixelType:
 
(id) - initCubeWithPixelFormat:withPixelType:
 
(id) - initCubeWithSideLength:withPixelFormat:withPixelType:
 
(id) - initCubeWithSize:andPixelFormat:andPixelType:
 
(id) - initFromFile:
 
(id) - initWithCCTexture:
 
(id) - initWithCGImage:
 
(id) - initWithPixelFormat:andPixelType:
 
(id) - initWithPixelFormat:withPixelType:
 
(id) - initWithSize:andPixelFormat:andPixelType:
 
(id) - initWithSize:withColor:
 
(id) - initWithSize:withPixelFormat:withPixelType:
 
(void) - remove
 
(void) - replacePixels:inTarget:withContent:
 
(void) - resizeTo:
 
- Instance Methods inherited from CC3Identifiable
(id) - copy
 
(id) - copyAsClass:
 
(void) - copyUserDataFrom:
 
(id) - copyWithName:
 
(id) - copyWithName:asClass:
 
(id) - copyWithZone:withName:
 
(id) - copyWithZone:withName:asClass:
 
(BOOL) - deriveNameFrom:
 
(BOOL) - deriveNameFrom:usingSuffix:
 
(NSString *) - fullDescription
 
(id) - init
 
(id) - initAtIndex:fromPODResource:
 
(void) - initUserData
 
(id) - initWithName:
 
(id) - initWithTag:
 
(id) - initWithTag:withName:
 
(GLuint) - nextTag
 
(void) - populateFrom:
 

Class Methods

(BOOL) + defaultShouldFlipHorizontallyOnLoad
 
(BOOL) + defaultShouldFlipVerticallyOnLoad
 
(void) + setDefaultShouldFlipHorizontallyOnLoad:
 
(void) + setDefaultShouldFlipVerticallyOnLoad:
 
- Class Methods inherited from CC3Texture
(void) + addTexture:
 
(NSString *) + cachedTexturesDescription
 
(ccTexParams) + defaultTextureParameters
 
(CC3Texture *) + getTextureNamed:
 
(BOOL) + isPreloading
 
(void) + removeAllTextures
 
(void) + removeTexture:
 
(void) + removeTextureNamed:
 
(void) + setDefaultTextureParameters:
 
(void) + setIsPreloading:
 
(void) + setShouldCacheAssociatedCCTextures:
 
(void) + setShouldGenerateMipmaps:
 
(BOOL) + shouldCacheAssociatedCCTextures
 
(BOOL) + shouldGenerateMipmaps
 
(id) + textureCubeColoredForAxes
 
(id) + textureCubeFromFilePattern:
 
(id) + textureCubeFromFilesPosX:negX:posY:negY:posZ:negZ:
 
(id) + textureCubeWithPixelFormat:andPixelType:
 
(id) + textureCubeWithPixelFormat:withPixelType:
 
(id) + textureCubeWithSideLength:withPixelFormat:withPixelType:
 
(id) + textureCubeWithSize:andPixelFormat:andPixelType:
 
(id) + textureFromFile:
 
(NSString *) + textureNameFromFilePath:
 
(id) + textureWithCCTexture:
 
(id) + textureWithCGImage:
 
(id) + textureWithPixelFormat:andPixelType:
 
(id) + textureWithPixelFormat:withPixelType:
 
(id) + textureWithSize:andPixelFormat:andPixelType:
 
(id) + textureWithSize:withColor:
 
(id) + textureWithSize:withPixelFormat:withPixelType:
 
- Class Methods inherited from CC3Identifiable
(GLint) + instanceCount
 
(void) + resetTagAllocation
 

Additional Inherited Members

- Properties inherited from CC3Texture
CCTexture *ccTexture2D __deprecated
 
CCTexture * ccTexture
 
CGSize coverage
 
BOOL hasAlpha
 
BOOL hasMipmap
 
BOOL hasPremultipliedAlpha
 
GLenum horizontalWrappingFunction
 
GLenum initialAttachmentFace
 
BOOL isBumpMap
 
BOOL isPOT
 
BOOL isPOTHeight
 
BOOL isPOTWidth
 
BOOL isTexture2D
 
BOOL isTextureCube
 
BOOL isUpsideDown
 
CC3Vector lightDirection
 
GLenum magnifyingFunction
 
GLenum minifyingFunction
 
GLenum pixelFormat
 
GLenum pixelType
 
GLenum samplerSemantic
 
BOOL shouldFlipHorizontallyOnLoad
 
BOOL shouldFlipVerticallyOnLoad
 
CC3IntSize size
 
CC3Texturetexture
 
GLuint textureID
 
ccTexParams textureParameters
 
GLenum textureTarget
 
CC3TextureUnittextureUnit
 
GLenum verticalWrappingFunction
 

Detailed Description

The representation of a 2D texture loaded into the GL engine.

This class is used for all 2D texture types except PVR.

This class is part of a class-cluster under the parent CC3Texture class. Although you can invoke an instance creation method on this class directly, you will more commonly invoke them on the CC3Texture class instead. The creation and initialization methods will ensure that the correct subclass for the texture type, and in some cases, the texture file type, is created and returned. Because of this class-cluster structure, be aware that the class of the instance returned by an instance creation or initialization method may be different than the receiver of that method.

Method Documentation

+ (BOOL) defaultShouldFlipHorizontallyOnLoad

This class-side property determines the initial value of the shouldFlipHorizontallyOnLoad for instances of this class.

The initial value for 2D textures is NO.

Implements CC3Texture.

+ (BOOL) defaultShouldFlipVerticallyOnLoad

This class-side property determines the initial value of the shouldFlipVerticallyOnLoad for instances of this class.

The initial value for 2D textures is YES, indicating that a 2D texture that has been loaded in upsdide-down will be fipped the right way up.

Implements CC3Texture.

- (void) replacePixels: (CC3Viewport rect
withContent: (ccColor4B *)  colorArray 

Replaces a portion of the content of this texture by writing the specified array of pixels into the specified rectangular area within this texture, The specified content replaces the texture data within the specified rectangle.

The specified content array must be large enough to contain content for the number of pixels in the specified rectangle.

Content is read from the specified array left to right across each row of pixels within the specified image rectangle, starting at the row at the bottom of the rectangle, and ending at the row at the top of the rectangle.

Within the specified array, the pixel content should be packed tightly, with no gaps left at the end of each row. The last pixel of one row should immediately be followed by the first pixel of the next row.

The pixels in the specified array are in standard 32-bit RGBA. If the pixelFormat and pixelType properties of this texture are not GL_RGBA and GL_UNSIGNED_BYTE, respectively, the pixels in the specified array will be converted to the format and type of this texture before being inserted into the texture. Be aware that this conversion will reduce the performance of this method. For maximum performance, match the format and type of this texture to the 32-bit RGBA format of the specified array, by setting the pixelFormat property to GL_RGBA and the pixelType property to GL_UNSIGNED_BYTE. However, keep in mind that the 32-bit RGBA format consumes more memory than most other formats, so if performance is of lesser concern, you may choose to minimize the memory requirements of this texture by setting the pixelFormat and pixelType properties to values that consume less memory.

If this texture has mipmaps, they are not automatically updated. Once all desired content has been replaced, invoke the generateMipmap method to regenerate the mipmaps.

+ (void) setDefaultShouldFlipHorizontallyOnLoad: (BOOL)  shouldFlip

This class-side property determines the initial value of the shouldFlipHorizontallyOnLoad for instances of this class.

The initial value for 2D textures is NO.

Implements CC3Texture.

+ (void) setDefaultShouldFlipVerticallyOnLoad: (BOOL)  shouldFlip

This class-side property determines the initial value of the shouldFlipVerticallyOnLoad for instances of this class.

The initial value for 2D textures is YES, indicating that a 2D texture that has been loaded in upsdide-down will be fipped the right way up.

Implements CC3Texture.


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