GLDrawable;
GLJPanel is provided for compatibility with Swing user
interfaces when adding a heavyweight doesn't work either because
of Z-ordering or LayoutManager problems.
setShallUseOffscreenLayer(true)
maybe called to use an offscreen drawable (FBO or PBuffer) allowing
the underlying JAWT mechanism to composite the image, if supported.
setShallUseOffscreenLayer(true)
is being called if GLCapabilitiesImmutable#isOnscreen() is false.
sun.java2d.opengl=false
sun.java2d.noddraw=true
GLProfile#GL2, eg. using GLProfile#getMaxFixedFunc().sun.java2d.opengl=true
sun.java2d.noddraw=true
java.awt.Toolkit method disableBeackgroundErase(java.awt.Canvas).sun.awt.noerasebackground=true
OpenGL Context Sharing
To share a GLContext see the following note in the documentation overview:
context sharing
as well as GLSharedContextSetter.
| Modifier and Type | Class and Description |
|---|---|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private volatile AWTGraphicsConfiguration | |
| private volatile GraphicsDevice | |
| private final AWTWindowClosingProtocol | |
| private final GLCapabilitiesImmutable | |
| private final GLCapabilitiesChooser | |
| private volatile GLContextImpl | |
| private static final boolean | |
| private final Runnable | |
| private static boolean | |
| private static Method | |
| private final Runnable | |
| private final Runnable | |
| private final Runnable | disposeJAWTWindowAndAWTDeviceOnEDT
Disposes the JAWTWindow and AbstractGraphicsDevice within EDT, since resources created (X11: Display), must be destroyed in the same thread, where they have been created. |
| private volatile GLDrawableImpl | |
| private final float[] | |
| private final GLDrawableHelper | |
| private final HierarchyListener | |
| private final Runnable | |
| private volatile boolean | |
| private volatile JAWTWindow | |
| private final RecursiveLock | |
| private final float[] | |
| private final float[] | |
| private volatile boolean | |
| private GLAnimatorControl | |
| private AWTTilePainter | |
| private GLAutoDrawable | |
| private final Runnable | |
| private final Runnable | |
| pack-priv final float[] | |
| private volatile boolean | |
| private final Runnable | |
| private final Runnable | |
| private boolean | |
| private final Runnable | |
| private final Runnable |
| Access | Constructor and Description |
|---|---|
| public | GLCanvas()
Creates a new GLCanvas component with a default set of OpenGL capabilities, using the default OpenGL capabilities selection mechanism, on the default screen device. |
| public | GLCanvas(final GLCapabilitiesImmutable capsReqUser)
Creates a new GLCanvas component with the requested set of OpenGL capabilities, using the default OpenGL capabilities selection mechanism, on the default screen device. |
| public | GLCanvas(final GLCapabilitiesImmutable capsReqUser, final GLCapabilitiesChooser chooser, final GraphicsDevice device)
Creates a new GLCanvas component. |
| Modifier and Type | Method and Description |
|---|---|
| public void | addGLEventListener(final GLEventListener
The GLEventListener object to be inserted listener)Implements com. listener to the end of this drawable queue.
|
| public void | addGLEventListener(final int
Position where the listener will be inserted.
Should be within (0 <= index && index <= size()).
An index value of -1 is interpreted as the end of the list, size(). index, final GLEventListener The GLEventListener object to be inserted listener)Implements com. listener at the given index of this drawable queue.
|
| public void | addNotify()
Overrides java. |
| public boolean | areAllGLEventListenerInitialized()
Implements com. GLEventListener are initialized, otherwise false.
|
| private AWTGraphicsConfiguration | Returns: the chosen AWTGraphicsConfigurationIssues the GraphicsConfigurationFactory's choosing facility within EDT, since resources created (X11: Display), must be destroyed in the same thread, where they have been created. |
| public GLContext | createContext(final GLContext shareWith)
Implements com. |
| private boolean | |
| private void | |
| public void | destroy()
Implements com. |
| protected void | |
| private void | |
| public void | display()
Implements com. Causes OpenGL rendering to be performed for this GLAutoDrawable in the following order:
|
| public GLEventListener | disposeGLEventListener(final GLEventListener
The GLEventListener object to be disposed and removed if listener, final boolean remove is truepass remove)true to have the listener removed from this drawable queue, otherwise pass falseImplements com. listener via dispose(.
if it has been initialized and added to this queue.
|
| public void | flushGLRunnables()
Implements com. enqueued GLRunnable of this GLAutoDrawable
including notifying waiting executor.
|
| public GLAnimatorControl | |
| public boolean | getAutoSwapBufferMode()
Implements com. |
| public GLCapabilitiesImmutable | getChosenGLCapabilities()
Implements com. GLCapabilitiesImmutable corresponding to the chosen
OpenGL capabilities (pixel format / visual / GLProfile) for this drawable.
|
| public GLContext | getContext()
Implements com. |
| public int | |
| public final float[] | getCurrentSurfaceScale(final float[]
float[2] storage for the result result)Implements com. NativeSurface.
|
| public WindowClosingProtocol. | |
| public final GLDrawable | getDelegatedDrawable()
Implements com. GLDrawable instance,
otherwise return this instance.
|
| public final Thread | |
| public GLDrawableFactory | getFactory()
Implements com. GLDrawableFactory being used to create this instance.
|
| public GL | getGL()
Implements com. GL pipeline object this GLAutoDrawable uses.
|
| public GLEventListener | getGLEventListener(final int
Position of the listener to be returned.
Should be within (0 <= index && index < size()).
An index value of -1 is interpreted as last listener, size()-1. index)Implements com. GLEventListener at the given index of this drawable queue.
|
| public int | getGLEventListenerCount()
Implements com. GLEventListener of this drawable queue.
|
| public boolean | getGLEventListenerInitState(final GLEventListener
the GLEventListener object to query it's initialized state. listener)Implements com. listener is initialized or not.
|
| public GLProfile | getGLProfile()
Implements com. GLProfile for this drawable.
|
| public GraphicsConfiguration | getGraphicsConfiguration()
Overrides java. GraphicsConfiguration associated with this
Component.
|
| public long | getHandle()
Implements com. realization
and while it's surface is being locked.
|
| public float[] | getMaximumSurfaceScale(final float[]
float[2] storage for the result result)Implements com. NativeSurface.
|
| public float[] | getMinimumSurfaceScale(final float[]
float[2] storage for the result result)Implements com. NativeSurface.
|
| public NativeSurface | getNativeSurface()
Implements com. NativeSurface of this NativeSurfaceHolder.
|
| private final String | |
| public GLCapabilitiesImmutable | getRequestedGLCapabilities()
Implements com. GLCapabilitiesImmutable corresponding to the user requested
OpenGL capabilities (pixel format / visual / GLProfile) for this drawable.
|
| public final float[] | getRequestedSurfaceScale(final float[]
float[2] storage for the result result)Implements com. requested pixel scale of the associated NativeSurface.
|
| public final boolean | getShallUseOffscreenLayer()
Implements com. setShallUseOffscreenLayer(boolean).
|
| public int | getSurfaceHeight()
Implements com. GLDrawable's surface client area in pixel units.
|
| public int | getSurfaceWidth()
Implements com. GLDrawable's surface client area in pixel units.
|
| protected static String | |
| public final RecursiveLock | getUpstreamLock()
Implements com. upstream widget
to synchronize multithreaded access on top of NativeSurface#lockSurface().
|
| public final Object | getUpstreamWidget()
Implements com. GLAutoDrawable instance, if exist.</td<></td<></td<></td<></td<>
|
| public boolean | invoke(final boolean
if wait, final GLRunnable true block until execution of glRunnable is finished, otherwise return immediately w/o waitingthe glRunnable)GLRunnable to execute within display()Implements com. GLRunnable,
which will be executed within the next display() call
after all registered GLEventListeners
display(GLAutoDrawable)
methods have been called.
|
| public boolean | invoke(final boolean
if wait, final List<GLRunnable> true block until execution of the last glRunnable is finished, otherwise return immediately w/o waitingthe glRunnables)GLRunnables to execute within display()Implements com. invoke(boolean, GLRunnable) functionality
allowing to inject a list of GLRunnables.
|
| public boolean | isGLOriented()
Implements com. true if the drawable is rendered in
OpenGL's coordinate system, origin at bottom left.
|
| public final boolean | isOffscreenLayerSurfaceEnabled()
Implements com. |
| public boolean | isRealized()
Implements com. true if this drawable is realized, otherwise true.
|
| public final boolean | isThreadGLCapable()
Implements com. |
| public static void | |
| public void | paint(final Graphics
the specified Graphics context g)Overrides java. |
| public void | print(final Graphics
the graphics context to use for printing graphics)Overrides java. |
| public void | releasePrint()
Implements com. PrinterJob#print().
|
| public GLEventListener | removeGLEventListener(final GLEventListener
The GLEventListener object to be removed listener)Implements com. listener from this drawable queue.
|
| public void | removeNotify()
Overrides java. Overridden to track when this component is removed from a container. |
| public void | reshape(final int
the x coordinate of the upper left corner of the rectangle x, final int the y coordinate of the upper left corner of the rectangle y, final int the width of the rectangle width, final int the height of the rectangle height)Overrides java. GLDrawableHelper#reshape to be
called on all registered GLEventListeners.
|
| private void | |
| public void | setAnimator(final GLAnimatorControl
null reference indicates no animator is using
this GLAutoDrawable,a valid reference indicates an animator is using this GLAutoDrawable.Implements com. com. implementation.
|
| public void | setAutoSwapBufferMode(final boolean onOrOff)
Implements com. |
| private void | |
| public GLContext | setContext(final GLContext
the new context, maybe newCtx, final boolean null for dis-association.if destroyPrevCtx)true, destroy the previous context if existsImplements com. newtCtx, to this auto-drawable.
|
| public void | setContextCreationFlags(final int
Additional context creation flags. flags)Implements com. |
| public WindowClosingProtocol. | setDefaultCloseOperation(final WindowClosingProtocol.
the new close operation value opImplements com. |
| public final Thread | setExclusiveContextThread(final Thread
the exclusive thread to claim the context, or t)null for default operation.Implements com. GLContext to the given thread.
|
| public GL | setGL(final GL gl)
Implements com. GL pipeline object this GLAutoDrawable uses.
|
| public void | setGLEventListenerInitState(final GLEventListener
the GLEventListener object to perform a state change. listener, final boolean if initialized)true, mark the listener initialized, otherwise uninitialized.Implements com. listener's initialized state.
|
| public final void | setRealized(final boolean realized)
Implements com. surface has been created and can be drawn into.
|
| private final void | |
| public void | setShallUseOffscreenLayer(final boolean v)
Implements com. |
| public final void | setSharedAutoDrawable(final GLAutoDrawable
The GLAutoDrawable, which OpenGL context shall be shared by this sharedAutoDrawable)GLAutoDrawable's GLContext.Implements com. GLAutoDrawable, which OpenGL context shall be shared by this GLAutoDrawable's GLContext.
|
| public final void | setSharedContext(final GLContext
The OpenGL context to be shared by this sharedContext)GLAutoDrawable's GLContext.Implements com. OpenGL context, which shall be shared by this GLAutoDrawable's GLContext.
|
| public final boolean | setSurfaceScale(final float[]
requested surface pixel scale float[2] values for x- and y-direction. pixelScale)Implements com. NativeSurface,
where size_in_pixel_units = pixel_scale * size_in_window_units.
|
| private final boolean | |
| public void | setupPrint(final double
Graphics2D scaling factor, i.e. rendering 1/scaleMatX * width pixelsGraphics2D scaling factor, i.e. rendering 1/scaleMatY * height pixelsmultisampling value: < 0 turns off, == 0 leaves as-is, > 0 enables using given num samples numSamples, final int custom tile width for tileWidth, final int tile renderer, pass -1 for default.custom tile height for tileHeight)tile renderer, pass -1 for default.
FIXME: Add border size !Implements com. PrinterJob#print().
|
| public void | swapBuffers()
Implements com. |
| public String | toString()
Overrides java. Implements com. |
| public void | update(final Graphics
the specified Graphics context g)Overrides java. |
| private final boolean | |
| private boolean |