Mac Developer Library

Developer

System Framework Reference CVOpenGLBufferPool Reference

Options
Deployment Target:

On This Page
Language:

CVOpenGLBufferPool Reference

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

  • Creates a new OpenGL buffer pool.

    Declaration

    Swift

    func CVOpenGLBufferPoolCreate(_ allocator: CFAllocator!, _ poolAttributes: CFDictionary!, _ openGLBufferAttributes: CFDictionary!, _ poolOut: UnsafeMutablePointer<Unmanaged<CVOpenGLBufferPool>?>) -> CVReturn

    Objective-C

    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.

    Import Statement

    import CoreVideo

    Availability

    Available in OS X v10.4 and later.

  • Creates a new OpenGL buffer from an OpenGL buffer pool.

    Declaration

    Swift

    func CVOpenGLBufferPoolCreateOpenGLBuffer(_ allocator: CFAllocator!, _ openGLBufferPool: CVOpenGLBufferPool!, _ openGLBufferOut: UnsafeMutablePointer<Unmanaged<CVOpenGLBuffer>?>) -> CVReturn

    Objective-C

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

    Import Statement

    import CoreVideo

    Availability

    Available in OS X v10.4 and later.

  • Returns the pool attributes dictionary for an Open GL buffer pool.

    Declaration

    Swift

    func CVOpenGLBufferPoolGetAttributes(_ pool: CVOpenGLBufferPool!) -> Unmanaged<CFDictionary>!

    Objective-C

    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.

    Import Statement

    import CoreVideo

    Availability

    Available in OS X v10.4 and later.

  • Returns the attributes of OpenGL buffers that will be created from a buffer pool.

    Declaration

    Swift

    func CVOpenGLBufferPoolGetOpenGLBufferAttributes(_ pool: CVOpenGLBufferPool!) -> Unmanaged<CFDictionary>!

    Objective-C

    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.

    Import Statement

    import CoreVideo

    Availability

    Available in OS X v10.4 and later.

  • Obtains the Core Foundation ID for the OpenGL buffer pool type.

    Declaration

    Swift

    func CVOpenGLBufferPoolGetTypeID() -> CFTypeID

    Objective-C

    CFTypeID CVOpenGLBufferPoolGetTypeID ( void );

    Return Value

    The Core Foundation ID for this data type.

    Import Statement

    import CoreVideo

    Availability

    Available in OS X v10.4 and later.

  • Releases an OpenGL buffer pool.

    Declaration

    Objective-C

    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.

    Import Statement

    Availability

    Available in OS X v10.4 and later.

  • Retains an OpenGL buffer pool.

    Declaration

    Objective-C

    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.

    Import Statement

    Availability

    Available in OS X v10.4 and later.

Data Types

  • A reference to an OpenGL buffer pool object.

    Declaration

    Swift

    typealias CVOpenGLBufferPoolRef = CVOpenGLBufferPool

    Objective-C

    typedef struct _CVOpenGLBufferPool *CVOpenGLBufferPoolRef;

    Import Statement

    import CoreVideo

    Availability

    Available in OS X v10.3 and later.

Constants

  • The attributes associated with an OpenGL buffer pool.

    Declaration

    Swift

    let kCVOpenGLBufferPoolMinimumBufferCountKey: CFString! let kCVOpenGLBufferPoolMaximumBufferAgeKey: CFString!

    Objective-C

    const CFStringRef kCVOpenGLBufferPoolMinimumBufferCountKey; const CFStringRef kCVOpenGLBufferPoolMaximumBufferAgeKey;

    Constants

    • kCVOpenGLBufferPoolMinimumBufferCountKey

      kCVOpenGLBufferPoolMinimumBufferCountKey

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

      Available in OS X v10.4 and later.

    • kCVOpenGLBufferPoolMaximumBufferAgeKey

      kCVOpenGLBufferPoolMaximumBufferAgeKey

      The maximum time that unused buffers should be kept before they are deallocated (type CFAbsoluteTime).

      Available in OS X v10.4 and later.

    Discussion

    You specify these keys in a Core Foundation dictionary when calling functions such as CVOpenGLBufferPoolCreate.

    Import Statement