28package com.jogamp.opengl.swt;
32import com.jogamp.nativewindow.AbstractGraphicsConfiguration;
33import com.jogamp.nativewindow.AbstractGraphicsDevice;
34import com.jogamp.nativewindow.AbstractGraphicsScreen;
35import com.jogamp.nativewindow.GraphicsConfigurationFactory;
36import com.jogamp.nativewindow.NativeSurface;
37import com.jogamp.nativewindow.NativeWindowException;
38import com.jogamp.nativewindow.ProxySurface;
39import com.jogamp.nativewindow.UpstreamSurfaceHook;
40import com.jogamp.nativewindow.VisualIDHolder;
41import com.jogamp.nativewindow.VisualIDHolder.VIDType;
42import com.jogamp.opengl.GL;
43import com.jogamp.opengl.GLAnimatorControl;
44import com.jogamp.opengl.GLAutoDrawable;
45import com.jogamp.opengl.GLCapabilities;
46import com.jogamp.opengl.GLCapabilitiesChooser;
47import com.jogamp.opengl.GLCapabilitiesImmutable;
48import com.jogamp.opengl.GLContext;
49import com.jogamp.opengl.GLDrawable;
50import com.jogamp.opengl.GLDrawableFactory;
51import com.jogamp.opengl.GLEventListener;
52import com.jogamp.opengl.GLException;
53import com.jogamp.opengl.GLProfile;
54import com.jogamp.opengl.GLRunnable;
55import com.jogamp.opengl.GLSharedContextSetter;
56import com.jogamp.opengl.Threading;
58import jogamp.nativewindow.macosx.OSXUtil;
59import jogamp.nativewindow.x11.X11Util;
60import jogamp.opengl.Debug;
61import jogamp.opengl.GLContextImpl;
62import jogamp.opengl.GLDrawableHelper;
63import jogamp.opengl.GLDrawableImpl;
65import org.eclipse.swt.SWT;
66import org.eclipse.swt.graphics.Color;
67import org.eclipse.swt.graphics.Rectangle;
68import org.eclipse.swt.internal.DPIUtil;
69import org.eclipse.swt.layout.FillLayout;
70import org.eclipse.swt.widgets.Canvas;
71import org.eclipse.swt.widgets.Composite;
72import org.eclipse.swt.widgets.Display;
73import org.eclipse.swt.widgets.Event;
74import org.eclipse.swt.widgets.Listener;
75import org.eclipse.swt.widgets.Shell;
77import com.jogamp.common.GlueGenVersion;
78import com.jogamp.common.os.Platform;
79import com.jogamp.common.util.VersionUtil;
80import com.jogamp.common.util.locks.LockFactory;
81import com.jogamp.common.util.locks.RecursiveLock;
82import com.jogamp.nativewindow.swt.SWTAccessor;
83import com.jogamp.nativewindow.x11.X11GraphicsDevice;
84import com.jogamp.opengl.JoglVersion;
99 private static final boolean DEBUG = Debug.debug(
"GLCanvas");
113 private final RecursiveLock lock = LockFactory.createRecursiveLock();
114 private final GLDrawableHelper helper =
new GLDrawableHelper();
119 private volatile Rectangle clientAreaPixels, clientAreaWindow;
120 private volatile GLDrawableImpl drawable;
121 private volatile GLContextImpl context;
124 private final boolean useX11GTK;
125 private volatile long x11Window;
129 private int additionalCtxCreationFlags = 0;
133 private volatile boolean sendReshape;
135 private static String getThreadName() {
return Thread.currentThread().getName(); }
136 private static String toHexString(
final int v) {
return "0x"+Integer.toHexString(v); }
137 private static String toHexString(
final long v) {
return "0x"+Long.toHexString(v); }
142 private final Runnable initAction =
new Runnable() {
145 helper.init(
GLCanvas.this, !sendReshape);
154 private final Runnable displayAction =
new Runnable() {
158 helper.reshape(
GLCanvas.this, 0, 0, clientAreaPixels.width, clientAreaPixels.height);
166 private final Runnable makeCurrentAndDisplayOnGLAction =
new Runnable() {
169 final RecursiveLock _lock = lock;
173 helper.invokeGL(drawable, context, displayAction, initAction);
182 private final Runnable swapBuffersOnGLAction =
new Runnable() {
185 final RecursiveLock _lock = lock;
188 final boolean drawableOK =
null != drawable && drawable.isRealized();
189 if( drawableOK && !
GLCanvas.this.isDisposed() ) {
190 drawable.swapBuffers();
201 private final Runnable disposeOnEDTGLAction =
new Runnable() {
204 final RecursiveLock _lock = lock;
208 final boolean animatorPaused;
211 animatorPaused = animator.
pause();
213 animatorPaused =
false;
217 if(
null != context ) {
218 if( context.isCreated() ) {
221 helper.disposeGL(
GLCanvas.this, context,
true);
226 exceptionOnDisposeGL = gle;
232 Throwable exceptionOnUnrealize =
null;
233 if(
null != drawable ) {
235 drawable.setRealized(
false);
236 }
catch(
final Throwable re ) {
237 exceptionOnUnrealize = re;
242 Throwable exceptionOnDeviceClose =
null;
244 if( 0 != x11Window) {
249 }
catch (
final Throwable re) {
250 exceptionOnDeviceClose = re;
253 if (animatorPaused) {
258 if(
null != exceptionOnDisposeGL ) {
259 throw exceptionOnDisposeGL;
261 if(
null != exceptionOnUnrealize ) {
264 if(
null != exceptionOnDeviceClose ) {
273 private class DisposeGLEventListenerAction
implements Runnable {
275 private final boolean remove;
276 private DisposeGLEventListenerAction(
final GLEventListener listener,
final boolean remove) {
277 this.listener = listener;
278 this.remove =
remove;
283 final RecursiveLock _lock = lock;
287 listener = helper.disposeGLEventListener(
GLCanvas.this, drawable, context, listener,
remove);
316 parent.getDisplay().syncExec(
new Runnable() {
319 res[0] =
new GLCanvas( parent, style, caps, chooser );
344 super(parent, style | SWT.NO_BACKGROUND);
351 clientAreaWindow = getClientArea();
360 final long x11DeviceHandle = X11Util.openDisplay(swtDevice.
getConnection());
361 if( 0 == x11DeviceHandle ) {
362 throw new RuntimeException(
"Error creating display(EDT): "+swtDevice.
getConnection());
371 if(
null == capsReqUser) {
376 this.capsChooser = capsChooser;
388 setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE));
390 final Listener listener =
new Listener () {
392 public void handleEvent (
final Event event) {
393 switch (event.type) {
395 displayIfNoAnimatorNoCheck();
406 addListener (SWT.Resize, listener);
407 addListener (SWT.Paint, listener);
408 addListener (SWT.Dispose, listener);
413 helper.setSharedContext(this.context, sharedContext);
418 helper.setSharedAutoDrawable(
this, sharedAutoDrawable);
430 return clientAreaPixels.width;
435 return clientAreaPixels.height;
440 return "SWTCanvasUpstreamSurfaceHook[upstream: "+
GLCanvas.this.toString()+
", "+clientAreaPixels.width+
"x"+clientAreaPixels.height+
" [pixel], "+clientAreaWindow.width+
"x"+clientAreaWindow.height+
" [win]]";
450 public final NativeSurface getUpstreamSurface() {
456 final Rectangle oClientAreaPixels = clientAreaPixels;
459 if ( nClientAreaPixels !=
null &&
460 ( nClientAreaPixels.width != oClientAreaPixels.width || nClientAreaPixels.height != oClientAreaPixels.height )
462 clientAreaPixels = nClientAreaPixels;
463 clientAreaWindow = getClientArea();
465 final GLDrawableImpl _drawable = drawable;
466 final boolean drawableOK =
null != _drawable && _drawable.isRealized();
468 final long dh = drawableOK ? _drawable.getHandle() : 0;
469 System.err.println(getThreadName()+
": GLCanvas.sizeChanged: ("+Thread.currentThread().getName()+
"): "+nClientAreaPixels.x+
"/"+nClientAreaPixels.y+
" "+nClientAreaPixels.width+
"x"+nClientAreaPixels.height+
" - drawableHandle "+toHexString(dh));
472 if( ! _drawable.getChosenGLCapabilities().isOnscreen() ) {
473 final RecursiveLock _lock = lock;
476 final GLDrawableImpl _drawableNew = GLDrawableHelper.resizeOffscreenDrawable(_drawable, context, nClientAreaPixels.width, nClientAreaPixels.height);
477 if(_drawable != _drawableNew) {
479 drawable = _drawableNew;
493 private boolean isValidAndVisibleOnEDTActionResult;
494 private final Runnable isValidAndVisibleOnEDTAction =
new Runnable() {
497 isValidAndVisibleOnEDTActionResult = !
GLCanvas.this.isDisposed() &&
GLCanvas.this.isVisible();
500 private final boolean isValidAndVisibleOnEDT() {
501 synchronized(isValidAndVisibleOnEDTAction) {
502 runOnEDTIfAvail(
true, isValidAndVisibleOnEDTAction);
503 return isValidAndVisibleOnEDTActionResult;
509 if( !isValidAndVisibleOnEDT() ) {
512 return validateDrawableAndContextPostCheck();
515 private final boolean isDrawableAndContextValid() {
517 return null != drawable &&
null != context;
521 private final boolean validateDrawableAndContextPostCheck() {
523 final RecursiveLock _lock = lock;
526 if(
null == drawable) {
528 createDrawableImpl();
530 final GLDrawable _drawable = drawable;
531 if (
null != _drawable ) {
533 if(
null == context ) {
535 res = createContextImpl(_drawable);
544 System.err.println(getThreadName()+
": SWT.GLCanvas.validate "+toHexString(hashCode())+
": null drawable");
549 final boolean isDrawableNull =
null == drawable;
550 final boolean isDrawableRealized = !isDrawableNull ? drawable.isRealized() :
false;
551 System.err.println(getThreadName()+
": SWT.GLCanvas.validate.X "+toHexString(hashCode())+
": "+res+
", drawable[null "+isDrawableNull+
", realized "+isDrawableRealized+
"], has context "+(
null!=context));
558 private final void createDrawableImpl() {
559 final Rectangle nClientArea = clientAreaPixels;
560 if(0 >= nClientArea.width || 0 >= nClientArea.height) {
562 System.err.println(getThreadName()+
": SWT.GLCanvas.validate.X "+toHexString(hashCode())+
": drawable could not be created: size < 0x0");
566 final AbstractGraphicsDevice device = screen.
getDevice();
569 final long nativeWindowHandle;
571 final GraphicsConfigurationFactory factory = GraphicsConfigurationFactory.getFactory(device, capsRequested);
572 final AbstractGraphicsConfiguration cfg = factory.chooseGraphicsConfiguration(
573 capsRequested, capsRequested, capsChooser, screen, VisualIDHolder.VID_UNDEFINED);
575 System.err.println(getThreadName()+
": SWT.GLCanvas.X11 "+toHexString(hashCode())+
": factory: "+factory+
", chosen config: "+cfg);
578 throw new NativeWindowException(
"Error choosing GraphicsConfiguration creating window: "+
this);
580 final int visualID = cfg.getVisualID(VIDType.NATIVE);
581 if( VisualIDHolder.VID_UNDEFINED != visualID ) {
584 x11Window = SWTAccessor.createCompatibleX11ChildWindow(screen,
this, visualID, clientAreaPixels.width, clientAreaPixels.height);
585 nativeWindowHandle = x11Window;
587 throw new GLException(
"Could not choose valid visualID: "+toHexString(visualID)+
", "+
this);
590 nativeWindowHandle = SWTAccessor.getWindowHandle(
this);
591 if( SWTAccessor.isOSX ) {
592 final float reqPixelScale = DPIUtil.autoScaleUp(
this, 1f);
594 System.err.println(getThreadName()+
": SWT.GLCanvas.OSX "+toHexString(hashCode())+
": Scaling: devZoom "+DPIUtil.getDeviceZoom()+
", general "+DPIUtil.autoScaleUp(1f)+
", onWidged "+reqPixelScale);
596 if( reqPixelScale > 1f ) {
597 OSXUtil.SetWindowPixelScale(nativeWindowHandle, reqPixelScale);
601 final GLDrawableFactory glFactory = GLDrawableFactory.getFactory(capsRequested.
getGLProfile());
604 final ProxySurface proxySurface = glFactory.createProxySurface(device, screen.
getIndex(), nativeWindowHandle,
605 capsRequested, capsChooser, swtCanvasUpStreamHook);
607 final GLDrawableImpl _drawable = (GLDrawableImpl) glFactory.createGLDrawable(proxySurface);
608 _drawable.setRealized(
true);
609 if(!_drawable.isRealized()) {
612 System.err.println(getThreadName()+
": SWT.GLCanvas.validate.X "+proxySurface);
613 System.err.println(getThreadName()+
": SWT.GLCanvas.validate.X "+toHexString(hashCode())+
": Drawable could not be realized: "+_drawable);
617 System.err.println(getThreadName()+
": SWT.GLCanvas.validate "+proxySurface);
618 System.err.println(getThreadName()+
": SWT.GLCanvas.validate "+toHexString(hashCode())+
": Drawable created and realized: "+_drawable);
620 drawable = _drawable;
623 private boolean createContextImpl(
final GLDrawable drawable) {
624 final GLContext[] shareWith = {
null };
625 if( !helper.isSharedGLContextPending(shareWith) ) {
626 context = (GLContextImpl) drawable.createContext(shareWith[0]);
627 context.setContextCreationFlags(additionalCtxCreationFlags);
629 System.err.println(getThreadName()+
": SWT.GLCanvas.validate "+toHexString(hashCode())+
": Context created: has shared "+(
null != shareWith[0]));
634 System.err.println(getThreadName()+
": SWT.GLCanvas.validate "+toHexString(hashCode())+
": Context !created: pending share");
658 runInGLThread(disposeOnEDTGLAction);
662 private final void displayIfNoAnimatorNoCheck() {
663 if ( !helper.isAnimatorAnimatingOnOtherThread() ) {
664 if( isDrawableAndContextValid() || validateDrawableAndContextPostCheck() ) {
665 runInGLThread(makeCurrentAndDisplayOnGLAction);
677 runInGLThread(makeCurrentAndDisplayOnGLAction);
691 return clientAreaPixels.width;
696 return clientAreaPixels.height;
702 return null != _drawable ? _drawable.
isGLOriented() :
true;
707 helper.addGLEventListener(listener);
712 helper.addGLEventListener(idx, listener);
717 return helper.getGLEventListenerCount();
722 return helper.getGLEventListener(index);
727 return helper.areAllGLEventListenerInitialized();
732 return helper.getGLEventListenerInitState(listener);
737 helper.setGLEventListenerInitState(listener, initialized);
742 final DisposeGLEventListenerAction r =
new DisposeGLEventListenerAction(listener,
remove);
749 return helper.removeGLEventListener(listener);
767 return helper.getAnimator();
772 return helper.setExclusiveContextThread(t, context);
777 return helper.getExclusiveContextThread();
782 return helper.getAutoSwapBufferMode();
797 return additionalCtxCreationFlags;
803 return (
null == _context) ? null : _context.
getGL();
807 public boolean invoke(
final boolean wait,
final GLRunnable runnable)
throws IllegalStateException {
808 return helper.invoke(
this, wait, runnable);
812 public boolean invoke(
final boolean wait,
final List<GLRunnable> runnables)
throws IllegalStateException {
813 return helper.invoke(
this, wait, runnables);
818 helper.flushGLRunnables();
823 helper.setAnimator(arg0);
828 helper.setAutoSwapBufferMode(arg0);
833 final RecursiveLock _lock = lock;
837 GLDrawableHelper.switchContext(drawable, oldCtx, destroyPrevCtx, newCtx, additionalCtxCreationFlags);
838 context=(GLContextImpl)newCtx;
847 additionalCtxCreationFlags = arg0;
849 if(
null != _context) {
857 if (
null != _context) {
858 _context.
setGL(arg0);
866 final RecursiveLock _lock = lock;
869 if(drawable !=
null) {
870 final GLContext _ctx = drawable.createContext(shareWith);
895 return (_drawable !=
null) ? _drawable.
getFactory() :
null;
906 return (_drawable !=
null) ? _drawable.
getHandle() : 0;
918 return (_drawable !=
null) ? _drawable.
isRealized() :
false;
928 runInGLThread(swapBuffersOnGLAction);
962 private void runInGLThread(
final Runnable action) {
981 private void runOnEDTIfAvail(
final boolean wait,
final Runnable action) {
982 final Display d = isDisposed() ? null : getDisplay();
983 if(
null == d || d.isDisposed() || d.getThread() == Thread.currentThread() ) {
999 ",\n\t"+((
null!=_drawable)?_drawable.getClass().getName():
"null-drawable")+
1001 ",\n\thandle "+toHexString(
getHandle())+
1002 ",\n\tDrawable size "+dw+
"x"+dh+
1006 public static void main(
final String[] args) {
1007 System.err.println(VersionUtil.getPlatformInfo());
1008 System.err.println(GlueGenVersion.getInstance());
1015 final Display
display =
new Display();
1016 final Shell shell =
new Shell(
display);
1017 shell.setSize(128,128);
1018 shell.setLayout(
new FillLayout());
1025 final GL gl = drawable.
getGL();
1029 public void reshape(
final GLAutoDrawable drawable,
final int x,
final int y,
final int width,
final int height) {}
static void destroyX11Window(final AbstractGraphicsDevice device, final long x11Window)
static Rectangle getClientAreaInPixels(final Scrollable s)
Returns the unscaled Scrollable#getClientArea() in pixels.
static AbstractGraphicsDevice getDevice(final Control swtControl)
static AbstractGraphicsScreen getScreen(final AbstractGraphicsDevice device, final int screen)
static void resizeX11Window(final AbstractGraphicsDevice device, final Rectangle clientArea, final long x11Window)
static void setRealized(final Control swtControl, final boolean realize)
static boolean useX11GTK()
Encapsulates a graphics device on X11 platforms.
Specifies a set of OpenGL capabilities.
Abstraction for an OpenGL rendering context.
abstract void setContextCreationFlags(int flags)
abstract GL setGL(GL gl)
Sets the GL pipeline object for this GLContext.
abstract GL getGL()
Returns the GL pipeline object for this GLContext.
A generic exception for OpenGL errors used throughout the binding as a substitute for RuntimeExceptio...
static GLException newGLException(final Throwable t)
Constructs a GLException object with the specified root cause with a decorating message including the...
Specifies the the OpenGL profile.
static GLProfile getDefault(final AbstractGraphicsDevice device)
Returns a default GLProfile object, reflecting the best for the running platform.
static AbstractGraphicsDevice getDefaultDevice()
static void initSingleton()
Static initialization of JOGL.
static JoglVersion getInstance()
static StringBuilder getGLInfo(final GL gl, final StringBuilder sb)
static StringBuilder getDefaultOpenGLInfo(AbstractGraphicsDevice device, StringBuilder sb, final boolean withCapabilitiesInfo)
Native SWT Canvas implementing GLAutoDrawable.
GLEventListener removeGLEventListener(final GLEventListener listener)
Removes the given listener from this drawable queue.
final GLDrawable getDelegatedDrawable()
If the implementation uses delegation, return the delegated GLDrawable instance, otherwise return thi...
void setAutoSwapBufferMode(final boolean arg0)
Enables or disables automatic buffer swapping for this drawable.
GLProfile getGLProfile()
Fetches the GLProfile for this drawable.
boolean isRealized()
Returns true if this drawable is realized, otherwise false.
int getContextCreationFlags()
final RecursiveLock getUpstreamLock()
Returns the recursive lock object of the upstream widget to synchronize multithreaded access on top o...
GLContext setContext(final GLContext newCtx, final boolean destroyPrevCtx)
Associate the new context, newtCtx, to this auto-drawable.
void destroy()
Destroys all resources associated with this GLAutoDrawable, inclusive the GLContext....
static void main(final String[] args)
boolean invoke(final boolean wait, final GLRunnable runnable)
Enqueues a one-shot GLRunnable, which will be executed within the next display() call after all regis...
long getHandle()
Returns the GL drawable handle, guaranteed to be valid after realization and while it's surface is be...
GLCanvas(final Composite parent, final int style, final GLCapabilitiesImmutable capsReqUser, final GLCapabilitiesChooser capsChooser)
Creates a new SWT GLCanvas.
GLContext getContext()
Returns the context associated with this drawable.
NativeSurface getNativeSurface()
Returns the associated NativeSurface of this NativeSurfaceHolder.Returns the underlying NativeSurface...
void setGLEventListenerInitState(final GLEventListener listener, final boolean initialized)
Sets the given listener's initialized state.
boolean areAllGLEventListenerInitialized()
Returns true if all added GLEventListener are initialized, otherwise false.
void addGLEventListener(final int idx, final GLEventListener listener)
Adds the given listener at the given index of this drawable queue.
int getGLEventListenerCount()
Returns the number of GLEventListener of this drawable queue.
int getSurfaceWidth()
Returns the width of this GLDrawable's surface client area in pixel units.
GLEventListener disposeGLEventListener(final GLEventListener listener, final boolean remove)
Disposes the given listener via dispose(..) if it has been initialized and added to this queue.
boolean invoke(final boolean wait, final List< GLRunnable > runnables)
Extends invoke(boolean, GLRunnable) functionality allowing to inject a list of GLRunnables.
boolean isGLOriented()
Returns true if the drawable is rendered in OpenGL's coordinate system, origin at bottom left.
static GLCanvas create(final Composite parent, final int style, final GLCapabilitiesImmutable caps, final GLCapabilitiesChooser chooser)
Creates an instance using GLCanvas(Composite, int, GLCapabilitiesImmutable, GLCapabilitiesChooser) on...
GL setGL(final GL arg0)
Sets the GL pipeline object this GLAutoDrawable uses.
GLEventListener getGLEventListener(final int index)
Returns the GLEventListener at the given index of this drawable queue.
void setRealized(final boolean arg0)
Indicates to GLDrawable implementations whether the underlying surface has been created and can be dr...
GLCapabilitiesImmutable getRequestedGLCapabilities()
Fetches the GLCapabilitiesImmutable corresponding to the user requested OpenGL capabilities (pixel fo...
final Object getUpstreamWidget()
Method may return the upstream UI toolkit object holding this GLAutoDrawable instance,...
final Thread getExclusiveContextThread()
GLCapabilitiesImmutable getChosenGLCapabilities()
Fetches the GLCapabilitiesImmutable corresponding to the chosen OpenGL capabilities (pixel format / v...
final void updateSizeCheck()
boolean getAutoSwapBufferMode()
Indicates whether automatic buffer swapping is enabled for this drawable.
int getSurfaceHeight()
Returns the height of this GLDrawable's surface client area in pixel units.
boolean getGLEventListenerInitState(final GLEventListener listener)
Retrieves whether the given listener is initialized or not.
void flushGLRunnables()
Flushes all enqueued GLRunnable of this GLAutoDrawable including notifying waiting executor.
final void setSharedAutoDrawable(final GLAutoDrawable sharedAutoDrawable)
Specifies an GLAutoDrawable, which OpenGL context shall be shared by this GLAutoDrawable's GLContext.
final boolean isThreadGLCapable()
Indicates whether the current thread is capable of performing OpenGL-related work....
final Thread setExclusiveContextThread(final Thread t)
Dedicates this instance's GLContext to the given thread.
void addGLEventListener(final GLEventListener listener)
Adds the given listener to the end of this drawable queue.
final void setSharedContext(final GLContext sharedContext)
Specifies an OpenGL context, which shall be shared by this GLAutoDrawable's GLContext.
void dispose()
@Override public boolean forceFocus() { final boolean r = super.forceFocus(); if(r && 0 !...
GLContext createContext(final GLContext shareWith)
Creates a new context for drawing to this drawable that will optionally share buffer objects,...
GLAnimatorControl getAnimator()
final boolean validateDrawableAndContextWithCheck()
assumes drawable == null (implying !drawable.isRealized()) ! Checks of !isDispose() and isVisible()
void swapBuffers()
Swaps the front and back buffers of this drawable.
void setContextCreationFlags(final int arg0)
GLDrawableFactory getFactory()
Return the GLDrawableFactory being used to create this instance.
void setAnimator(final GLAnimatorControl arg0)
Registers the usage of an animator, an com.jogamp.opengl.GLAnimatorControl implementation.
GL getGL()
Returns the GL pipeline object this GLAutoDrawable uses.
A interface describing a graphics device in a toolkit-independent manner.
boolean close()
Optionally closing the device if handle is not null.
boolean open()
Optionally [re]opening the device if handle is null.
static int DEFAULT_UNIT
Default unit id for the 1st device: 0.
String getConnection()
Returns the semantic GraphicsDevice connection.
A interface describing a graphics screen in a toolkit-independent manner.
int getIndex()
Returns the screen index this graphics screen is valid for.
AbstractGraphicsDevice getDevice()
Return the device this graphics configuration is valid for.
Provides low-level information required for hardware-accelerated rendering using a surface in a platf...
Provides a mutable NativeSurface, i.e.
Interface allowing upstream caller to pass lifecycle actions and size info to a ProxySurface instance...
An animator control interface, which implementation may drive a com.jogamp.opengl....
boolean resume()
Resumes animation if paused.
boolean pause()
Pauses this animator.
A higher-level abstraction than GLDrawable which supplies an event based mechanism (GLEventListener) ...
GL getGL()
Returns the GL pipeline object this GLAutoDrawable uses.
Provides a mechanism by which applications can customize the window type selection for a given GLCapa...
Specifies an immutable set of OpenGL capabilities.
GLProfile getGLProfile()
Returns the GL profile you desire or used by the drawable.
An abstraction for an OpenGL rendering target.
GLCapabilitiesImmutable getChosenGLCapabilities()
Fetches the GLCapabilitiesImmutable corresponding to the chosen OpenGL capabilities (pixel format / v...
int getSurfaceWidth()
Returns the width of this GLDrawable's surface client area in pixel units.
GLCapabilitiesImmutable getRequestedGLCapabilities()
Fetches the GLCapabilitiesImmutable corresponding to the user requested OpenGL capabilities (pixel fo...
long getHandle()
Returns the GL drawable handle, guaranteed to be valid after realization and while it's surface is be...
boolean isRealized()
Returns true if this drawable is realized, otherwise false.
boolean isGLOriented()
Returns true if the drawable is rendered in OpenGL's coordinate system, origin at bottom left.
NativeSurface getNativeSurface()
Returns the associated NativeSurface of this NativeSurfaceHolder.
GLDrawableFactory getFactory()
Return the GLDrawableFactory being used to create this instance.
int getSurfaceHeight()
Returns the height of this GLDrawable's surface client area in pixel units.
Declares events which client code can use to manage OpenGL rendering into a GLAutoDrawable.
Adds capabilities to set a shared GLContext directly or via an GLAutoDrawable.