WindowSurface

Recordable EGL window surface.

It's good practice to explicitly release() the surface, preferably from a "finally" block.

Constructors

Link copied to clipboard
constructor(eglCore: EglCore, surface: Surface, releaseSurface: Boolean)
Associates an EGL surface with the native window surface.
constructor(eglCore: EglCore, surfaceTexture: SurfaceTexture)
Associates an EGL surface with the SurfaceTexture.

Functions

Link copied to clipboard
open fun createOffscreenSurface(width: Int, height: Int)
Creates an off-screen surface.
Link copied to clipboard
open fun createWindowSurface(surface: Any)
Creates a window surface.
Link copied to clipboard
open fun getHeight(): Int
Returns the surface's height, in pixels.
Link copied to clipboard
open fun getWidth(): Int
Returns the surface's width, in pixels.
Link copied to clipboard
open fun makeCurrent()
Makes our EGL context and surface current.
Link copied to clipboard
open fun makeCurrentReadFrom(readSurface: EglSurfaceBase)
Makes our EGL context and surface current for drawing, using the supplied surface for reading.
Link copied to clipboard
open fun recreate(newEglCore: EglCore)
Recreate the EGLSurface, using the new EglBase.
Link copied to clipboard
open fun release()
Releases any resources associated with the EGL surface (and, if configured to do so, with the Surface as well).
Link copied to clipboard
Release the EGL surface.
Link copied to clipboard
open fun saveFrame(file: File)
Saves the EGL surface to a file.
Link copied to clipboard
open fun setPresentationTime(nsecs: Long)
Sends the presentation time stamp to EGL.
Link copied to clipboard
open fun swapBuffers(): Boolean
Calls eglSwapBuffers.