<!--
{
  "availability" : [
    "iOS: 2.0.0 - 12.0.0",
    "iPadOS: 2.0.0 - 12.0.0",
    "macCatalyst: 2.0.0 - 12.0.0",
    "tvOS: 9.0.0 - 12.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "OpenGLES",
  "identifier" : "/documentation/OpenGLES/EAGLContext/renderbufferStorage(_:from:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "OpenGL ES",
      "OpenGLES"
    ],
    "preciseIdentifier" : "c:objc(cs)EAGLContext(im)renderbufferStorage:fromDrawable:"
  },
  "title" : "renderbufferStorage(_:from:)"
}
-->

# renderbufferStorage(_:from:)

Binds a drawable object’s storage to an OpenGL ES renderbuffer object.

```
func renderbufferStorage(_ target: Int, from drawable: (any EAGLDrawable)?) -> Bool
```

## Parameters

`target`

The OpenGL ES binding point for a currently bound renderbuffer. The value of this parameter must be `GL_RENDERBUFFER` (or `GL_RENDERBUFFER_OES` in an OpenGL ES 1.1 context).

`drawable`

An object managing the data store for the renderbuffer. In iOS, the value of this parameter must be a <doc://com.apple.documentation/documentation/QuartzCore/CAEAGLLayer> object.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if successful; otherwise, <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

To create a renderbuffer that can be presented to the screen, you bind the renderbuffer and then allocate shared storage for it by calling this method. This method call replaces the call normally made to `glRenderbufferStorage`. A renderbuffer whose storage has been allocated with this method can later be displayed with a call to [`presentRenderbuffer(_:)`](/documentation/OpenGLES/EAGLContext/presentRenderbuffer(_:)).

The width, height, and internal color buffer format are derived from the characteristics of the drawable object. You may override the internal color buffer format by adding an [`kEAGLDrawablePropertyColorFormat`](/documentation/OpenGLES/kEAGLDrawablePropertyColorFormat) key to the [`drawableProperties`](/documentation/OpenGLES/EAGLDrawable/drawableProperties) dictionary of the drawable object before calling this method.

To specify that the OpenGL ES renderbuffer should be detached from the drawable object, call this method with the `drawable` parameter set to `nil`.

### Special Considerations

In iOS 6.0 and later, this method automatically flushes the OpenGL ES command buffer, making it unsuitable to call repeatedly in performance-critical code.

---

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)