aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/javax/media/opengl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-09-04 16:23:32 +0200
committerSven Gothel <[email protected]>2013-09-04 16:23:32 +0200
commitb33bdf41cf53f37203643a8551bf5d94b42a8fab (patch)
tree3670c0e098eead832859e121b1b257b21a8e814e /src/jogl/classes/javax/media/opengl
parent8215886492eca47c036ed35861956290d2f3e898 (diff)
GLPixelBuffer*: Add componentCount==1 (ALPHA/RED), 'allowRowStride' utilization AWTGLPixelBuffer* -> GLPixelBuffer*
GLPixelBufferProvider: - Default*.getAttributes(): Add componentCount==1 (ALPHA/RED), validate values, throw exception if n/a or not supported - Add 'allowRowStride' (as for AWTGLPixelBufferProvider) - Add default for true and false GLPixelBuffer: - Add 'allowRowStride' (as for AWTGLPixelBuffer) - Fix requiresNewBuffer(..): - aquire minByteSize if passed one is <= 0 - validate minByteSize w/ currentByteSize according to allowRowStride. AWTGLPixelBuffer: 'allowRowStride' impl. moved to GLPixelBuffer.
Diffstat (limited to 'src/jogl/classes/javax/media/opengl')
-rw-r--r--src/jogl/classes/javax/media/opengl/awt/GLJPanel.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
index 2a23defbe..a8235d396 100644
--- a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
+++ b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
@@ -60,6 +60,7 @@ import javax.media.nativewindow.WindowClosingProtocol;
import javax.media.opengl.DefaultGLCapabilitiesChooser;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
+import javax.media.opengl.GL2ES3;
import javax.media.opengl.GL2GL3;
import javax.media.opengl.GLAnimatorControl;
import javax.media.opengl.GLAutoDrawable;
@@ -1048,8 +1049,8 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
OffscreenBackend(GLProfile glp, AWTGLPixelBufferProvider custom) {
if(null == custom) {
- pixelBufferProvider = glp.isGL2GL3() ? getSingleAWTGLPixelBufferProvider() :
- new AWTGLPixelBufferProvider( false /* allowRowStride */ ) ;
+ pixelBufferProvider = ( glp.isGL2GL3() || glp.isGL3ES3() ) ? getSingleAWTGLPixelBufferProvider() :
+ new AWTGLPixelBufferProvider( false /* allowRowStride */ ) ;
} else {
pixelBufferProvider = custom;
}
@@ -1248,10 +1249,10 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
// Save current modes
psm.setAlignment(gl, alignment, alignment);
- if(gl.isGL2GL3()) {
- final GL2GL3 gl2gl3 = gl.getGL2GL3();
- gl2gl3.glPixelStorei(GL2GL3.GL_PACK_ROW_LENGTH, pixelBuffer.width);
- gl2gl3.glReadBuffer(gl2gl3.getDefaultReadBuffer());
+ if(gl.isGL2ES3()) {
+ final GL2ES3 gl2es3 = gl.getGL2ES3();
+ gl2es3.glPixelStorei(GL2ES3.GL_PACK_ROW_LENGTH, pixelBuffer.width);
+ gl2es3.glReadBuffer(gl2es3.getDefaultReadBuffer());
}
if(null != glslTextureRaster) { // implies flippedVertical