---
title: "init(glTexture:target:width:height:)"
framework: coreimage
role: symbol
role_heading: Initializer
path: "coreimage/cirenderdestination/init(gltexture:target:width:height:)-9ci8e"
---

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

Creates a render destination based on an OpenGL texture.

## Declaration

```swift
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

Return Value A CIRenderDestination object for rendering to a GLTexture supported by GLContext-backed CIContext.

## Discussion

Discussion Rendering to a GLTexture-backed CIRenderDestination is supported by only GLContext-backed CIContext. The destination’s colorSpace property will default to a CGColorSpace created with sRGB, extendedSRGB, or genericGrayGamma2_2.

## See Also

### Creating a Render Destination

- [init(pixelBuffer:)](coreimage/cirenderdestination/init(pixelbuffer:).md)
- [init(ioSurface:)](coreimage/cirenderdestination/init(iosurface:)-1hfcq.md)
- [init(mtlTexture:commandBuffer:)](coreimage/cirenderdestination/init(mtltexture:commandbuffer:)-2iu5i.md)
- [init(width:height:pixelFormat:commandBuffer:mtlTextureProvider:)](coreimage/cirenderdestination/init(width:height:pixelformat:commandbuffer:mtltextureprovider:).md)
- [init(bitmapData:width:height:bytesPerRow:format:)](coreimage/cirenderdestination/init(bitmapdata:width:height:bytesperrow:format:).md)
