diff options
author | Sven Gothel <[email protected]> | 2001-07-24 12:07:18 +0000 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2001-07-24 12:07:18 +0000 |
commit | 3583101e586a6fe3306f84d4d34ee764596e0632 (patch) | |
tree | d5c228654f882fa0f0c6214e6d4866ce44181b89 /gl4java/drawable/GLDrawable.java | |
parent | c9eae90cb823d918ecc4bf5afa73ce3a0859d578 (diff) |
optimized context switchingrel-2-8-0-0-prerelease-3
Diffstat (limited to 'gl4java/drawable/GLDrawable.java')
-rw-r--r-- | gl4java/drawable/GLDrawable.java | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/gl4java/drawable/GLDrawable.java b/gl4java/drawable/GLDrawable.java index a0818c0..55c1311 100644 --- a/gl4java/drawable/GLDrawable.java +++ b/gl4java/drawable/GLDrawable.java @@ -31,6 +31,61 @@ public interface GLDrawable public GLContext getGLContext();
/**
+ *
+ * This is the rendering-method called by
+ * e.g.: {@link gl4java.awt.GLCanvas#display} or by
+ * {@link gl4java.GLThread#run}.
+ *
+ * <p>
+ * The default implementation of display() sends
+ * preDisplay, display and postDisplay events to
+ * all {@link gl4java.drawable.GLEventListener}s associated with this
+ * GLDrawable in the above order.
+ *
+ * <p>
+ * <pre>
+ reset timer for frame duration
+
+ for_all(gl4java.drawable.GLEventListener)
+ SEND preDisplay
+
+ if( gljMakeCurrent() )
+ {
+ for_all(gl4java.drawable.GLEventListener)
+ SEND display
+ gljSwap()
+ gljFree()
+
+ for_all(gl4java.drawable.GLEventListener)
+ SEND postDisplay
+ }
+
+ stop timer for frame duration
+ * </pre>
+ *
+ * <p>
+ * If you use the subclassing model (as opposed to the
+ * GLEventListener model), your subclass will redefine this to
+ * perform its OpenGL drawing. In this case you MUST encapsulate
+ * your OpenGL calls within:
+ * <pre>
+ - glj.gljMakeCurrent()
+ YOUR OpenGL commands here !
+ - glj.gljFree()
+ * </pre>
+ *
+ * @return void
+ *
+ * @see gl4java.GLContext#gljMakeCurrent
+ * @see gl4java.GLContext#gljFree
+ * @see gl4java.GLContext#gljSwap
+ * @see gl4java.drawable.GLEventListener#preDisplay
+ * @see gl4java.drawable.GLEventListener#display
+ * @see gl4java.drawable.GLEventListener#postDisplay
+ */
+ public void display();
+
+ /**
* the components listener's should be implemented also !
* since JDK 1.1
*/
|