Don't use unsupported TEXTURE_{BASE,MAX}_LEVEL in GLES

opengles2-fixes
Kirill Vainer 7 years ago
parent 69139a1e95
commit 23700d5140
  1. 2
      jme3-core/src/main/java/com/jme3/renderer/opengl/GL.java
  2. 2
      jme3-core/src/main/java/com/jme3/renderer/opengl/GL2.java
  3. 8
      jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java
  4. 4
      jme3-core/src/main/java/com/jme3/renderer/opengl/GLTracer.java

@ -173,9 +173,7 @@ public interface GL {
public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518;
public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519;
public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A;
public static final int GL_TEXTURE_BASE_LEVEL = 0x813C;
public static final int GL_TEXTURE_MAG_FILTER = 0x2800;
public static final int GL_TEXTURE_MAX_LEVEL = 0x813D;
public static final int GL_TEXTURE_MIN_FILTER = 0x2801;
public static final int GL_TEXTURE_WRAP_S = 0x2802;
public static final int GL_TEXTURE_WRAP_T = 0x2803;

@ -65,6 +65,8 @@ public interface GL2 extends GL {
public static final int GL_STACK_OVERFLOW = 0x503;
public static final int GL_STACK_UNDERFLOW = 0x504;
public static final int GL_TEXTURE_3D = 0x806F;
public static final int GL_TEXTURE_BASE_LEVEL = 0x813C;
public static final int GL_TEXTURE_MAX_LEVEL = 0x813D;
public static final int GL_POINT_SPRITE = 0x8861;
public static final int GL_TEXTURE_COMPARE_FUNC = 0x884D;
public static final int GL_TEXTURE_COMPARE_MODE = 0x884C;

@ -2197,11 +2197,15 @@ public final class GLRenderer implements Renderer {
} else if (img.hasMipmaps()) {
// Image already has mipmaps, set the max level based on the
// number of mipmaps we have.
gl.glTexParameteri(target, GL.GL_TEXTURE_MAX_LEVEL, img.getMipMapSizes().length - 1);
if (caps.contains(Caps.OpenGL20)) {
gl.glTexParameteri(target, GL2.GL_TEXTURE_MAX_LEVEL, img.getMipMapSizes().length - 1);
}
} else {
// Image does not have mipmaps and they are not required.
// Specify that that the texture has no mipmaps.
gl.glTexParameteri(target, GL.GL_TEXTURE_MAX_LEVEL, 0);
if (caps.contains(Caps.OpenGL20)) {
gl.glTexParameteri(target, GL2.GL_TEXTURE_MAX_LEVEL, 0);
}
}
int imageSamples = img.getMultiSamples();

@ -366,8 +366,8 @@ public final class GLTracer implements InvocationHandler {
printEnum(param);
print(", ");
if (param == GL.GL_TEXTURE_BASE_LEVEL
|| param == GL.GL_TEXTURE_MAX_LEVEL) {
if (param == GL2.GL_TEXTURE_BASE_LEVEL
|| param == GL2.GL_TEXTURE_MAX_LEVEL) {
printInt(value);
} else {
printEnum(value);

Loading…
Cancel
Save