EglCore

class EglCore

Core EGL state (display, context, config).

The EGLContext must only be attached to one thread at a time. This class is not thread-safe.

Constructors

Link copied to clipboard
constructor()
Prepares EGL display and context.
constructor(sharedContext: EGLContext, flags: Int)
Prepares EGL display and context.

Properties

Link copied to clipboard
Constructor flag: surface must be recordable.
Link copied to clipboard
Constructor flag: ask for GLES3, fall back to GLES2 if not available.

Functions

Link copied to clipboard
open fun createOffscreenSurface(width: Int, height: Int): EGLSurface
Creates an EGL surface associated with an offscreen buffer.
Link copied to clipboard
open fun createWindowSurface(surface: Any): EGLSurface
Creates an EGL surface associated with a Surface.
Link copied to clipboard
open fun getGlVersion(): Int
Returns the GLES version this context is configured for (currently 2 or 3).
Link copied to clipboard
open fun isCurrent(eglSurface: EGLSurface): Boolean
Returns true if our context and the specified surface are current.
Link copied to clipboard
open fun logCurrent(msg: String)
Writes the current display, context, and surface to the log.
Link copied to clipboard
open fun makeCurrent(eglSurface: EGLSurface)
Makes our EGL context current, using the supplied surface for both "draw" and "read".
open fun makeCurrent(drawSurface: EGLSurface, readSurface: EGLSurface)
Makes our EGL context current, using the supplied "draw" and "read" surfaces.
Link copied to clipboard
Makes no context current.
Link copied to clipboard
open fun queryString(what: Int): String
Queries a string value.
Link copied to clipboard
open fun querySurface(eglSurface: EGLSurface, what: Int): Int
Performs a simple surface query.
Link copied to clipboard
open fun release()
Discards all resources held by this class, notably the EGL context.
Link copied to clipboard
open fun releaseSurface(eglSurface: EGLSurface)
Destroys the specified surface.
Link copied to clipboard
open fun setPresentationTime(eglSurface: EGLSurface, nsecs: Long)
Sends the presentation time stamp to EGL.
Link copied to clipboard
open fun swapBuffers(eglSurface: EGLSurface): Boolean
Calls eglSwapBuffers.