Switches to JOGL 2.0.2

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10741 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
jul..se 2013-08-01 20:08:45 +00:00
parent 07477b0be8
commit e877d1f8c9
34 changed files with 33 additions and 34 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -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);

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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,