FrameBuffer


@RequiresApi(value = 26)
class FrameBuffer : AutoCloseable


Object that enables rendering into a HardwareBuffer by creating a frame buffer object from it by leveraging Android specific EGL extensions to create an EGLImageKHR object that is loaded as a texture.

Summary

Public constructors

FrameBuffer(egl: EGLSpec, hardwareBuffer: HardwareBuffer)

Public functions

open Unit

Closes out the frame buffer, freeing all resources within it.

Unit

Binds this frame buffer to the read and draw framebuffer targets if it's not closed.

Public properties

HardwareBuffer

the HardwareBuffer that this class wraps and used to generate a EGLImageKHR object

Boolean

Boolean that tells if the frame buffer is currently closed

Public constructors

FrameBuffer

Added in 1.0.2
FrameBuffer(egl: EGLSpec, hardwareBuffer: HardwareBuffer)
Parameters
egl: EGLSpec

EGLSpec used to specify EGL version and call various EGL methods

hardwareBuffer: HardwareBuffer

the HardwareBuffer that this class wraps and used to generate a EGLImageKHR object

Public functions

close

Added in 1.0.2
open fun close(): Unit

Closes out the frame buffer, freeing all resources within it. This should be done only when the frame buffer is no longer needed or being accessed.

makeCurrent

Added in 1.0.2
fun makeCurrent(): Unit

Binds this frame buffer to the read and draw framebuffer targets if it's not closed. If the frame buffer is already closed this method will do nothing.

Public properties

hardwareBuffer

Added in 1.0.2
val hardwareBufferHardwareBuffer

the HardwareBuffer that this class wraps and used to generate a EGLImageKHR object

isClosed

Added in 1.0.2
val isClosedBoolean

Boolean that tells if the frame buffer is currently closed