cocos3d  2.0.0
Instance Methods | Properties | List of all members
CC3GLViewSurfaceManager Class Reference

#import <CC3RenderSurfaces.h>

Inheritance diagram for CC3GLViewSurfaceManager:
Inheritance graph
[legend]

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
 
CC3GLFramebuffermultisampleSurface
 
CC3IntSize multisamplingSize
 
CC3GLFramebufferpickingSurface
 
GLuint pixelSamples
 
CC3GLFramebufferrenderingSurface
 
BOOL shouldUseDedicatedPickingSurface
 
CC3IntSize size
 
GLenum stencilFormat
 
CC3GLView * view
 
CC3GLRenderbufferviewColorBuffer
 
CC3GLFramebufferviewSurface
 

Detailed Description

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.

Method Documentation

- (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.

Property Documentation

- (GLenum) colorFormat
readnonatomicassign

Returns the color format of the pixels.

- (GLenum) colorTexelFormat
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.

- (GLenum) colorTexelType
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.

- (CC3Backgrounder* backgrounder) DEPRECATED_ATTRIBUTE
readwritenonatomicstrong
Deprecated:
Property moved to [CC3Backgrounder sharedBackgrounder] singleton.
- (GLenum) depthFormat
readnonatomicassign

Returns the depth format of the pixels.

- (GLenum) depthTexelFormat
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.

- (GLenum) depthTexelType
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.

- (BOOL) isMultisampling
readnonatomicassign

Returns whether multisampling is in use.

- (CC3GLFramebuffer*) multisampleSurface
readwritenonatomicstrong

The surface used for off-screen multisample rendering.

The value of this property may be nil if multisampleing is not in use.

- (CC3IntSize) multisamplingSize
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.

- (CC3GLFramebuffer*) pickingSurface
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.

- (GLuint) pixelSamples
readnonatomicassign

Returns the number of samples used to define each pixel.

If this value is larger than one, then multisampling is in use.

- (CC3GLFramebuffer*) renderingSurface
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.

- (BOOL) shouldUseDedicatedPickingSurface
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.

- (CC3IntSize) size
readnonatomicassign

The size of the rendering surface in pixels.

- (GLenum) stencilFormat
readnonatomicassign

Returns the stencil format of the pixels.

- (CC3GLView*) view
readnonatomicstrong

The GL view whose surface is being managed by this instance.

- (CC3GLRenderbuffer*) viewColorBuffer
readnonatomicstrong

The renderbuffer that is the colorAttachment to the framebuffer in the viewSurface property.

- (CC3GLFramebuffer*) viewSurface
readwritenonatomicstrong

The on-screen surface attached to the underlying core animation layer.


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