<!--
{
  "availability" : [
    "iOS: 5.0.0 - 12.0.0",
    "iPadOS: 5.0.0 - 12.0.0",
    "tvOS: 9.0.0 - 12.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "CoreVideo",
  "identifier" : "/documentation/CoreVideo/CVOpenGLESTextureCacheCreate(_:_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Video"
    ],
    "preciseIdentifier" : "c:@F@CVOpenGLESTextureCacheCreate"
  },
  "title" : "CVOpenGLESTextureCacheCreate(_:_:_:_:_:)"
}
-->

# CVOpenGLESTextureCacheCreate(_:_:_:_:_:)

Creates a new Core Video texture cache.

```
func CVOpenGLESTextureCacheCreate(_ allocator: CFAllocator?, _ cacheAttributes: CFDictionary?, _ eaglContext: CVEAGLContext, _ textureAttributes: CFDictionary?, _ cacheOut: UnsafeMutablePointer<CVOpenGLESTextureCache?>) -> CVReturn
```

## Parameters

`allocator`

The <doc://com.apple.documentation/documentation/CoreFoundation/CFAllocator> to use for allocating the texture cache. This parameter can be `NULL`.

`cacheAttributes`

A <doc://com.apple.documentation/documentation/CoreFoundation/CFDictionary> containing the attributes of the texture cache itself. This parameter can be `NULL`.

`eaglContext`

The OpenGLES 2.0 context into which the texture objects will be created. OpenGLES 1.x contexts are not supported.

`textureAttributes`

A <doc://com.apple.documentation/documentation/CoreFoundation/CFDictionary> containing the attributes to be used for creating the [`CVOpenGLESTexture`](/documentation/CoreVideo/CVOpenGLESTexture) objects. This parameter can be `NULL`.

`cacheOut`

A pointer to a `CVOpenGLESTextureCacheRef` where the newly created texture cache will be placed.

## Return Value

Upon successful creation of the texture cache, this function returns [`kCVReturnSuccess`](/documentation/CoreVideo/kCVReturnSuccess).

---

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)