Class 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 Detail

      • 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()