Module egl

egl - Nim bindings for EGL, the native platform interface for rendering APIs.

This file is part of the Nim I/O package collection. See the file LICENSE included in this distribution for licensing details. GitHub pull requests are encouraged. (c) 2015 Headcrash Industries LLC.

Types

EGLNativeDisplayType = HDC
  Source
EGLNativePixmapType = HBITMAP
  Source
EGLNativeWindowType = HWND
  Source
NativeDisplayType = EGLNativeDisplayType
  Source
NativePixmapType = EGLNativePixmapType
  Source
NativeWindowType = EGLNativeWindowType
  Source
EGLInt = int
  Source
EGLBoolean = cuint
  Source
EGLDisplay = pointer
  Source
EGLConfig = pointer
  Source
EGLSurface = pointer
  Source
EGLContext = pointer
  Source
EGLAttribList = seq[EGLInt]
  Source
EGLMustCastToProperProcType = proc ()
  Source
EGLenum = cuint
  Source
EGLClientBuffer = pointer
  Source
EGLSync = pointer
  Source
EGLAttrib = csize
  Source
EGLTime = culonglong
  Source
EGLImage = pointer
  Source

Consts

EGL_ALPHA_SIZE = 0x00003021
  Source
EGL_BAD_ACCESS = 0x00003002
  Source
EGL_BAD_ALLOC = 0x00003003
  Source
EGL_BAD_ATTRIBUTE = 0x00003004
  Source
EGL_BAD_CONFIG = 0x00003005
  Source
EGL_BAD_CONTEXT = 0x00003006
  Source
EGL_BAD_CURRENT_SURFACE = 0x00003007
  Source
EGL_BAD_DISPLAY = 0x00003008
  Source
EGL_BAD_MATCH = 0x00003009
  Source
EGL_BAD_NATIVE_PIXMAP = 0x0000300A
  Source
EGL_BAD_NATIVE_WINDOW = 0x0000300B
  Source
EGL_BAD_PARAMETER = 0x0000300C
  Source
EGL_BAD_SURFACE = 0x0000300D
  Source
EGL_BLUE_SIZE = 0x00003022
  Source
EGL_BUFFER_SIZE = 0x00003020
  Source
EGL_CONFIG_CAVEAT = 0x00003027
  Source
EGL_CONFIG_ID = 0x00003028
  Source
EGL_CORE_NATIVE_ENGINE = 0x0000305B
  Source
EGL_DEPTH_SIZE = 0x00003025
  Source
EGL_DONT_CARE = -1
  Source
EGL_DRAW = 0x00003059
  Source
EGL_EXTENSIONS = 0x00003055
  Source
EGL_FALSE = 0
  Source
EGL_GREEN_SIZE = 0x00003023
  Source
EGL_HEIGHT = 0x00003056
  Source
EGL_LARGEST_PBUFFER = 0x00003058
  Source
EGL_LEVEL = 0x00003029
  Source
EGL_MAX_PBUFFER_HEIGHT = 0x0000302A
  Source
EGL_MAX_PBUFFER_PIXELS = 0x0000302B
  Source
EGL_MAX_PBUFFER_WIDTH = 0x0000302C
  Source
EGL_NATIVE_RENDERABLE = 0x0000302D
  Source
EGL_NATIVE_VISUAL_ID = 0x0000302E
  Source
EGL_NATIVE_VISUAL_TYPE = 0x0000302F
  Source
EGL_NONE = 0x00003038
  Source
EGL_NON_CONFORMANT_CONFIG = 0x00003051
  Source
EGL_NOT_INITIALIZED = 0x00003001
  Source
EGL_NO_CONTEXT = 0
  Source
EGL_NO_DISPLAY = 0
  Source
EGL_NO_SURFACE = 0
  Source
EGL_PBUFFER_BIT = 0x00000001
  Source
EGL_PIXMAP_BIT = 0x00000002
  Source
EGL_READ = 0x0000305A
  Source
EGL_RED_SIZE = 0x00003024
  Source
EGL_SAMPLES = 0x00003031
  Source
EGL_SAMPLE_BUFFERS = 0x00003032
  Source
EGL_SLOW_CONFIG = 0x00003050
  Source
EGL_STENCIL_SIZE = 0x00003026
  Source
EGL_SUCCESS = 0x00003000
  Source
EGL_SURFACE_TYPE = 0x00003033
  Source
EGL_TRANSPARENT_BLUE_VALUE = 0x00003035
  Source
EGL_TRANSPARENT_GREEN_VALUE = 0x00003036
  Source
EGL_TRANSPARENT_RED_VALUE = 0x00003037
  Source
EGL_TRANSPARENT_RGB = 0x00003052
  Source
EGL_TRANSPARENT_TYPE = 0x00003034
  Source
EGL_TRUE = 1
  Source
EGL_VENDOR = 0x00003053
  Source
EGL_VERSION = 0x00003054
  Source
EGL_WIDTH = 0x00003057
  Source
EGL_WINDOW_BIT = 0x00000004
  Source
EGL_BACK_BUFFER = 0x00003084
  Source
EGL_BIND_TO_TEXTURE_RGB = 0x00003039
  Source
EGL_BIND_TO_TEXTURE_RGBA = 0x0000303A
  Source
EGL_CONTEXT_LOST = 0x0000300E
  Source
EGL_MIN_SWAP_INTERVAL = 0x0000303B
  Source
EGL_MAX_SWAP_INTERVAL = 0x0000303C
  Source
EGL_MIPMAP_TEXTURE = 0x00003082
  Source
EGL_MIPMAP_LEVEL = 0x00003083
  Source
EGL_NO_TEXTURE = 0x0000305C
  Source
EGL_TEXTURE_2D = 0x0000305F
  Source
EGL_TEXTURE_FORMAT = 0x00003080
  Source
EGL_TEXTURE_RGB = 0x0000305D
  Source
EGL_TEXTURE_RGBA = 0x0000305E
  Source
EGL_TEXTURE_TARGET = 0x00003081
  Source
EGL_ALPHA_FORMAT = 0x00003088
  Source
EGL_ALPHA_FORMAT_NONPRE = 0x0000308B
  Source
EGL_ALPHA_FORMAT_PRE = 0x0000308C
  Source
EGL_ALPHA_MASK_SIZE = 0x0000303E
  Source
EGL_BUFFER_PRESERVED = 0x00003094
  Source
EGL_BUFFER_DESTROYED = 0x00003095
  Source
EGL_CLIENT_APIS = 0x0000308D
  Source
EGL_COLORSPACE = 0x00003087
  Source
EGL_COLORSPACE_sRGB = 0x00003089
  Source
EGL_COLORSPACE_LINEAR = 0x0000308A
  Source
EGL_COLOR_BUFFER_TYPE = 0x0000303F
  Source
EGL_CONTEXT_CLIENT_TYPE = 0x00003097
  Source
EGL_DISPLAY_SCALING = 10000
  Source
EGL_HORIZONTAL_RESOLUTION = 0x00003090
  Source
EGL_LUMINANCE_BUFFER = 0x0000308F
  Source
EGL_LUMINANCE_SIZE = 0x0000303D
  Source
EGL_OPENGL_ES_BIT = 0x00000001
  Source
EGL_OPENVG_BIT = 0x00000002
  Source
