From d90855bfc457a703d7a8fe14598f4d5e8de7e73e Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 26 Mar 2013 12:42:04 +0100 Subject: GLJPanel: Refine API doc --- .../classes/javax/media/opengl/awt/GLJPanel.java | 23 ++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'src/jogl/classes/javax') diff --git a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java index ed0fadfa9..f1a2ccc7e 100644 --- a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java +++ b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java @@ -109,16 +109,23 @@ import com.jogamp.opengl.util.GLPixelStorageModes; using {@link GLDrawableFactory#createOffscreenDrawable(AbstractGraphicsDevice, GLCapabilitiesImmutable, GLCapabilitiesChooser, int, int) GLDrawableFactory.createOffscreenDrawable(..)}.

- The OpenGL rendered pixels are copied to an {@link BufferedImage} via {@link GL#glReadPixels(int, int, int, int, int, int, java.nio.Buffer) glReadPixels(..)} - which is drawn to the Swing space via {@link Graphics#drawImage(java.awt.Image, int, int, int, int, java.awt.image.ImageObserver) Graphics.drawImage(...)}. -

-

- If FBO is being used and GLSL is available, a fragment shader is utilized - to flip the OpenGL pixels vertically before glReadPixels(..), - if not disabled via system property jogl.gljpanel.noglsl.
- Otherwise {@link System#arraycopy(Object, int, Object, int, int) System.arraycopy(..)} is used line by line, causing more CPU load per frame. + In case FBO is used and GLSL is available, a fragment shader is utilized + to flip the FBO texture vertically. This hardware-accelerated step can be disabled via system property jogl.gljpanel.noglsl.

+ The OpenGL path is concluded by copying the rendered pixels an {@link BufferedImage} via {@link GL#glReadPixels(int, int, int, int, int, int, java.nio.Buffer) glReadPixels(..)} + for later Java2D composition. +

+

+ In case the above mentioned GLSL vertical-flipping is not performed, + {@link System#arraycopy(Object, int, Object, int, int) System.arraycopy(..)} is used line by line. + This step causes more CPU load per frame and is not hardware-accelerated. +

+

+ Finally the Java2D compositioning takes place via via {@link Graphics#drawImage(java.awt.Image, int, int, int, int, java.awt.image.ImageObserver) Graphics.drawImage(...)} + on the prepared {@link BufferedImage} as described above. +

+

* Please read Java2D OpenGL Remarks. *

*/ -- cgit v1.2.3