Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Factory:Rebuild
scirenderer
scirenderer-fix-compilation-with-jogl-2.3.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File scirenderer-fix-compilation-with-jogl-2.3.patch of Package scirenderer
http://forge.scilab.org/index.php/p/scirenderer/issues/1545/ From 804872762b3c0cdcc440bb191034afe55bb46fa4 Mon Sep 17 00:00:00 2001 From: Atri Bhattacharya <badshah400@gmail.com> Date: Wed, 15 Apr 2015 22:40:25 -0400 Subject: [PATCH] Port to jogl 2.3. Adapt to name changes of jogl classes: javax.media.gl -> com.jogamp.gl Drop use of removed classes: * com.jogamp.opengl.util.awt.Screenshot * import javax.media.opengl.GLPbuffer Port to using updated methods from: * com.jogamp.opengl.util.GLReadBufferUtil * com.jogamp.opengl.util.awt.AWTGLReadBufferUtil respectively. Replace the now removed GLAutoDrawable.getWidth()/GLAutoDrawable.getHeight() by GLAutoDrawable.getSurfaceWidth()/GLAutoDrawable.getSurfaceHeight() respectively. --- .../scirenderer/examples/JScrollPaneExample.java | 4 +-- .../scirenderer/examples/utils/ExampleFrame.java | 2 +- .../implementation/jogl/JoGLCanvas.java | 39 ++++++++++++---------- .../implementation/jogl/JoGLCanvasFactory.java | 2 +- .../implementation/jogl/JoGLCapacity.java | 2 +- .../implementation/jogl/JoGLDrawingTools.java | 2 +- .../implementation/jogl/JoGLParameters.java | 4 +-- .../jogl/buffers/JoGLBuffersManager.java | 2 +- .../jogl/buffers/JoGLDataBuffer.java | 2 +- .../jogl/buffers/JoGLElementsBuffer.java | 2 +- .../jogl/buffers/JoGLIndicesBuffer.java | 2 +- .../jogl/clipping/JoGLClippingManager.java | 2 +- .../jogl/clipping/JoGLClippingPlane.java | 2 +- .../jogl/drawer/JoGLShapeDrawer.java | 2 +- .../implementation/jogl/lightning/JoGLLight.java | 2 +- .../jogl/lightning/JoGLLightManager.java | 2 +- .../jogl/picking/GLPickingManager.java | 2 +- .../jogl/picking/JoGLPickingTools.java | 2 +- .../implementation/jogl/renderer/JoGLRenderer.java | 2 +- .../jogl/renderer/JoGLRendererManager.java | 2 +- .../jogl/texture/JoGLTextureManager.java | 4 +-- .../implementation/jogl/utils/GLShortCuts.java | 2 +- 22 files changed, 46 insertions(+), 41 deletions(-) diff --git a/examples/org/scilab/forge/scirenderer/examples/JScrollPaneExample.java b/examples/org/scilab/forge/scirenderer/examples/JScrollPaneExample.java index f864b17..47f5f35 100644 --- a/examples/org/scilab/forge/scirenderer/examples/JScrollPaneExample.java +++ b/examples/org/scilab/forge/scirenderer/examples/JScrollPaneExample.java @@ -13,8 +13,8 @@ import org.scilab.forge.scirenderer.tranformations.Transformation; import org.scilab.forge.scirenderer.tranformations.TransformationFactory; import org.scilab.forge.scirenderer.utils.shapes.geometry.CubeFactory; -import javax.media.opengl.awt.GLCanvas; -import javax.media.opengl.awt.GLJPanel; +import com.jogamp.opengl.awt.GLCanvas; +import com.jogamp.opengl.awt.GLJPanel; import javax.swing.*; import java.awt.*; diff --git a/examples/org/scilab/forge/scirenderer/examples/utils/ExampleFrame.java b/examples/org/scilab/forge/scirenderer/examples/utils/ExampleFrame.java index 14af6a7..d94a81a 100644 --- a/examples/org/scilab/forge/scirenderer/examples/utils/ExampleFrame.java +++ b/examples/org/scilab/forge/scirenderer/examples/utils/ExampleFrame.java @@ -15,7 +15,7 @@ import com.jogamp.opengl.util.Animator; import org.scilab.forge.scirenderer.Canvas; import org.scilab.forge.scirenderer.implementation.jogl.JoGLCanvasFactory; -import javax.media.opengl.awt.GLJPanel; +import com.jogamp.opengl.awt.GLJPanel; import javax.swing.JFrame; import javax.swing.JPanel; import java.awt.BorderLayout; diff --git a/src/org/scilab/forge/scirenderer/implementation/jogl/JoGLCanvas.java b/src/org/scilab/forge/scirenderer/implementation/jogl/JoGLCanvas.java index 5865f30..fae9e46 100644 --- a/src/org/scilab/forge/scirenderer/implementation/jogl/JoGLCanvas.java +++ b/src/org/scilab/forge/scirenderer/implementation/jogl/JoGLCanvas.java @@ -20,21 +20,21 @@ import org.scilab.forge.scirenderer.implementation.jogl.texture.JoGLTextureManag import org.scilab.forge.scirenderer.picking.PickingManager; import com.jogamp.opengl.util.awt.ImageUtil; -import com.jogamp.opengl.util.awt.Screenshot; +import com.jogamp.opengl.util.GLReadBufferUtil; import java.awt.Dimension; import java.awt.image.BufferedImage; import java.lang.reflect.InvocationTargetException; import java.util.concurrent.Semaphore; -import javax.media.opengl.DebugGL2; -import javax.media.opengl.GL2; -import javax.media.opengl.GLAutoDrawable; -import javax.media.opengl.GLCapabilities; -import javax.media.opengl.GLContext; -import javax.media.opengl.GLDrawableFactory; -import javax.media.opengl.GLEventListener; -import javax.media.opengl.GLException; -import javax.media.opengl.GLPbuffer; -import javax.media.opengl.GLProfile; +import com.jogamp.opengl.DebugGL2; +import com.jogamp.opengl.GL2; +import com.jogamp.opengl.GLAutoDrawable; +import com.jogamp.opengl.GLCapabilities; +import com.jogamp.opengl.GLContext; +import com.jogamp.opengl.GLDrawableFactory; +import com.jogamp.opengl.GLEventListener; +import com.jogamp.opengl.GLException; +import com.jogamp.opengl.util.awt.AWTGLReadBufferUtil; +import com.jogamp.opengl.GLProfile; import javax.swing.SwingUtilities; import jogamp.opengl.GLContextImpl; @@ -155,17 +155,18 @@ public final class JoGLCanvas implements Canvas, GLEventListener { @Override public int getWidth() { - return autoDrawable.getWidth(); + return autoDrawable.getSurfaceWidth(); } @Override public int getHeight() { - return autoDrawable.getHeight(); + return autoDrawable.getSurfaceHeight(); } @Override public Dimension getDimension() { - return new Dimension(autoDrawable.getWidth(), autoDrawable.getHeight()); + return new Dimension(autoDrawable.getSurfaceWidth(), + autoDrawable.getSurfaceHeight()); } @Override @@ -241,7 +242,10 @@ public final class JoGLCanvas implements Canvas, GLEventListener { SwingUtilities.invokeAndWait(new Runnable() { public void run() { context.makeCurrent(); - image[0] = Screenshot.readToBufferedImage(autoDrawable.getWidth(), autoDrawable.getHeight()); + AWTGLReadBufferUtil screenshot = new AWTGLReadBufferUtil(autoDrawable.getGLProfile(), false); + image[0] = screenshot.readPixelsToBufferedImage(autoDrawable.getGL().getGL2(), + 0, 0, autoDrawable.getSurfaceWidth(), + autoDrawable.getSurfaceHeight(), false); context.release(); } }); @@ -272,7 +276,7 @@ public final class JoGLCanvas implements Canvas, GLEventListener { */ public void destroy() { if (isOffscreen) { - ((GLPbuffer) autoDrawable).destroy(); + autoDrawable.destroy(); } try { isValid = false; @@ -291,8 +295,9 @@ public final class JoGLCanvas implements Canvas, GLEventListener { private static GLAutoDrawable getOffscreenDrawable(int width, int height) { GLDrawableFactory factory = GLDrawableFactory.getDesktopFactory(); GLCapabilities capabilities = new GLCapabilities(GLProfile.getDefault()); + capabilities.setPBuffer(true); - return factory.createGLPbuffer(null, capabilities, null, width, height, null); + return factory.createOffscreenAutoDrawable(null, capabilities, null, width, height); } // Implementation of function from GLEventListener. diff --git a/src/org/scilab/forge/scirenderer/implementation/jogl/JoGLCanvasFactory.java b/src/org/scilab/forge/scirenderer/implementation/jogl/JoGLCanvasFactory.java index f7db548..0f7a414 100644 --- a/src/org/scilab/forge/scirenderer/implementation/jogl/JoGLCanvasFactory.java +++ b/src/org/scilab/forge/scirenderer/implementation/jogl/JoGLCanvasFactory.java @@ -13,7 +13,7 @@ package org.scilab.forge.scirenderer.implementation.jogl; import org.scilab.forge.scirenderer.Canvas; -import javax.media.opengl.GLAutoDrawable; +import com.jogamp.opengl.GLAutoDrawable; /** * @author Pierre Lando diff --git a/src/org/scilab/forge/scirenderer/implementation/jogl/JoGLCapacity.java b/src/org/scilab/forge/scirenderer/implementation/jogl/JoGLCapacity.java index c4d5af4..1f5560b 100644 --- a/src/org/scilab/forge/scirenderer/implementation/jogl/JoGLCapacity.java +++ b/src/org/scilab/forge/scirenderer/implementation/jogl/JoGLCapacity.java @@ -11,7 +11,7 @@ package org.scilab.forge.scirenderer.implementation.jogl; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL2; /** * This class store current OpenGl context capacity. diff --git a/src/org/scilab/forge/scirenderer/implementation/jogl/JoGLDrawingTools.java b/src/org/scilab/forge/scirenderer/implementation/jogl/JoGLDrawingTools.java index 8c597f0..be1ce3e 100644 --- a/src/org/scilab/forge/scirenderer/implementation/jogl/JoGLDrawingTools.java +++ b/src/org/scilab/forge/scirenderer/implementation/jogl/JoGLDrawingTools.java @@ -30,7 +30,7 @@ import org.scilab.forge.scirenderer.tranformations.TransformationManagerImpl; import org.scilab.forge.scirenderer.tranformations.TransformationManagerListener; import org.scilab.forge.scirenderer.tranformations.Vector3d; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL2; /** * diff --git a/src/org/scilab/forge/scirenderer/implementation/jogl/JoGLParameters.java b/src/org/scilab/forge/scirenderer/implementation/jogl/JoGLParameters.java index 4b583fa..c45d049 100644 --- a/src/org/scilab/forge/scirenderer/implementation/jogl/JoGLParameters.java +++ b/src/org/scilab/forge/scirenderer/implementation/jogl/JoGLParameters.java @@ -11,8 +11,8 @@ package org.scilab.forge.scirenderer.implementation.jogl; -import javax.media.opengl.GL; -import javax.media.opengl.glu.GLU; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.glu.GLU; /** * @author Pierre Lando diff --git a/src/org/scilab/forge/scirenderer/implementation/jogl/buffers/JoGLBuffersManager.java b/src/org/scilab/forge/scirenderer/implementation/jogl/buffers/JoGLBuffersManager.java index 6245565..16077e1 100644 --- a/src/org/scilab/forge/scirenderer/implementation/jogl/buffers/JoGLBuffersManager.java +++ b/src/org/scilab/forge/scirenderer/implementation/jogl/buffers/JoGLBuffersManager.java @@ -16,7 +16,7 @@ import org.scilab.forge.scirenderer.buffers.DataBuffer; import org.scilab.forge.scirenderer.buffers.ElementsBuffer; import org.scilab.forge.scirenderer.buffers.IndicesBuffer; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL2; import java.util.Collection; import java.util.HashSet; import java.util.Set; diff --git a/src/org/scilab/forge/scirenderer/implementation/jogl/buffers/JoGLDataBuffer.java b/src/org/scilab/forge/scirenderer/implementation/jogl/buffers/JoGLDataBuffer.java index 767fe80..82f1f33 100644 --- a/src/org/scilab/forge/scirenderer/implementation/jogl/buffers/JoGLDataBuffer.java +++ b/src/org/scilab/forge/scirenderer/implementation/jogl/buffers/JoGLDataBuffer.java @@ -13,7 +13,7 @@ package org.scilab.forge.scirenderer.implementation.jogl.buffers; import org.scilab.forge.scirenderer.buffers.DataBuffer; -import javax.media.opengl.GL; +import com.jogamp.opengl.GL; import java.nio.Buffer; /** diff --git a/src/org/scilab/forge/scirenderer/implementation/jogl/buffers/JoGLElementsBuffer.java b/src/org/scilab/forge/scirenderer/implementation/jogl/buffers/JoGLElementsBuffer.java index 94f4ddd..d602c6c 100644 --- a/src/org/scilab/forge/scirenderer/implementation/jogl/buffers/JoGLElementsBuffer.java +++ b/src/org/scilab/forge/scirenderer/implementation/jogl/buffers/JoGLElementsBuffer.java @@ -13,7 +13,7 @@ package org.scilab.forge.scirenderer.implementation.jogl.buffers; import org.scilab.forge.scirenderer.buffers.ElementsBuffer; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL2; import java.nio.Buffer; import java.nio.FloatBuffer; diff --git a/src/org/scilab/forge/scirenderer/implementation/jogl/buffers/JoGLIndicesBuffer.java b/src/org/scilab/forge/scirenderer/implementation/jogl/buffers/JoGLIndicesBuffer.java index a7830d8..a6636f5 100644 --- a/src/org/scilab/forge/scirenderer/implementation/jogl/buffers/JoGLIndicesBuffer.java +++ b/src/org/scilab/forge/scirenderer/implementation/jogl/buffers/JoGLIndicesBuffer.java @@ -13,7 +13,7 @@ package org.scilab.forge.scirenderer.implementation.jogl.buffers; import org.scilab.forge.scirenderer.buffers.IndicesBuffer; -import javax.media.opengl.GL; +import com.jogamp.opengl.GL; import java.nio.Buffer; import java.nio.IntBuffer; import java.util.Collection; diff --git a/src/org/scilab/forge/scirenderer/implementation/jogl/clipping/JoGLClippingManager.java b/src/org/scilab/forge/scirenderer/implementation/jogl/clipping/JoGLClippingManager.java index 0f64f57..96e0692 100644 --- a/src/org/scilab/forge/scirenderer/implementation/jogl/clipping/JoGLClippingManager.java +++ b/src/org/scilab/forge/scirenderer/implementation/jogl/clipping/JoGLClippingManager.java @@ -15,7 +15,7 @@ import org.scilab.forge.scirenderer.clipping.ClippingManager; import org.scilab.forge.scirenderer.clipping.ClippingPlane; import org.scilab.forge.scirenderer.implementation.jogl.JoGLDrawingTools; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL2; /** * @author Pierre Lando diff --git a/src/org/scilab/forge/scirenderer/implementation/jogl/clipping/JoGLClippingPlane.java b/src/org/scilab/forge/scirenderer/implementation/jogl/clipping/JoGLClippingPlane.java index 72ffe28..5e2dcad 100644 --- a/src/org/scilab/forge/scirenderer/implementation/jogl/clipping/JoGLClippingPlane.java +++ b/src/org/scilab/forge/scirenderer/implementation/jogl/clipping/JoGLClippingPlane.java @@ -17,7 +17,7 @@ import org.scilab.forge.scirenderer.tranformations.Transformation; import org.scilab.forge.scirenderer.tranformations.TransformationFactory; import org.scilab.forge.scirenderer.tranformations.Vector4d; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL2; /** * @author Pierre Lando diff --git a/src/org/scilab/forge/scirenderer/implementation/jogl/drawer/JoGLShapeDrawer.java b/src/org/scilab/forge/scirenderer/implementation/jogl/drawer/JoGLShapeDrawer.java index 640b66a..ada1cfc 100644 --- a/src/org/scilab/forge/scirenderer/implementation/jogl/drawer/JoGLShapeDrawer.java +++ b/src/org/scilab/forge/scirenderer/implementation/jogl/drawer/JoGLShapeDrawer.java @@ -21,7 +21,7 @@ import org.scilab.forge.scirenderer.shapes.appearance.Appearance; import org.scilab.forge.scirenderer.shapes.geometry.Geometry; import org.scilab.forge.scirenderer.texture.Texture; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL2; import java.nio.FloatBuffer; import java.nio.IntBuffer; diff --git a/src/org/scilab/forge/scirenderer/implementation/jogl/lightning/JoGLLight.java b/src/org/scilab/forge/scirenderer/implementation/jogl/lightning/JoGLLight.java index 692d8b6..b72bb5d 100644 --- a/src/org/scilab/forge/scirenderer/implementation/jogl/lightning/JoGLLight.java +++ b/src/org/scilab/forge/scirenderer/implementation/jogl/lightning/JoGLLight.java @@ -11,7 +11,7 @@ package org.scilab.forge.scirenderer.implementation.jogl.lightning; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL2; import org.scilab.forge.scirenderer.implementation.jogl.utils.GLShortCuts; import org.scilab.forge.scirenderer.lightning.Light; diff --git a/src/org/scilab/forge/scirenderer/implementation/jogl/lightning/JoGLLightManager.java b/src/org/scilab/forge/scirenderer/implementation/jogl/lightning/JoGLLightManager.java index 60f642f..a2d275d 100644 --- a/src/org/scilab/forge/scirenderer/implementation/jogl/lightning/JoGLLightManager.java +++ b/src/org/scilab/forge/scirenderer/implementation/jogl/lightning/JoGLLightManager.java @@ -16,7 +16,7 @@ import org.scilab.forge.scirenderer.implementation.jogl.utils.GLShortCuts; import org.scilab.forge.scirenderer.lightning.Light; import org.scilab.forge.scirenderer.lightning.LightManager; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL2; /** * JoGL implementation of {@link LightManager} diff --git a/src/org/scilab/forge/scirenderer/implementation/jogl/picking/GLPickingManager.java b/src/org/scilab/forge/scirenderer/implementation/jogl/picking/GLPickingManager.java index ba9da13..36b40a1 100644 --- a/src/org/scilab/forge/scirenderer/implementation/jogl/picking/GLPickingManager.java +++ b/src/org/scilab/forge/scirenderer/implementation/jogl/picking/GLPickingManager.java @@ -11,7 +11,7 @@ package org.scilab.forge.scirenderer.implementation.jogl.picking; -import javax.media.opengl.GL; +import com.jogamp.opengl.GL; /** * @author Pierre Lando diff --git a/src/org/scilab/forge/scirenderer/implementation/jogl/picking/JoGLPickingTools.java b/src/org/scilab/forge/scirenderer/implementation/jogl/picking/JoGLPickingTools.java index cfcdc53..630522e 100644 --- a/src/org/scilab/forge/scirenderer/implementation/jogl/picking/JoGLPickingTools.java +++ b/src/org/scilab/forge/scirenderer/implementation/jogl/picking/JoGLPickingTools.java @@ -16,7 +16,7 @@ import org.scilab.forge.scirenderer.implementation.jogl.JoGLDrawingTools; import org.scilab.forge.scirenderer.picking.PickingTools; import org.scilab.forge.scirenderer.tranformations.Vector3d; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL2; import java.awt.Point; import java.nio.FloatBuffer; diff --git a/src/org/scilab/forge/scirenderer/implementation/jogl/renderer/JoGLRenderer.java b/src/org/scilab/forge/scirenderer/implementation/jogl/renderer/JoGLRenderer.java index 03f1d25..0d8be8f 100644 --- a/src/org/scilab/forge/scirenderer/implementation/jogl/renderer/JoGLRenderer.java +++ b/src/org/scilab/forge/scirenderer/implementation/jogl/renderer/JoGLRenderer.java @@ -15,7 +15,7 @@ import org.scilab.forge.scirenderer.Drawer; import org.scilab.forge.scirenderer.implementation.jogl.JoGLDrawingTools; import org.scilab.forge.scirenderer.renderer.Renderer; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL2; /** * @author Pierre Lando diff --git a/src/org/scilab/forge/scirenderer/implementation/jogl/renderer/JoGLRendererManager.java b/src/org/scilab/forge/scirenderer/implementation/jogl/renderer/JoGLRendererManager.java index 4f869f1..c8452de 100644 --- a/src/org/scilab/forge/scirenderer/implementation/jogl/renderer/JoGLRendererManager.java +++ b/src/org/scilab/forge/scirenderer/implementation/jogl/renderer/JoGLRendererManager.java @@ -15,7 +15,7 @@ import org.scilab.forge.scirenderer.implementation.jogl.JoGLDrawingTools; import org.scilab.forge.scirenderer.renderer.Renderer; import org.scilab.forge.scirenderer.renderer.RendererManager; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL2; import java.util.HashSet; import java.util.Set; import java.util.Stack; diff --git a/src/org/scilab/forge/scirenderer/implementation/jogl/texture/JoGLTextureManager.java b/src/org/scilab/forge/scirenderer/implementation/jogl/texture/JoGLTextureManager.java index 8b51998..f4e6696 100644 --- a/src/org/scilab/forge/scirenderer/implementation/jogl/texture/JoGLTextureManager.java +++ b/src/org/scilab/forge/scirenderer/implementation/jogl/texture/JoGLTextureManager.java @@ -27,9 +27,9 @@ import org.scilab.forge.scirenderer.tranformations.Transformation; import org.scilab.forge.scirenderer.tranformations.TransformationManager; import org.scilab.forge.scirenderer.tranformations.Vector3d; -import javax.media.opengl.GLContext; +import com.jogamp.opengl.GLContext; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL2; import java.awt.AlphaComposite; import java.awt.Dimension; import java.awt.Graphics2D; diff --git a/src/org/scilab/forge/scirenderer/implementation/jogl/utils/GLShortCuts.java b/src/org/scilab/forge/scirenderer/implementation/jogl/utils/GLShortCuts.java index 70fe28d..b3b7975 100644 --- a/src/org/scilab/forge/scirenderer/implementation/jogl/utils/GLShortCuts.java +++ b/src/org/scilab/forge/scirenderer/implementation/jogl/utils/GLShortCuts.java @@ -14,7 +14,7 @@ package org.scilab.forge.scirenderer.implementation.jogl.utils; import org.scilab.forge.scirenderer.shapes.appearance.Appearance; import org.scilab.forge.scirenderer.shapes.appearance.Color; -import javax.media.opengl.GL2; +import com.jogamp.opengl.GL2; /** * -- 2.1.4
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor