瀏覽代碼

Switches to JOGL 2.0.2

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10741 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
jul..se 12 年之前
父節點
當前提交
e877d1f8c9
共有 34 個文件被更改,包括 33 次插入34 次删除
  1. 二進制
      engine/lib/jogl/gluegen-rt-natives-linux-amd64.jar
  2. 二進制
      engine/lib/jogl/gluegen-rt-natives-linux-armv6.jar
  3. 二進制
      engine/lib/jogl/gluegen-rt-natives-linux-armv6hf.jar
  4. 二進制
      engine/lib/jogl/gluegen-rt-natives-linux-i586.jar
  5. 二進制
      engine/lib/jogl/gluegen-rt-natives-macosx-universal.jar
  6. 二進制
      engine/lib/jogl/gluegen-rt-natives-solaris-amd64.jar
  7. 二進制
      engine/lib/jogl/gluegen-rt-natives-solaris-i586.jar
  8. 二進制
      engine/lib/jogl/gluegen-rt-natives-windows-amd64.jar
  9. 二進制
      engine/lib/jogl/gluegen-rt-natives-windows-i586.jar
  10. 二進制
      engine/lib/jogl/gluegen-rt.jar
  11. 二進制
      engine/lib/jogl/joal-natives-linux-amd64.jar
  12. 二進制
      engine/lib/jogl/joal-natives-linux-armv6.jar
  13. 二進制
      engine/lib/jogl/joal-natives-linux-armv6hf.jar
  14. 二進制
      engine/lib/jogl/joal-natives-linux-i586.jar
  15. 二進制
      engine/lib/jogl/joal-natives-macosx-universal.jar
  16. 二進制
      engine/lib/jogl/joal-natives-solaris-amd64.jar
  17. 二進制
      engine/lib/jogl/joal-natives-solaris-i586.jar
  18. 二進制
      engine/lib/jogl/joal-natives-windows-amd64.jar
  19. 二進制
      engine/lib/jogl/joal-natives-windows-i586.jar
  20. 二進制
      engine/lib/jogl/joal.jar
  21. 二進制
      engine/lib/jogl/jogl-all-natives-linux-amd64.jar
  22. 二進制
      engine/lib/jogl/jogl-all-natives-linux-armv6.jar
  23. 二進制
      engine/lib/jogl/jogl-all-natives-linux-armv6hf.jar
  24. 二進制
      engine/lib/jogl/jogl-all-natives-linux-i586.jar
  25. 二進制
      engine/lib/jogl/jogl-all-natives-macosx-universal.jar
  26. 二進制
      engine/lib/jogl/jogl-all-natives-solaris-amd64.jar
  27. 二進制
      engine/lib/jogl/jogl-all-natives-solaris-i586.jar
  28. 二進制
      engine/lib/jogl/jogl-all-natives-windows-amd64.jar
  29. 二進制
      engine/lib/jogl/jogl-all-natives-windows-i586.jar
  30. 二進制
      engine/lib/jogl/jogl-all.jar
  31. 2 0
      engine/src/core/com/jme3/app/Application.java
  32. 2 1
      engine/src/jogl/com/jme3/input/jogl/NewtMouseInput.java
  33. 22 24
      engine/src/jogl/com/jme3/renderer/jogl/JoglRenderer.java
  34. 7 9
      engine/src/jogl/com/jme3/renderer/jogl/TextureUtil.java

二進制
engine/lib/jogl/gluegen-rt-natives-linux-amd64.jar


二進制
engine/lib/jogl/gluegen-rt-natives-linux-armv6.jar


二進制
engine/lib/jogl/gluegen-rt-natives-linux-armv6hf.jar


二進制
engine/lib/jogl/gluegen-rt-natives-linux-i586.jar


二進制
engine/lib/jogl/gluegen-rt-natives-macosx-universal.jar


二進制
engine/lib/jogl/gluegen-rt-natives-solaris-amd64.jar


二進制
engine/lib/jogl/gluegen-rt-natives-solaris-i586.jar


二進制
engine/lib/jogl/gluegen-rt-natives-windows-amd64.jar


二進制
engine/lib/jogl/gluegen-rt-natives-windows-i586.jar


二進制
engine/lib/jogl/gluegen-rt.jar


二進制
engine/lib/jogl/joal-natives-linux-amd64.jar


二進制
engine/lib/jogl/joal-natives-linux-armv6.jar


二進制
engine/lib/jogl/joal-natives-linux-armv6hf.jar


二進制
engine/lib/jogl/joal-natives-linux-i586.jar


二進制
engine/lib/jogl/joal-natives-macosx-universal.jar


二進制
engine/lib/jogl/joal-natives-solaris-amd64.jar


二進制
engine/lib/jogl/joal-natives-solaris-i586.jar


二進制
engine/lib/jogl/joal-natives-windows-amd64.jar


