35package com.jogamp.newt.opengl;
37import java.security.PrivilegedAction;
40import com.jogamp.nativewindow.AbstractGraphicsConfiguration;
41import com.jogamp.nativewindow.CapabilitiesChooser;
42import com.jogamp.nativewindow.CapabilitiesImmutable;
43import com.jogamp.nativewindow.NativeSurface;
44import com.jogamp.nativewindow.NativeWindow;
45import com.jogamp.nativewindow.NativeWindowException;
46import com.jogamp.nativewindow.SurfaceUpdatedListener;
47import com.jogamp.nativewindow.util.InsetsImmutable;
48import com.jogamp.nativewindow.util.Point;
49import com.jogamp.nativewindow.util.Rectangle;
50import com.jogamp.opengl.FPSCounter;
51import com.jogamp.opengl.GL;
52import com.jogamp.opengl.GL3;
53import com.jogamp.opengl.GL4ES3;
54import com.jogamp.opengl.GLAnimatorControl;
55import com.jogamp.opengl.GLAutoDrawable;
56import com.jogamp.opengl.GLCapabilities;
57import com.jogamp.opengl.GLCapabilitiesImmutable;
58import com.jogamp.opengl.GLContext;
59import com.jogamp.opengl.GLDrawable;
60import com.jogamp.opengl.GLDrawableFactory;
61import com.jogamp.opengl.GLES2;
62import com.jogamp.opengl.GLES3;
63import com.jogamp.opengl.GLEventListener;
64import com.jogamp.opengl.GLException;
65import com.jogamp.opengl.GLProfile;
66import com.jogamp.opengl.GLRunnable;
67import com.jogamp.opengl.GLSharedContextSetter;
69import jogamp.common.os.PlatformPropsImpl;
70import jogamp.newt.WindowImpl;
71import jogamp.opengl.GLAutoDrawableBase;
72import jogamp.opengl.GLContextImpl;
73import jogamp.opengl.GLDrawableImpl;
75import com.jogamp.common.GlueGenVersion;
76import com.jogamp.common.os.Clock;
77import com.jogamp.common.util.SecurityUtil;
78import com.jogamp.common.util.VersionUtil;
79import com.jogamp.common.util.locks.RecursiveLock;
80import com.jogamp.newt.MonitorDevice;
81import com.jogamp.newt.NewtFactory;
82import com.jogamp.newt.Screen;
83import com.jogamp.newt.Window;
84import com.jogamp.newt.Display.PointerIcon;
85import com.jogamp.newt.event.GestureHandler;
86import com.jogamp.newt.event.KeyListener;
87import com.jogamp.newt.event.MouseListener;
88import com.jogamp.newt.event.NEWTEvent;
89import com.jogamp.newt.event.NEWTEventConsumer;
90import com.jogamp.newt.event.NEWTEventListener;
91import com.jogamp.newt.event.WindowAdapter;
92import com.jogamp.newt.event.WindowEvent;
93import com.jogamp.newt.event.WindowListener;
94import com.jogamp.newt.event.WindowUpdateEvent;
95import com.jogamp.opengl.JoglVersion;
96import com.jogamp.opengl.GLStateKeeper;
122 private final WindowImpl window;
128 super(
null,
null,
false );
129 this.window = (WindowImpl) window;
133 defaultWindowDestroyNotifyOp();
138 defaultWindowRepaintOp();
157 return window.getLock();
218 return window.getDefaultCloseOperation();
223 return window.setDefaultCloseOperation(op);
232 return window.getStatePublicBitCount();
237 return window.getStatePublicBitmask();
242 return window.getStateMask();
247 return window.getStateMaskString();
252 return window.getSupportedStateMask();
257 return window.getSupportedStateMaskString();
262 return window.setCapabilitiesChooser(chooser);
273 return window.getRequestedCapabilities();
288 return window.getScreen();
293 return window.getMainMonitor();
298 window.setTitle(title);
303 return window.getTitle();
308 return window.isPointerVisible();
313 window.setPointerVisible(mouseVisible);
318 return window.getPointerIcon();
323 window.setPointerIcon(pi);
328 return window.isPointerConfined();
333 window.confinePointer(grab);
338 window.setUndecorated(value);
343 window.warpPointer(x, y);
347 return window.isUndecorated();
352 window.setAlwaysOnTop(value);
357 return window.isAlwaysOnTop();
362 window.setAlwaysOnBottom(value);
367 return window.isAlwaysOnBottom();
372 window.setResizable(value);
377 return window.isResizable();
382 window.setSticky(value);
387 return window.isSticky();
391 public final void setMaximized(
final boolean horz,
final boolean vert) {
392 window.setMaximized(horz, vert);
397 return window.isMaximizedVert();
402 return window.isMaximizedHorz();
407 window.setFocusAction(focusAction);
412 window.setKeyboardFocusHandler(l);
417 window.requestFocus();
422 window.requestFocus(wait);
427 return window.hasFocus();
432 return window.getInsets();
437 return window.getX();
442 return window.getY();
447 return window.getWidth();
452 return window.getHeight();
457 return window.getBounds();
462 return window.getSurfaceWidth();
467 return window.getSurfaceHeight();
472 return window.getSurfaceBounds();
477 return window.convertToWindowUnits(pixelUnitsAndResult);
482 return window.convertToPixelUnits(windowUnitsAndResult);
496 return window.setSurfaceScale(pixelScale);
501 return window.getRequestedSurfaceScale(result);
506 return window.getCurrentSurfaceScale(result);
511 return window.getMinimumSurfaceScale(result);
516 return window.getMaximumSurfaceScale(result);
521 return window.getPixelsPerMM(ppmmStore);
526 window.setPosition(x, y);
530 window.setTopLevelPosition(x, y);
535 return window.setFullscreen(fullscreen);
540 return window.setFullscreen(monitors);
545 return window.isFullscreen();
550 return window.isVisible();
555 sb.append(
"GLWindow[");
556 window.toSimpleString(sb).append(
"]");
564 public final StringBuilder
toString(
final StringBuilder sb) {
565 sb.append(
"GLWindow").append(
"[")
566 .append(PlatformPropsImpl.NEWLINE).append(
"\t").append(
"Helper: ").append(helper)
567 .append(
", ").append(PlatformPropsImpl.NEWLINE).append(
"\t").append(
"Drawable: ").append(drawable)
568 .append(
", ").append(PlatformPropsImpl.NEWLINE).append(
"\t").append(
"Context: ").append(context)
569 .append(
", ").append(PlatformPropsImpl.NEWLINE).append(
"\t").append(
"Window: ");
578 return toString(
new StringBuilder()).toString();
583 return window.reparentWindow(newParent, x, y, hints);
587 return window.isChildWindow();
592 return window.removeChild(win);
597 return window.addChild(win);
611 window.setWindowDestroyNotifyAction(r);
616 window.setVisible(visible);
620 public void setVisible(
final boolean wait,
final boolean visible) {
621 window.setVisible(wait, visible);
625 public final void setSize(
final int width,
final int height) {
626 window.setSize(width, height);
630 window.setSurfaceSize(pixelWidth, pixelHeight);
634 window.setTopLevelSize(width, height);
639 return window.isNativeValid();
644 return window.getLocationOnScreen(storage);
652 GLWindow.this.preserveGLStateAtDestroy(value);
663 final String msg =
"GLWindow.destroy() "+WindowImpl.getThreadName()+
", start";
664 System.err.println(msg);
672 System.err.println(
"GLWindow.destroy() "+WindowImpl.getThreadName()+
", fin");
679 System.err.println(
"GLWindow.resetCounter() "+WindowImpl.getThreadName());
683 if(
null != animator ) {
692 t0 = Clock.currentNanos();
693 System.err.println(
"GLWindow.setVisibleActionPost("+visible+
", "+nativeWindowCreated+
") "+WindowImpl.getThreadName()+
", start");
699 if( (
null != context ) ) {
700 throw new InternalError(
"GLWindow.LifecycleHook.setVisiblePost: "+WindowImpl.getThreadName()+
" - Null drawable, but valid context - "+
GLWindow.this);
703 if( !helper.isSharedGLContextPending(shareWith) ) {
707 ns =
null != wrapped_ns ? wrapped_ns : window;
716 if( !
GLWindow.this.restoreGLEventListenerState() ) {
717 context = (GLContextImpl) drawable.createContext(shareWith[0]);
718 context.setContextCreationFlags(additionalCtxCreationFlags);
723 System.err.println(
"GLWindow.setVisibleActionPost("+visible+
", "+nativeWindowCreated+
") "+WindowImpl.getThreadName()+
", fin: dt "+ (Clock.currentNanos()-t0)/1e6 +
"ms");
731 final boolean animatorPaused;
733 if (
null != savedAnimator ) {
734 animatorPaused = savedAnimator.
pause();
736 animatorPaused =
false;
738 return animatorPaused;
743 if (
null != savedAnimator && savedAnimator.
isPaused() ) {
748 @SuppressWarnings(
"deprecation")
753 final Thread animThread = anim.
getThread();
754 if( animThread == Thread.currentThread() ) {
757 SecurityUtil.doPrivileged(
new PrivilegedAction<Object>() {
759 public Object run() {
763 }
catch(
final Throwable t) {
765 System.err.println(
"Caught "+t.getClass().getName()+
": "+t.getMessage());
792 final RecursiveLock lock = window.getLock();
795 if(
null != context ) {
797 helper.invokeGL(drawable, context, defaultDisplayAction, defaultInitAction);
832 defaultSwapBuffers();
840 return window.consumeEvent(event);
847 public final boolean windowRepaint(
final int x,
final int y,
final int width,
final int height) {
848 return window.windowRepaint(x, y, width, height);
852 public final void enqueueEvent(
final boolean wait,
final com.jogamp.newt.event.NEWTEvent event) {
853 window.enqueueEvent(wait, event);
858 window.runOnEDTIfAvail(wait, task);
863 window.sendWindowEvent(eventType);
868 return window.getWindowListener(index);
873 return window.getWindowListeners();
878 window.removeWindowListener(l);
883 window.addWindowListener(l);
888 window.addWindowListener(index, l);
893 window.setKeyboardVisible(visible);
898 return window.isKeyboardVisible();
903 window.addKeyListener(l);
908 window.addKeyListener(index, l);
913 window.removeKeyListener(l);
918 return window.getKeyListener(index);
923 return window.getKeyListeners();
928 window.addMouseListener(l);
933 window.addMouseListener(index, l);
938 window.removeMouseListener(l);
943 return window.getMouseListener(index);
948 return window.getMouseListeners();
953 window.setDefaultGesturesEnabled(enable);
957 return window.areDefaultGesturesEnabled();
961 window.addGestureHandler(gh);
965 window.addGestureHandler(index, gh);
969 window.removeGestureHandler(gh);
973 window.addGestureListener(-1, gl);
977 window.addGestureListener(index, gl);
981 window.removeGestureListener(gl);
990 return window.getLock();
995 return window.lockSurface();
1000 window.unlockSurface();
1005 return window.isSurfaceLockedByOtherThread();
1010 return window.getSurfaceLockOwner();
1016 return window.surfaceSwap();
1021 window.removeSurfaceUpdatedListener(l);
1026 window.addSurfaceUpdatedListener(l);
1031 window.addSurfaceUpdatedListener(index, l);
1036 window.surfaceUpdated(updater, ns, when);
1041 return window.getWindowHandle();
1047 return window.getSurfaceHandle();
1053 return window.getGraphicsConfiguration();
1058 return window.getDisplayHandle();
1063 return window.getScreenIndex();
1069 public static void main(
final String args[]) {
1070 final boolean forceES2;
1071 final boolean forceES3;
1072 final boolean forceGL3;
1073 final boolean forceGL4ES3;
1075 boolean _forceES2 =
false;
1076 boolean _forceES3 =
false;
1077 boolean _forceGL3 =
false;
1078 boolean _forceGL4ES3 =
false;
1079 if(
null != args ) {
1080 for(
int i=0; i<args.length; i++) {
1081 if(args[i].equals(
"-es2")) {
1083 }
else if(args[i].equals(
"-es3")) {
1085 }
else if(args[i].equals(
"-gl3")) {
1087 }
else if(args[i].equals(
"-gl4es3")) {
1088 _forceGL4ES3 =
true;
1092 forceES2 = _forceES2;
1093 forceES3 = _forceES3;
1094 forceGL3 = _forceGL3;
1095 forceGL4ES3 = _forceGL4ES3;
1097 System.err.println(
"forceES2 "+forceES2);
1098 System.err.println(
"forceES3 "+forceES3);
1099 System.err.println(
"forceGL3 "+forceGL3);
1100 System.err.println(
"forceGL4ES3 "+forceGL4ES3);
1102 System.err.println(VersionUtil.getPlatformInfo());
1103 System.err.println(GlueGenVersion.getInstance());
1111 }
else if(forceGL3) {
1113 }
else if(forceES3) {
1115 }
else if(forceES2) {
1121 System.err.println(
"Requesting: "+caps);
1130 System.err.println(
"Main Monitor: "+monitor);
1132 System.err.println(
" pixel/mm ["+pixelPerMM[0]+
", "+pixelPerMM[1]+
"]");
1133 System.err.println(
" pixel/in ["+pixelPerMM[0]*25.4f+
", "+pixelPerMM[1]*25.4f+
"]");
1134 final GL gl = drawable.
getGL();
1138 System.err.println(
"GL impl. class "+gl.getClass().getName());
1141 System.err.println(
"GL4ES3 retrieved, impl. class "+_gl.getClass().getName());
1145 System.err.println(
"GL3 retrieved, impl. class "+_gl.getClass().getName());
1149 System.err.println(
"GLES3 retrieved, impl. class "+_gl.getClass().getName());
1153 System.err.println(
"GLES2 retrieved, impl. class "+_gl.getClass().getName());
1158 public void reshape(
final GLAutoDrawable drawable,
final int x,
final int y,
final int width,
final int height) {
A generic exception for OpenGL errors used throughout the binding as a substitute for RuntimeExceptio...
Visual output device, i.e.
final float[] getPixelsPerMM(final float[] ppmmStore)
Returns the pixels per millimeter value according to the current mode's surface resolution.
static Window createWindow(final CapabilitiesImmutable caps)
Create a top level Window entity on the default Display and default Screen.
A screen may span multiple MonitorDevices representing their combined virtual size.
NEWT events are provided for notification purposes ONLY; The NEWT will automatically handle the even...
NEWT Window events are provided for notification purposes ONLY.
synchronized void setVisibleActionPost(final boolean visible, final boolean nativeWindowCreated)
synchronized void resetCounter()
synchronized void destroyActionPreLock()
void preserveGLStateAtDestroy(final boolean value)
void shutdownRenderingAction()
synchronized boolean pauseRenderingAction()
synchronized void resumeRenderingAction()
synchronized void destroyActionInLock()
An implementation of GLAutoDrawable and Window interface, using a delegated Window instance,...
final void addKeyListener(final int index, final KeyListener l)
Inserts the given com.jogamp.newt.event.KeyListener at the specified position in the list.
final float[] getMaximumSurfaceScale(final float[] result)
Returns the maximum pixel scale of the associated NativeSurface.
final int getStateMask()
Returns the current status mask of this instance.
final void warpPointer(final int x, final int y)
Moves the pointer to x/y relative to this window's origin in pixel units.
void setTopLevelSize(final int width, final int height)
Sets the size of the top-level window including insets (window decorations) in window units.
final String toString()
Returns a full string multi-line representation of this instance using toString(StringBuilder).
final long getSurfaceHandle()
Returns the handle to the surface for this NativeSurface.
final void setPointerIcon(final PointerIcon pi)
final boolean isSurfaceLockedByOtherThread()
Query if surface is locked by another thread, i.e.
void setVisible(final boolean wait, final boolean visible)
setVisible(..) makes the window and children visible if visible is true, otherwise the window and chi...
final String getStateMaskString()
Returns a string representation of the current state mask.
Point getLocationOnScreen(final Point storage)
Returns the window's top-left client-area position in the screen.
final void enqueueEvent(final boolean wait, final com.jogamp.newt.event.NEWTEvent event)
final boolean isFullscreen()
final void requestFocus(final boolean wait)
Request focus for this native window.
void setKeyboardFocusHandler(final KeyListener l)
Sets a KeyListener allowing focus traversal with a covered window toolkit like AWT.
final boolean canSetSurfaceScale()
Returns true if setSurfaceScale(float[]) is supported, otherwise false.For pure downstream scalable s...
final RecursiveLock getUpstreamLock()
Returns the recursive lock object of the upstream widget to synchronize multithreaded access on top o...
final CapabilitiesImmutable getRequestedCapabilities()
Gets an immutable set of requested capabilities.
void setWindowDestroyNotifyAction(final Runnable r)
Set a custom action handling destruction issued by a toolkit triggered window destroy replacing the d...
final int lockSurface()
Lock the surface of this native window.
final NativeWindow getParent()
WindowClosingMode setDefaultCloseOperation(final WindowClosingMode op)
final void addGestureHandler(final int index, final GestureHandler gh)
Inserts the given GestureHandler at the specified position in the list.
final void swapBuffers()
Swaps the front and back buffers of this drawable.
final void removeGestureListener(final GestureHandler.GestureListener gl)
Removes the given GestureHandler.GestureListener from the list.
final int getSurfaceHeight()
Returns the height of this GLDrawable's surface client area in pixel units.
final void addGestureHandler(final GestureHandler gh)
Appends the given GestureHandler to the end of the list.
final void setPointerVisible(final boolean mouseVisible)
Makes the pointer visible or invisible.
final boolean isNativeValid()
final WindowListener[] getWindowListeners()
final void addMouseListener(final MouseListener l)
Appends the given MouseListener to the end of the list.
static void main(final String args[])
A most simple JOGL AWT test entry.
final long getDisplayHandle()
Convenience: Get display handle from AbstractGraphicsConfiguration .
final void setPosition(final int x, final int y)
Sets the location of the window's client area excluding insets (window decorations) in window units.
final ReparentOperation reparentWindow(final NativeWindow newParent, final int x, final int y, final int hints)
Change this window's parent window.
final boolean addChild(final NativeWindow win)
boolean setFullscreen(final List< MonitorDevice > monitors)
Enable fullscreen mode for this window spanning across the given MonitorDevices or across all Monitor...
final void setTitle(final String title)
final StringBuilder toSimpleString(final StringBuilder sb)
Appends this class simple string one-line representation to the given StringBuilder instance.
final void addGestureListener(final GestureHandler.GestureListener gl)
Appends the given GestureHandler.GestureListener to the end of the list.
final boolean isAlwaysOnBottom()
final Object getUpstreamWidget()
Method may return the upstream UI toolkit object holding this GLAutoDrawable instance,...
final float[] getPixelsPerMM(final float[] ppmmStore)
Returns the pixels per millimeter of this window's NativeSurface according to the main monitor's curr...
static GLWindow create(final Screen screen, final GLCapabilitiesImmutable caps)
Creates a new GLWindow attaching a new Window referencing the given Screen with the given GLCapabilit...
final boolean isChildWindow()
Returns true if this window is a child window, i.e.
final boolean isResizable()
final void setAlwaysOnTop(final boolean value)
final float[] getRequestedSurfaceScale(final float[] result)
Returns the requested pixel scale of the associated NativeSurface.
final boolean surfaceSwap()
Provide a mechanism to utilize custom (pre-) swap surface code.
final StringBuilder toString(final StringBuilder sb)
Appends this class full string multi-line representation to the given StringBuilder instance.
static GLWindow create(final Window window)
Creates a new GLWindow attaching the given window.
final void setMaximized(final boolean horz, final boolean vert)
final int getX()
Returns the current x position of this window, relative to it's parent.
final void removeSurfaceUpdatedListener(final SurfaceUpdatedListener l)
Remove the specified SurfaceUpdatedListener from the list.
final boolean isAlwaysOnTop()
final int getScreenIndex()
Convenience: Get display handle from AbstractGraphicsConfiguration .
final void setKeyboardVisible(final boolean visible)
In case the platform supports or even requires a virtual on-screen keyboard, this method shows or hid...
final void addKeyListener(final KeyListener l)
Appends the given com.jogamp.newt.event.KeyListener to the end of the list.
final KeyListener getKeyListener(final int index)
final boolean removeChild(final NativeWindow win)
final AbstractGraphicsConfiguration getGraphicsConfiguration()
Returns the graphics configuration corresponding to this window.
final boolean isUndecorated()
final GLDrawableFactory getFactory()
Return the GLDrawableFactory being used to create this instance.
final void removeWindowListener(final WindowListener l)
final int getY()
Returns the current y position of the top-left corner of the client area relative to it's parent in w...
final float[] getCurrentSurfaceScale(final float[] result)
Returns the current pixel scale of the associated NativeSurface.
final int getSurfaceWidth()
Returns the width of this GLDrawable's surface client area in pixel units.
final void setSize(final int width, final int height)
Sets the size of the window's client area in window units, excluding decorations.
final String getSupportedStateMaskString()
Returns a string representation of the supported state mask.
final void addGestureListener(final int index, final GestureHandler.GestureListener gl)
Inserts the given GestureHandler.GestureListener at the specified position in the list.
final int[] convertToWindowUnits(final int[] pixelUnitsAndResult)
Converts the given pixel units into window units in place.
final Rectangle getSurfaceBounds()
Returns a newly created Rectangle containing window's surface origin and size in pixel units.
final MonitorDevice getMainMonitor()
Returns the MonitorDevice with the highest viewport coverage of this window.
final boolean windowRepaint(final int x, final int y, final int width, final int height)
Trigger window repaint while passing the dirty region in pixel units.
final boolean setFullscreen(final boolean fullscreen)
Enable or disable fullscreen mode for this window.
final KeyListener[] getKeyListeners()
final String toSimpleString()
Returns a simple string one-line representation of this instance using toSimpleString(StringBuilder).
final int[] convertToPixelUnits(final int[] windowUnitsAndResult)
Converts the given window units into pixel units in place.
final void setAlwaysOnBottom(final boolean value)
final boolean isVisible()
final int getStatePublicBitCount()
Number of all public state bits.
final int getSupportedStateMask()
Returns the supported state mask of the implementation.
final void setVisible(final boolean visible)
Calls setVisible(true, visible), i.e.
final void unlockSurface()
Unlock the surface of this native window.
final void setSurfaceSize(final int pixelWidth, final int pixelHeight)
Sets the size of the window's surface in pixel units which claims the window's client area excluding ...
final PointerIcon getPointerIcon()
Returns the current PointerIcon, which maybe null for the default.
final Rectangle getBounds()
Returns a newly created Rectangle containing window origin, getX() & getY(), and size,...
final boolean isPointerConfined()
final void addWindowListener(final WindowListener l)
Appends the given com.jogamp.newt.event.WindowListener to the end of the list.
final void removeKeyListener(final KeyListener l)
final void setFocusAction(final FocusRunnable focusAction)
Sets a FocusRunnable, which FocusRunnable#run() method is executed before the native focus is request...
final void addSurfaceUpdatedListener(final SurfaceUpdatedListener l)
Appends the given SurfaceUpdatedListener to the end of the list.
final int getHeight()
Returns the height of the client area excluding insets (window decorations) in window units.
void setTopLevelPosition(final int x, final int y)
Sets the location of the top-level window inclusive insets (window decorations) in window units.
WindowClosingMode getDefaultCloseOperation()
final boolean isMaximizedHorz()
final void setSticky(final boolean value)
final CapabilitiesImmutable getChosenCapabilities()
Gets an immutable set of chosen capabilities.
void sendWindowEvent(final int eventType)
Send a WindowEvent to all WindowListener.
final void setResizable(final boolean value)
final boolean isPointerVisible()
final Thread getSurfaceLockOwner()
Return the locking owner's Thread, or null if not locked.
final void surfaceUpdated(final Object updater, final NativeSurface ns, final long when)
Notification of a surface update event, eg.
boolean hasFocus()
Returns true if this native window owns the focus, otherwise false.
final InsetsImmutable getInsets()
Returns the insets defined as the width and height of the window decoration on the left,...
final WindowListener getWindowListener(final int index)
final int getStatePublicBitmask()
Bitmask covering all public state bits.
CapabilitiesChooser setCapabilitiesChooser(final CapabilitiesChooser chooser)
Set the CapabilitiesChooser to help determine the native visual type.
final void setUndecorated(final boolean value)
boolean consumeEvent(final NEWTEvent event)
Consume the event.
final boolean isMaximizedVert()
final void removeMouseListener(final MouseListener l)
Removes the given MouseListener from the list.
RecursiveLock getLock()
Returns the implementation's RecursiveLock synchronizing multithreaded access if used.
final void addWindowListener(final int index, final WindowListener l)
Inserts the given com.jogamp.newt.event.WindowListener at the specified position in the list.
final boolean setSurfaceScale(final float[] pixelScale)
Request a pixel scale in x- and y-direction for the associated NativeSurface, where size_in_pixel_uni...
final void addMouseListener(final int index, final MouseListener l)
Inserts the given MouseListener at the specified position in the list.
final long getWindowHandle()
Returns the window handle for this NativeWindow.
final void removeGestureHandler(final GestureHandler gh)
Removes the given GestureHandler from the list.
void setDefaultGesturesEnabled(final boolean enable)
Enable or disable default GestureHandler.
final float[] getMinimumSurfaceScale(final float[] result)
Returns the minimum pixel scale of the associated NativeSurface.
static GLWindow create(final NativeWindow parentNativeWindow, final GLCapabilitiesImmutable caps)
Creates a new GLWindow attaching a new child Window of the given parentNativeWindow with the given GL...
final boolean isKeyboardVisible()
Return true if the virtual on-screen keyboard is visible, otherwise false.
final void destroy()
Destroys all resources associated with this GLAutoDrawable, inclusive the GLContext.
final int getWidth()
Returns the width of the client area excluding insets (window decorations) in window units.
final void runOnEDTIfAvail(final boolean wait, final Runnable task)
final Window getDelegatedWindow()
If the implementation uses delegation, return the delegated Window instance, otherwise return this in...
final void addSurfaceUpdatedListener(final int index, final SurfaceUpdatedListener l)
Inserts the given SurfaceUpdatedListener at the specified position in the list.
final MouseListener[] getMouseListeners()
Returns all MouseListener.
final void confinePointer(final boolean grab)
Confine the pointer to this window, ie.
final MouseListener getMouseListener(final int index)
Returns the MouseListener from the list at the given index.
final void requestFocus()
Request focus for this native window.
boolean areDefaultGesturesEnabled()
Return true if default GestureHandler are enabled.
GLWindow(final Window window)
Constructor.
final boolean isGLStatePreservationSupported()
static GLWindow create(final GLCapabilitiesImmutable caps)
Creates a new GLWindow attaching a new Window referencing a new default Screen and default Display wi...
Specifies a set of OpenGL capabilities.
Abstraction for an OpenGL rendering context.
abstract GLDrawable createGLDrawable(NativeSurface target)
Returns an unrealized GLDrawable according to it's chosen GLCapabilitiesImmutable,...
static GLDrawableFactory getFactory(final GLProfile glProfile)
Returns the sole GLDrawableFactory instance.
A generic exception for OpenGL errors used throughout the binding as a substitute for RuntimeExceptio...
Specifies the the OpenGL profile.
static final String GLES3
The embedded OpenGL profile ES 3.x, with x >= 0.
static final String GL3
The desktop OpenGL core profile 3.x, with x >= 1.
static final String GLES2
The embedded OpenGL profile ES 2.x, with x >= 0.
static GLProfile getDefault(final AbstractGraphicsDevice device)
Returns a default GLProfile object, reflecting the best for the running platform.
static GLProfile get(final AbstractGraphicsDevice device, String profile)
Returns a GLProfile object.
static final String GL4ES3
The intersection of the desktop GL4 and ES3 profile, available only if either ES3 or GL4 w/ GL_ARB_ES...
static JoglVersion getInstance()
static StringBuilder getGLInfo(final GL gl, final StringBuilder sb)
static StringBuilder getDefaultOpenGLInfo(AbstractGraphicsDevice device, StringBuilder sb, final boolean withCapabilitiesInfo)
Window closing mode if triggered by toolkit close operation.
Reparenting operation types.
A marker interface describing a graphics configuration, visual, or pixel format in a toolkit-independ...
CapabilitiesImmutable getChosenCapabilities()
Return the capabilities reflecting this graphics configuration, which may differ from the capabilitie...
CapabilitiesImmutable getRequestedCapabilities()
Return the capabilities used to choose this graphics configuration.
Provides a mechanism by which applications can customize the window type selection for a given Capabi...
Specifies an immutable set of capabilities that a window's rendering context must support,...
Provides low-level information required for hardware-accelerated rendering using a surface in a platf...
AbstractGraphicsConfiguration getGraphicsConfiguration()
Returns the graphics configuration corresponding to this window.
Extend the NativeSurface interface with windowing information such as window-handle,...
Clients may add their SurfaceUpdateListener implementation to a com.jogamp.nativewindow....
Immutable insets representing rectangular window decoration insets on all four edges in window units.
Native PointerIcon handle.
Specifying NEWT's Window functionality:
Window getDelegatedWindow()
If the implementation uses delegation, return the delegated Window instance, otherwise return this in...
void addWindowListener(WindowListener l)
Appends the given com.jogamp.newt.event.WindowListener to the end of the list.
static final boolean DEBUG_IMPLEMENTATION
void setWindowDestroyNotifyAction(Runnable r)
Set a custom action handling destruction issued by a toolkit triggered window destroy replacing the d...
Listener for GestureEvents.
Generic gesture handler interface designed to allow pass-through filtering of InputEvents.
Listener for MouseEvents.
NEWT WindowEvent listener.
void resetFPSCounter()
Reset all performance counter (startTime, currentTime, frame number)
An animator control interface, which implementation may drive a com.jogamp.opengl....
boolean isPaused()
Indicates whether this animator is started and either manually paused or paused automatically due to ...
boolean resume()
Resumes animation if paused.
boolean isAnimating()
Indicates whether this animator is started and is not paused.
boolean stop()
Stops this animator.
boolean pause()
Pauses this animator.
A higher-level abstraction than GLDrawable which supplies an event based mechanism (GLEventListener) ...
GLAnimatorControl getAnimator()
static final boolean SCREEN_CHANGE_ACTION_ENABLED
Flag reflecting whether the GLDrawable reconfiguration will be issued in case a screen device change ...
GL getGL()
Returns the GL pipeline object this GLAutoDrawable uses.
void addGLEventListener(GLEventListener listener)
Adds the given listener to the end of this drawable queue.
GL4ES3 getGL4ES3()
Casts this object to the GL4ES3 interface.
GL3 getGL3()
Casts this object to the GL3 interface.
boolean isGL3()
Indicates whether this GL object conforms to the OpenGL ≥ 3.1 core profile.
GLES2 getGLES2()
Casts this object to the GLES2 interface.
boolean isGLES3()
Indicates whether this GL object conforms to the OpenGL ES ≥ 3.0 profile.
boolean isGL4ES3()
Returns true if this GL object conforms to a GL4ES3 compatible profile, i.e.
GLES3 getGLES3()
Casts this object to the GLES3 interface.
boolean isGLES2()
Indicates whether this GL object conforms to the OpenGL ES ≥ 2.0 profile.
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...
NativeSurface getNativeSurface()
Returns the associated NativeSurface of this NativeSurfaceHolder.
void setRealized(boolean realized)
Indicates to GLDrawable implementations whether the underlying surface has been created and can be dr...
Declares events which client code can use to manage OpenGL rendering into a GLAutoDrawable.