---
title: EAGLContext
framework: opengles
role: symbol
role_heading: Class
path: opengles/eaglcontext
---

# EAGLContext

An EAGLContext object manages an OpenGL ES rendering context—the state information, commands, and resources needed to draw using OpenGL ES. To execute OpenGL ES commands, you need a current rendering context.

## Declaration

```swift
class EAGLContext
```

## Overview

Overview Drawing resources, such as textures and renderbuffers, are managed for the EAGLContext object by an EAGLSharegroup object associated with the context. When you initialize a new EAGLContext object, you can choose to have it create a new sharegroup, or you can use one obtained from a previously created context. Before drawing to a context, you must bind a complete framebuffer object to the context. For more information on configuring rendering contexts, see OpenGL ES Programming Guide.

## Topics

### Creating Contexts

- [init(api:)](opengles/eaglcontext/init(api:)-q09o.md)
- [init(api:sharegroup:)](opengles/eaglcontext/init(api:sharegroup:)-2rt8m.md)

### Setting the Current Context

- [setCurrent(_:)](opengles/eaglcontext/setcurrent(_:).md)

### Attaching Storage to a Renderbuffer

- [renderbufferStorage(_:from:)](opengles/eaglcontext/renderbufferstorage(_:from:).md)

### Displaying a Renderbuffer

- [presentRenderbuffer(_:)](opengles/eaglcontext/presentrenderbuffer(_:).md)

### Getting Context Information

- [api](opengles/eaglcontext/api.md)
- [sharegroup](opengles/eaglcontext/sharegroup.md)
- [debugLabel](opengles/eaglcontext/debuglabel.md)
- [current()](opengles/eaglcontext/current().md)

### Enabling OpenGL ES Multithreading

- [isMultiThreaded](opengles/eaglcontext/ismultithreaded.md)

### Constants

- [EAGLRenderingAPI](opengles/eaglrenderingapi.md)

### Instance Methods

- [presentRenderbuffer(_:afterMinimumDuration:)](opengles/eaglcontext/presentrenderbuffer(_:afterminimumduration:).md)
- [presentRenderbuffer(_:atTime:)](opengles/eaglcontext/presentrenderbuffer(_:attime:).md)
- [texImageIOSurface(_:target:internalFormat:width:height:format:type:plane:)](opengles/eaglcontext/teximageiosurface(_:target:internalformat:width:height:format:type:plane:).md)

### Initializers

- [init(API:)](opengles/eaglcontext/init(api:)-54mtn.md)
- [init(API:sharegroup:)](opengles/eaglcontext/init(api:sharegroup:)-3gr8h.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
