|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.badlogic.gdx.graphics.glutils.FrameBuffer
public class FrameBuffer
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
texture by 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
Field Summary | |
---|---|
protected Texture |
colorTexture
the color buffer texture |
protected Pixmap.Format |
format
format |
protected boolean |
hasDepth
depth |
protected int |
height
height |
protected int |
width
width |
Constructor Summary | |
---|---|
FrameBuffer(Pixmap.Format format,
int width,
int height,
boolean hasDepth)
Creates a new FrameBuffer having the given dimensions and potentially a depth buffer attached. |
Method Summary | |
---|---|
void |
begin()
Makes the frame buffer current so everything gets drawn to it. |
static void |
clearAllFrameBuffers(Application app)
|
void |
dispose()
Releases all resources associated with the FrameBuffer. |
void |
end()
Unbinds the framebuffer, all drawing will be performed to the normal framebuffer from here on. |
Texture |
getColorBufferTexture()
|
int |
getHeight()
|
static java.lang.String |
getManagedStatus()
|
int |
getWidth()
|
static void |
invalidateAllFrameBuffers(Application app)
Invalidates all frame buffers. |
protected void |
setupTexture()
Override this method in a derived class to set up the backing texture as you like. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Texture colorTexture
protected final int width
protected final int height
protected final boolean hasDepth
protected final Pixmap.Format format
Constructor Detail |
---|
public FrameBuffer(Pixmap.Format format, int width, int height, boolean hasDepth)
format
- the format of the color bufferwidth
- the width of the framebuffer in pixelsheight
- the height of the framebuffer in pixelshasDepth
- whether to attach a depth buffer
GdxRuntimeException
- in case the FraeBuffer could not be createdMethod Detail |
---|
protected void setupTexture()
public void dispose()
dispose
in interface Disposable
public void begin()
public void end()
public static void invalidateAllFrameBuffers(Application app)
public static void clearAllFrameBuffers(Application app)
public static java.lang.String getManagedStatus()
public Texture getColorBufferTexture()
public int getHeight()
public int getWidth()
|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |