public class FrameBuffer extends GLFrameBuffer<Texture>
Encapsulates OpenGL ES 2.0 frame buffer objects. This is a simple helper class which should cover most FBO uses. It will
automatically create a texture for the color attachment and a renderbuffer for the depth buffer. You can get a hold of the
GLFrameBuffer.getColorBufferTexture(). This class will only work with OpenGL ES 2.0.
FrameBuffers are managed. In case of an OpenGL context loss, which only happens on Android when a user switches to another application or receives an incoming call, the framebuffer will be automatically recreated.
A FrameBuffer must be disposed if it is no longer needed
|Constructor and Description|
Creates a new FrameBuffer having the given dimensions and potentially a depth buffer attached.
Creates a new FrameBuffer having the given dimensions and potentially a depth and a stencil buffer attached.
|Modifier and Type||Method and Description|
Override this method in a derived class to set up the backing texture as you like.
Override this method in a derived class to dispose the backing texture as you like.
begin, bind, clearAllFrameBuffers, dispose, end, end, getColorBufferTexture, getDepth, getDepthBufferHandle, getFramebufferHandle, getHeight, getManagedStatus, getManagedStatus, getStencilBufferHandle, getWidth, invalidateAllFrameBuffers, setFrameBufferViewport
public FrameBuffer(Pixmap.Format format, int width, int height, boolean hasDepth)
public FrameBuffer(Pixmap.Format format, int width, int height, boolean hasDepth, boolean hasStencil)
format- the format of the color buffer; according to the OpenGL ES 2.0 spec, only RGB565, RGBA4444 and RGB5_A1 are color-renderable
width- the width of the framebuffer in pixels
height- the height of the framebuffer in pixels
hasDepth- whether to attach a depth buffer
GdxRuntimeException- in case the FrameBuffer could not be created
protected Texture createColorTexture()
protected void disposeColorTexture(Texture colorTexture)
public static void unbind()