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 NULL to 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, poolOut points 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.h

CVOpenGLBufferPoolCreateOpenGLBuffer

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 NULL to specify the default allocator.

openGLBufferPool

The OpenGL buffer pool that should create the new OpenGL buffer.

openGLBufferOut

On output, OpenGLBufferOut points 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.h

CVOpenGLBufferPoolGetAttributes

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

CVOpenGLBufferPoolGetOpenGLBufferAttributes

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

CVOpenGLBufferPoolGetTypeID

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

CVOpenGLBufferPoolRelease

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

CVOpenGLBufferPoolRetain

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

Data 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.h

Constants

OpenGL Buffer Pool Attribute Keys

The attributes associated with an OpenGL buffer pool.

const CFStringRef kCVOpenGLBufferPoolMinimumBufferCountKey;
const CFStringRef kCVOpenGLBufferPoolMaximumBufferAgeKey;
Constants
kCVOpenGLBufferPoolMinimumBufferCountKey

The minimum number of buffers to be kept in the pool (type CFNumber).

Available in OS X v10.4 and later.

Declared in CVOpenGLBufferPool.h.

kCVOpenGLBufferPoolMaximumBufferAgeKey

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