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 |
|---|
FrameBuffer(@NonNull EGLSpec egl, @NonNull HardwareBuffer hardwareBuffer) |
Public methods |
|
|---|---|
void |
close()Closes out the frame buffer, freeing all resources within it. |
final @NonNull HardwareBuffer |
the |
final boolean |
isClosed()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
public FrameBuffer(@NonNull EGLSpec egl, @NonNull HardwareBuffer hardwareBuffer)
| Parameters | |
|---|---|
@NonNull EGLSpec egl |
|
@NonNull HardwareBuffer hardwareBuffer |
the |
Public methods
close
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
public final @NonNull HardwareBuffer getHardwareBuffer()
the HardwareBuffer that this class wraps and used to generate a EGLImageKHR object
isClosed
public final boolean isClosed()
Boolean that tells if the frame buffer is currently closed
makeCurrent
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.