<!--
{
  "availability" : [
    "iOS: 5.0.0 - 12.0.0",
    "iPadOS: 5.0.0 - 12.0.0",
    "tvOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreImage",
  "identifier" : "/documentation/CoreImage/CIContext/init(eaglContext:options:)-6uyqj",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Core Image"
    ],
    "preciseIdentifier" : "c:objc(cs)CIContext(cm)contextWithEAGLContext:options:"
  },
  "title" : "init(eaglContext:options:)"
}
-->

# init(eaglContext:options:)

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

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

## Parameters

`eaglContext`

The EAGL context to render to.

`options`

A dictionary that contains options for creating a [`CIContext`](/documentation/CoreImage/CIContext) object. You can pass any of the keys defined in [`CIContextOption`](/documentation/CoreImage/CIContextOption) along with the appropriate value.

## Return Value

A Core Image context that targets OpenGL ES.

## 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.

---

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)