GLAutoDrawable implementation
utilizing already created GLDrawable and GLContext instances.
Since no native windowing system events are being processed, it is recommended
to handle at least the window events:
repaint using windowRepaintOp()resize using windowResizedOp()custom toolkit destruction issuing windowDestroyNotifyOp().
See example TestGLAutoDrawableDelegateNEWT.
OpenGL Context Sharing
To share a GLContext see the following note in the documentation overview:
context sharing
as well as GLSharedContextSetter.
| Modifier and Type | Field and Description |
|---|---|
| private final RecursiveLock | |
| private Object |
| Access | Constructor and Description |
|---|---|
| public | GLAutoDrawableDelegate(final GLDrawable
a valid drawable, final GLContext context, final Object GLDrawable, may not be realized yet.optional UI element holding this instance, see upstreamWidget, final boolean getUpstreamWidget().pass ownDevice, final RecursiveLock true if AbstractGraphicsDevice#close() shall be issued,
otherwise pass false. Closing the device is required in case
the drawable is created w/ it's own new instance, e.g. offscreen drawables,
and no further lifecycle handling is applied.optional custom lock)RecursiveLock.
The |
| Modifier and Type | Method and Description |
|---|---|
| public final void | destroy()
Implements com. |
| protected void | destroyImplInLock()
Overrides jogamp.
|
| public void | display()
Implements com. Causes OpenGL rendering to be performed for this GLAutoDrawable in the following order:
|
| public final GLDrawableFactory | getFactory()
Implements com. GLDrawableFactory being used to create this instance.
|
| 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 final void | |
| public final void | swapBuffers()
Implements com. |
| public String | toString()
Overrides jogamp. Implements com. |
| public final void | |
| public final void | |
| public final void | windowResizedOp(final int
Handling resize events from the windowing system. |
| lock | back to summary |
|---|---|
| private final RecursiveLock lock | |
| upstreamWidget | back to summary |
|---|---|
| private Object upstreamWidget | |
| GLAutoDrawableDelegate | back to summary |
|---|---|
| public GLAutoDrawableDelegate(final GLDrawable drawable, final GLContext context, final Object upstreamWidget, final boolean ownDevice, final RecursiveLock lock)
The
| |
| destroy | back to summary |
|---|---|
| public final void destroy() Implements com. Doc from com. Destroys all resources associated with this GLAutoDrawable,
inclusive the GLContext.
If a window is attached to it's implementation, it shall be closed.
Causes disposing of all OpenGL resources
by calling
This implementation calls
User still needs to destroy the upstream window, which details are hidden from this aspect.
This can be performed by overriding
| |
| destroyImplInLock | back to summary |
|---|---|
| protected void destroyImplInLock() Overrides jogamp. Doc from jogamp. Default implementation to destroys the drawable and context of this GLAutoDrawable:
Method assumes the lock is being hold. Override it to extend it to destroy your resources, i.e. the actual window.
In such case call
| |
| display | back to summary |
|---|---|
| public void display() Implements com. Doc from com. Causes OpenGL rendering to be performed for this GLAutoDrawable in the following order:
May be called periodically by a running
Called automatically by the window system toolkit upon receiving a repaint() request,
This routine may also be called manually for better control over the
rendering process. It is legal to call another GLAutoDrawable's
display method from within the
In case of a new generated OpenGL context,
the implementation shall call
| |
| getFactory | back to summary |
|---|---|
| public final GLDrawableFactory getFactory() Implements com. Doc from com. Return the
| |
| getUpstreamLock | back to summary |
|---|---|
| public final RecursiveLock getUpstreamLock() Implements com. Doc from com. Returns the recursive lock object of the
| |
| getUpstreamWidget | back to summary | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| public final Object getUpstreamWidget() Implements com. Doc from com. Method may return the upstream UI toolkit object
holding this Currently known Java UI toolkits and it's known return types are:
This method may also return
| |||||||||||||||||||||
| setUpstreamWidget | back to summary |
|---|---|
| public final void setUpstreamWidget(final Object newUpstreamWidget) Set the upstream UI toolkit object.
| |
| swapBuffers | back to summary |
|---|---|
| public final void swapBuffers() throws GLException Implements com. Doc from com. Swaps the front and back buffers of this drawable. For
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides jogamp. Implements com. Doc from java. Returns a string representation of the object. | |
| windowDestroyNotifyOp | back to summary |
|---|---|
| public final void windowDestroyNotifyOp() Implementation to handle destroy notifications from the windowing system.
If the | |
| windowRepaintOp | back to summary |
|---|---|
| public final void windowRepaintOp() Default implementation to handle repaint events from the windowing system | |
| windowResizedOp | back to summary |
|---|---|
| public final void windowResizedOp(final int newWidth, final int newHeight) Handling resize events from the windowing system. Implementation:
All required locks are being claimed.
| |