二進制
engine/lib/jogl/joal-natives-windows-i586.jar


二進制
engine/lib/jogl/joal.jar


二進制
engine/lib/jogl/jogl-all-natives-linux-amd64.jar


二進制
engine/lib/jogl/jogl-all-natives-linux-armv6.jar


二進制
engine/lib/jogl/jogl-all-natives-linux-armv6hf.jar


二進制
engine/lib/jogl/jogl-all-natives-linux-i586.jar


二進制
engine/lib/jogl/jogl-all-natives-macosx-universal.jar


二進制
engine/lib/jogl/jogl-all-natives-solaris-amd64.jar


二進制
engine/lib/jogl/jogl-all-natives-solaris-i586.jar


二進制
engine/lib/jogl/jogl-all-natives-windows-amd64.jar


二進制
engine/lib/jogl/jogl-all-natives-windows-i586.jar


二進制
engine/lib/jogl/jogl-all.jar


+ 2 - 0
engine/src/core/com/jme3/app/Application.java

@@ -380,6 +380,8 @@ public class Application implements SystemListener {
         if (settings == null){
             settings = new AppSettings(true);
         }
+        settings.setRenderer("JOGL");
+        settings.setAudioRenderer("JOAL");
 
         logger.log(Level.FINE, "Starting application: {0}", getClass().getName());
         context = JmeSystem.newContext(settings, contextType);

+ 2 - 1
engine/src/jogl/com/jme3/input/jogl/NewtMouseInput.java

@@ -205,7 +205,8 @@ public class NewtMouseInput  implements MouseInput, MouseListener {
 
     public void mouseWheelMoved(MouseEvent awtEvt) {
         //FIXME not sure this is the right way to handle this case
-        float dwheel = awtEvt.getWheelRotation();
+        // [0] should be used when the shift key is down
+        float dwheel = awtEvt.getRotation()[1];
         wheelPos += dwheel * WHEEL_AMP;
         cursorMoved = true;
     }

+ 22 - 24
engine/src/jogl/com/jme3/renderer/jogl/JoglRenderer.java

@@ -31,25 +31,6 @@
  */
 package com.jme3.renderer.jogl;
 
-import java.nio.Buffer;
-import java.nio.ByteBuffer;
-import java.nio.FloatBuffer;
-import java.nio.IntBuffer;
-import java.util.EnumSet;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.media.opengl.GL;
-import javax.media.opengl.GL2;
-import javax.media.opengl.GL2ES1;
-import javax.media.opengl.GL2ES2;
-import javax.media.opengl.GL2GL3;
-import javax.media.opengl.GLContext;
-
-import jme3tools.converters.MipMapGenerator;
-import jme3tools.shader.ShaderDebug;
-
 import com.jme3.light.LightList;
 import com.jme3.material.RenderState;
 import com.jme3.math.ColorRGBA;
@@ -83,7 +64,24 @@ import com.jme3.util.BufferUtils;
 import com.jme3.util.ListMap;
 import com.jme3.util.NativeObjectManager;
 import com.jme3.util.SafeArrayList;
+import java.nio.Buffer;
+import java.nio.ByteBuffer;
+import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+import java.util.EnumSet;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 import javax.media.nativewindow.NativeWindowFactory;
+import javax.media.opengl.GL;
+import javax.media.opengl.GL2;
+import javax.media.opengl.GL2ES1;
+import javax.media.opengl.GL2ES2;
+import javax.media.opengl.GL2GL3;
+import javax.media.opengl.GL3;
+import javax.media.opengl.GLContext;
+import jme3tools.converters.MipMapGenerator;
+import jme3tools.shader.ShaderDebug;
 
 public class JoglRenderer implements Renderer {
 
@@ -376,11 +374,11 @@ public class JoglRenderer implements Renderer {
             if (gl.isExtensionAvailable("GL_ARB_texture_multisample")) {
                 caps.add(Caps.TextureMultisample);
 
-                gl.glGetIntegerv(GL2GL3.GL_MAX_COLOR_TEXTURE_SAMPLES, intBuf16);
+                gl.glGetIntegerv(GL3.GL_MAX_COLOR_TEXTURE_SAMPLES, intBuf16);
                 maxColorTexSamples = intBuf16.get(0);
                 logger.log(Level.FINER, "Texture Multisample Color Samples: {0}", maxColorTexSamples);
 
-                gl.glGetIntegerv(GL2GL3.GL_MAX_DEPTH_TEXTURE_SAMPLES, intBuf16);
+                gl.glGetIntegerv(GL3.GL_MAX_DEPTH_TEXTURE_SAMPLES, intBuf16);
                 maxDepthTexSamples = intBuf16.get(0);
                 logger.log(Level.FINER, "Texture Multisample Depth Samples: {0}", maxDepthTexSamples);
             }
@@ -1543,7 +1541,7 @@ public class JoglRenderer implements Renderer {
         GL gl = GLContext.getCurrentGL();
         if (gl.isGL2GL3()) {
             for (int i = 0; i < samplePositions.length; i++) {
-                gl.getGL2GL3().glGetMultisamplefv(GL2GL3.GL_SAMPLE_POSITION, i, samplePos);
+                gl.getGL3().glGetMultisamplefv(GL3.GL_SAMPLE_POSITION, i, samplePos);
                 samplePos.clear();
                 samplePositions[i] = new Vector2f(samplePos.get(0) - 0.5f,
                         samplePos.get(1) - 0.5f);
@@ -1754,13 +1752,13 @@ public class JoglRenderer implements Renderer {
         switch (type) {
             case TwoDimensional:
                 if (samples > 1) {
-                    return GL2GL3.GL_TEXTURE_2D_MULTISAMPLE;
+                    return GL3.GL_TEXTURE_2D_MULTISAMPLE;
                 } else {
                     return GL.GL_TEXTURE_2D;
                 }
             case TwoDimensionalArray:
                 if (samples > 1) {
-                    return GL2GL3.GL_TEXTURE_2D_MULTISAMPLE_ARRAY;
+                    return GL3.GL_TEXTURE_2D_MULTISAMPLE_ARRAY;
                 } else {
                     return GL.GL_TEXTURE_2D_ARRAY;
                 }

+ 7 - 9
engine/src/jogl/com/jme3/renderer/jogl/TextureUtil.java

@@ -32,18 +32,16 @@
 
 package com.jme3.renderer.jogl;
 
+import com.jme3.renderer.RendererException;
+import com.jme3.texture.Image;
+import com.jme3.texture.Image.Format;
 import java.nio.ByteBuffer;
-
 import javax.media.opengl.GL;
 import javax.media.opengl.GL2;
 import javax.media.opengl.GL2ES2;
 import javax.media.opengl.GL2GL3;
 import javax.media.opengl.GLContext;
 
-import com.jme3.renderer.RendererException;
-import com.jme3.texture.Image;
-import com.jme3.texture.Image.Format;
-
 public class TextureUtil {
     
     private static boolean abgrToRgbaConversionEnabled = false;
@@ -105,13 +103,13 @@ public class TextureUtil {
         // Luminance formats
         setFormat(Format.Luminance8,   GL2.GL_LUMINANCE8,  GL.GL_LUMINANCE, GL.GL_UNSIGNED_BYTE, false);
         setFormat(Format.Luminance16,  GL2.GL_LUMINANCE16, GL.GL_LUMINANCE, GL.GL_UNSIGNED_SHORT, false);
-        setFormat(Format.Luminance16F, GL.GL_LUMINANCE16F_ARB, GL.GL_LUMINANCE, GL.GL_HALF_FLOAT, false);
-        setFormat(Format.Luminance32F, GL.GL_LUMINANCE32F_ARB, GL.GL_LUMINANCE, GL.GL_FLOAT, false);
+        setFormat(Format.Luminance16F, GL2.GL_LUMINANCE16F, GL.GL_LUMINANCE, GL.GL_HALF_FLOAT, false);
+        setFormat(Format.Luminance32F, GL2.GL_LUMINANCE32F, GL.GL_LUMINANCE, GL.GL_FLOAT, false);
         
         // Luminance alpha formats
         setFormat(Format.Luminance8Alpha8, GL2.GL_LUMINANCE8_ALPHA8,  GL.GL_LUMINANCE_ALPHA, GL.GL_UNSIGNED_BYTE, false);
         setFormat(Format.Luminance16Alpha16, GL2.GL_LUMINANCE16_ALPHA16, GL.GL_LUMINANCE_ALPHA, GL.GL_UNSIGNED_SHORT, false);
-        setFormat(Format.Luminance16FAlpha16F, GL.GL_LUMINANCE_ALPHA16F_ARB, GL.GL_LUMINANCE_ALPHA, GL.GL_HALF_FLOAT, false);
+        setFormat(Format.Luminance16FAlpha16F, GL2.GL_LUMINANCE_ALPHA16F, GL.GL_LUMINANCE_ALPHA, GL.GL_HALF_FLOAT, false);
         
         // Depth formats
         setFormat(Format.Depth,    GL2ES2.GL_DEPTH_COMPONENT,    GL2ES2.GL_DEPTH_COMPONENT, GL.GL_UNSIGNED_BYTE, false);
@@ -368,7 +366,7 @@ public class TextureUtil {
                     }else{
                         if (samples > 1){
                             if (gl.isGL2GL3()) {
-                                gl.getGL2GL3().glTexImage2DMultisample(target,
+                                gl.getGL3().glTexImage2DMultisample(target,
                                         samples,
                                         glFmt.internalFormat,
                                         mipWidth,