29package com.jogamp.opengl;
31import com.jogamp.nativewindow.AbstractGraphicsDevice;
32import com.jogamp.nativewindow.NativeSurface;
33import com.jogamp.nativewindow.WindowClosingProtocol;
34import com.jogamp.nativewindow.WindowClosingProtocol.WindowClosingMode;
35import com.jogamp.opengl.GLAutoDrawable;
36import com.jogamp.opengl.GLContext;
37import com.jogamp.opengl.GLDrawable;
38import com.jogamp.opengl.GLDrawableFactory;
39import com.jogamp.opengl.GLEventListener;
40import com.jogamp.opengl.GLException;
41import com.jogamp.opengl.GLSharedContextSetter;
43import com.jogamp.common.util.locks.LockFactory;
44import com.jogamp.common.util.locks.RecursiveLock;
46import jogamp.opengl.GLAutoDrawableBase;
47import jogamp.opengl.GLContextImpl;
48import jogamp.opengl.GLDrawableImpl;
95 super((GLDrawableImpl)drawable, (GLContextImpl)context, ownDevice);
96 if(
null == drawable) {
97 throw new IllegalArgumentException(
"null drawable");
99 this.upstreamWidget = upstreamWidget;
100 this.lock = (
null != lock ) ? lock : LockFactory.createRecursiveLock() ;
109 super.defaultWindowRepaintOp();
129 super.defaultWindowResizedOp(newWidth, newHeight);
142 super.defaultWindowDestroyNotifyOp();
149 private Object upstreamWidget;
150 private final RecursiveLock lock;
157 return upstreamWidget;
165 upstreamWidget = newUpstreamWidget;
185 super.destroyImplInLock();
204 defaultSwapBuffers();
209 return getClass().getSimpleName()+
"[ \n\tHelper: " + helper +
", \n\tDrawable: " + drawable +
210 ", \n\tContext: " + context +
", \n\tUpstreamWidget: "+upstreamWidget+
"]";
Fully functional GLAutoDrawable implementation utilizing already created GLDrawable and GLContext ins...
final void swapBuffers()
Swaps the front and back buffers of this drawable.
final GLDrawableFactory getFactory()
Return the GLDrawableFactory being used to create this instance.
final Object getUpstreamWidget()
Method may return the upstream UI toolkit object holding this GLAutoDrawable instance,...
final void windowResizedOp(final int newWidth, final int newHeight)
Handling resize events from the windowing system.
final void windowDestroyNotifyOp()
Implementation to handle destroy notifications from the windowing system.
GLAutoDrawableDelegate(final GLDrawable drawable, final GLContext context, final Object upstreamWidget, final boolean ownDevice, final RecursiveLock lock)
final void windowRepaintOp()
Default implementation to handle repaint events from the windowing system.
final void setUpstreamWidget(final Object newUpstreamWidget)
Set the upstream UI toolkit object.
final RecursiveLock getUpstreamLock()
Returns the recursive lock object of the upstream widget to synchronize multithreaded access on top o...
final void destroy()
Destroys all resources associated with this GLAutoDrawable, inclusive the GLContext....
Abstraction for an OpenGL rendering context.
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...
A higher-level abstraction than GLDrawable which supplies an event based mechanism (GLEventListener) ...
An abstraction for an OpenGL rendering target.