aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-10-12 14:40:33 +0200
committerSven Gothel <[email protected]>2014-10-12 14:40:33 +0200
commitf39e66e9c5137dacb556ce7a1edbdd3fb460b5e2 (patch)
treeeb6221e5e39cbaa1ebe303811dcf7e550e956d03 /src/jogl/classes
parente2d7816823039fc75be809d64b88a3d3af9cdca8 (diff)
Fix GLContext.Version* regression: Use Version1_1 and Version1_2 for 1.1 and 1.2 (Version110 and Version120 are for 1.10 and 1.20 GLSL)
Following commit introduced the wrong version usage, where a comparison w/ 1.1 and 1.2 was intended. Commit 6363fccee219ce238b0b2ded39c116e2bc8613d5 GLBuffers.sizeof(..): Add support for ES3, reading supported glPixelStorei states Commit 73a4d809f92126228b64a3bded75686db806be64 Don't utilize glPixelStorei's PACK/UNPACK IMAGE_HEIGHT and SKIP_IMAGES for Desktop GL < 1.2, avoiding GL-Error Commit f358c49418e95c622d50eb29f53c60dc4dbdee5b Bug 1047 - jogamp.opengl.glu.mipmap.Mipmap now uses already parsed GL version number and GL profile selection
Diffstat (limited to 'src/jogl/classes')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java28
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/GLPixelStorageModes.java4
-rw-r--r--src/jogl/classes/javax/media/opengl/GLContext.java12
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/mipmap/Mipmap.java2
4 files changed, 29 insertions, 17 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java b/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java
index d4ab4e4f4..b8088bd16 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java
@@ -372,29 +372,29 @@ public class GLBuffers extends Buffers {
int skipImages = 0;
if (pack) {
- alignment = glGetInteger(gl, GL.GL_PACK_ALIGNMENT, tmp);
+ alignment = glGetInteger(gl, GL.GL_PACK_ALIGNMENT, tmp); // es2, es3, gl3
if( gl.isGL2ES3() ) {
- rowLength = glGetInteger(gl, GL2ES3.GL_PACK_ROW_LENGTH, tmp);
- skipRows = glGetInteger(gl, GL2ES3.GL_PACK_SKIP_ROWS, tmp);
- skipPixels = glGetInteger(gl, GL2ES3.GL_PACK_SKIP_PIXELS, tmp);
- if (depth > 1 && gl.isGL2GL3() && gl.getContext().getGLVersionNumber().compareTo(GLContext.Version120) >= 0 ) {
- imageHeight = glGetInteger(gl, GL2GL3.GL_PACK_IMAGE_HEIGHT, tmp);
- skipImages = glGetInteger(gl, GL2GL3.GL_PACK_SKIP_IMAGES, tmp);
+ rowLength = glGetInteger(gl, GL2ES3.GL_PACK_ROW_LENGTH, tmp); // es3, gl3
+ skipRows = glGetInteger(gl, GL2ES3.GL_PACK_SKIP_ROWS, tmp); // es3, gl3
+ skipPixels = glGetInteger(gl, GL2ES3.GL_PACK_SKIP_PIXELS, tmp); // es3, gl3
+ if (depth > 1 && gl.isGL2GL3() && gl.getContext().getGLVersionNumber().compareTo(GLContext.Version1_2) >= 0 ) {
+ imageHeight = glGetInteger(gl, GL2GL3.GL_PACK_IMAGE_HEIGHT, tmp); // gl3, GL_VERSION_1_2
+ skipImages = glGetInteger(gl, GL2GL3.GL_PACK_SKIP_IMAGES, tmp); // gl3, GL_VERSION_1_2
}
}
} else {
- alignment = glGetInteger(gl, GL.GL_UNPACK_ALIGNMENT, tmp);
+ alignment = glGetInteger(gl, GL.GL_UNPACK_ALIGNMENT, tmp); // es2, es3, gl3
if( gl.isGL2ES3() ) {
- rowLength = glGetInteger(gl, GL2ES2.GL_UNPACK_ROW_LENGTH, tmp);
- skipRows = glGetInteger(gl, GL2ES2.GL_UNPACK_SKIP_ROWS, tmp);
- skipPixels = glGetInteger(gl, GL2ES2.GL_UNPACK_SKIP_PIXELS, tmp);
+ rowLength = glGetInteger(gl, GL2ES2.GL_UNPACK_ROW_LENGTH, tmp); // es3, gl3
+ skipRows = glGetInteger(gl, GL2ES2.GL_UNPACK_SKIP_ROWS, tmp); // es3, gl3
+ skipPixels = glGetInteger(gl, GL2ES2.GL_UNPACK_SKIP_PIXELS, tmp); // es3, gl3
if( depth > 1 &&
( gl.isGL3ES3() ||
- ( gl.isGL2GL3() && gl.getContext().getGLVersionNumber().compareTo(GLContext.Version120) >= 0 )
+ ( gl.isGL2GL3() && gl.getContext().getGLVersionNumber().compareTo(GLContext.Version1_2) >= 0 )
)
) {
- imageHeight = glGetInteger(gl, GL2ES3.GL_UNPACK_IMAGE_HEIGHT, tmp);
- skipImages = glGetInteger(gl, GL2ES3.GL_UNPACK_SKIP_IMAGES, tmp);
+ imageHeight = glGetInteger(gl, GL2ES3.GL_UNPACK_IMAGE_HEIGHT, tmp);// es3, gl3, GL_VERSION_1_2
+ skipImages = glGetInteger(gl, GL2ES3.GL_UNPACK_SKIP_IMAGES, tmp); // es3, gl3, GL_VERSION_1_2
}
}
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLPixelStorageModes.java b/src/jogl/classes/com/jogamp/opengl/util/GLPixelStorageModes.java
index 290033e99..7ac555f78 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLPixelStorageModes.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLPixelStorageModes.java
@@ -180,7 +180,7 @@ public class GLPixelStorageModes {
if( gl.isGL2GL3() ) {
gl.glPixelStorei(GL2GL3.GL_PACK_SWAP_BYTES, GL.GL_FALSE); // gl3
gl.glPixelStorei(GL2GL3.GL_PACK_LSB_FIRST, GL.GL_FALSE); // gl3
- if( gl.getContext().getGLVersionNumber().compareTo(GLContext.Version120) >= 0 ) {
+ if( gl.getContext().getGLVersionNumber().compareTo(GLContext.Version1_2) >= 0 ) {
gl.glPixelStorei(GL2GL3.GL_PACK_IMAGE_HEIGHT, 0); // gl3, GL_VERSION_1_2
gl.glPixelStorei(GL2GL3.GL_PACK_SKIP_IMAGES, 0); // gl3, GL_VERSION_1_2
}
@@ -251,7 +251,7 @@ public class GLPixelStorageModes {
gl.glPixelStorei(GL2ES2.GL_UNPACK_SKIP_ROWS, 0); // es3, gl3
gl.glPixelStorei(GL2ES2.GL_UNPACK_SKIP_PIXELS, 0); // es3, gl3
if( gl.isGL2GL3() ) {
- if( gl.getContext().getGLVersionNumber().compareTo(GLContext.Version120) >= 0 ) {
+ if( gl.getContext().getGLVersionNumber().compareTo(GLContext.Version1_2) >= 0 ) {
gl.glPixelStorei(GL2ES3.GL_UNPACK_IMAGE_HEIGHT, 0); // es3, gl3, GL_VERSION_1_2
gl.glPixelStorei(GL2ES3.GL_UNPACK_SKIP_IMAGES, 0); // es3, gl3, GL_VERSION_1_2
}
diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java
index e2498e6f1..f27f4f91b 100644
--- a/src/jogl/classes/javax/media/opengl/GLContext.java
+++ b/src/jogl/classes/javax/media/opengl/GLContext.java
@@ -135,6 +135,18 @@ public abstract class GLContext {
/** Version 1.50, i.e. GLSL 1.50 for GL 3.2. */
public static final VersionNumber Version150 = new VersionNumber(1, 50, 0);
+ /** Version 1.1, i.e. GL 1.1 */
+ public static final VersionNumber Version1_1 = new VersionNumber(1, 1, 0);
+
+ /** Version 1.2, i.e. GL 1.2 */
+ public static final VersionNumber Version1_2 = new VersionNumber(1, 2, 0);
+
+ /** Version 1.4, i.e. GL 1.4 */
+ public static final VersionNumber Version1_4 = new VersionNumber(1, 4, 0);
+
+ /** Version 1.5, i.e. GL 1.5 */
+ public static final VersionNumber Version1_5 = new VersionNumber(1, 5, 0);
+
/** Version 3.0. As an OpenGL version, it qualifies for desktop {@link #isGL2()} only, or ES 3.0. Or GLSL 3.00 for ES 3.0. */
public static final VersionNumber Version300 = new VersionNumber(3, 0, 0);
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Mipmap.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Mipmap.java
index 51d8ca6fe..d5a4d9a09 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Mipmap.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Mipmap.java
@@ -257,7 +257,7 @@ public class Mipmap {
public static void closestFit( final GL gl, final int target, final int width, final int height, final int internalFormat,
final int format, final int type, final int[] newWidth, final int[] newHeight ) {
// Use proxy textures if OpenGL GL2/GL3 version >= 1.1
- if( gl.isGL2GL3() && gl.getContext().getGLVersionNumber().compareTo(GLContext.Version110) >= 0 ) {
+ if( gl.isGL2GL3() && gl.getContext().getGLVersionNumber().compareTo(GLContext.Version1_1) >= 0 ) {
int widthPowerOf2 = nearestPower( width );
int heightPowerOf2 = nearestPower( height );
final int[] proxyWidth = new int[1];