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

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

Creates a new texture cache.

## Declaration

```swift
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 doc://com.apple.corevideo/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

Return Value Returns kCVReturnSuccess on success.

## See Also

### Functions

- [CVOpenGLTextureCacheCreateTextureFromImage(_:_:_:_:_:)](corevideo/cvopengltexturecachecreatetexturefromimage(_:_:_:_:_:).md)
- [CVOpenGLTextureCacheFlush(_:_:)](corevideo/cvopengltexturecacheflush(_:_:).md)
- [CVOpenGLTextureCacheGetTypeID()](corevideo/cvopengltexturecachegettypeid().md)
