<!--
{
  "availability" : [
    "macOS: 10.5.0 - 10.14.0"
  ],
  "documentType" : "symbol",
  "framework" : "Quartz",
  "identifier" : "/documentation/Quartz/QCPlugInInputImageSource/bindTextureRepresentation(toCGLContext:textureUnit:normalizeCoordinates:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Quartz"
    ],
    "preciseIdentifier" : "c:objc(pl)QCPlugInInputImageSource(im)bindTextureRepresentationToCGLContext:textureUnit:normalizeCoordinates:"
  },
  "title" : "bindTextureRepresentation(toCGLContext:textureUnit:normalizeCoordinates:)"
}
-->

# bindTextureRepresentation(toCGLContext:textureUnit:normalizeCoordinates:)

Binds the texture to a given texture unit and optionally scales or flips the texture.

```
func bindTextureRepresentation(toCGLContext cgl_ctx: CGLContextObj!, textureUnit unit: GLenum, normalizeCoordinates flag: Bool)
```

## Parameters

`cgl_ctx`

The CGL context to render to.)

`unit`

The texture unit to bind to (such as, `GL_TEXTURE0`)

`flag`

To apply a texture matrix to scale coordinates (from `[0, pixels]` to `[0,1]`) and flip them vertically (if necessary), pass <doc://com.apple.documentation/documentation/Swift/true>.

## Discussion

When you no longer need the texture, call [`unbindTextureRepresentation(fromCGLContext:textureUnit:)`](/documentation/Quartz/QCPlugInInputImageSource/unbindTextureRepresentation(fromCGLContext:textureUnit:)).

---

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)