FrameBuffer


@RequiresApi(value = 26)
public final class FrameBuffer implements 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

Public methods

void

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

final @NonNull HardwareBuffer

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

final boolean

Boolean that tells if the frame buffer is currently closed

final void

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

Public constructors

FrameBuffer

Added in 1.0.2
public FrameBuffer(@NonNull EGLSpec egl, @NonNull HardwareBuffer hardwareBuffer)
Parameters
@NonNull EGLSpec egl

EGLSpec used to specify EGL version and call various EGL methods

@NonNull HardwareBuffer hardwareBuffer

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

Public methods

close

Added in 1.0.2
public void close()

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.

getHardwareBuffer

Added in 1.0.2
public final @NonNull HardwareBuffer getHardwareBuffer()

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

isClosed

Added in 1.0.2
public final boolean isClosed()

Boolean that tells if the frame buffer is currently closed

makeCurrent

Added in 1.0.2
public final void makeCurrent()

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.