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

#import <CC3RenderSurfaces.h>

Inheritance diagram for CC3GLRenderbuffer:
Inheritance graph
[legend]

Instance Methods

(void) - bind
 
(instancetype) - initWithPixelFormat:
 
(instancetype) - initWithPixelFormat:withPixelSamples:
 
(instancetype) - initWithPixelFormat:withPixelSamples:withRenderbufferID:
 
(instancetype) - initWithPixelFormat:withRenderbufferID:
 
- Instance Methods inherited from CC3Identifiable
(void) - __deprecated
 
(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:
 
- 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
 
(id) - resolveWeakReference
 

Class Methods

(instancetype) + renderbuffer
 
(instancetype) + renderbufferWithPixelFormat:
 
(instancetype) + renderbufferWithPixelFormat:withPixelSamples:
 
(instancetype) + renderbufferWithPixelFormat:withPixelSamples:withRenderbufferID:
 
(instancetype) + renderbufferWithPixelFormat:withRenderbufferID:
 
- Class Methods inherited from CC3Identifiable
(GLint) + instanceCount
 
(void) + resetTagAllocation
 

Properties

BOOL isManagingGL
 
GLenum pixelFormat
 
GLuint pixelSamples
 
GLuint renderbufferID
 
CC3IntSize size
 
- Properties inherited from CC3Identifiable
NSObject *sharedUserData __deprecated
 
NSString * name
 
NSString * nameSuffix
 
GLint podIndex
 
BOOL shouldIncludeInDeepCopy
 
GLuint tag
 
NSObject * userData
 
- Properties inherited from <CC3Cacheable>
NSString * name
 

Detailed Description

Represents an OpenGL renderbuffer.

CC3GLRenderbuffer implements the CC3FramebufferAttachment, allowing it to be attached to a framebuffer. This class represents a general off-screen or on-screen GL renderbuffer, whose storage is allocated from GL memory.

Broadly speaking, there are two ways to instantiate an instance and manage the lifespan of the corresponding renderbuffer in the GL engine, these are described as follows.

If you instantiate an instance without explicitly providing the ID of an existing OpenGL renderbuffer, a renderbuffer will automatically be created within the GL engine, as needed, and will automatically be deleted from the GL engine when the instance is deallocated.

To map to an existing OpenGL renderbuffer, you can provide the value of the renderbufferID property during instance instantiation. In this case, the instance will not delete the renderbuffer from the GL engine when the instance is deallocated, and it is up to you to coordinate the lifespan of the instance and the GL renderbuffer. Do not use the instance once you have deleted the renderbuffer from the GL engine.

Method Documentation

- (void) bind

Binds this renderbuffer as the active renderbuffer in the GL engine.

- (instancetype) initWithPixelFormat: (GLenum)  format

Initializes this instance with the specified pixel format and with one sample per pixel.

See the pixelFormat property for allowable values for the format parameter.

- (instancetype) initWithPixelFormat: (GLenum)  format
withPixelSamples: (GLuint)  samples 

Initializes this instance with the specified pixel format and with number of samples per pixel.

See the pixelFormat property for allowable values for the format parameter.

- (instancetype) initWithPixelFormat: (GLenum)  format
withPixelSamples: (GLuint)  samples
withRenderbufferID: (GLuint)  rbID 

Initializes this instance with the specified pixel format, number of samples per pixel, and renderbuffer ID.

See the pixelFormat property for allowable values for the format parameter.

The value of the isManagingGL property will be set to NO, indicating that this instance will not delete the renderbuffer from the GL engine when this instance is deallocated. It is up to you to coordinate the lifespan of this instance and the GL renderbuffer. Do not use this instance once you have deleted the renderbuffer from the GL engine.

- (instancetype) initWithPixelFormat: (GLenum)  format
withRenderbufferID: (GLuint)  rbID 

Initializes this instance with the specified pixel format and renderbuffer ID.

See the pixelFormat property for allowable values for the format parameter.

The value of the isManagingGL property will be set to NO, indicating that this instance will not delete the renderbuffer from the GL engine when this instance is deallocated. It is up to you to coordinate the lifespan of this instance and the GL renderbuffer. Do not use this instance once you have deleted the renderbuffer from the GL engine.

+ (instancetype) renderbuffer

Allocates and initializes an autoreleased instance with one sample per pixel.

+ (instancetype) renderbufferWithPixelFormat: (GLenum)  format

Allocates and initializes an autoreleased instance with the specified pixel format and with one sample per pixel.

See the pixelFormat property for allowable values for the format parameter.

+ (instancetype) renderbufferWithPixelFormat: (GLenum)  format
withPixelSamples: (GLuint)  samples 

Allocates and initializes an autoreleased instance with the specified pixel format and number of samples per pixel.

See the pixelFormat property for allowable values for the format parameter.

+ (instancetype) renderbufferWithPixelFormat: (GLenum)  format
withPixelSamples: (GLuint)  samples
withRenderbufferID: (GLuint)  rbID 

Allocates and initializes an autoreleased instance with the specified pixel format, number of samples per pixel, and renderbuffer ID.

See the pixelFormat property for allowable values for the format parameter.

The value of the isManagingGL property of the returned instance will be set to NO, indicating that the instance will not delete the renderbuffer from the GL engine when the returned instance is deallocated. It is up to you to coordinate the lifespan of the returned instance and the GL renderbuffer. Do not use the returned instance once you have deleted the renderbuffer from the GL engine.

+ (instancetype) renderbufferWithPixelFormat: (GLenum)  format
withRenderbufferID: (GLuint)  rbID 

Allocates and initializes an autoreleased instance with the specified pixel format, and renderbuffer ID.

See the pixelFormat property for allowable values for the format parameter.

The value of the isManagingGL property of the returned instance will be set to NO, indicating that the instance will not delete the renderbuffer from the GL engine when the returned instance is deallocated. It is up to you to coordinate the lifespan of the returned instance and the GL renderbuffer. Do not use the returned instance once you have deleted the renderbuffer from the GL engine.

Property Documentation

- (BOOL) isManagingGL
readnonatomicassign

Returns whether the renderbuffer in the GL engine is being managed by this instance.

If the value of this property is YES, this instance is managing the renderbuffer in the GL engine, and when this instance is deallocated, the renderbuffer will automatically be deleted from the GL engine.

If the value of this property is NO, this instance is NOT managing the renderbuffer in the GL engine, and when this instance is deallocated, the renderbuffer will NOT automatically be deleted from the GL engine.

If the value of this property is NO, indicating the lifespan of the GL renderbuffer is not managed by this instance, it is up to you to coordinate the lifespan of this instance and the GL renderbuffer. Do not use this instance once you have deleted the renderbuffer from the GL engine.

The value of this property also has an effect on the behaviour of the size property. If this property returns YES, setting the size property will also resize the memory allocation in the GL engine. If this property returns NO, setting the size property has no effect on the memory allocation in the GL engine.

If this instance is initialized with with a specific value for the renderbufferID property, the value of this property will be NO, otherwise, the value of this property will be YES.

- (GLenum) pixelFormat
readnonatomicassign

Returns the format of each pixel in the buffer.

The returned value may be one of the following:

  • GL_RGB8
  • GL_RGBA8
  • GL_RGBA4
  • GL_RGB5_A1
  • GL_RGB565
  • GL_DEPTH_COMPONENT16
  • GL_DEPTH_COMPONENT24
  • GL_DEPTH24_STENCIL8
  • GL_STENCIL_INDEX8
- (GLuint) pixelSamples
readnonatomicassign

Returns the number of samples used to define each pixel.

- (GLuint) renderbufferID
readnonatomicassign

The ID used to identify the renderbuffer to the GL engine.

If the value of this property is not explicitly set during instance initialization, then the first time this property is accessed a renderbuffer will automatically be generated in the GL engine, and its ID set into this property.

- (CC3IntSize) size
readwritenonatomicassign

The size of this renderbuffer in pixels.

When the value of this property is changed, if the isManagingGL property returns YES, storage space within GL memory is allocated or reallocated. If the isManagingGL property returns NO, the memory allocation in the GL engine remains unchanged, but the value of this property will reflect the new value.


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