init(api:)
Initializes and returns a newly allocated rendering context with the specified version of the OpenGL ES rendering API.
Declaration
convenience init?(api: EAGLRenderingAPI)Parameters
- api:
The desired version of the OpenGL ES rendering API. For legal values, see Eaglrenderingapi.
Return Value
An initialized context object, or nil if the object couldn’t be created.
Discussion
To issue OpenGL ES commands to this context, you must first make the context current by calling setCurrent(_:).
Calling init(api:) creates a new EAGLSharegroup object and attaches it to this context.