---
title: "releaseRenderedTexture(_:forCGLContext:)"
framework: quartz
role: symbol
role_heading: Instance Method
path: "quartz/qcpluginoutputimageprovider/releaserenderedtexture(_:forcglcontext:)"
---

# releaseRenderedTexture(_:forCGLContext:)

Releases the previously copied texture.

## Declaration

```swift
optional func releaseRenderedTexture(_ name: GLuint, forCGLContext cgl_ctx: CGLContextObj!)
```

## Parameters

- `name`: The name of the previously bound texture.
- `cgl_ctx`: The CGL context.

## Discussion

Discussion Your OpenGL code should save and restore all states except for those that are part of GL_CURRENT_BIT (vertex position, color, texture, and so on). Also use CGL macros instead of changing the current context, by including this statement: #import <OpenGL/CGLMacro.h> For more details, see Quartz Composer Custom Patch Programming Guide.

## See Also

### Rendering an Image to a Destination

- [render(toBuffer:withBytesPerRow:pixelFormat:forBounds:)](quartz/qcpluginoutputimageprovider/render(tobuffer:withbytesperrow:pixelformat:forbounds:).md)
- [copyRenderedTexture(forCGLContext:pixelFormat:bounds:isFlipped:)](quartz/qcpluginoutputimageprovider/copyrenderedtexture(forcglcontext:pixelformat:bounds:isflipped:).md)
- [render(withCGLContext:forBounds:)](quartz/qcpluginoutputimageprovider/render(withcglcontext:forbounds:).md)