EGL_OPENGL_ES_API = 0x000030A0
  Source
EGL_OPENVG_API = 0x000030A1
  Source
EGL_OPENVG_IMAGE = 0x00003096
  Source
EGL_PIXEL_ASPECT_RATIO = 0x00003092
  Source
EGL_RENDERABLE_TYPE = 0x00003040
  Source
EGL_RENDER_BUFFER = 0x00003086
  Source
EGL_RGB_BUFFER = 0x0000308E
  Source
EGL_SINGLE_BUFFER = 0x00003085
  Source
EGL_SWAP_BEHAVIOR = 0x00003093
  Source
EGL_UNKNOWN = -1
  Source
EGL_VERTICAL_RESOLUTION = 0x00003091
  Source
EGL_CONFORMANT = 0x00003042
  Source
EGL_CONTEXT_CLIENT_VERSION = 0x00003098
  Source
EGL_MATCH_NATIVE_PIXMAP = 0x00003041
  Source
EGL_OPENGL_ES2_BIT = 0x00000004
  Source
EGL_VG_ALPHA_FORMAT = 0x00003088
  Source
EGL_VG_ALPHA_FORMAT_NONPRE = 0x0000308B
  Source
EGL_VG_ALPHA_FORMAT_PRE = 0x0000308C
  Source
EGL_VG_ALPHA_FORMAT_PRE_BIT = 0x00000040
  Source
EGL_VG_COLORSPACE = 0x00003087
  Source
EGL_VG_COLORSPACE_sRGB = 0x00003089
  Source
EGL_VG_COLORSPACE_LINEAR = 0x0000308A
  Source
EGL_VG_COLORSPACE_LINEAR_BIT = 0x00000020
  Source
EGL_DEFAULT_DISPLAY = 0
  Source
EGL_MULTISAMPLE_RESOLVE_BOX_BIT = 0x00000200
  Source
EGL_MULTISAMPLE_RESOLVE = 0x00003099
  Source
EGL_MULTISAMPLE_RESOLVE_DEFAULT = 0x0000309A
  Source
EGL_MULTISAMPLE_RESOLVE_BOX = 0x0000309B
  Source
EGL_OPENGL_API = 0x000030A2
  Source
EGL_OPENGL_BIT = 0x00000008
  Source
EGL_SWAP_BEHAVIOR_PRESERVED_BIT = 0x00000400
  Source
EGL_CONTEXT_MAJOR_VERSION = 0x00003098
  Source
EGL_CONTEXT_MINOR_VERSION = 0x000030FB
  Source
EGL_CONTEXT_OPENGL_PROFILE_MASK = 0x000030FD
  Source
EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY = 0x000031BD
  Source
EGL_NO_RESET_NOTIFICATION = 0x000031BE
  Source
EGL_LOSE_CONTEXT_ON_RESET = 0x000031BF
  Source
EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT = 0x00000001
  Source
EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT = 0x00000002
  Source
EGL_CONTEXT_OPENGL_DEBUG = 0x000031B0
  Source
EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE = 0x000031B1
  Source
EGL_CONTEXT_OPENGL_ROBUST_ACCESS = 0x000031B2
  Source
EGL_OPENGL_ES3_BIT = 0x00000040
  Source
EGL_CL_EVENT_HANDLE = 0x0000309C
  Source
EGL_SYNC_CL_EVENT = 0x000030FE
  Source
EGL_SYNC_CL_EVENT_COMPLETE = 0x000030FF
  Source
EGL_SYNC_PRIOR_COMMANDS_COMPLETE = 0x000030F0
  Source
EGL_SYNC_TYPE = 0x000030F7
  Source
EGL_SYNC_STATUS = 0x000030F1
  Source
EGL_SYNC_CONDITION = 0x000030F8
  Source
EGL_SIGNALED = 0x000030F2
  Source
EGL_UNSIGNALED = 0x000030F3
  Source
EGL_SYNC_FLUSH_COMMANDS_BIT = 0x00000001
  Source
EGL_FOREVER = 0xFFFFFFFFFFFFFFFF'i64
  Source
EGL_TIMEOUT_EXPIRED = 0x000030F5
  Source
EGL_CONDITION_SATISFIED = 0x000030F6
  Source
EGL_NO_SYNC = 0
  Source
EGL_SYNC_FENCE = 0x000030F9
  Source
EGL_GL_COLORSPACE = 0x0000309D
  Source
EGL_GL_COLORSPACE_SRGB = 0x00003089
  Source
EGL_GL_COLORSPACE_LINEAR = 0x0000308A
  Source
EGL_GL_RENDERBUFFER = 0x000030B9
  Source
EGL_GL_TEXTURE_2D = 0x000030B1
  Source
EGL_GL_TEXTURE_LEVEL = 0x000030BC
  Source
EGL_GL_TEXTURE_3D = 0x000030B2
  Source
EGL_GL_TEXTURE_ZOFFSET = 0x000030BD
  Source
EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X = 0x000030B3
  Source
EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 0x000030B4
  Source
EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 0x000030B5
  Source
EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x000030B6
  Source
EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 0x000030B7
  Source
EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x000030B8
  Source
EGL_IMAGE_PRESERVED = 0x000030D2
  Source
EGL_NO_IMAGE = 0
  Source

Procs

proc eglChooseConfig(display: EGLDisplay; attribList: ptr EGLInt;
                    configs: ptr EGLConfig; configSize: EGLInt; numConfig: ptr EGLInt): EGLBoolean {.
    cdecl, dynlib: dllname, importc.}
Return a list of EGL frame buffer configurations that match specified attributes.
display
Specifies the EGL display connection.
attribList
Specifies attributes required to match by configs.
configs
Returns an array of frame buffer configurations.
configSize
Specifies the size of the array of frame buffer configurations.
numConfig
Returns the number of frame buffer configurations returned.
result
EGL_TRUE on success, EGL_FALSE on failure.

configs and numConfig are not modified when EGL_FALSE is returned.

The following error codes may be generated:

  • EGL_BAD_DISPLAY if display is not an EGL display connection.
  • EGL_BAD_ATTRIBUTE if attributeList contains an invalid frame buffer configuration attribute or an attribute value that is unrecognized or out of range.
  • EGL_NOT_INITIALIZED if display has not been initialized.
  • EGL_BAD_PARAMETER if num_config is nil.
  Source
proc eglCopyBuffers(display: EGLDisplay; surface: EGLSurface;
                   nativePixmap: EGLNativePixmapType): EGLBoolean {.cdecl,
    dynlib: dllname, importc.}
Copy EGL surface color buffer to a native pixmap.
display
Specifies the EGL display connection.
surface
Specifies the EGL surface whose color buffer is to be copied.
nativePixmap
Specifies the native pixmap as target of the copy.
result
EGL_FALSE if swapping of the buffers failed, EGL_TRUE otherwise.

The following error codes may be generated:

  • EGL_BAD_DISPLAY if display is not an EGL display connection.
  • EGL_NOT_INITIALIZED if display has not been initialized.
  • EGL_BAD_SURFACE if surface is not an EGL drawing surface.
  • EGL_BAD_NATIVE_PIXMAP if the implementation does not support native pixmaps.
  • EGL_BAD_NATIVE_PIXMAP if nativePixmap is not a valid native pixmap.
  • EGL_BAD_MATCH if the format of nativePixmap is not compatible with the color buffer of surface.
  • EGL_CONTEXT_LOST if a power management event has occurred. The application must destroy all contexts and reinitialise OpenGL ES state and objects to continue rendering.
  Source
