Agora Java API Reference for Android
Public Member Functions | List of all members
io.agora.rtc.gl.GlTextureFrameBuffer Class Reference

Public Member Functions

 GlTextureFrameBuffer (int pixelFormat)
 
void setSize (int width, int height)
 
int getWidth ()
 
int getHeight ()
 
int getFrameBufferId ()
 
int getTextureId ()
 
void release ()
 

Detailed Description

Helper class for handling OpenGL framebuffer with only color attachment and no depth or stencil buffer. Intended for simple tasks such as texture copy, texture downscaling, and texture color conversion.

Constructor & Destructor Documentation

◆ GlTextureFrameBuffer()

io.agora.rtc.gl.GlTextureFrameBuffer.GlTextureFrameBuffer ( int  pixelFormat)

Generate texture and framebuffer resources. An EGLContext must be bound on the current thread when calling this function. The framebuffer is not complete until setSize() is called.

Member Function Documentation

◆ setSize()

void io.agora.rtc.gl.GlTextureFrameBuffer.setSize ( int  width,
int  height 
)

(Re)allocate texture. Will do nothing if the requested size equals the current size. An EGLContext must be bound on the current thread when calling this function. Must be called at least once before using the framebuffer. May be called multiple times to change size.

◆ release()

void io.agora.rtc.gl.GlTextureFrameBuffer.release ( )

Release texture and framebuffer. An EGLContext must be bound on the current thread when calling this function. This object should not be used after this call.