diff options
author | Kenneth Russel <[email protected]> | 2005-07-17 06:13:30 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2005-07-17 06:13:30 +0000 |
commit | 6f2bdbacf131b05937925fbfe32ac0b603ccbcc6 (patch) | |
tree | c4b54e3602f91a90cfb0fbc7d14e01fa89a32ac8 /src/gleem/ExaminerViewer.java | |
parent | 15bc81d1e89d16e7f462f13acb554d4df27fa1b8 (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-demos/branches/JSR-231@103 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
Diffstat (limited to 'src/gleem/ExaminerViewer.java')
-rw-r--r-- | src/gleem/ExaminerViewer.java | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/src/gleem/ExaminerViewer.java b/src/gleem/ExaminerViewer.java index e60d4f7..f621ae7 100644 --- a/src/gleem/ExaminerViewer.java +++ b/src/gleem/ExaminerViewer.java @@ -78,6 +78,7 @@ public class ExaminerViewer { private boolean iOwnInteraction; private boolean noAltKeyMode; + private boolean autoRedrawMode; /** Simple state machine for computing distance dragged */ private boolean button1Down; @@ -300,6 +301,20 @@ public class ExaminerViewer { return noAltKeyMode; } + /** Enables or disables the automatic redrawing of the + GLAutoDrawable to which this ExaminerViewer is attached. If the + GLAutoDrawable is already being animated, disabling auto redraw + mode may provide better performance. Defaults to on. */ + public void setAutoRedrawMode(boolean onOrOff) { + autoRedrawMode = onOrOff; + } + + /** Returns whether this ExaminerViewer automatically redraws the + GLAutoDrawable to which it is attached upon updates. */ + public boolean getAutoRedrawMode() { + return autoRedrawMode; + } + /** Rotates this ExaminerViewer about the focal point by the specified incremental rotation; performs postmultiplication, i.e. the incremental rotation is applied after the current @@ -410,12 +425,10 @@ public class ExaminerViewer { } - // Force redraw - // FIXME: this can cause bad behavior (slowdowns, jittery - // rendering) if window is being automatically rendered; should - // have flag to disable auto redraw by the examiner viewer, - // since that API isn't present in the GLDrawable any more - window.display(); + if (autoRedrawMode) { + // Force redraw + window.display(); + } } } @@ -472,12 +485,10 @@ public class ExaminerViewer { iOwnInteraction = false; } - // Force redraw - // FIXME: this can cause bad behavior (slowdowns, jittery - // rendering) if window is being automatically rendered; should - // have flag to disable auto redraw by the examiner viewer, - // since that API isn't present in the GLDrawable any more - window.display(); + if (autoRedrawMode) { + // Force redraw + window.display(); + } } } |