proc eglCreateContext(display: EGLDisplay; config: EGLConfig;
                     shareContext: EGLContext; attribList: ptr EGLInt): EGLContext {.
    cdecl, dynlib: dllname, importc.}
Create a new EGL rendering context.
display
Specifies the EGL display connection.
config
Specifies the EGL frame buffer configuration that defines the frame buffer resource available to the rendering context.
shareContext
Specifies another EGL rendering context with which to share data, as defined by the client API corresponding to the contexts. Data is also shared with all other contexts with which shareContext shares data. EGL_NO_CONTEXT indicates that no sharing is to take place.
attribList
Specifies attributes and attribute values for the context being created. Only the attribute EGL_CONTEXT_CLIENT_VERSION may be specified.
result
EGL_NO_CONTEXT if creation of the context fails, EGL_TRUE otherwise.

The following error codes may be generated:

  • EGL_BAD_MATCH if the current rendering API is EGL_NONE (this can only arise in an EGL implementation which does not support OpenGL ES, prior to the first call to eglBindAPI).
  • EGL_BAD_MATCH if the server context state for shareContext exists in an address space which cannot be shared with the newly created context, if shareContext was created on a different display than the one referenced by config, or if the contexts are otherwise incompatible.
  • EGL_BAD_DISPLAY if display is not an EGL display connection.
  • EGL_NOT_INITIALIZED if display has not been initialized.
  • EGL_BAD_CONFIG if config is not an EGL frame buffer configuration, or does not support the current rendering API. This includes requesting creation of an OpenGL ES 1.x context when the EGL_RENDERABLE_TYPE attribute of config does not contain EGL_OPENGL_ES_BIT, or creation of an OpenGL ES 2.x context when the attribute does not contain EGL_OPENGL_ES2_BIT.
  • EGL_BAD_CONTEXT if shareContext is not an EGL rendering context of the same client API type as the newly created context and is not EGL_NO_CONTEXT.
  • EGL_BAD_ATTRIBUTE if attribList contains an invalid context attribute or if an attribute is not recognized or out of range. Note that attribute EGL_CONTEXT_CLIENT_VERSION is only valid when the current rendering API is EGL_OPENGL_ES_API.
  • EGL_BAD_ALLOC if there are not enough resources to allocate the new context.
  Source
proc eglCreatePbufferSurface(display: EGLDisplay; config: EGLConfig;
                            attribList: ptr EGLInt): EGLSurface {.cdecl,
    dynlib: dllname, importc.}
Create a new EGL pixel buffer surface.
display
Specifies the EGL display connection.
config
Specifies the EGL frame buffer configuration that defines the frame buffer resource available to the surface.
attribList
Specifies pixel buffer surface attributes. May be nil or empty (first attribute is EGL_NONE).
result
EGL_NO_SURFACE if creation of the context fails, EGL_TRUE otherwise.

The following error codes may be generated:

  • EGL_BAD_DISPLAY if display is not an EGL display connection.
  • EGL_NOT_INITIALIZED if display has not been initialized.
  • EGL_BAD_CONFIG if config is not an EGL frame buffer configuration.
  • EGL_BAD_ATTRIBUTE if attribList contains an invalid pixel buffer attribute or if an attribute value is not recognized or out of range.
  • EGL_BAD_ATTRIBUTE if attribList contains any of the attributes EGL_MIPMAP_TEXTURE, EGL_TEXTURE_FORMAT, or EGL_TEXTURE_TARGET, and config does not support OpenGL ES rendering (e.g. the EGL version is 1.2 or later, and the EGL_RENDERABLE_TYPE attribute of config does not include at least one of EGL_OPENGL_ES_BIT or EGL_OPENGL_ES2_BIT).
  • EGL_BAD_ALLOC if there are not enough resources to allocate the new surface.
  • EGL_BAD_MATCH if config does not support rendering to pixel buffers (the EGL_SURFACE_TYPE attribute does not contain EGL_PBUFFER_BIT).
  • EGL_BAD_MATCH if the EGL_TEXTURE_FORMAT attribute is not EGL_NO_TEXTURE, and EGL_WIDTH and/or EGL_HEIGHT specify an invalid size (e.g., the texture size is not a power of 2, and the underlying OpenGL ES implementation does not support non-power-of-two textures).
  • EGL_BAD_MATCH if the EGL_TEXTURE_FORMAT attribute is EGL_NO_TEXTURE, and EGL_TEXTURE_TARGET is something other than EGL_NO_TEXTURE; or, EGL_TEXTURE_FORMAT is something other than EGL_NO_TEXTURE, and EGL_TEXTURE_TARGET is EGL_NO_TEXTURE.
  • EGL_BAD_MATCH if config does not support the specified OpenVG alpha format attribute (the value of EGL_VG_ALPHA_FORMAT is EGL_VG_ALPHA_FORMAT_PRE and the EGL_VG_ALPHA_FORMAT_PRE_BIT is not set in the EGL_SURFACE_TYPE attribute of config) or colorspace attribute (the value of EGL_VG_COLORSPACE is EGL_VG_COLORSPACE_LINEAR and the EGL_VG_COLORSPACE_LINEAR_IT is not set in the EGL_SURFACE_TYPE attribute of config).
  Source
proc eglCreatePixmapSurface(display: EGLDisplay; config: EGLConfig;
                           nativePixmap: EGLNativePixmapType;
                           attribList: ptr EGLInt): EGLSurface {.cdecl,
    dynlib: dllname, importc.}
Create a new EGL pixmap surface.
display
Specifies the EGL display connection.
config
Specifies the EGL frame buffer configuration that defines the frame buffer resource available to the surface.
nativePixmap
Specifies the native pixmap.
attribList
Specifies pixmap surface attributes. May be nil or empty (first attribute is EGL_NONE).
result
EGL_NO_SURFACE if creation of the context fails, EGL_TRUE otherwise.

The following error codes may be generated:

  • EGL_BAD_DISPLAY if display is not an EGL display connection.
  • EGL_NOT_INITIALIZED if display has not been initialized.
  • EGL_BAD_CONFIG if config is not an EGL config.
  • EGL_BAD_NATIVE_PIXMAP if nativePixmap is not a valid native pixmap.
  • EGL_BAD_ATTRIBUTE if attribList contains an invalid pixmap attribute or if an attribute value is not recognized or out of range.
  • EGL_BAD_ALLOC if there are not enough resources to allocate the new surface.
  • EGL_BAD_MATCH if the attributes of nativePixmap do not correspond to config or if config does not support rendering to pixmaps (the EGL_SURFACE_TYPE attribute does not contain EGL_PIXMAP_BIT).
  • EGL_BAD_MATCH if config does not support the specified OpenVG alpha format attribute (the value of EGL_VG_ALPHA_FORMAT is EGL_VG_ALPHA_FORMAT_PRE and the EGL_VG_ALPHA_FORMAT_PRE_BIT is not set in the EGL_SURFACE_TYPE attribute of config) or colorspace attribute (the value of EGL_VG_COLORSPACE is EGL_VG_COLORSPACE_LINEAR and the EGL_VG_COLORSPACE_LINEAR_IT is not set in the EGL_SURFACE_TYPE attribute of config).
  Source
