<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreImage",
  "identifier" : "/documentation/CoreImage/CIRenderDestination/init(glTexture:target:width:height:)-9ci8e",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Core Image"
    ],
    "preciseIdentifier" : "c:objc(cs)CIRenderDestination(im)initWithGLTexture:target:width:height:"
  },
  "title" : "init(glTexture:target:width:height:)"
}
-->

# init(glTexture:target:width:height:)

Creates a render destination based on an OpenGL texture.

```
init(glTexture texture: UInt32, target: UInt32, width: Int, height: Int)
```

## Parameters

`texture`

`GLTexture`-backed texture data.

`target`

A value denoting the type of destination.  Use `GL_TEXTURE_2D` if your texture dimensions are a power of two, or `GL_TEXTURE_RECTANGLE_EXT` otherwise.

`width`

Width of the texture in texels.

`height`

Height of the texture in texels.

## Return Value

A [`CIRenderDestination`](/documentation/CoreImage/CIRenderDestination) object for rendering to a `GLTexture` supported by `GLContext`-backed [`CIContext`](/documentation/CoreImage/CIContext).

## Discussion

Rendering to a `GLTexture`-backed [`CIRenderDestination`](/documentation/CoreImage/CIRenderDestination) is supported by only `GLContext`-backed [`CIContext`](/documentation/CoreImage/CIContext).

The destination’s [`colorSpace`](/documentation/CoreImage/CIRenderDestination/colorSpace) property will default to a <doc://com.apple.documentation/documentation/CoreGraphics/CGColorSpace> created with <doc://com.apple.documentation/documentation/CoreGraphics/CGColorSpace/sRGB>, <doc://com.apple.documentation/documentation/CoreGraphics/CGColorSpace/extendedSRGB>, or <doc://com.apple.documentation/documentation/CoreGraphics/CGColorSpace/genericGrayGamma2_2>.

---

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)