From d90855bfc457a703d7a8fe14598f4d5e8de7e73e Mon Sep 17 00:00:00 2001
From: Sven Gothel
- 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