<!--
{
  "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/sharegroup",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "OpenGL ES"
    ],
    "preciseIdentifier" : "c:objc(cs)EAGLContext(py)sharegroup"
  },
  "title" : "sharegroup"
}
-->

# sharegroup

The context’s sharegroup object. (read-only)

```
var sharegroup: EAGLSharegroup { get }
```

## Discussion

Retrieve the sharegroup of a context when you want to create two or more contexts that share rendering resources. Call [`init(api:)`](/documentation/OpenGLES/EAGLContext/init(api:)-q09o) to initialize the first context, retrieve its sharegroup, and then initialize additional contexts by calling [`init(api:sharegroup:)`](/documentation/OpenGLES/EAGLContext/init(api:sharegroup:)-2rt8m), passing this sharegroup as the parameter.

## See Also

[`init?(api: EAGLRenderingAPI, sharegroup: EAGLSharegroup)`](/documentation/OpenGLES/EAGLContext/init(api:sharegroup:)-2rt8m)

Initializes and returns a newly allocated rendering context with the specified version of OpenGL ES rendering API and the specified sharegroup.



---

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)