---
title: "CVOpenGLBufferCreate(_:_:_:_:_:)"
framework: Core Video
role: symbol
role_heading: Function
platforms: [macOS 10.4+]
path: "corevideo/cvopenglbuffercreate(_:_:_:_:_:)"
---

# CVOpenGLBufferCreate(_:_:_:_:_:)

Creates a new Core Video OpenGL buffer that can be used for OpenGL rendering purposes

## Declaration

```swift
func CVOpenGLBufferCreate(_ allocator: CFAllocator?, _ width: Int, _ height: Int, _ attributes: CFDictionary?, _ bufferOut: UnsafeMutablePointer<CVOpenGLBuffer?>) -> CVReturn
```

## Parameters

- `allocator`: The allocator to use to create the Core Video OpenGL buffer. Pass NULL to specify the default allocator.
- `width`: The width of the buffer in pixels.
- `height`: The height of the buffer in pixels.
- `attributes`: A Core Foundation dictionary containing other desired attributes of the buffer (texture target, internal format, max mipmap level, etc.). May be NULL. The following attribute values are assumed if you do not explicitly define them: kCVOpenGLBufferTarget = GL_TEXTURE_RECTANGLE_EXT kCVOpenGLBufferInternalFormat = GL_RGBA kCVOpenGLBufferMaximumMipmapLevel = 0
- `bufferOut`: On output, bufferOut points to the newly created OpenGL buffer.

## Return Value

Return Value A Core Video result code. See Core Video Constants for possible values.

## Discussion

Discussion

## See Also

### Functions

- [CVOpenGLBufferAttach(_:_:_:_:_:)](corevideo/cvopenglbufferattach(_:_:_:_:_:).md)
- [CVOpenGLBufferGetAttributes(_:)](corevideo/cvopenglbuffergetattributes(_:).md)
- [CVOpenGLBufferGetTypeID()](corevideo/cvopenglbuffergettypeid().md)
