cocos3d
2.0.0
|
#import <CC3RenderSurfaces.h>
Instance Methods | |
(void) | - addSurface: |
(id) | - initWithView: |
(void) | - removeSurface: |
(void) | - resizeTo: |
(void) | - resolveMultisampling |
Properties | |
GLenum | colorFormat |
GLenum | colorTexelFormat |
GLenum | colorTexelType |
CC3Backgrounder *backgrounder | DEPRECATED_ATTRIBUTE |
GLenum | depthFormat |
GLenum | depthTexelFormat |
GLenum | depthTexelType |
BOOL | isMultisampling |
CC3GLFramebuffer * | multisampleSurface |
CC3IntSize | multisamplingSize |
CC3GLFramebuffer * | pickingSurface |
GLuint | pixelSamples |
CC3GLFramebuffer * | renderingSurface |
BOOL | shouldUseDedicatedPickingSurface |
CC3IntSize | size |
GLenum | stencilFormat |
CC3GLView * | view |
CC3GLRenderbuffer * | viewColorBuffer |
CC3GLFramebuffer * | viewSurface |
Manages the render surfaces used to render content to the OS view on the screen.
Wraps the view's surface, an optional anti-aliasing multisampling surface, and an optional separate surface for rendering during node picking from touch events.
If multisampling is not in use, rendering is directed to the surface in the the viewSurface property, which is attached to the underlying core animation layer.
If multisampling is used, rendering is directed to the surface in the the multisampleSurface property, and then once rendering is complete, the multisampled surface is resolved onto the view surface.
- (void) addSurface: | (id< CC3RenderSurface >) | surface |
Registers the specified surface to be automatically resized when the view is resized.
The attachments of the specified surface will have the resizeTo: method invoked whenever the view is resized.
If you have created an off-screen surface, and you want it to be resized automatically whenever the view is resized, you can register it using this method. Do not register a surface that you do not want resized when the view is resized.
You can use the addSurfaceWithColorAttachmentType:andDepthAttachmentType: method to create and register a surface in one step.
It is safe to register the same surface more than once, and it is safe to register two surfaces that share one or more attachments. This implementation will ensure that each attachment is resized only once for each view resizing.
- (id) initWithView: | (CC3GLView *) | view |
Initializes this instance for the specified view.
- (void) removeSurface: | (id< CC3RenderSurface >) | surface |
Removes the specified surface previously added with the addSurface: method.
It is safe to invoke this method even if the specified surface has never been added, or has already been removed.
- (void) resizeTo: | (CC3IntSize) | size |
Resizes the framebuffers in this instance to the specified size.
- (void) resolveMultisampling |
If the view supports multisampling, resolve the multisampling surface into the view surface.
If framebuffer discarding is supported, this method also instructs the GL engine to allow the discarding of any framebuffers that are not needed for presenting the final image to the screen.
Upon completion, this method leaves the renderbuffer that is attached to the view (in the viewColorBuffer property) bound to the GL engine, so that it can be presented to the view.
|
readnonatomicassign |
Returns the color format of the pixels.
|
readnonatomicassign |
Returns the texture pixel format that matches the format of the color attachment of the view's rendering surface.
Under OpenGL, textures use different formatting than renderbuffers. When creating an off-screen surface that uses a texture as its color attachment, you can use the values returned by this property and the colorTexelType property to create a texture that matches the format of the color buffer of the view's rendering surface.
|
readnonatomicassign |
Returns the texture pixel type that matches the format of the color attachment of the view's rendering surface.
Under OpenGL, textures use different formatting than renderbuffers. When creating an off-screen surface that uses a texture as its color attachment, you can use the values returned by this property and the colorTexelFormat property to create a texture that matches the format of the color buffer of the view's rendering surface.
|
readwritenonatomicstrong |
|
readnonatomicassign |
Returns the depth format of the pixels.
|
readnonatomicassign |
Returns the texture pixel format that matches the format of the depth attachment of the view's rendering surface.
Under OpenGL, textures use different formatting than renderbuffers. When creating an off-screen surface that uses a texture as its depth attachment, you can use the values returned by this property and the depthTexelType property to create a texture that matches the format of the depth buffer of the view's rendering surface.
|
readnonatomicassign |
Returns the texture pixel type that matches the format of the depth attachment of the view's rendering surface.
Under OpenGL, textures use different formatting than renderbuffers. When creating an off-screen surface that uses a texture as its depth attachment, you can use the values returned by this property and the depthTexelFormat property to create a texture that matches the format of the depth buffer of the view's rendering surface.
|
readnonatomicassign |
Returns whether multisampling is in use.
|
readwritenonatomicstrong |
The surface used for off-screen multisample rendering.
The value of this property may be nil if multisampleing is not in use.
|
readnonatomicassign |
Returns the size of this surface in multisampling pixels.
The value of this property will be larger than the value of the size property if multisampling is in use. For example, if the value of the pixelSamples property is 4, then the width and height returned by this property will be twice that of the width and height of returned by the size property.
|
readwritenonatomicstrong |
The surface to which rendering for picking should be directed.
If the shouldUseDedicatedPickingSurface property returns NO, this property returns the surface in the viewSurface property. However, if the shouldUseDedicatedPickingSurface returns YES, this property returns a dedicated surface created just for picking.
Lazy initialization is used in case touch picking is never actually used by the app.
|
readnonatomicassign |
Returns the number of samples used to define each pixel.
If this value is larger than one, then multisampling is in use.
|
readnonatomicstrong |
The surface to which rendering should be directed.
If multisampling is in use, this property returns the framebuffer in the multisampleSurface property, otherwise it returns the framebuffer in the viewSurface property.
|
readwritenonatomicassign |
Returns whether a dedicated surface should be created by the pickingSurface property.
If this property returns NO, the pickingSurface property will return the surface in the viewSurface property. However, if this property returns YES, the pickingSufrace property will return a dedicated surface created just for picking.
For economy, if multisampling is not active and the viewSurface is readable, the viewSurface can also be used as the picking surface. For that reason, if both of those conditions hold, and this property has not been set to YES directly, this property will return NO. Otherwise, this property will return YES.
You can force the use of a dedicated picking surface, even if multisampling is not in use and the viewSurface is readable, by directly setting this property to YES. There are situations where this may be preferrable, such as if there is no backdrop, and some of the objects contain transparency. In that situation, using the viewSurface for both view rendering and node picking rendering may result in unwanted visual artifacts on the transparent nodes during node picking resulting from touch events. To avoid these artifacts, you can set this property to YES.
|
readnonatomicassign |
The size of the rendering surface in pixels.
|
readnonatomicassign |
Returns the stencil format of the pixels.
|
readnonatomicstrong |
The GL view whose surface is being managed by this instance.
|
readnonatomicstrong |
The renderbuffer that is the colorAttachment to the framebuffer in the viewSurface property.
|
readwritenonatomicstrong |
The on-screen surface attached to the underlying core animation layer.