GLDrawable specialization,
exposing FBObject functionality.
A GLFBODrawable is uninitialized until a GLContext is bound
and made current the first time, hence only then it's capabilities fully reflect expectations,
i.e. color, depth, stencil and MSAA bits will be valid only after the first makeCurrent() call.
On-/offscreen bits are valid after setRealized(true).
MSAA is used if requested.
Double buffering is used if requested.
In MSAA mode, it always uses the implicit 2nd framebuffer sink.
Hence double buffering is always the case w/ MSAA.
In non MSAA a second explicit framebuffer is being used.
This method allows compliance w/ the spec, i.e. read and draw framebuffer selection
and double buffer usage for e.g. glReadPixels(..
This method also allows usage of both textures seperately.
It would be possible to implement double buffering simply using
Colorbuffers with one framebuffer.
This would require mode selection and hence complicate the API. Besides, it would
not support differentiation of read and write framebuffer and hence not be spec compliant.
Actual swapping of the Colorbuffers and/or framebuffer
is performed either in the context current hook
or when swapping buffers, whatever comes first.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | GLFBODrawable.
Resizeable |
| Modifier and Type | Field and Description |
|---|---|
| public static final int | FBOMODE_USE_TEXTURE
FBO Mode Bit: Use a |
| Modifier and Type | Method and Description |
|---|---|
| public FBObject. | Returns: the namedColorbufferGL#GL_FRONT and GL#GL_BACK are valid buffer namesReturns the named |
| public FBObject | Returns: the namedFBObjectGL#GL_FRONT and GL#GL_BACK are valid buffer namesIf MSAA is being used and |
| public int | |
| public int | Returns: the number of buffers (FBO) being used. 1 if not usingdouble buffering,
otherwise ≥ 2, depending on setNumBuffers(int).
|
| public int | |
| public int | |
| public boolean | |
| public void | |
| public void | setFBOMode(final int
custom FBO mode bits like modeBits)FBOMODE_USE_TEXTURE.Set the FBO mode bits used for FBO creation. |
| public int | Returns: the new number of buffers (FBO) used, maybe different than the requestedbufferCount (see above)Sets the number of buffers (FBO) being used if using |
| public void | setNumSamples(final GL
GL context object bound to this drawable, will be made current during operation.
A prev. current context will be make current after operation. gl, final int new sample size newSamples)Set the number of sample buffers if using MSAA |
| public void |
| FBOMODE_USE_TEXTURE | back to summary |
|---|---|
| public static final int FBOMODE_USE_TEXTURE FBO Mode Bit: Use a | |
| getColorbuffer | back to summary |
|---|---|
| public FBObject. Returns the named
If MSAA is being used, only the
Depending on the
| |
| getFBObject | back to summary |
|---|---|
| public FBObject getFBObject(final int bufferName) throws IllegalArgumentException If MSAA is being used and
| |
| getFBOMode | back to summary |
|---|---|
public int getFBOMode()
| |
| getNumBuffers | back to summary |
|---|---|
public int getNumBuffers()
| |
| getNumSamples | back to summary |
|---|---|
public int getNumSamples()
| |
| getTextureUnit | back to summary |
|---|---|
public int getTextureUnit()
| |
| isInitialized | back to summary |
|---|---|
public boolean isInitialized()
| |
| resetSize | back to summary |
|---|---|
| public void resetSize(final GL gl) throws GLException Notify this instance about upstream size change
to reconfigure the
| |
| setFBOMode | back to summary |
|---|---|
| public void setFBOMode(final int modeBits) throws IllegalStateException Set the FBO mode bits used for FBO creation.
Default value is:
If
| |
| setNumBuffers | back to summary |
|---|---|
| public int setNumBuffers(final int bufferCount) throws IllegalStateException, GLException Sets the number of buffers (FBO) being used if using
If
Must be called before
| |
| setNumSamples | back to summary |
|---|---|
| public void setNumSamples(final GL gl, final int newSamples) throws GLException Set the number of sample buffers if using MSAA
| |
| setTextureUnit | back to summary |
|---|---|
public void setTextureUnit(final int unit)
| |
GLFBODrawable specialization
| Modifier and Type | Method and Description |
|---|---|
| public void | setSurfaceSize(GLContext
the context, int GLContext bound to this drawable, will be made current during operation
A prev. current context will be make current after operation.new width in pixel units newWidth, int new width in pixel units newHeight)Resize this |
| setSurfaceSize | back to summary |
|---|---|
| public void setSurfaceSize(GLContext context, int newWidth, int newHeight) throws NativeWindowException, GLException Resize this This drawable is being locked during operation.
| |