aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/games/jogl/GLAutoDrawable.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2005-07-17 06:13:24 +0000
committerKenneth Russel <[email protected]>2005-07-17 06:13:24 +0000
commit7e7e225eaf4fddb31152ab204bf1776f26079d40 (patch)
tree522044c1fb226235fa34b9d013945f320765edd8 /src/net/java/games/jogl/GLAutoDrawable.java
parent9d28b7f7fffdaeee7353945000546cb73a00157b (diff)
Further context-related changes for the JSR-231 API. The GLContext
implementations on all platforms have been split into orthogonal GLDrawable and GLContext concepts. It is now possible to create more than one GLContet per GLDrawable (though this has not been tested yet). GLCanvas has been reimplemented in terms of GLDrawableFactory.getGLDrawable(). More functionality has been moved from GLDrawable to GLAutoDrawable. Reimplemented lazy sending of reshape GLEventListener events in GLCanvas and GLJPanel and deleted notion of deferred reshapes from GLDrawableHelper and elsewhere. Sharing of textures and display lists is now expressed in terms of GLContexts instead of GLDrawables. Still need to move pbuffer creation into GLDrawableFactory from the onscreen GLContext implementations. Added option to gleem ExaminerViewer to disable automatic redraws upon mouse events and respecified more of gleem to work on GLAutoDrawables rather than GLDrawables. Updated all JOGL demos to work with new APIs and slightly different initialization sequences (in particular, for pbuffers -- this will change with the addition of GLDrawableFactory.createGLPbuffer()). git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JSR-231@324 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/net/java/games/jogl/GLAutoDrawable.java')
-rwxr-xr-xsrc/net/java/games/jogl/GLAutoDrawable.java68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/net/java/games/jogl/GLAutoDrawable.java b/src/net/java/games/jogl/GLAutoDrawable.java
index 2b7528069..d9afd4599 100755
--- a/src/net/java/games/jogl/GLAutoDrawable.java
+++ b/src/net/java/games/jogl/GLAutoDrawable.java
@@ -40,6 +40,12 @@
package net.java.games.jogl;
public interface GLAutoDrawable extends GLDrawable, ComponentEvents {
+ /**
+ * Returns the context associated with this drawable. The returned
+ * context will be synchronized.
+ */
+ public GLContext getContext();
+
/** Adds a {@link GLEventListener} to this drawable. If multiple
listeners are added to a given drawable, they are notified of
events in an arbitrary order. */
@@ -51,4 +57,66 @@ public interface GLAutoDrawable extends GLDrawable, ComponentEvents {
guaranteed that all other listeners will be evaluated properly
during this update cycle. */
public void removeGLEventListener(GLEventListener listener);
+
+ /** Causes OpenGL rendering to be performed for this GLAutoDrawable
+ by calling {@link GLEventListener#display} for all registered
+ {@link GLEventListener}s. Called automatically by the window
+ system toolkit upon receiving a repaint() request. this routine
+ may be called manually for better control over the rendering
+ process. It is legal to call another GLAutoDrawable's display
+ method from within {@link GLEventListener#display}. */
+ public void display();
+
+ /** Enables or disables automatic buffer swapping for this drawable.
+ By default this property is set to true; when true, after all
+ GLEventListeners have been called for a display() event, the
+ front and back buffers are swapped, displaying the results of
+ the render. When disabled, the user is responsible for calling
+ {@link #swapBuffers} manually. */
+ public void setAutoSwapBufferMode(boolean onOrOff);
+
+ /** Indicates whether automatic buffer swapping is enabled for this
+ drawable. See {@link #setAutoSwapBufferMode}. */
+ public boolean getAutoSwapBufferMode();
+
+ /** Returns the {@link GL} pipeline object this GLDrawable uses. If
+ this method is called outside of the {@link GLEventListener}'s
+ callback methods (init, display, etc.) it may return null. Users
+ should not rely on the identity of the returned GL object; for
+ example, users should not maintain a hash table with the GL
+ object as the key. Additionally, the GL object should not be
+ cached in client code, but should be re-fetched from the
+ GLDrawable at the beginning of each call to init, display,
+ etc. */
+ public GL getGL();
+
+ /** Sets the {@link GL} pipeline object this GLDrawable uses. This
+ should only be called from within the GLEventListener's callback
+ methods, and usually only from within the init() method, in
+ order to install a composable pipeline. See the JOGL demos for
+ examples. */
+ public void setGL(GL gl);
+
+ /** Returns the {@link GLU} pipeline object this GLDrawable uses. */
+ public GLU getGLU();
+
+ /** Sets the {@link GLU} pipeline object this GLDrawable uses. */
+ public void setGLU(GLU glu);
+
+ /** Indicates whether this drawable is capable of fabricating a
+ subordinate offscreen drawable for advanced rendering techniques
+ which require offscreen hardware-accelerated surfaces. Note that
+ this method is only guaranteed to return a correct result once
+ your GLEventListener's init() method has been called. */
+ public boolean canCreateOffscreenDrawable();
+
+ /** Creates a subordinate offscreen drawable (pbuffer) for this
+ drawable. This routine should only be called if {@link
+ #canCreateOffscreenDrawable} returns true. The passed
+ capabilities are matched according to the platform-dependent
+ pbuffer format selection algorithm, which currently can not be
+ overridden. */
+ public GLPbuffer createOffscreenDrawable(GLCapabilities capabilities,
+ int initialWidth,
+ int initialHeight);
}