Package panamagl.offscreen
Interface FBO
- All Known Implementing Classes:
AFBO
public interface FBO
A frame buffer object, or
FBO, can render OpenGL into an offscreen buffer that can later
be read to an Image by a FBOReader which will access the FBO content through readPixels(GL).- Author:
- Martin Pernollet
-
Method Summary
Modifier and TypeMethodDescriptionvoidBind this FBO so that the following GL commands target it, e.g.intintgetWidth()booleanvoidreadPixels(GL gl) voidvoidresize(int width, int height) voidBind back the default framebuffer, so that the following GL commands do not target this FBO anymore.
-
Method Details
-
prepare
-
release
-
resize
void resize(int width, int height) -
getWidth
int getWidth() -
getHeight
int getHeight() -
isPrepared
boolean isPrepared() -
readPixels
-
bind
Bind this FBO so that the following GL commands target it, e.g. to perform GL work out of the rendering of a canvas such as picking from a mouse event. The FBO is prepared if it is not already, otherwise it is bound as is, i.e. without being recreated nor cleared. The GL context of the canvas must be current on the calling thread. Out of aGLEventListenermethod, the work must therefore be performed with theThreadRedirectof the canvas renderer, which may run it later (seedoc/Multithreading.md) :OffscreenRenderer renderer = canvas.getOffscreenRenderer(); renderer.getThreadRedirect().run(() -> { GL gl = renderer.getGL(); renderer.getFBO().bind(gl); // GL work targeting the canvas framebuffer renderer.getFBO().unbind(gl); });- See Also:
-
unbind
-