v2.0.2
Instance Methods | Properties | List of all members
<CC3RenderSurfaceAttachment> Protocol Reference

#import <CC3RenderSurfaces.h>

Inheritance diagram for <CC3RenderSurfaceAttachment>:
Inheritance graph
[legend]

Instance Methods

(void) - replacePixels:withContent:
 
- Instance Methods inherited from <CC3Object>
(id) - asWeakReference
 
(NSString *) - fullDescription
 
(id) - resolveWeakReference
 

Properties

GLenum pixelFormat
 
CC3IntSize size
 

Detailed Description

An implementation of CC3RenderSurfaceAttachment can be attached to a CC3RenderSurface to provide a buffer to which drawing can occur.

The type of data that is drawn to the attachment depends on how it is attached to the CC3RenderSurface, and can include color data, depth data, or stencil data.

Method Documentation

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

If this attachment supports pixel replacement, replaces a portion of the content of this attachment by writing the specified array of pixels into the specified rectangular area within this attachment, The specified content replaces the pixel 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.

Not all attachments support pixel replacement. In particular, pixel replacement is available only for color attachments whose content is provided by an underlying texture. Attachments that do not support pixel replacement will simply ignore this method.

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 format of the underlying storage does not match this format, the specified array will be converted to the format of the underlying storage before being inserted. Be aware that this conversion will reduce the performance of this method. For maximum performance, match the format of the underlying storage to the 32-bit RGBA format of the specified array. 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 choosing a more memory efficient storage format.

Property Documentation

- (GLenum) pixelFormat
readnonatomicassign

The format of each pixel in the buffer.

- (CC3IntSize) size
readwritenonatomicassign

The size of this attachment in pixels.


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