Options
All
  • Public
  • Public/Protected
  • All
V1.7
  • V1.6
  • V1.7
Menu

Namespace "egl"

This is minimal bindings to egl APIs needed by webgl polyfills to setup exclusive mode. See this for example: https://github.com/magic-script/magic-script-samples/blob/master/sample-exclusive/src/app.js

Index

Type aliases

Context

Context: { __computed: "EGLContext" }

Opaque handle to EGLContext

Type declaration

  • __computed: "EGLContext"

Surface

Surface: { __computed: "EGLSurface" }

Opaque handle to EGLSurface

Type declaration

  • __computed: "EGLSurface"

Variables

Const CONTEXT_MAJOR_VERSION_KHR

CONTEXT_MAJOR_VERSION_KHR: number

expose EGL_CONTEXT_MAJOR_VERSION_KHR

Const CONTEXT_MINOR_VERSION_KHR

CONTEXT_MINOR_VERSION_KHR: number

expose EGL_CONTEXT_MINOR_VERSION_KHR

Const DRAW

DRAW: number

expose EGL_DRAW

Const OPENGL_API

OPENGL_API: number

expose EGL_OPENGL_API

Const OPENGL_ES_API

OPENGL_ES_API: number

expose EGL_OPENGL_ES_API

Const READ

READ: number

expose EGL_READ

Functions

bindAPI

  • bindAPI(api: number): void

createContext

  • createContext(major: number, minor: number): Context
  • Expose eglCreateContext. Note this automatically uses eglGetDisplay(EGL_DEFAULT_DISPLAY) for display. The config is auto hard-coded for now and requests:

    EGL_RED_SIZE, 8,
    EGL_GREEN_SIZE, 8,
    EGL_BLUE_SIZE, 8,
    EGL_ALPHA_SIZE, 8,
    EGL_DEPTH_SIZE, 24,
    EGL_STENCIL_SIZE, 8,
    EGL_RENDERABLE_TYPE, EGL_OPENGL_ES3_BIT_KHR,

    Parameters

    • major: number
    • minor: number

    Returns Context

destroyContext

  • destroyContext(ctx: Context): void
  • Expose eglDestroyContext. Note this automatically uses eglGetDisplay(EGL_DEFAULT_DISPLAY) for display.

    Parameters

    Returns void

initialize

  • initialize(major: number, minor: number): [number, number]
  • Expose eglInitialize. Note this automatically uses eglGetDisplay(EGL_DEFAULT_DISPLAY) for display.

    Parameters

    • major: number

      requested major version

    • minor: number

      requested minor version

    Returns [number, number]

    actual major/minor versions.

makeCurrent

  • Expose eglMakeCurrent.

    Parameters

    • draw: Surface | null

      optional surface for draw commands

    • read: Surface | null

      optional surface for read commands

    • ctx: Context

      context to use for commands.

    Returns void

releaseThread

  • releaseThread(): void

swapBuffers

  • swapBuffers(surface: Surface): void
  • Expose eglSwapBuffers. Note this automatically uses eglGetDisplay(EGL_DEFAULT_DISPLAY) for display.

    Parameters

    Returns void

terminate

  • terminate(): void

Generated using TypeDoc