proc eglCreateWindowSurface(display: EGLDisplay; config: EGLConfig;
                           nativeWindow: EGLNativeWindowType;
                           attribList: ptr EGLInt): EGLSurface {.cdecl,
    dynlib: dllname, importc.}
Create a new EGL window surface.
display
Specifies the EGL display connection.
config
Specifies the EGL frame buffer configuration that defines the frame buffer resource available to the surface.
nativeWindow
Specifies the native window.
attribList
Specifies window surface attributes. May be nil or empty (first
attribute is EGL_NONE).
result
EGL_NO_SURFACE if creation of the context fails, EGL_TRUE otherwise.

The following error codes may be generated:

  • EGL_BAD_DISPLAY if display is not an EGL display connection.
  • EGL_NOT_INITIALIZED if display has not been initialized.
  • EGL_BAD_CONFIG if config is not an EGL frame buffer configuration.
  • EGL_BAD_NATIVE_WINDOW if native_window is not a valid native window.
  • EGL_BAD_ATTRIBUTE if attribList contains an invalid window attribute or if an attribute value is not recognized or is out of range.
  • EGL_BAD_ALLOC if there are not enough resources to allocate the new surface.
  • EGL_BAD_MATCH if the attributes of nativeWindow do not correspond to config or if config does not support rendering to windows (the EGL_SURFACE_TYPE attribute does not contain EGL_WINDOW_BIT).
  • EGL_BAD_MATCH if config does not support the specified OpenVG alpha format attribute (the value of EGL_VG_ALPHA_FORMAT is EGL_VG_ALPHA_FORMAT_PRE and the EGL_VG_ALPHA_FORMAT_PRE_BIT is not set in the EGL_SURFACE_TYPE attribute of `config) or colorspace attribute (the value of EGL_VG_COLORSPACE is EGL_VG_COLORSPACE_LINEAR and the EGL_VG_COLORSPACE_LINEAR_IT is not set in the EGL_SURFACE_TYPE attribute of config).
  Source
proc eglDestroyContext(display: EGLDisplay; context: EGLContext): EGLBoolean {.cdecl,
    dynlib: dllname, importc.}
Destroy an EGL rendering context.
display
Specifies the EGL display connection.
context
Specifies the EGL rendering context to be destroyed.
result
EGL_FALSE if destruction of the context fails, EGL_TRUE otherwise.

The following error codes may be generated:

  • EGL_BAD_DISPLAY if display is not an EGL display connection.
  • EGL_NOT_INITIALIZED if display has not been initialized.
  • EGL_BAD_CONTEXT if context is not an EGL rendering context.
  Source
proc eglDestroySurface(display: EGLDisplay; surface: EGLSurface): EGLBoolean {.cdecl,
    dynlib: dllname, importc.}
Destroy an EGL surface.
display
Specifies the EGL display connection.
surface
Specifies the EGL surface to be destroyed.
result
EGL_FALSE if destruction of the surface fails, EGL_TRUE otherwise.

The following error codes may be generated:

  • EGL_BAD_DISPLAY if display is not an EGL display connection.
  • EGL_NOT_INITIALIZED if display has not been initialized.
  • EGL_BAD_SURFACE if surface is not an EGL surface.
  Source
proc eglGetConfigAttrib(display: EGLDisplay; config: EGLConfig; attribute: EGLInt;
                       value: ptr EGLInt): EGLBoolean {.cdecl, dynlib: dllname, importc.}
Return information about an EGL frame buffer configuration.
display
Specifies the EGL display connection.
config
Specifies the EGL frame buffer configuration to be queried.
attribute
Specifies the EGL rendering context attribute to be returned.
value
Returns the requested value.
result
EGL_FALSE on failure, EGL_TRUE otherwise. value is not modified when EGL_FALSE is returned.

The following error codes may be generated:

  • EGL_BAD_DISPLAY if display is not an EGL display connection.
  • EGL_NOT_INITIALIZED if display has not been initialized.
  • EGL_BAD_CONFIG if config is not an EGL frame buffer configuration.
  • EGL_BAD_ATTRIBUTE if attribute is not a valid frame buffer configuration attribute.
  Source
proc eglGetConfigs(display: EGLDisplay; configs: ptr EGLConfig; configSize: EGLInt;
                  numConfig: ptr EGLInt): EGLBoolean {.cdecl, dynlib: dllname, importc.}
Return a list of all EGL frame buffer configurations for a display.
display
Specifies the EGL display connection.
configs
Returns a list of configs.
configSize
Specifies the size of the list of configs.
numConfig
Returns the number of configs returned.
result
EGL_TRUE on success, EGL_FALSE on failure.

configs and numConfig are not modified when EGL_FALSE is returned.

The following error codes may be generated:

  • EGL_BAD_DISPLAY if display is not an EGL display connection.
  • EGL_NOT_INITIALIZED if display has not been initialized.
  • EGL_BAD_PARAMETER if numConfig is nil.
  Source
proc eglGetCurrentDisplay(): EGLDisplay {.cdecl, dynlib: dllname, importc.}
Return the display for the current EGL rendering context.
result
The current EGL display connection.
  Source
proc eglGetCurrentSurface(readdraw: EGLInt): EGLSurface {.cdecl, dynlib: dllname,
    importc.}
Return the read or draw surface for the current EGL rendering context.
readdraw
Specifies whether the EGL read or draw surface is to be returned.
result
The read or draw surface attached to the current EGL rendering context.
  Source
proc eglGetDisplay(nativeDisplay: EGLNativeDisplayType): EGLDisplay {.cdecl,
    dynlib: dllname, importc.}
Return an EGL display connection.
nativeDisplay
Specifies the display to connect to. EGL_DEFAULT_DISPLAY indicates the default display.
result
The display connection, or EGL_NO_DISPLAY if no display connection matching nativeDisplay is available.

No error is generated.

  Source
proc eglGetError(): EGLInt {.cdecl, dynlib: dllname, importc.}
Return error information.
result
  • EGL_SUCCESS: The last function succeeded without error.
  • EGL_NOT_INITIALIZED: EGL is not initialized, or could not be initialized, for the specified EGL display connection.
  • EGL_BAD_ACCESS: EGL cannot access a requested resource (for example a context is bound in another thread).
  • EGL_BAD_ALLOC: EGL failed to allocate resources for the requested operation.
  • EGL_BAD_ATTRIBUTE: An unrecognized attribute or attribute value was passed in the attribute list.
  • EGL_BAD_CONTEXT: An EGLContext argument does not name a valid EGL rendering context.
  • EGL_BAD_CONFIG: An EGLConfig argument does not name a valid EGL frame buffer configuration.
  • EGL_BAD_CURRENT_SURFACE: The current surface of the calling thread is a window, pixel buffer or pixmap that is no longer valid.
  • EGL_BAD_DISPLAY: An EGLDisplay argument does not name a valid EGL display connection.
  • EGL_BAD_SURFACE: An EGLSurface argument does not name a valid surface (window, pixel buffer or pixmap) configured for GL rendering.
  • EGL_BAD_MATCH: Arguments are inconsistent (for example, a valid context requires buffers not supplied by a valid surface).
  • EGL_BAD_PARAMETER: One or more argument values are invalid.
  • EGL_BAD_NATIVE_PIXMAP: A NativePixmapType argument does not refer to a valid native pixmap.
  • EGL_BAD_NATIVE_WINDOW: A NativeWindowType argument does not refer to a valid native window.
  • EGL_CONTEXT_LOST: A power management event has occurred. The application must destroy all contexts and reinitialise OpenGL ES state and objects to continue rendering.

A call to eglGetError sets the error to EGL_SUCCESS.

  Source
proc eglGetProcAddress(procname: cstring): EGLMustCastToProperProcType {.cdecl,
    dynlib: dllname, importc.}
Return a GL or an EGL extension function.
procname
Specifies the name of the function to return.
result
The address of the extension function named by procname.
  Source
proc eglInitialize(display: EGLDisplay; major: ptr EGLInt; minor: ptr EGLInt): EGLBoolean {.
    cdecl, dynlib: dllname, importc.}
Initialize an EGL display connection.
display
Specifies the EGL display connection to initialize.
major
Returns the major version number of the EGL implementation. May be nil.
minor
Returns the minor version number of the EGL implementation. May be nil.
  Source
proc eglMakeCurrent(display: EGLDisplay; draw: EGLSurface; read: EGLSurface;
                   context: EGLContext): EGLBoolean {.cdecl, dynlib: dllname, importc.}
Attach an EGL rendering context to EGL surfaces.
display
Specifies the EGL display connection.
draw
Specifies the EGL draw surface.
read
Specifies the EGL read surface.
context
Specifies the EGL rendering context to be attached to the surfaces.
result
EGL_FALSE on failure, EGL_TRUE otherwise. If EGL_FALSE is returned, the previously current rendering context and surfaces (if any) remain unchanged.

The following error codes may be generated:

  • EGL_BAD_DISPLAY if display is not an EGL display connection.
  • EGL_NOT_INITIALIZED if display has not been initialized.
  • EGL_BAD_SURFACE if draw or read is not an EGL surface.
  • EGL_BAD_CONTEXT if context is not an EGL rendering context.
  • EGL_BAD_MATCH if draw or read are not compatible with context, or if context is set to EGL_NO_CONTEXT and draw or read are not set to EGL_NO_SURFACE, or if draw or read are set to EGL_NO_SURFACE and context is not set to EGL_NO_CONTEXT.
  • EGL_BAD_ACCESS if context is current to some other thread.
  • EGL_BAD_NATIVE_PIXMAP if a native pixmap underlying either draw or read is no longer valid.
  • EGL_BAD_NATIVE_WINDOW if a native window underlying either draw or read is no longer valid.
  • EGL_BAD_CURRENT_SURFACE if the previous context has unflushed commands and the previous surface is no longer valid.
  • EGL_BAD_ALLOC if allocation of ancillary buffers for draw or read were delayed until eglMakeCurrent is called, and there are not enough resources to allocate them.
  • EGL_CONTEXT_LOST if a power management event has occurred. The application must destroy all contexts and reinitialise OpenGL ES state and objects to continue rendering.
  Source
proc eglQueryContext(display: EGLDisplay; context: EGLContext; attribute: EGLInt;
                    value: ptr EGLInt): EGLBoolean {.cdecl, dynlib: dllname, importc.}
Return EGL rendering context information.
display
Specifies the EGL display connection.
context
Specifies the EGL rendering context to query.
attribute
Specifies the EGL rendering context attribute to be returned.
value
Returns the requested value.
result
EGL_FALSE on failure, EGL_TRUE otherwise. value is not modified when EGL_FALSE is returned.

The following error codes may be generated:

  • EGL_BAD_DISPLAY if display is not an EGL display connection.
  • EGL_NOT_INITIALIZED if display has not been initialized.
  • EGL_BAD_CONTEXT if context is not an EGL rendering context.
  • EGL_BAD_ATTRIBUTE if attribute is not a valid context attribute.
  Source
proc eglQueryString(display: EGLDisplay; name: EGLInt): cstring {.cdecl,
    dynlib: dllname, importc.}
Return a string describing an EGL display connection.
display
Specifies the EGL display connection.
name
Specifies a symbolic constant, one of EGL_CLIENT_APIS, EGL_VENDOR, EGL_VERSION, or EGL_EXTENSIONS.
result
nil is returned on failure.

The following error codes may be generated:

  • EGL_BAD_DISPLAY if display is not an EGL display connection.
  • EGL_NOT_INITIALIZED if display has not been initialized.
  • EGL_BAD_PARAMETER if name is not an accepted value.
  Source
proc eglQuerySurface(display: EGLDisplay; surface: EGLSurface; attribute: EGLInt;
                    value: ptr EGLInt): EGLBoolean {.cdecl, dynlib: dllname, importc.}
Return EGL surface information.
display
Specifies the EGL display connection.
surface
Specifies the EGL surface to query.
attribute
Specifies the EGL surface attribute to be returned.
value
Returns the requested value.
result
EGL_FALSE on failure, EGL_TRUE otherwise. value is not modified when EGL_FALSE is returned.

The following error codes may be generated:

  • EGL_BAD_DISPLAY if display is not an EGL display connection.
  • EGL_NOT_INITIALIZED if display has not been initialized.
  • EGL_BAD_SURFACE if surface is not an EGL surface.
  • EGL_BAD_ATTRIBUTE if attribute is not a valid surface attribute.
  Source
proc eglSwapBuffers(display: EGLDisplay; surface: EGLSurface): EGLBoolean {.cdecl,
    dynlib: dllname, importc.}
Post EGL surface color buffer to a native window.
display
Specifies the EGL display connection.
surface
Specifies the EGL drawing surface whose buffers are to be swapped.
result
EGL_FALSE if swapping of the buffers fails, EGL_TRUE otherwise.

The following error codes may be generated:

  • EGL_BAD_DISPLAY if display is not an EGL display connection.
  • EGL_NOT_INITIALIZED if display has not been initialized.
  • EGL_BAD_SURFACE if surface is not an EGL drawing surface.
  • EGL_CONTEXT_LOST if a power management event has occurred. The application must destroy all contexts and reinitialise OpenGL ES state and objects to continue rendering.
  Source
proc eglTerminate(display: EGLDisplay): EGLBoolean {.cdecl, dynlib: dllname, importc.}
Terminate an EGL display connection.
display
Specifies the EGL display connection to terminate.
result
EGL_FALSE on failure, EGL_TRUE otherwise.

The following error codes may be generated:

  • EGL_BAD_DISPLAY if display is not an EGL display connection.
  Source
proc eglWaitGL(): EGLBoolean {.cdecl, dynlib: dllname, importc.}
Complete GL execution prior to subsequent native rendering calls.
result
EGL_FALSE on failure, EGL_TRUE otherwise.

The following error codes may be generated:

  • EGL_BAD_CURRENT_SURFACE if the surface associated with the current context has a native window or pixmap, and that window or pixmap is no longer valid.
  Source
proc eglWaitNative(engine: EGLInt): EGLBoolean {.cdecl, dynlib: dllname, importc.}
Complete native execution prior to subsequent GL rendering calls.
engine
Specifies a particular marking engine to be waited on. Must be EGL_CORE_NATIVE_ENGINE.
result
EGL_TRUE on success, EGL_FALSE otherwise

The following error codes may be generated:

  • EGL_BAD_PARAMETER if engine is not a recognized marking engine.
  • EGL_BAD_CURRENT_SURFACE if the surface associated with the current context has a native window or pixmap, and that window or pixmap is no longer valid.
  Source
proc eglBindTexImage(display: EGLDisplay; surface: EGLSurface; buffer: EGLInt): EGLBoolean {.
    cdecl, dynlib: dllname, importc.}
Defines a two-dimensional texture image.
display
Specifies the EGL display connection.
surface
Specifies the EGL surface.
buffer
Specifies the texture image data.
result
EGL_TRUE on success, EGL_FALSE otherwise.

The following error codes may be generated:

  • EGL_BAD_ACCESS if buffer is already bound to a texture.
  • EGL_BAD_MATCH if the surface attribute EGL_TEXTURE_FORMAT is set to EGL_NO_TEXTURE.
  • EGL_BAD_MATCH if buffer is not a valid buffer (currently only EGL_BACK_BUFFER may be specified).
  • EGL_BAD_SURFACE if surface is not an EGL surface, or is not a pbuffer surface supporting texture binding.
  Source
proc eglReleaseTexImage(display: EGLDisplay; surface: EGLSurface; buffer: EGLInt): EGLBoolean {.
    cdecl, dynlib: dllname, importc.}
Releases a color buffer that is being used as a texture.
display
Specifies the EGL display connection.
surface
Specifies the EGL surface.
buffer
Specifies the texture image data.
result
EGL_TRUE on success, EGL_FALSE otherwise.

The following error codes may be generated:

  • EGL_BAD_MATCH if the surface attribute EGL_TEXTURE_FORMAT is set to EGL_NO_TEXTURE.
  • EGL_BAD_MATCH if buffer is not a valid buffer (currently only EGL_BACK_BUFFER may be specified).
  • EGL_BAD_SURFACE if surface is not an EGL surface, or is not a bound pbuffer surface.
  Source
proc eglSurfaceAttrib(display: EGLDisplay; surface: EGLSurface; attribute: EGLInt;
                     value: EGLInt): EGLBoolean {.cdecl, dynlib: dllname, importc.}
Set an EGL surface attribute.
display
Specifies the EGL display connection.
surface
Specifies the EGL surface.
attribute
Specifies the EGL surface attribute to set.
value
Specifies the attributes required value.
result
EGL_TRUE on success, EGL_FALSE otherwise.

The following error codes may be generated:

  • EGL_BAD_DISPLAY if display is not an EGL display connection.
  • EGL_BAD_MATCH if attribute is EGL_MULTISAMPLE_RESOLVE, value is EGL_MULTISAMPLE_RESOLVE_BOX, and the EGL_SURFACE_TYPE attribute of the EGLConfig used to create surface does not contain EGL_MULTISAMPLE_RESOLVE_BOX_BIT.
  • EGL_BAD_MATCH if attribute is EGL_SWAP_BEHAVIOR, value is EGL_BUFFER_PRESERVED, and the EGL_SURFACE_TYPE attribute of the EGLConfig used to create surface does not contain EGL_SWAP_BEHAVIOR_PRESERVED_BIT.
  • EGL_NOT_INITIALIZED if display has not been initialized.
  • EGL_BAD_SURFACE if surface is not an EGL surface.
  • EGL_BAD_ATTRIBUTE if attribute is not a valid surface attribute.
  Source
proc eglSwapInterval(display: EGLDisplay; interval: EGLInt): EGLBoolean {.cdecl,
    dynlib: dllname, importc.}
Specifies the minimum number of video frame periods per buffer swap for the window associated with the current context.
display
Specifies the EGL display connection.
interval
Specifies the minimum number of video frames that are displayed before a buffer swap will occur.
result
EGL_TRUE on success, EGL_FALSE otherwise.

The following error codes may be generated:

  • EGL_BAD_CONTEXT if there is no current context on the calling thread.
  • EGL_BAD_SURFACE if there is no surface bound to the current context.
  Source
proc eglBindAPI(api: EGLenum): EGLBoolean {.cdecl, dynlib: dllname, importc.}
Set the current rendering API.
api
Specifies the client API to bind, one of EGL_OPENGL_API, EGL_OPENGL_ES_API, or EGL_OPENVG_API.
result
EGL_TRUE on success, EGL_FALSE otherwise.

The following error codes may be generated:

  • EGL_BAD_PARAMETER if api is not one of the accepted tokens, or if the specified client API is not supported by the EGL implementation.
  Source
proc eglQueryAPI(): EGLenum {.cdecl, dynlib: dllname, importc.}
Query the current rendering API.
result
One of the valid API parameters to eglBindAPI, or EGL_NONE.
  Source
proc eglCreatePbufferFromClientBuffer(display: EGLDisplay; buftype: EGLenum;
                                     buffer: EGLClientBuffer; config: EGLConfig;
                                     attribList: ptr EGLInt): EGLSurface {.cdecl,
    dynlib: dllname, importc.}
Create a new EGL pixel buffer surface bound to an OpenVG image.
display
Specifies the EGL display connection.
buftype
Specifies the type of client API buffer to be bound. Must be EGL_OPENVG_IMAGE, corresponding to an OpenVG VGImage buffer.
buffer
Specifies the OpenVG VGImage handle of the buffer to be bound.
config
Specifies the EGL frame buffer configuration that defines the frame buffer resource available to the surface.
attribList
Specifies pixel buffer surface attributes. May be NULL or empty (first attribute is EGL_NONE).
result
EGL_NO_SURFACE is returned if creation of the context fails.

The following error codes may be generated:

  • EGL_BAD_DISPLAY if `display is not an EGL display connection.
  • EGL_NOT_INITIALIZED if display has not been initialized.
  • EGL_BAD_CONFIG if config is not an EGL frame buffer configuration.
  • EGL_BAD_PARAMETER if buftype is not EGL_OPENVG_IMAGE, or if buffer is not a valid handle to a VGImage object in the currently bound OpenVG context.
  • EGL_BAD_ACCESS if there is no current OpenVG context, or if buffer is already bound to another pixel buffer or in use by OpenVG.
  • EGL_BAD_ALLOC if there are not enough resources to allocate the new surface.
  • EGL_BAD_ATTRIBUTE if attribList contains an invalid pixel buffer attribute or if an attribute value is not recognized or out of range.
  • EGL_BAD_ATTRIBUTE if attribList contains any of the attributes EGL_MIPMAP_TEXTURE, EGL_TEXTURE_FORMAT, or EGL_TEXTURE_TARGET, and config does not support OpenGL ES rendering (e.g. the EGL version is 1.2 or later, and the EGL_RENDERABLE_TYPE attribute of config does not include at least one of EGL_OPENGL_ES_BIT or EGL_OPENGL_ES2_BIT).
  • EGL_BAD_MATCH if config does not support rendering to pixel buffers (the EGL_SURFACE_TYPE attribute does not contain EGL_PBUFFER_BIT).
  • EGL_BAD_MATCH if the buffers contained in buffer do not match the bit depths for those buffers specified by config.
  • EGL_BAD_MATCH if the EGL_TEXTURE_FORMAT attribute is not EGL_NO_TEXTURE, and EGL_WIDTH and/or EGL_HEIGHT specify an invalid size (e.g., the texture size is not a power of 2, and the underlying OpenGL ES implementation does not support non-power-of-two textures).
  • EGL_BAD_MATCH if the EGL_TEXTURE_FORMAT attribute is EGL_NO_TEXTURE, and EGL_TEXTURE_TARGET is something other than EGL_NO_TEXTURE; or, EGL_TEXTURE_FORMAT is something other than EGL_NO_TEXTURE, and EGL_TEXTURE_TARGET is EGL_NO_TEXTURE.
  • EGL_BAD_MATCH if the implementation has additional constraints on which types of client API buffers may be bound to pixel buffer surfaces. For example, it is possible that the OpenVG implementation might not support a VGImage being bound to a pixel buffer which will be used as a mipmapped OpenGL ES texture (e.g. whose EGL_MIPMAP_TEXTURE attribute is EGL_TRUE). Any such constraints should be documented by the implementation release notes.
  Source
proc eglReleaseThread(): EGLBoolean {.cdecl, dynlib: dllname, importc.}
Release EGL per-thread state.
result
EGL_TRUE on success, EGL_FALSE otherwise.
  Source
proc eglWaitClient(): EGLBoolean {.cdecl, dynlib: dllname, importc.}
Complete client API execution prior to subsequent native rendering calls.
result
EGL_TRUE on success, EGL_FALSE otherwise.

The following error codes may be generated:

  • EGL_BAD_CURRENT_SURFACE if the surface associated with the current context has a native window or pixmap, and that window or pixmap is no longer valid.
  Source
proc eglGetCurrentContext(): EGLContext {.cdecl, dynlib: dllname, importc.}
Return the current EGL rendering context.
result
The current context, or EGL_NO_CONTEXT if no context is current.
  Source
proc eglCreateSync(display: EGLDisplay; syncType: EGLenum; attribList: ptr EGLAttrib): EGLSync {.
    cdecl, dynlib: dllname, importc.}
Create a sync object of the specified type.
display
Specifies the EGL display connection.
syncType
The type of sync object to create.
attribList
Specifies attributes for the sync object.
result
The sync object.
  Source
proc eglDestroySync(display: EGLDisplay; sync: EGLSync): EGLBoolean {.cdecl,
    dynlib: dllname, importc.}
Destroy an existing sync object.
display
Specifies the EGL display connection.
sync
The sync object to destroy.
result
EGL_TRUE on success, EGL_FALSE otherwise.
The following error codes may be generated:
  • EGL_BAD_PARAMETER if sync is not a valid sync object for display.
  Source
proc eglClientWaitSync(display: EGLDisplay; sync: EGLSync; flags: EGLInt;
                      timeout: EGLTime): EGLInt {.cdecl, dynlib: dllname, importc.}
Blocks the calling thread until the specified sync object signaled or timed out.
display
Specifies the EGL display connection.
sync
The sync object to wait for.
flags
Optional EGL_SYNC_FLUSH_COMMANDS_BIT to perform a flush when the sync object is unsignaled. If no context is current for the bound API, the EGL_SYNC_FLUSH_COMMANDS_BIT bit is ignored.
timeout
Maximum number of nanoseconds to wait, or EGL_FOREVER.
result
  • EGL_TIMEOUT_EXPIRED if the time out period expired before the sync

object was signaled

  • EGL_CONDITION_SATISFIED if the sync object was signaled
  • EGL_FALSE on error.

The following error codes may be generated:

  • EGL_BAD_PARAMETER if sync is not a valid sync object for display.
  Source
proc eglGetSyncAttrib(display: EGLDisplay; sync: EGLSync; attribute: EGLInt;
                     value: ptr EGLAttrib): EGLBoolean {.cdecl, dynlib: dllname,
    importc.}
Query attributes of a sync object.
display
Specifies the EGL display connection.
sync
The sync object to query.
attribute
The attribute to query. These depend on the type of sync object being queried. See the official EGL documentation for details.
value
Will contain the queried value on success.
result
EGL_TRUE on success, EGL_FALSE otherwise.

The following error codes may be generated:

  • EGL_BAD_PARAMETER if sync is not a valid sync object.
  • EGL_BAD_ATTRIBUTE if attribute is not one of the available attributes.
  • EGL_BAD_MATCH if attribute is not supported for the type of sync object passed in sync.
  Source
proc eglCreateImage(display: EGLDisplay; context: EGLContext; target: EGLenum;
                   buffer: EGLClientBuffer; attribList: ptr EGLAttrib): EGLImage {.
    cdecl, dynlib: dllname, importc.}
Create an EGLImage from an existing image resource.
display
Specifies the EGL display connection.
context
Specifies the EGL client API context.
target
The type of resource being used as the image source.
buffer
The name or handle of the resource to be used as the image source.
attribList
Specifies a list of attributes used to select sub-sections of buffer, such as mipmap levels for OpenGL ES texture map resources, as well as behavioral options, such as whether to preserve pixel data during creation. May be nil.
result
The image object, or EGL_NO_IMAGE on failure.

The following error codes may be generated:

  • EGL_BAD_DISPLAY if display is not a valid display object.
  • EGL_BAD_CONTEXT if context is neither a valid context on the display, nor EGL_NO_CONTEXT
  • EGL_BAD_DISPLAY if target is EGL_GL_TEXTURE_2D, EGL_GL_TEXTURE_CUBE_MAP_*, EGL_GL_RENDERBUFFER or EGL_GL_TEXTURE_3D, and display is not a valid display.
  • EGL_BAD_CONTEXT if target is EGL_GL_TEXTURE_2D, EGL_GL_TEXTURE_CUBE_MAP_*, EGL_GL_RENDERBUFFER or EGL_GL_TEXTURE_3D, and context is not a valid context.
  • EGL_BAD_MATCH if target is EGL_GL_TEXTURE_2D, EGL_GL_TEXTURE_CUBE_MAP_*, EGL_GL_RENDERBUFFER or EGL_GL_TEXTURE_3D, and context is not a valid GL context, or does not match the display.
  • EGL_BAD_PARAMETER if target is EGL_GL_TEXTURE_2D, EGL_GL_TEXTURE_CUBE_MAP_* or EGL_GL_TEXTURE_3D and buffer is not the name of a texture object of type target.
  • EGL_BAD_PARAMETER if target is EGL_GL_RENDERBUFFER and buffer is not the name of a renderbuffer object, or if buffer is the name of a multisampled renderbuffer object.
  • EGL_BAD_PARAMETER if EGL_GL_TEXTURE_LEVEL is nonzero, target is EGL_GL_TEXTURE_2D, EGL_GL_TEXTURE_CUBE_MAP_* or EGL_GL_TEXTURE_3D, and buffer is not the name of a complete GL texture object.
  • EGL_BAD_PARAMETER if EGL_GL_TEXTURE_LEVEL is 0, target is EGL_GL_TEXTURE_2D, EGL_GL_TEXTURE_CUBE_MAP_* or EGL_GL_TEXTURE_3D, buffer is the name of an incomplete GL texture object, and any mipmap levels other than mipmap level 0 are specified.
  • EGL_BAD_PARAMETER if EGL_GL_TEXTURE_LEVEL is 0, target is EGL_GL_TEXTURE_2D or EGL_GL_TEXTURE_3D, buffer is not the name of a complete GL texture object, and mipmap level 0 is not specified.
  • EGL_BAD_PARAMETER if EGL_GL_TEXTURE_LEVEL is 0, target is EGL_GL_TEXTURE_CUBE_MAP_*, buffer is not the name of a complete GL texture object, and one or more faces do not have mipmap level 0 specified.
  • EGL_BAD_PARAMETER if target is EGL_GL_TEXTURE_2D, EGL_GL_TEXTURE_CUBE_MAP_*, EGL_GL_RENDERBUFFER or EGL_GL_TEXTURE_3D and buffer refers to the default GL texture object (0) for the corresponding GL target.
  • EGL_BAD_MATCH if target is EGL_GL_TEXTURE_2D, EGL_GL_TEXTURE_CUBE_MAP_*, or EGL_GL_TEXTURE_3D, and the value specified in attribList for EGL_GL_TEXTURE_LEVEL is not a valid mipmap level for the specified GL texture object buffer.
  • EGL_BAD_PARAMETER if target is EGL_GL_TEXTURE_3D, and the value specified in attribList for EGL_GL_TEXTURE_ZOFFSET exceeds the depth of the specified mipmap level-of-detail in buffer.
  • EGL_BAD_PARAMETER if an attribute specified in attribList is not one of the supported attributes.
  • EGL_BAD_MATCH if an attribute specified in attribList is not a valid attribute for target.
  • EGL_BAD_ACCESS if the resource specified by display, context, target, buffer and attribList has an off-screen buffer bound to it (e.g., by a previous call to eglBindTexImage).
  • EGL_BAD_ACCESS if the resource specified by display, context, target, buffer and attribList is bound to an off-screen buffer (e.g., by a previous call to eglCreatePbufferFromClientBuffer)
  • EGL_BAD_ACCESS if the resource specified by display, context, target, buffer and attribList is itself an EGLImage sibling.
  • EGL_BAD_ALLOC if f insufficient memory is available to complete the specified operation.
  • EGL_BAD_ACCESS if the value specified in attribList for EGL_IMAGE_PRESERVED is EGL_TRUE, and an EGLImage handle cannot be created from the specified resource such that the pixel data values in buffer are preserved.
  Source
proc eglDestroyImage(display: EGLDisplay; image: EGLImage): EGLBoolean {.cdecl,
    dynlib: dllname, importc.}
Destroy an image object.
display
Specifies the EGL display connection.
image
The image to destroy.
result
EGL_TRUE on success, EGL_FALSE otherwise.

The following error codes may be generated:

  • EGL_BAD_DISPLAY if display is not the handle of a valid EGLDisplay object.
  • EGL_BAD_PARAMETER if image is not a valid EGLImage object created with respect to display.
  Source
proc eglGetPlatformDisplay(platform: EGLenum; nativeDisplay: pointer;
                          attribList: ptr EGLAttrib): EGLDisplay {.cdecl,
    dynlib: dllname, importc.}
Obtain a native platform display.
platform
Specifies the native platform.
nativeDisplay
Handle to a native display, i.e. pointer to an X11 display.
attribList
Specifies the list of desired display attributes
result
The display, or EGL_NO_DISPLAY if no matching display is available, or on error.

The following error codes may be generated:

  • EGL_BAD_PARAMETER if platform has an invalid value.
  Source
proc eglCreatePlatformWindowSurface(display: EGLDisplay; config: EGLConfig;
                                   nativeWindow: pointer;
                                   attribList: ptr EGLAttrib): EGLSurface {.cdecl,
    dynlib: dllname, importc.}
Create an onscreen EGLSurface.
display
Specifies the EGL display connection.
config
Specifies the color and ancillary buffer configuration for the surface.
nativeWindow
A native window that must belong to the same platform as display.
attribList
Specifies the attributes for the window.
result
A handle to the created surface, or EGL_NO_SURFACE on error.

The following error codes may be generated:

  • EGL_BAD_MATCH if the pixel format of nativeWindow does not correspond to the format, type, and size of the color buffers required by config.
  • EGL_BAD_MATCH if config does not support rendering to windows (the EGL_SURFACE_TYPE attribute does not contain EGL_WINDOW_BIT).
  • EGL_BAD_MATCH if config does not support the OpenVG colorspace or alpha format attributes specified in attribList (as defined for eglCreatePlatformWindowSurface).
  • EGL_BAD_CONFIG if config is not a valid EGLConfig.
  • EGL_BAD_NATIVE_WINDOW if nativeWindow is not a valid native window handle
  • EGL_BAD_ALLOC if there is already an EGLSurface associated with nativeWindow (as a result of a previous call to eglCreatePlatformWindowSurface).
  • EGL_BAD_ALLOC if the implementation cannot allocate resources for the new EGL window.
  Source
proc eglCreatePlatformPixmapSurface(display: EGLDisplay; config: EGLConfig;
                                   nativePixmap: pointer;
                                   attribList: ptr EGLAttrib): EGLSurface {.cdecl,
    dynlib: dllname, importc.}
Create an offscreen EGLSurface.
display
Specifies the EGL display connection.
config
Specifies the color and ancillary buffer configuration for the surface.
nativePixmap
A native pixmap that must belong to the same platform as display.
attribList
Specifies the attributes for the pixmap.
result
A handle to the created surface, or EGL_NO_SURFACE on error.

The following error codes may be generated:

  • EGL_BAD_MATCH if the attributes of nativePixmap do not correspond to config.
  • EGL_BAD_MATCH if config does not support rendering to pixmaps (the EGL_SURFACE_TYPE attribute does not contain EGL_PIXMAP_BIT).
  • EGL_BAD_MATCH if config does not support the colorspace or alpha format attributes specified in attribList (as defined for eglCreatePlatformWindowSurface).
  • EGL_BAD_CONFIG if config is not a valid EGLConfig.
  • EGL_BAD_NATIVE_PIXMAP if pixmap is not a valid native pixmap handle.
  • EGL_BAD_ALLOC if there is already an EGLSurface associated with nativePixmap (as a result of a previous call to eglCreatePlatformPixmapSurface).
  • EGL_BAD_ALLOC if the implementation cannot allocate resources for the new EGL pixmap.
  Source
proc eglWaitSync(display: EGLDisplay; sync: EGLSync; flags: EGLInt): EGLBoolean {.cdecl,
    dynlib: dllname, importc.}
Check whether a sync object is signaled (without blocking the application).
display
Specifies the EGL display connection.
sync
The sync object to check.
flags
Must be 0.
result
EGL_TRUE on success, EGL_FALSE otherwise.

The following error codes may be generated:

  • EGL_BAD_MATCH if the current context for the currently bound client API does not support server waits.
  • EGL_BAD_MATCH if no context is current for the currently bound client API (i.e., eglGetCurrentContext returns EGL_NO_CONTEXT)
  • EGL_BAD_PARAMETER if sync is not a valid sync object.
  • EGL_BAD_PARAMETER if flags is not 0.
  Source