<!--
{
  "availability" : [
    "macOS: 10.5.0 - 10.14.0"
  ],
  "documentType" : "symbol",
  "framework" : "Quartz",
  "identifier" : "/documentation/Quartz/QCPlugInOutputImageProvider/copyRenderedTexture(forCGLContext:pixelFormat:bounds:isFlipped:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Quartz"
    ],
    "preciseIdentifier" : "c:objc(pl)QCPlugInOutputImageProvider(im)copyRenderedTextureForCGLContext:pixelFormat:bounds:isFlipped:"
  },
  "title" : "copyRenderedTexture(forCGLContext:pixelFormat:bounds:isFlipped:)"
}
-->

# copyRenderedTexture(forCGLContext:pixelFormat:bounds:isFlipped:)

Returns the name of an OpenGL texture of type `GL_TEXTURE_RECTANGLE_EXT` that contains a subregion of the image in a given pixel format.

```
optional func copyRenderedTexture(forCGLContext cgl_ctx: CGLContextObj!, pixelFormat format: String!, bounds: NSRect, isFlipped flipped: UnsafeMutablePointer<ObjCBool>!) -> GLuint
```

## Parameters

`cgl_ctx`

The CGL context to render to.

`format`

A string that represents the pixel format of the texture.

`bounds`

The bounds of the subregion of the image.

`flipped`

Set to <doc://com.apple.documentation/documentation/Swift/true> on output if the contents of the returned texture are vertically flipped.

## Return Value

The name of an OpenGL texture of type `GL_TEXTURE_RECTANGLE_EXT` that contains a subregion of the image in a given pixel format or `0` if the texture can’t be provided.

## Discussion

Implement this method if you want to create the texture yourself or use framebuffer objects (FBO). Use `<OpenGL/CGLMacro.h>` to send commands to the OpenGL context. Make sure to preserve all the OpenGL states except the ones defined by `GL_CURRENT_BIT`.

---

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)