* BorderClamp and Clamp texture wrap modes now become EdgeClamp on Android

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9221 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
Sha..rd 13 years ago
parent 9ddb941daa
commit 491d514c0f
  1. 30
      engine/src/android/com/jme3/renderer/android/OGLESShaderRenderer.java

@ -31,9 +31,7 @@
*/ */
package com.jme3.renderer.android; package com.jme3.renderer.android;
import android.graphics.Bitmap;
import android.opengl.GLES10; import android.opengl.GLES10;
import android.opengl.GLES11;
import android.opengl.GLES20; import android.opengl.GLES20;
import android.os.Build; import android.os.Build;
import com.jme3.asset.AndroidImageInfo; import com.jme3.asset.AndroidImageInfo;
@ -60,14 +58,11 @@ import com.jme3.texture.Texture.WrapAxis;
import com.jme3.util.BufferUtils; import com.jme3.util.BufferUtils;
import com.jme3.util.ListMap; import com.jme3.util.ListMap;
import com.jme3.util.NativeObjectManager; import com.jme3.util.NativeObjectManager;
import com.jme3.util.SafeArrayList;
import java.nio.*; import java.nio.*;
import java.util.ArrayList;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.List; import java.util.List;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import javax.microedition.khronos.opengles.GL10;
public class OGLESShaderRenderer implements Renderer { public class OGLESShaderRenderer implements Renderer {
@ -360,25 +355,10 @@ public class OGLESShaderRenderer implements Renderer {
} }
applyRenderState(RenderState.DEFAULT); applyRenderState(RenderState.DEFAULT);
// GLES20.glClearDepthf(1.0f); GLES20.glDisable(GLES20.GL_DITHER);
if (verboseLogging) {
logger.info("GLES20.glDisable(GL10.GL_DITHER)");
}
GLES20.glDisable(GL10.GL_DITHER);
checkGLError(); checkGLError();
if (verboseLogging) {
logger.info("GLES20.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_FASTEST)");
}
//It seems that GL10.GL_PERSPECTIVE_CORRECTION_HINT gives invalid_enum error on android.
// GLES20.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_FASTEST);
// checkGLError();
useVBO = false; useVBO = false;
// NOTE: SDK_INT is only available since 1.6, // NOTE: SDK_INT is only available since 1.6,
@ -1779,10 +1759,8 @@ public class OGLESShaderRenderer implements Renderer {
private int convertWrapMode(Texture.WrapMode mode) { private int convertWrapMode(Texture.WrapMode mode) {
switch (mode) { switch (mode) {
// case BorderClamp: case BorderClamp:
// return GLES20.GL_CLAMP_TO_BORDER; case Clamp:
// case Clamp:
// return GLES20.GL_CLAMP;
case EdgeClamp: case EdgeClamp:
return GLES20.GL_CLAMP_TO_EDGE; return GLES20.GL_CLAMP_TO_EDGE;
case Repeat: case Repeat:
@ -2557,7 +2535,7 @@ public class OGLESShaderRenderer implements Renderer {
logger.log(Level.INFO, "glDrawElements(), indexBuf.capacity ({0}), vertCount ({1})", new Object[]{indexBuf.getData().capacity(), vertCount}); logger.log(Level.INFO, "glDrawElements(), indexBuf.capacity ({0}), vertCount ({1})", new Object[]{indexBuf.getData().capacity(), vertCount});
} }
GLES11.glDrawElements( GLES20.glDrawElements(
convertElementMode(mesh.getMode()), convertElementMode(mesh.getMode()),
indexBuf.getData().capacity(), indexBuf.getData().capacity(),
convertFormat(indexBuf.getFormat()), convertFormat(indexBuf.getFormat()),

Loading…
Cancel
Save