<!--
{
  "availability" : [
    "iOS: 2.0.0 - 12.0.0",
    "iPadOS: 2.0.0 - 12.0.0",
    "tvOS: 9.0.0 - 12.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "QuartzCore",
  "identifier" : "/documentation/QuartzCore/CAEAGLLayer",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core Animation"
    ],
    "preciseIdentifier" : "c:objc(cs)CAEAGLLayer"
  },
  "title" : "CAEAGLLayer"
}
-->

# CAEAGLLayer

A layer that supports drawing OpenGL content in iOS and tvOS applications.

```
class CAEAGLLayer
```

## Overview

If you plan to use OpenGL for your rendering, use this class as the backing layer for your views by returning it from your view’s <doc://com.apple.documentation/documentation/UIKit/UIView/layerClass> class method. The returned [`CAEAGLLayer`](/documentation/QuartzCore/CAEAGLLayer) object is a wrapper for a Core Animation surface that is fully compatible with OpenGL ES function calls.

Prior to designating the layer’s associated view as the render target for a graphics context, you can change the rendering attributes you want using the <doc://com.apple.documentation/documentation/OpenGLES/EAGLDrawable/drawableProperties> property. This property lets you configure the color format for the rendering surface and whether the surface retains its contents. For a list of keys (and corresponding values) you can include in this dictionary (along with their default values), see the <doc://com.apple.documentation/documentation/OpenGLES/EAGLDrawable>.

Because an OpenGL ES rendering surface is presented to the user using Core Animation, any effects and animations you apply to the layer affect the 3D content you render. However, for best performance, do the following:

- Set the layer’s opaque attribute to `TRUE`.
- Set the layer bounds to match the dimensions of the display.
- Make sure the layer is not transformed.
- Avoid drawing other layers on top of the `CAEAGLLayer` object. If you must draw other, non OpenGL content, you might find the performance cost acceptable if you place transparent 2D content on top of the GL content and also make sure that the OpenGL content is opaque and not transformed.
- When drawing landscape content on a portrait display, you should rotate the content yourself rather than using the `CAEAGLLayer` transform to rotate it.

## Topics

### Accessing the Layer Properties

  <doc://com.apple.documentation/documentation/OpenGLES/EAGLDrawable/drawableProperties>

[`presentsWithTransaction`](/documentation/QuartzCore/CAEAGLLayer/presentsWithTransaction)

A Boolean value that determines whether the layer presents its content using a Core Animation transaction.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`EAGLDrawable`](/documentation/OpenGLES/EAGLDrawable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`CAMediaTiming`](/documentation/QuartzCore/CAMediaTiming)

[`Sendable`](/documentation/Swift/Sendable)

[`Hashable`](/documentation/Swift/Hashable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSCoding`](/documentation/Foundation/NSCoding)

### Inherits From

[`CALayer`](/documentation/QuartzCore/CALayer)

---

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)