CVOpenGLBufferPool Reference
| Derived from | |
| Framework | System/Library/Frameworks/QuartzCore.framework |
| Companion guide | |
| Declared in | CVOpenGLBufferPool.h |
Overview
An OpenGL buffer pool is a utility object for managing a set of OpenGL buffer objects for repeated use. OpenGL buffer pools allocate a number of buffers in video memory that can be reused as needed, avoiding repeated allocations and deallocations, which hurt performance.
Functions
CVOpenGLBufferPoolCreate
Creates a new OpenGL buffer pool.
CVReturn CVOpenGLBufferPoolCreate ( CFAllocatorRef allocator, CFDictionaryRef poolAttributes, CFDictionaryRef openGLBufferAttributes, CVOpenGLBufferPoolRef *poolOut );
Parameters
- allocator
The allocator to use for allocating this buffer pool. Pass
NULLto specify the default allocator.- poolAttributes
A Core Foundation dictionary containing the attributes to be used for the pool itself.
- openGLBufferAttributes
A Core Foundation dictionary containing the attributes to be used for creating new OpenGL buffers within the pool.
- poolOut
On output,
poolOutpoints to the new OpenGL buffer pool.
Return Value
A Core Video result code. SeeCore Video Constants Reference for possible values.
Availability
- Available in OS X v10.4 and later.
Declared In
CVOpenGLBufferPool.hCVOpenGLBufferPoolCreateOpenGLBuffer
Creates a new OpenGL buffer from an OpenGL buffer pool.
CVReturn CVOpenGLBufferPoolCreateOpenGLBuffer ( CFAllocatorRef allocator, CVOpenGLBufferPoolRef openGLBufferPool, CVOpenGLBufferRef *openGLBufferOut );
Parameters
- allocator
The allocator to use for creating the buffer. May be
NULLto specify the default allocator.- openGLBufferPool
The OpenGL buffer pool that should create the new OpenGL buffer.
- openGLBufferOut
On output,
OpenGLBufferOutpoints to the new OpenGL buffer.
Return Value
A Core Video result code. See Core Video Constants Reference for possible values.
Discussion
The function creates a new OpenGL buffer using the OpenGL buffer attributes specified in the CVOpenGLBufferPoolCreate call. This buffer has default attachments as specified in the openGLBufferAttributes parameter of CVOpenGLBufferPoolCreate (using either the kCVBufferPropagatedAttachmentsKey or kCVBufferNonPropagatedAttachmentsKey attributes).
Availability
- Available in OS X v10.4 and later.
Declared In
CVOpenGLBufferPool.hCVOpenGLBufferPoolGetAttributes
Returns the pool attributes dictionary for an Open GL buffer pool.
CFDictionaryRef CVOpenGLBufferPoolGetAttributes ( CVOpenGLBufferPoolRef pool );
Parameters
- pool
The OpenGL buffer pool containing the attributes to be retrieved.
Return Value
The buffer-pool attributes Core Foundation dictionary, or NULL on failure.
Availability
- Available in OS X v10.4 and later.
Declared In
CVOpenGLBufferPool.hCVOpenGLBufferPoolGetOpenGLBufferAttributes
Returns the attributes of OpenGL buffers that will be created from a buffer pool.
CFDictionaryRef CVOpenGLBufferPoolGetOpenGLBufferAttributes ( CVOpenGLBufferPoolRef pool );
Parameters
- pool
The OpenGL buffer pool containing the attributes to be retrieved.
Return Value
The OpenGL buffer attributes Core Foundation dictionary, or NULL on failure.
Discussion
You can use this function to obtain information about the OpenGL buffers that will be created from the buffer pool.
Availability
- Available in OS X v10.4 and later.
Declared In
CVOpenGLBufferPool.hCVOpenGLBufferPoolGetTypeID
Obtains the Core Foundation ID for the OpenGL buffer pool type.
CFTypeID CVOpenGLBufferPoolGetTypeID ( void );
Return Value
The Core Foundation ID for this data type.
Availability
- Available in OS X v10.4 and later.
Declared In
CVOpenGLBufferPool.hCVOpenGLBufferPoolRelease
Releases an OpenGL buffer pool.
void CVOpenGLBufferPoolRelease ( CVOpenGLBufferPoolRef openGLBufferPool );
Parameters
- openGLBufferPool
The OpenGL buffer pool that you want to release.
Discussion
This function is equivalent to CFRelease, but is NULL safe.
Availability
- Available in OS X v10.4 and later.
Declared In
CVOpenGLBufferPool.hCVOpenGLBufferPoolRetain
Retains an OpenGL buffer pool.
CVOpenGLBufferPoolRef CVOpenGLBufferPoolRetain ( CVOpenGLBufferPoolRef openGLBufferPool );
Parameters
- openGLBufferPool
The OpenGL buffer pool that you want to retain.
Return Value
For convenience, the same buffer pool object you wanted to retain.
Discussion
This function is equivalent to CFRetain, but is NULL safe.
Availability
- Available in OS X v10.4 and later.
Declared In
CVOpenGLBufferPool.hData Types
CVOpenGLBufferPoolRef
A reference to an OpenGL buffer pool object.
typedef struct _CVOpenGLBufferPool *CVOpenGLBufferPoolRef;
Availability
- Available in OS X v10.3 and later.
Declared In
CVOpenGLBufferPool.hConstants
OpenGL Buffer Pool Attribute Keys
The attributes associated with an OpenGL buffer pool.
const CFStringRef kCVOpenGLBufferPoolMinimumBufferCountKey; const CFStringRef kCVOpenGLBufferPoolMaximumBufferAgeKey;
Constants
kCVOpenGLBufferPoolMinimumBufferCountKeyThe minimum number of buffers to be kept in the pool (type
CFNumber).Available in OS X v10.4 and later.
Declared in
CVOpenGLBufferPool.h.kCVOpenGLBufferPoolMaximumBufferAgeKeyThe maximum time that unused buffers should be kept before they are deallocated (type
CFAbsoluteTime).Available in OS X v10.4 and later.
Declared in
CVOpenGLBufferPool.h.
Discussion
You specify these keys in a Core Foundation dictionary when calling functions such as CVOpenGLBufferPoolCreate.
© 2010 Apple Inc. All Rights Reserved. (Last updated: 2010-08-03)