aboutsummaryrefslogtreecommitdiffstats
path: root/gl4java/drawable/GLDrawable.java
diff options
context:
space:
mode:
Diffstat (limited to 'gl4java/drawable/GLDrawable.java')
-rw-r--r--gl4java/drawable/GLDrawable.java55
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
*/