|
JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java (public API).
|
Platform-independent GLDrawable specialization, exposing FBObject functionality.
More...
Classes | |
| interface | Resizeable |
Resizeable GLFBODrawable specialization. More... | |
Public Member Functions | |
| boolean | isInitialized () |
| void | setFBOMode (final int modeBits) throws IllegalStateException |
| Set the FBO mode bits used for FBO creation. More... | |
| int | getFBOMode () |
| void | resetSize (final GL gl) throws GLException |
Notify this instance about upstream size change to reconfigure the FBObject. More... | |
| int | getTextureUnit () |
| void | setTextureUnit (final int unit) |
| void | setNumSamples (final GL gl, final int newSamples) throws GLException |
| Set the number of sample buffers if using MSAA. More... | |
| int | getNumSamples () |
| int | setNumBuffers (final int bufferCount) throws IllegalStateException, GLException |
Sets the number of buffers (FBO) being used if using double buffering. More... | |
| int | getNumBuffers () |
| FBObject | getFBObject (final int bufferName) throws IllegalArgumentException |
Sets the DoubleBufferMode. More... | |
| Colorbuffer | getColorbuffer (final int bufferName) throws IllegalArgumentException |
Returns the named Colorbuffer instance. More... | |
Public Member Functions inherited from com.jogamp.opengl.GLDrawable | |
| GLContext | createContext (GLContext shareWith) |
| Creates a new context for drawing to this drawable that will optionally share buffer objects, textures and other server-side OpenGL objects with the specified GLContext. More... | |
| void | setRealized (boolean realized) |
Indicates to GLDrawable implementations whether the underlying surface has been created and can be drawn into. More... | |
| boolean | isRealized () |
Returns true if this drawable is realized, otherwise false. More... | |
| int | getSurfaceWidth () |
Returns the width of this GLDrawable's surface client area in pixel units. More... | |
| int | getSurfaceHeight () |
Returns the height of this GLDrawable's surface client area in pixel units. More... | |
| boolean | isGLOriented () |
Returns true if the drawable is rendered in OpenGL's coordinate system, origin at bottom left. More... | |
| void | swapBuffers () throws GLException |
| Swaps the front and back buffers of this drawable. More... | |
| GLCapabilitiesImmutable | getChosenGLCapabilities () |
Fetches the GLCapabilitiesImmutable corresponding to the chosen OpenGL capabilities (pixel format / visual / GLProfile) for this drawable. More... | |
| GLCapabilitiesImmutable | getRequestedGLCapabilities () |
Fetches the GLCapabilitiesImmutable corresponding to the user requested OpenGL capabilities (pixel format / visual / GLProfile) for this drawable. More... | |
| GLProfile | getGLProfile () |
Fetches the GLProfile for this drawable. More... | |
| NativeSurface | getNativeSurface () |
Returns the associated NativeSurface of this NativeSurfaceHolder. More... | |
| long | getHandle () |
Returns the GL drawable handle, guaranteed to be valid after realization and while it's surface is being locked. More... | |
| GLDrawableFactory | getFactory () |
Return the GLDrawableFactory being used to create this instance. More... | |
| String | toString () |
| NativeSurface | getNativeSurface () |
Returns the associated NativeSurface of this NativeSurfaceHolder. More... | |
Static Public Attributes | |
| static final int | FBOMODE_USE_TEXTURE = 1 << 0 |
FBO Mode Bit: Use a TextureAttachment for the render colorbuffer, see setFBOMode(int). More... | |
Platform-independent 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.
Definition at line 78 of file GLFBODrawable.java.
| Colorbuffer com.jogamp.opengl.GLFBODrawable.getColorbuffer | ( | final int | bufferName | ) | throws IllegalArgumentException |
Returns the named Colorbuffer instance.
If MSAA is being used, only the GL#GL_FRONT buffer is accessible and an exception is being thrown if GL#GL_BACK is being requested.
Depending on the fbo mode the resulting Colorbuffer is either a TextureAttachment if FBOMODE_USE_TEXTURE is set, otherwise a ColorAttachment. See Colorbuffer#isTextureAttachment().
| bufferName | GL#GL_FRONT and GL#GL_BACK are valid buffer names |
Colorbuffer | IllegalArgumentException | if using MSAA and GL#GL_BACK is requested or an illegal buffer name is being used |
| FBObject com.jogamp.opengl.GLFBODrawable.getFBObject | ( | final int | bufferName | ) | throws IllegalArgumentException |
Sets the DoubleBufferMode.
DoubleBufferMode Must be called before initialization, otherwise an exception is thrown. This call has no effect is MSAA is selected, since MSAA always forces the mode to FBO. Also setting the mode to NONE where double buffering is requested or setting a double buffering mode w/o request will be ignored.
Since TEXTURE mode is currently not implemented, this method has no effect.
| GLException | if already initialized, see isInitialized(). If MSAA is being used and GL#GL_FRONT is requested, the internal FBObject sample sink is being returned. |
| bufferName | GL#GL_FRONT and GL#GL_BACK are valid buffer names |
FBObject | IllegalArgumentException | if an illegal buffer name is being used |
| int com.jogamp.opengl.GLFBODrawable.getFBOMode | ( | ) |
setFBOMode(int) | int com.jogamp.opengl.GLFBODrawable.getNumBuffers | ( | ) |
double buffering, otherwise ≥ 2, depending on setNumBuffers(int). | int com.jogamp.opengl.GLFBODrawable.getNumSamples | ( | ) |
| int com.jogamp.opengl.GLFBODrawable.getTextureUnit | ( | ) |
| boolean com.jogamp.opengl.GLFBODrawable.isInitialized | ( | ) |
true if initialized, i.e. a GLContext is bound and made current once, otherwise false. | void com.jogamp.opengl.GLFBODrawable.resetSize | ( | final GL | gl | ) | throws GLException |
Notify this instance about upstream size change to reconfigure the FBObject.
| gl | GL context object bound to this drawable, will be made current during operation. A prev. current context will be make current after operation. |
| GLException | if resize operation failed |
| void com.jogamp.opengl.GLFBODrawable.setFBOMode | ( | final int | modeBits | ) | throws IllegalStateException |
Set the FBO mode bits used for FBO creation.
Default value is: FBOMODE_USE_TEXTURE.
If GLRendererQuirks#BuggyColorRenderbuffer is set, FBOMODE_USE_TEXTURE is always added at initialization.
| modeBits | custom FBO mode bits like FBOMODE_USE_TEXTURE. |
| IllegalStateException | if already initialized, see isInitialized(). |
| int com.jogamp.opengl.GLFBODrawable.setNumBuffers | ( | final int | bufferCount | ) | throws IllegalStateException, GLException |
Sets the number of buffers (FBO) being used if using double buffering.
If double buffering is not chosen, this is a NOP.
Must be called before initialization, otherwise an exception is thrown.
bufferCount (see above) | IllegalStateException | if already initialized, see isInitialized(). |
| void com.jogamp.opengl.GLFBODrawable.setNumSamples | ( | final GL | gl, |
| final int | newSamples | ||
| ) | throws GLException |
Set the number of sample buffers if using MSAA.
| gl | GL context object bound to this drawable, will be made current during operation. A prev. current context will be make current after operation. |
| newSamples | new sample size |
| GLException | if resetting the FBO failed |
| void com.jogamp.opengl.GLFBODrawable.setTextureUnit | ( | final int | unit | ) |
| unit | the texture unit to be used |
|
static |
FBO Mode Bit: Use a TextureAttachment for the render colorbuffer, see setFBOMode(int).
Definition at line 82 of file GLFBODrawable.java.