jogamp 2.3.2 refactor for 18.1.1 updates

This commit is contained in:
Michael James 2018-08-03 11:27:21 -06:00
parent 888a909399
commit d683e87e35
8 changed files with 58 additions and 55 deletions

View file

@ -9,4 +9,5 @@ Require-Bundle: com.raytheon.uf.viz.core;bundle-version="1.16.0",
com.raytheon.uf.viz.drawables.image.stipple;bundle-version="1.16.0",
com.raytheon.uf.common.colormap;bundle-version="1.15.1",
com.raytheon.viz.core.gl;bundle-version="1.15.2",
javax.measure;bundle-version="1.0.0"
javax.measure;bundle-version="1.0.0",
com.jogamp.jogl;bundle-version="2.3.2"

View file

@ -22,7 +22,7 @@ package com.raytheon.uf.viz.gl.image.stipple;
import java.util.Arrays;
import java.util.List;
import javax.media.opengl.GL;
import com.jogamp.opengl.GL2;
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
import com.raytheon.uf.viz.core.DrawableImage;
@ -75,7 +75,7 @@ public class GLStippledColormappedImageExtension
IColormappedImageExtension cmapExt = target
.getExtension(IColormappedImageExtension.class);
boolean result = true;
GL gl = target.getGl();
GL2 gl = target.getGl().getGL2();
for (DrawableImage image : images) {
GLStippledColormappedImage stippled = (GLStippledColormappedImage) image
.getImage();
@ -148,14 +148,14 @@ public class GLStippledColormappedImageExtension
}
byte[] pattern = patterns.get(i);
if (pattern != null) {
gl.glEnable(GL.GL_POLYGON_STIPPLE);
gl.glEnable(GL2.GL_POLYGON_STIPPLE);
gl.glPolygonStipple(pattern, 0);
}
params.setAlphaMask(alphaMask);
params.setUseMask(true);
result &= cmapExt.drawRasters(paintProps, images);
if (pattern != null) {
gl.glDisable(GL.GL_POLYGON_STIPPLE);
gl.glDisable(GL2.GL_POLYGON_STIPPLE);
}
/* Reset the alpha for the next loop. */
for (int a = alphaStart; a < alphaEnd; a += 1) {

View file

@ -9,6 +9,7 @@ Require-Bundle: com.raytheon.uf.viz.drawables.triangulated;bundle-version="1.15.
com.raytheon.uf.viz.core;bundle-version="1.15.1",
com.raytheon.uf.common.colormap;bundle-version="1.15.0",
com.raytheon.viz.core.gl;bundle-version="1.15.1",
javax.measure;bundle-version="1.0.0"
javax.measure;bundle-version="1.0.0",
com.jogamp.jogl;bundle-version="2.3.2"
Import-Package: com.vividsolutions.jts.algorithm,
com.vividsolutions.jts.geom

View file

@ -26,7 +26,7 @@ import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import javax.measure.unit.Unit;
import javax.media.opengl.GL;
import com.jogamp.opengl.GL2;
import com.raytheon.uf.common.colormap.image.ColorMapData;
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
@ -200,35 +200,35 @@ public class GLTriangulatedImage implements ITriangulatedImage {
if (this.indexBuffer == null) {
stage();
}
GL gl = target.getGl();
GL2 gl = target.getGl().getGL2();
target.pushGLState();
try {
gl.glPolygonMode(GL.GL_BACK, GL.GL_FILL);
gl.glPolygonMode(GL.GL_FRONT, GL.GL_FILL);
gl.glPolygonMode(GL2.GL_BACK, GL2.GL_FILL);
gl.glPolygonMode(GL2.GL_FRONT, GL2.GL_FILL);
gl.glEnable(GL.GL_BLEND);
gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
gl.glEnable(GL2.GL_BLEND);
gl.glBlendFunc(GL2.GL_SRC_ALPHA, GL2.GL_ONE_MINUS_SRC_ALPHA);
GLTextureObject cmapTexture = target
.getColorMapTexture(colorMapParameters);
gl.glActiveTexture(GL.GL_TEXTURE1);
cmapTexture.bind(gl, GL.GL_TEXTURE_1D);
gl.glActiveTexture(GL2.GL_TEXTURE1);
cmapTexture.bind(gl, GL2.GL_TEXTURE_1D);
if (colorMapParameters.isInterpolate()) {
gl.glTexParameteri(GL.GL_TEXTURE_1D, GL.GL_TEXTURE_MIN_FILTER,
GL.GL_LINEAR);
gl.glTexParameteri(GL.GL_TEXTURE_1D, GL.GL_TEXTURE_MAG_FILTER,
GL.GL_LINEAR);
gl.glTexParameteri(GL2.GL_TEXTURE_1D, GL2.GL_TEXTURE_MIN_FILTER,
GL2.GL_LINEAR);
gl.glTexParameteri(GL2.GL_TEXTURE_1D, GL2.GL_TEXTURE_MAG_FILTER,
GL2.GL_LINEAR);
} else {
gl.glTexParameteri(GL.GL_TEXTURE_1D, GL.GL_TEXTURE_MIN_FILTER,
GL.GL_NEAREST);
gl.glTexParameteri(GL.GL_TEXTURE_1D, GL.GL_TEXTURE_MAG_FILTER,
GL.GL_NEAREST);
gl.glTexParameteri(GL2.GL_TEXTURE_1D, GL2.GL_TEXTURE_MIN_FILTER,
GL2.GL_NEAREST);
gl.glTexParameteri(GL2.GL_TEXTURE_1D, GL2.GL_TEXTURE_MAG_FILTER,
GL2.GL_NEAREST);
}
setupDataMapping(gl, GL.GL_TEXTURE3, GL.GL_TEXTURE4);
setupDataMapping(gl, GL2.GL_TEXTURE3, GL2.GL_TEXTURE4);
GLShaderProgram program = GLSLFactory.getInstance()
.getShaderProgram(gl, "copyValueVertexShader",
@ -248,9 +248,9 @@ public class GLTriangulatedImage implements ITriangulatedImage {
GLSLStructFactory.createColorModifiers(program, "modifiers",
paintProps.getAlpha(), brightness, contrast);
gl.glEnableClientState(GL.GL_VERTEX_ARRAY);
gl.glEnableClientState(GL2.GL_VERTEX_ARRAY);
vertexBuffer.rewind();
gl.glVertexPointer(2, GL.GL_FLOAT, 0, vertexBuffer);
gl.glVertexPointer(2, GL2.GL_FLOAT, 0, vertexBuffer);
Buffer attribBufferData = attribBuffer.getData();
attribBufferData.rewind();
@ -258,8 +258,8 @@ public class GLTriangulatedImage implements ITriangulatedImage {
attribBuffer.getTextureType(), attribBufferData);
indexBuffer.rewind();
gl.glDrawElements(GL.GL_TRIANGLES, indexBuffer.capacity(),
GL.GL_UNSIGNED_INT, indexBuffer);
gl.glDrawElements(GL2.GL_TRIANGLES, indexBuffer.capacity(),
GL2.GL_UNSIGNED_INT, indexBuffer);
program.endShader();
if (SHOW_MESH_LINES) {
@ -268,27 +268,27 @@ public class GLTriangulatedImage implements ITriangulatedImage {
* lines on top of the image for debugging.
*/
indexBuffer.rewind();
gl.glDisable(GL.GL_BLEND);
gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL.GL_LINE);
gl.glDrawElements(GL.GL_TRIANGLES, indexBuffer.capacity(),
GL.GL_UNSIGNED_INT, indexBuffer);
gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL.GL_FILL);
gl.glEnable(GL.GL_BLEND);
gl.glDisable(GL2.GL_BLEND);
gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_LINE);
gl.glDrawElements(GL2.GL_TRIANGLES, indexBuffer.capacity(),
GL2.GL_UNSIGNED_INT, indexBuffer);
gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_FILL);
gl.glEnable(GL2.GL_BLEND);
}
gl.glDisableClientState(GL.GL_VERTEX_ARRAY);
gl.glDisableClientState(GL2.GL_VERTEX_ARRAY);
gl.glActiveTexture(GL.GL_TEXTURE1);
gl.glBindTexture(GL.GL_TEXTURE_1D, 0);
gl.glActiveTexture(GL2.GL_TEXTURE1);
gl.glBindTexture(GL2.GL_TEXTURE_1D, 0);
gl.glDisable(GL.GL_BLEND);
gl.glDisable(GL2.GL_BLEND);
} finally {
target.popGLState();
}
}
protected void setupDataMapping(GL gl,
protected void setupDataMapping(GL2 gl,
int dataMappedTexBinding, int colorMappedTexBinding)
throws VizException {
if (dataMapping == null && colorMapParameters.getColorMap() != null) {

View file

@ -7,6 +7,7 @@ Bundle-Vendor: RAYTHEON
Require-Bundle: com.raytheon.viz.radar;bundle-version="1.14",
com.raytheon.viz.core.gl;bundle-version="1.14",
com.raytheon.uf.viz.core;bundle-version="1.14",
com.raytheon.uf.common.geospatial;bundle-version="1.14"
com.raytheon.uf.common.geospatial;bundle-version="1.14",
com.jogamp.jogl;bundle-version="2.3.2"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy

View file

@ -22,7 +22,7 @@ package com.raytheon.uf.viz.radar.gl;
import java.util.HashMap;
import java.util.Map;
import javax.media.opengl.GL;
import com.jogamp.opengl.GL2;
import org.geotools.coverage.grid.GeneralGridGeometry;
import org.geotools.coverage.grid.GridGeometry2D;
@ -117,7 +117,7 @@ public class RadarRadialMesh extends AbstractGLMesh {
public RadarRadialMesh(RadialMeshData data,
GeneralGridGeometry targetGeometry, CacheKey cacheKey)
throws VizException {
super(GL.GL_TRIANGLE_STRIP);
super(GL2.GL_TRIANGLE_STRIP);
this.data = data;
this.cacheKey = cacheKey;
ProjectedCRS crs = CRSCache.getInstance().constructStereographic(

View file

@ -8,9 +8,9 @@ Require-Bundle: org.eclipse.core.runtime,
com.raytheon.uf.viz.core;bundle-version="1.12.1174",
com.raytheon.uf.viz.truecolor;bundle-version="1.0.0",
com.raytheon.viz.core.gl;bundle-version="1.12.1174",
javax.media.opengl;bundle-version="1.1.0",
com.raytheon.uf.common.util;bundle-version="1.12.1174",
com.raytheon.uf.common.colormap;bundle-version="1.12.1174"
com.raytheon.uf.common.colormap;bundle-version="1.12.1174",
com.jogamp.jogl;bundle-version="2.3.2"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: com.raytheon.uf.viz.truecolor.gl.jar

View file

@ -22,7 +22,7 @@ package com.raytheon.uf.viz.truecolor.gl.extension;
import java.util.IdentityHashMap;
import java.util.Map;
import javax.media.opengl.GL;
import com.jogamp.opengl.GL2;
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
import com.raytheon.uf.viz.core.DrawableImage;
@ -163,13 +163,13 @@ public class GLTrueColorImagingExtension extends AbstractGLSLImagingExtension
return null;
}
} else if (image instanceof AbstractGLColormappedImage) {
GL gl = target.getGl();
GL2 gl = target.getGl().getGL2();
GLColormappedImageExtension.setupDataMapping(gl,
(AbstractGLColormappedImage) image, GL.GL_TEXTURE2,
GL.GL_TEXTURE3);
(AbstractGLColormappedImage) image, GL2.GL_TEXTURE2,
GL2.GL_TEXTURE3);
// bind on GL_TEXTURE1 as 0 is channel image
writeToImage.bind(gl, GL.GL_TEXTURE1);
writeToImage.bind(gl, GL2.GL_TEXTURE1);
return image;
}
return null;
@ -193,17 +193,17 @@ public class GLTrueColorImagingExtension extends AbstractGLSLImagingExtension
((GLTrueColorImage) image).getWrappedImage(),
(PixelCoverage) data));
} else if (writeToImage != null) {
GL gl = target.getGl();
GL2 gl = target.getGl().getGL2();
// Unbind the writeToImage from GL_TEXTURE1
gl.glActiveTexture(GL.GL_TEXTURE1);
gl.glActiveTexture(GL2.GL_TEXTURE1);
gl.glBindTexture(writeToImage.getTextureStorageType(), 0);
// Unbind the data mapped textures
gl.glActiveTexture(GL.GL_TEXTURE2);
gl.glBindTexture(GL.GL_TEXTURE_1D, 0);
gl.glActiveTexture(GL2.GL_TEXTURE2);
gl.glBindTexture(GL2.GL_TEXTURE_1D, 0);
gl.glActiveTexture(GL.GL_TEXTURE3);
gl.glBindTexture(GL.GL_TEXTURE_1D, 0);
gl.glActiveTexture(GL2.GL_TEXTURE3);
gl.glBindTexture(GL2.GL_TEXTURE_1D, 0);
}
}
@ -270,7 +270,7 @@ public class GLTrueColorImagingExtension extends AbstractGLSLImagingExtension
* (javax.media.opengl.GL)
*/
@Override
protected void enableBlending(GL gl) {
protected void enableBlending(GL2 gl) {
// Do not enable blending for this extension as it messes with alpha
// values between passes
}