<!--
{
  "availability" : [
    "macOS: 10.4.0 - 10.14.0"
  ],
  "documentType" : "symbol",
  "framework" : "CoreVideo",
  "identifier" : "/documentation/CoreVideo/CVOpenGLTextureCacheCreate(_:_:_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Video"
    ],
    "preciseIdentifier" : "c:@F@CVOpenGLTextureCacheCreate"
  },
  "title" : "CVOpenGLTextureCacheCreate(_:_:_:_:_:_:)"
}
-->

# CVOpenGLTextureCacheCreate(_:_:_:_:_:_:)

Creates a new texture cache.

```
func CVOpenGLTextureCacheCreate(_ allocator: CFAllocator?, _ cacheAttributes: CFDictionary?, _ cglContext: CGLContextObj, _ cglPixelFormat: CGLPixelFormatObj, _ textureAttributes: CFDictionary?, _ cacheOut: UnsafeMutablePointer<CVOpenGLTextureCache?>) -> CVReturn
```

## Parameters

`allocator`

The `CFAllocatorRef` to use for allocating the cache.  May be NULL.

`cacheAttributes`

A dictionary specifying options for the cache’s behavior, or `NULL` to use default options. For applicable keys and values, see [Cache Attributes](/documentation/CoreVideo/CVOpenGLTextureCache-cache-attributes).

`cglContext`

The OpenGL context into which the texture objects will be created.

`cglPixelFormat`

The OpenGL pixel format object used to create the passed in OpenGL context.

`textureAttributes`

A `CFDictionaryRef` containing the attributes to be used for creating the `CVOpenGLTexture` objects.  May be `NULL`.

`cacheOut`

Upon return, contains the newly created texture cache.

## Return Value

Returns [`kCVReturnSuccess`](/documentation/CoreVideo/kCVReturnSuccess) on success.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)