#import <CC3RenderSurfaces.h>
Instance Methods | |
(instancetype) | - initWithTexture: |
(instancetype) | - initWithTexture:usingFace: |
(instancetype) | - initWithTexture:usingFace:andLevel: |
Instance Methods inherited from <CC3FramebufferAttachment> | |
(void) | - bindToFramebuffer:asAttachment: |
(void) | - deriveNameFromFramebuffer:asAttachment: |
(void) | - unbindFromFramebuffer:asAttachment: |
Instance Methods inherited from <CC3RenderSurfaceAttachment> | |
(void) | - replacePixels:withContent: |
Instance Methods inherited from <CC3Object> | |
(id) | - asWeakReference |
(NSString *) | - fullDescription |
(id) | - resolveWeakReference |
Class Methods | |
(instancetype) | + attachment |
(instancetype) | + attachmentWithTexture: |
(instancetype) | + attachmentWithTexture:usingFace: |
(instancetype) | + attachmentWithTexture:usingFace:andLevel: |
Properties | |
GLenum | face |
GLint | mipmapLevel |
BOOL | shouldUseStrongReferenceToTexture |
CC3Texture * | texture |
CC3TextureFramebufferAttachment is a framebuffer attachment that uses a texture as the rendering buffer.
+ (instancetype) attachment |
Allocates and initializes an autoreleased instance to render to mipmap level zero of an unspecified 2D texture.
The texture must be set using the texure property before rendering.
+ (instancetype) attachmentWithTexture: | (CC3Texture *) | texture |
Allocates and initializes an autoreleased instance to render to mipmap level zero of the specified 2D texture.
+ (instancetype) attachmentWithTexture: | (CC3Texture *) | texture | |
usingFace: | (GLenum) | face | |
Allocates and initializes an autoreleased instance to render to mipmap level zero of the specified face of the specified texture.
+ (instancetype) attachmentWithTexture: | (CC3Texture *) | texture | |
usingFace: | (GLenum) | face | |
andLevel: | (GLint) | mipmapLevel | |
Allocates and initializes an autoreleased instance to render to the specified mipmap level of the specified face of the specified texture.
- (instancetype) initWithTexture: | (CC3Texture *) | texture |
Initializes this instance to render to mipmap level zero of the specified 2D texture.
- (instancetype) initWithTexture: | (CC3Texture *) | texture | |
usingFace: | (GLenum) | face | |
Initializes this instance to render to mipmap level zero of the specified face of the specified texture.
- (instancetype) initWithTexture: | (CC3Texture *) | texture | |
usingFace: | (GLenum) | face | |
andLevel: | (GLint) | mipmapLevel | |
Initializes this instance to render to the specified mipmap level of the specified face of the specified texture.
|
readwritenonatomicassign |
The target face within the texture into which rendering is to occur.
This property must be set prior to invoking the bindToFramebuffer:asAttachment: method.
For 2D textures, there is only one face, and this property should be set to GL_TEXTURE_2D.
For cube-map textures, this should be set to one of:
The initial value is set during initialization.
|
readwritenonatomicassign |
The mipmap level of the texture into which rendering is to occur.
This property must be set prior to invoking the bindToFramebuffer:asAttachment: method.
The initial value is set during initialization.
|
readwritenonatomicassign |
Indicates whether this attachment should create a strong reference to the texture in the texture property.
The initial value of this property is YES, indicating that the texture will be held as a strong reference, and in most cases, this is sufficient. However, in the case where this attachment is part of a surface that is, in turn, being held by the texture that is being rendered to (the contained texture), this attachment should maintain a weak reference to the texture, to avoid a retain cycle. Such a retain cycle would occur if this attachment holds a texture, that holds a surface, that, in turn, holds this attachment.
CC3EnvironmentMapTexture is an example of this design. CC3EnvironmentMapTexture holds a render surface that in turns holds the CC3EnvironmentMapTexture as the color attachment. CC3EnvironmentMapTexture automatically sets the shouldUseStrongReferenceToTexture property of the color texture attachment to NO, avoiding the retain cycle that would arise if the reference from the attachment to the texture was left as a strong reference.
If the texture property has already been set when this property is changed, the texture reference type is modified to comply with the new setting.
|
readwritenonatomicassign |
The texture to bind as an attachment to the framebuffer, and into which rendering will occur.
When the value of this property is set, both the horizontalWrappingFunction and verticalWrappingFunction properties of the texture will be set to GL_CLAMP_TO_EDGE, as required when using a texture as a rendering target.
The shouldUseStrongReferenceToTexture property determines whether the texture in this property will be held by a strong, or weak, reference.