aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/games/jogl/GLDrawable.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2005-07-10 23:17:43 +0000
committerKenneth Russel <[email protected]>2005-07-10 23:17:43 +0000
commit8a4e964a88703bcab4a8888b25ea9e997953180a (patch)
tree073e1a11d44a0f4cb407419c90f89aee0979403d /src/net/java/games/jogl/GLDrawable.java
parent6e8dd12319e2d6f702cf66728b177e6ea0152c2c (diff)
Initial set of context-related changes for the JSR-231 API. GLContext
has been exposed in the public API. The GLEventListener callback mechanism has been removed from the core GLContext implementation and moved up to a higher level. GLAutoDrawable now contains the GLEventListener-related methods, and the GLEventListener's methods now receive a GLAutoDrawable as argument. All JOGL demos have been updated for the new APIs. Many FIXMEs and much unimplemented functionality remain. There is slightly different initialization behavior for the demos containing pbuffers, and the deferring of reshape callbacks needs to be rethought. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JSR-231@320 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/net/java/games/jogl/GLDrawable.java')
-rw-r--r--src/net/java/games/jogl/GLDrawable.java84
1 files changed, 7 insertions, 77 deletions
diff --git a/src/net/java/games/jogl/GLDrawable.java b/src/net/java/games/jogl/GLDrawable.java
index 9ca86ca79..93fa6c580 100644
--- a/src/net/java/games/jogl/GLDrawable.java
+++ b/src/net/java/games/jogl/GLDrawable.java
@@ -39,8 +39,6 @@
package net.java.games.jogl;
-import java.awt.Dimension;
-
// FIXME: We need some way to tell when the device upon which the canvas is
// being displayed has changed (e.g., the user drags the canvas's parent
// window from one screen on multi-screen environment to another, when the
@@ -67,32 +65,16 @@ import java.awt.Dimension;
GLCanvas} and {@link GLJPanel}. */
public interface GLDrawable extends ComponentEvents {
- /** 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. */
- public void addGLEventListener(GLEventListener listener);
-
- /** Removes a {@link GLEventListener} from this drawable. Note that
- if this is done from within a particular drawable's {@link
- GLEventListener} handler (reshape, display, etc.) that it is not
- guaranteed that all other listeners will be evaluated properly
- during this update cycle. */
- public void removeGLEventListener(GLEventListener listener);
-
- /** Sets the size of this GLDrawable. */
+ /** Requests a new width and height for this GLDrawable. Not all
+ drawables are able to respond to this request and may silently
+ ignore it. */
public void setSize(int width, int height);
- /** Sets the size of this GLDrawable. */
- public void setSize(Dimension d);
-
- /** Returns the size of this GLDrawable as a newly-created Dimension
- object. */
- public Dimension getSize();
+ /** Returns the current width of this GLDrawable. */
+ public int getWidth();
- /** Stores the size of this GLDrawable into the user-provided
- Dimension object, returning that object. If the provided
- Dimension is null a new one will be allocated and returned. */
- public Dimension getSize(Dimension d);
+ /** Returns the current height of this GLDrawable. */
+ public int getHeight();
/** Returns the {@link GL} pipeline object this GLDrawable uses. If
this method is called outside of the {@link GLEventListener}'s
@@ -130,58 +112,6 @@ public interface GLDrawable extends ComponentEvents {
{@link GLEventListener#display}. */
public void display();
- /** <P> Changes this GLDrawable to allow OpenGL rendering only from
- the supplied thread, which must either be the current thread or
- null. Attempts by other threads to perform OpenGL operations
- like rendering or resizing the window will be ignored as long as
- the thread is set. Setting up the rendering thread is not
- required but enables the system to perform additional
- optimizations, in particular when the application requires
- control over the rendering loop. Before exiting,
- <code>setRenderingThread(null)</code> must be called or other
- threads will be unable to perform OpenGL rendering to this
- drawable. Throws {@link GLException} if the rendering thread for
- this drawable has been set and attempts are made to set or clear
- the rendering thread from another thread, or if the passed
- thread is not equal to the current thread or null. Also throws
- {@link GLException} if the current thread attempts to call
- <code>setRenderingThread</code> on more than one drawable. </P>
-
- <P> <B>NOTE:</B> Currently this routine is only advisory, which
- means that on some platforms the underlying optimizations are
- disabled and setting the rendering thread has no effect.
- Applications should not rely on setRenderingThread to prevent
- rendering from other threads. <P>
-
- @throws GLException if the rendering thread for this drawable has
- been set by another thread or if the passed thread is not equal
- to the current thread or null
- */
- public void setRenderingThread(Thread currentThreadOrNull) throws GLException;
-
- /** Returns the rendering thread for this drawable, or null if none
- has been set. */
- public Thread getRenderingThread();
-
- /** Disables automatic redraws of this drawable if possible. This is
- provided as an overriding mechanism for applications which
- perform animation on the drawable and for which the (currently
- advisory) {@link #setRenderingThread} does not provide strict
- enough guarantees. Its sole purpose is to avoid deadlocks that
- are unfortunately all too easy to run into when both animating a
- drawable from a given thread as well as having updates performed
- by the AWT event thread (repaints, etc.). When it is enabled,
- repaint requests driven by the AWT will not result in the OpenGL
- event listeners' display methods being called from the AWT
- thread, unless (as with GLJPanel) this is the only mechanism by
- which repaints are done. The necessity of this API may be
- rethought in a future release. Defaults to false. */
- public void setNoAutoRedrawMode(boolean noAutoRedraws);
-
- /** Returns whether automatic redraws are disabled for this
- drawable. Defaults to false. */
- public boolean getNoAutoRedrawMode();
-
/** 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