eglBindAPI - EGL Reference Pages

## Name

eglBindAPI — Set the current rendering API

## C Specification

`EGLBoolean eglBindAPI(` | EGLenum api`)`;

## Parameters

`api`

  Specifies the client API to bind, one of `EGL_OPENGL_API`, `EGL_OPENGL_ES_API`, or `EGL_OPENVG_API`.

## Description

`eglBindAPI` defines the current rendering API for EGL in the thread it is called from. The current rendering API is one of the client rendering APIs supported by the EGL implementation, and affects the behavior of other EGL commands including `eglCreateContext`, `eglGetCurrentContext`, `eglGetCurrentDisplay`, `eglGetCurrentSurface`, `eglMakeCurrent`, `eglWaitClient`, and `eglWaitNative`.

If `api` is `EGL_OPENGL_API`, the current rendering API is set to the OpenGL API.

If `api` is `EGL_OPENGL_ES_API`, the current rendering API is set to the OpenGL ES API.

If `api` is `EGL_OPENVG_API`, the current rendering API is set to the OpenVG API.

If an error occurs, the current rendering API is unchanged.

## Notes

`eglBindAPI` and the corresponding `EGL_OPENGL_ES_API` and `EGL_OPENVG_API` `api` parameters are supported only if the EGL version is 1.2 or greater. The `EGL_OPENGL_API` parameter is supported only if the EGL version is 1.4 or greater.

The initial value of the current rendering API is `EGL_OPENGL_ES_API` unless OpenGL ES is not supported by an implementation, in which case the initial value is `EGL_NONE` (however, `EGL_NONE` is not a valid `api` parameter to `eglBindAPI`).

The current rendering API can be queried by calling `eglQueryAPI`.

## Errors

`EGL_FALSE` is returned on failure.

`EGL_BAD_PARAMETER` is generated if `api` is not one of the accepted tokens, or if the specified client API is not supported by the EGL implementation.

## See Also

eglCreateContext, eglGetCurrentContext, eglGetCurrentDisplay, eglGetCurrentSurface, eglMakeCurrent, eglQueryAPI, eglWaitClient, eglWaitNative

Copyright © 2003-2014 The Khronos Group Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and/or associated documentation files (the "Materials"), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Materials, and to permit persons to whom the Materials are furnished to do so, subject to the condition that this copyright notice and permission notice shall be included in all copies or substantial portions of the Materials.