- java.lang.Object
-
- processing.opengl.FrameBuffer
-
- All Implemented Interfaces:
PConstants
public class FrameBuffer extends Object implements PConstants
Encapsulates a Frame Buffer Object for offscreen rendering. When created with onscreen == true, it represents the normal framebuffer. Needed by the stack mechanism in OPENGL2 to return to onscreen rendering after a sequence of pushFramebuffer calls. It transparently handles the situations when the FBO extension is not available. By Andres Colubri.
-
-
Field Summary
Fields Modifier and Type Field Description protected Texture[]colorBufferTexprotected intcontextprotected intdepthBitsintglDepthintglDepthStencilintglFbointglMultisampleintglStencilintheightprotected booleanmultisampleprotected booleannoDepthprotected intnsamplesprotected intnumColorBuffersprotected booleanpackedDepthStencilprotected PGraphicsOpenGLpgprotected PGLpglprotected IntBufferpixelBufferprotected booleanscreenFbprotected intstencilBitsintwidth-
Fields inherited from interface processing.core.PConstants
ADD, ALPHA, ALT, AMBIENT, ARC, ARGB, ARROW, BACKSPACE, BASELINE, BEVEL, BEZIER_VERTEX, BLEND, BLUR, BOTTOM, BOX, BREAK, BURN, CENTER, CHATTER, CHORD, CLAMP, CLOSE, CODED, COMPLAINT, CONTROL, CORNER, CORNERS, CROSS, CURVE_VERTEX, CUSTOM, DARKEST, DEG_TO_RAD, DELETE, DIAMETER, DIFFERENCE, DILATE, DIRECTIONAL, DISABLE_ASYNC_SAVEFRAME, DISABLE_BUFFER_READING, DISABLE_DEPTH_MASK, DISABLE_DEPTH_SORT, DISABLE_DEPTH_TEST, DISABLE_KEY_REPEAT, DISABLE_NATIVE_FONTS, DISABLE_OPENGL_ERRORS, DISABLE_OPTIMIZED_STROKE, DISABLE_STROKE_PERSPECTIVE, DISABLE_STROKE_PURE, DISABLE_TEXTURE_MIPMAPS, DODGE, DOWN, DXF, ELLIPSE, ENABLE_ASYNC_SAVEFRAME, ENABLE_BUFFER_READING, ENABLE_DEPTH_MASK, ENABLE_DEPTH_SORT, ENABLE_DEPTH_TEST, ENABLE_KEY_REPEAT, ENABLE_NATIVE_FONTS, ENABLE_OPENGL_ERRORS, ENABLE_OPTIMIZED_STROKE, ENABLE_STROKE_PERSPECTIVE, ENABLE_STROKE_PURE, ENABLE_TEXTURE_MIPMAPS, ENTER, EPSILON, ERODE, ESC, EXCLUSION, FX2D, GIF, GRAY, GROUP, HALF_PI, HAND, HARD_LIGHT, HINT_COUNT, HSB, IMAGE, INVERT, JAVA2D, JPEG, LANDSCAPE, LEFT, LIGHTEST, LINE, LINE_LOOP, LINE_STRIP, LINES, LINUX, MACOSX, MAX_FLOAT, MAX_INT, MIN_FLOAT, MIN_INT, MITER, MODEL, MODELVIEW, MOVE, MULTIPLY, NORMAL, OPAQUE, OPEN, OPENGL, ORTHOGRAPHIC, OTHER, OVERLAY, P2D, P3D, PATH, PDF, PERSPECTIVE, PI, PIE, platformNames, POINT, POINTS, POLYGON, PORTRAIT, POSTERIZE, PROBLEM, PROJECT, PROJECTION, QUAD, QUAD_BEZIER_VERTEX, QUAD_STRIP, QUADRATIC_VERTEX, QUADS, QUARTER_PI, RAD_TO_DEG, RADIUS, RECT, REPEAT, REPLACE, RETURN, RGB, RIGHT, ROUND, SCREEN, SHAPE, SHIFT, SOFT_LIGHT, SPAN, SPHERE, SPOT, SQUARE, SUBTRACT, SVG, TAB, TARGA, TAU, TEXT, THIRD_PI, THRESHOLD, TIFF, TOP, TRIANGLE, TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP, VERTEX, WAIT, WHITESPACE, WINDOWS, X, Y, Z
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidallocate()voidbind()voidclear()protected booleancontextIsOutdated()voidcopy(FrameBuffer dest, int mask)voidcopyColor(FrameBuffer dest)voidcopyDepth(FrameBuffer dest)voidcopyStencil(FrameBuffer dest)protected voidcreatePixelBuffer()voiddisableDepthTest()protected voiddispose()voidfinish()intgetDefaultDrawBuffer()intgetDefaultReadBuffer()IntBuffergetPixelBuffer()voidgetPixels(int[] pixels)booleanhasDepthBuffer()booleanhasStencilBuffer()protected voidinitColorBufferMultisample()protected voidinitDepthBuffer()protected voidinitPackedDepthStencilBuffer()protected voidinitStencilBuffer()voidreadPixels()voidsetColorBuffer(Texture tex)voidsetColorBuffers(Texture[] textures)voidsetColorBuffers(Texture[] textures, int n)voidsetFBO(int id)voidswapColorBuffers()
-
-
-
Field Detail
-
pg
protected PGraphicsOpenGL pg
-
pgl
protected PGL pgl
-
context
protected int context
-
glFbo
public int glFbo
-
glDepth
public int glDepth
-
glStencil
public int glStencil
-
glDepthStencil
public int glDepthStencil
-
glMultisample
public int glMultisample
-
width
public int width
-
height
public int height
-
depthBits
protected int depthBits
-
stencilBits
protected int stencilBits
-
packedDepthStencil
protected boolean packedDepthStencil
-
multisample
protected boolean multisample
-
nsamples
protected int nsamples
-
numColorBuffers
protected int numColorBuffers
-
colorBufferTex
protected Texture[] colorBufferTex
-
screenFb
protected boolean screenFb
-
noDepth
protected boolean noDepth
-
pixelBuffer
protected IntBuffer pixelBuffer
-
-
Method Detail
-
clear
public void clear()
-
copyColor
public void copyColor(FrameBuffer dest)
-
copyDepth
public void copyDepth(FrameBuffer dest)
-
copyStencil
public void copyStencil(FrameBuffer dest)
-
copy
public void copy(FrameBuffer dest, int mask)
-
bind
public void bind()
-
disableDepthTest
public void disableDepthTest()
-
finish
public void finish()
-
readPixels
public void readPixels()
-
getPixels
public void getPixels(int[] pixels)
-
getPixelBuffer
public IntBuffer getPixelBuffer()
-
hasDepthBuffer
public boolean hasDepthBuffer()
-
hasStencilBuffer
public boolean hasStencilBuffer()
-
setFBO
public void setFBO(int id)
-
setColorBuffer
public void setColorBuffer(Texture tex)
-
setColorBuffers
public void setColorBuffers(Texture[] textures)
-
setColorBuffers
public void setColorBuffers(Texture[] textures, int n)
-
swapColorBuffers
public void swapColorBuffers()
-
getDefaultReadBuffer
public int getDefaultReadBuffer()
-
getDefaultDrawBuffer
public int getDefaultDrawBuffer()
-
allocate
protected void allocate()
-
dispose
protected void dispose()
-
contextIsOutdated
protected boolean contextIsOutdated()
-
initColorBufferMultisample
protected void initColorBufferMultisample()
-
initPackedDepthStencilBuffer
protected void initPackedDepthStencilBuffer()
-
initDepthBuffer
protected void initDepthBuffer()
-
initStencilBuffer
protected void initStencilBuffer()
-
createPixelBuffer
protected void createPixelBuffer()
-
-