---
title: "init(eaglContext:options:)"
framework: coreimage
role: symbol
role_heading: Initializer
path: "coreimage/cicontext/init(eaglcontext:options:)-6uyqj"
---

# init(eaglContext:options:)

Creates a Core Image context from an EAGL context using the specified options.

## Declaration

```swift
init(eaglContext: EAGLContext, options: [CIContextOption : Any]? = nil)
```

## Parameters

- `eaglContext`: The EAGL context to render to.
- `options`: A dictionary that contains options for creating a doc://com.apple.coreimage/documentation/CoreImage/CIContext object. You can pass any of the keys defined in doc://com.apple.coreimage/documentation/CoreImage/CIContextOption along with the appropriate value.

## Return Value

Return Value A Core Image context that targets OpenGL ES.

## Discussion

Discussion The OpenGL ES context must support OpenGL ES 2.0. All drawing performed using the methods listed in Drawing Images is rendered directly into the context.

## See Also

### Deprecated

- [init(cglContext:pixelFormat:colorSpace:options:)](coreimage/cicontext/init(cglcontext:pixelformat:colorspace:options:)-6rp6d.md)
- [init(eaglContext:)](coreimage/cicontext/init(eaglcontext:)-8ajef.md)
- [init(forOfflineGPUAtIndex:)](coreimage/cicontext/init(forofflinegpuatindex:).md)
- [init(forOfflineGPUAtIndex:colorSpace:options:sharedContext:)](coreimage/cicontext/init(forofflinegpuatindex:colorspace:options:sharedcontext:).md)
- [createCGLayer(with:info:)](coreimage/cicontext/createcglayer(with:info:).md)
- [draw(_:at:from:)](coreimage/cicontext/draw(_:at:from:).md)
