Implementation allows use of custom GLCapabilities.
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 final GLCapabilitiesChooser | |
| private final GLCapabilitiesImmutable | |
| private volatile Rectangle | |
| private volatile GLContextImpl | |
| private static final boolean | |
| private final Runnable | |
| private final Runnable | |
| private volatile GLDrawableImpl | |
| private volatile long | |
| private final GLDrawableHelper | |
| private final Runnable | |
| private final Runnable | |
| private boolean | |
| private final RecursiveLock | |
| private final Runnable | |
| private final AbstractGraphicsScreen | |
| private volatile boolean | |
| private final Runnable | |
| private final UpstreamSurfaceHook | |
| private final boolean | |
| private volatile long |
| Access | Constructor and Description |
|---|---|
| public | GLCanvas(final Composite
Required (non-null) parent Composite. parent, final int Optional SWT style bit-field. The style, final GLCapabilitiesImmutable SWT#NO_BACKGROUND bit is set before passing this up to the
Canvas constructor, so OpenGL handles the background.Optional GLCapabilities. If not provided, the default capabilities for the default GLProfile for the
graphics device determined by the parent Composite are used. Note that the GLCapabilities that are
actually used may differ based on the capabilities of the graphics device. capsReqUser, final GLCapabilitiesChooser Optional GLCapabilitiesChooser to customize the selection of the used GLCapabilities based on the
requested GLCapabilities, and the available capabilities of the graphics device. capsChooser)Creates a new SWT GLCanvas. |
| 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(). idx, final GLEventListener The GLEventListener object to be inserted listener)Implements com. listener at the given index of this drawable queue.
|
| public boolean | areAllGLEventListenerInitialized()
Implements com. GLEventListener are initialized, otherwise false.
|
| public static GLCanvas | Returns: a new instanceRequired (non-null) parent Composite. parent, final int Optional SWT style bit-field. The style, final GLCapabilitiesImmutable SWT#NO_BACKGROUND bit is set before passing this up to the
Canvas constructor, so OpenGL handles the background.Optional GLCapabilities. If not provided, the default capabilities for the default GLProfile for the
graphics device determined by the parent Composite are used. Note that the GLCapabilities that are
actually used may differ based on the capabilities of the graphics device. caps, final GLCapabilitiesChooser Optional GLCapabilitiesChooser to customize the selection of the used GLCapabilities based on the
requested GLCapabilities, and the available capabilities of the graphics device. chooser)Creates an instance using |
| public GLContext | createContext(final GLContext shareWith)
Implements com. |
| private boolean | |
| private final void | |
| public void | destroy()
Implements com. |
| public void | display()
Implements com. Causes OpenGL rendering to be performed for this GLAutoDrawable in the following order:
|
| private final void | |
| public void | dispose()
Overrides org. |
| 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 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 long | getHandle()
Implements com. realization
and while it's surface is being locked.
|
| public NativeSurface | getNativeSurface()
Implements com. NativeSurface of this NativeSurfaceHolder.
|
| public GLCapabilitiesImmutable | getRequestedGLCapabilities()
Implements com. GLCapabilitiesImmutable corresponding to the user requested
OpenGL capabilities (pixel format / visual / GLProfile) for this drawable.
|
| 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.
|
| private 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 runnable)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 runnables)GLRunnables to execute within display()Implements com. invoke(boolean, GLRunnable) functionality
allowing to inject a list of GLRunnables.
|
| private final boolean | |
| public boolean | isGLOriented()
Implements com. true if the drawable is rendered in
OpenGL's coordinate system, origin at bottom left.
|
| public boolean | isRealized()
Implements com. true if this drawable is realized, otherwise true.
|
| public final boolean | isThreadGLCapable()
Implements com. |
| private final boolean | |
| public static void | |
| public GLEventListener | removeGLEventListener(final GLEventListener
The GLEventListener object to be removed listener)Implements com. listener from this drawable queue.
|
| private void | runInGLThread(final Runnable action)
Runs the specified action in an SWT compatible thread, which is:
|
| 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 arg0)
Implements com. |
| 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. arg0)Implements 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 arg0)
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 void | setRealized(final boolean arg0)
Implements com. surface has been created and can be drawn into.
|
| 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 void | swapBuffers()
Implements com. |
| private static String | |
| private static String | |
| public String | toString()
Overrides org. Implements com. |
| public void | update()
Overrides org. |
| protected final void | |
| private final boolean | validateDrawableAndContextPostCheck()
assumes drawable == null (implying !drawable.isRealized()) || context == null ! |
| protected final boolean |