Cleanup GL interface from unused calls

Also modify glGet***InfoLog a bit to be more compatible with Android
experimental
shadowislord 10 years ago
parent 373eaeae30
commit ac2f765d5b
  1. 6
      jme3-core/src/main/java/com/jme3/renderer/opengl/GL.java
  2. 24
      jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java
  3. 170
      jme3-lwjgl/src/main/java/com/jme3/renderer/lwjgl/LwjglGL.java

@ -171,12 +171,10 @@ public interface GL {
public void glBindTexture(int target, int texture);
public void glBlendFunc(int sfactor, int dfactor);
public void glBufferData(int target, FloatBuffer data, int usage);
public void glBufferData(int target, DoubleBuffer data, int usage);
public void glBufferData(int target, ShortBuffer data, int usage);
public void glBufferData(int target, ByteBuffer data, int usage);
public void glBufferSubData(int target, long offset, FloatBuffer data);
public void glBufferSubData(int target, long offset, ShortBuffer data);
public void glBufferSubData(int target, long offset, DoubleBuffer data);
public void glBufferSubData(int target, long offset, ByteBuffer data);
public void glClear(int mask);
public void glClearColor(float red, float green, float blue, float alpha);
@ -209,9 +207,9 @@ public interface GL {
public int glGetError();
public void glGetInteger(int pname, IntBuffer params);
public void glGetProgram(int program, int pname, IntBuffer params);
public void glGetProgramInfoLog(int program, IntBuffer length, ByteBuffer infoLog);
public String glGetProgramInfoLog(int program, int maxSize);
public void glGetShader(int shader, int pname, IntBuffer params);
public void glGetShaderInfoLog(int shader, IntBuffer length, ByteBuffer infoLog);
public String glGetShaderInfoLog(int shader, int maxSize);
public String glGetString(int name);
public int glGetUniformLocation(int program, String name);
public boolean glIsEnabled(int cap);

@ -156,7 +156,11 @@ public class GLRenderer implements Renderer {
if (m.matches()) {
int major = Integer.parseInt(m.group(1));
int minor = Integer.parseInt(m.group(2));
if (minor >= 10 && minor % 10 == 0) {
// some versions can look like "1.30" instead of "1.3".
// make sure to correct for this
minor /= 10;
}
return major * 100 + minor * 10;
} else {
return -1;
@ -1087,12 +1091,7 @@ public class GLRenderer implements Renderer {
int length = intBuf1.get(0);
if (length > 3) {
// get infos
ByteBuffer logBuf = BufferUtils.createByteBuffer(length);
gl.glGetShaderInfoLog(id, null, logBuf);
byte[] logBytes = new byte[length];
logBuf.get(logBytes, 0, length);
// convert to string, etc
infoLog = new String(logBytes);
infoLog = gl.glGetShaderInfoLog(id, length);
}
}
@ -1158,13 +1157,7 @@ public class GLRenderer implements Renderer {
int length = intBuf1.get(0);
if (length > 3) {
// get infos
ByteBuffer logBuf = BufferUtils.createByteBuffer(length);
gl.glGetProgramInfoLog(id, null, logBuf);
// convert to string, etc
byte[] logBytes = new byte[length];
logBuf.get(logBytes, 0, length);
infoLog = new String(logBytes);
infoLog = gl.glGetProgramInfoLog(id, length);
}
}
@ -2165,9 +2158,6 @@ public class GLRenderer implements Renderer {
case Float:
gl.glBufferData(target, (FloatBuffer) vb.getData(), usage);
break;
case Double:
gl.glBufferData(target, (DoubleBuffer) vb.getData(), usage);
break;
default:
throw new UnsupportedOperationException("Unknown buffer format.");
}

@ -3,7 +3,6 @@ package com.jme3.renderer.lwjgl;
import com.jme3.renderer.opengl.GL;
import com.jme3.renderer.opengl.GL2;
import java.nio.ByteBuffer;
import java.nio.DoubleBuffer;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import java.nio.ShortBuffer;
@ -12,7 +11,6 @@ import org.lwjgl.opengl.GL12;
import org.lwjgl.opengl.GL13;
import org.lwjgl.opengl.GL15;
import org.lwjgl.opengl.GL20;
import org.lwjgl.opengl.GL30;
public class LwjglGL implements GL, GL2 {
@ -32,18 +30,10 @@ public class LwjglGL implements GL, GL2 {
GL15.glBindBuffer(param1, param2);
}
public void glBindFragDataLocation(int param1, int param2, String param3) {
GL30.glBindFragDataLocation(param1, param2, param3);
}
public void glBindTexture(int param1, int param2) {
GL11.glBindTexture(param1, param2);
}
public void glBindVertexArray(int param1) {
GL30.glBindVertexArray(param1);
}
public void glBlendFunc(int param1, int param2) {
GL11.glBlendFunc(param1, param2);
}
@ -52,30 +42,14 @@ public class LwjglGL implements GL, GL2 {
GL15.glBufferData(param1, param2, param3);
}
public void glBufferData(int param1, DoubleBuffer param2, int param3) {
GL15.glBufferData(param1, param2, param3);
}
public void glBufferData(int param1, ShortBuffer param2, int param3) {
GL15.glBufferData(param1, param2, param3);
}
public void glBufferData(int param1, IntBuffer param2, int param3) {
GL15.glBufferData(param1, param2, param3);
}
public void glBufferData(int param1, long param2, int param3) {
GL15.glBufferData(param1, param2, param3);
}
public void glBufferData(int param1, ByteBuffer param2, int param3) {
GL15.glBufferData(param1, param2, param3);
}
public void glBufferSubData(int param1, long param2, IntBuffer param3) {
GL15.glBufferSubData(param1, param2, param3);
}
public void glBufferSubData(int param1, long param2, FloatBuffer param3) {
GL15.glBufferSubData(param1, param2, param3);
}
@ -84,10 +58,6 @@ public class LwjglGL implements GL, GL2 {
GL15.glBufferSubData(param1, param2, param3);
}
public void glBufferSubData(int param1, long param2, DoubleBuffer param3) {
GL15.glBufferSubData(param1, param2, param3);
}
public void glBufferSubData(int param1, long param2, ByteBuffer param3) {
GL15.glBufferSubData(param1, param2, param3);
}
@ -220,18 +190,10 @@ public class LwjglGL implements GL, GL2 {
GL20.glGetProgram(param1, param2, param3);
}
public void glGetProgramInfoLog(int param1, IntBuffer param2, ByteBuffer param3) {
GL20.glGetProgramInfoLog(param1, param2, param3);
}
public void glGetShader(int param1, int param2, IntBuffer param3) {
GL20.glGetShader(param1, param2, param3);
}
public void glGetShaderInfoLog(int param1, IntBuffer param2, ByteBuffer param3) {
GL20.glGetShaderInfoLog(param1, param2, param3);
}
public String glGetString(int param1) {
return GL11.glGetString(param1);
}
@ -268,26 +230,6 @@ public class LwjglGL implements GL, GL2 {
GL11.glReadBuffer(param1);
}
public void glReadPixels(int param1, int param2, int param3, int param4, int param5, int param6, IntBuffer param7) {
GL11.glReadPixels(param1, param2, param3, param4, param5, param6, param7);
}
public void glReadPixels(int param1, int param2, int param3, int param4, int param5, int param6, FloatBuffer param7) {
GL11.glReadPixels(param1, param2, param3, param4, param5, param6, param7);
}
public void glReadPixels(int param1, int param2, int param3, int param4, int param5, int param6, ShortBuffer param7) {
GL11.glReadPixels(param1, param2, param3, param4, param5, param6, param7);
}
public void glReadPixels(int param1, int param2, int param3, int param4, int param5, int param6, long param7) {
GL11.glReadPixels(param1, param2, param3, param4, param5, param6, param7);
}
public void glReadPixels(int param1, int param2, int param3, int param4, int param5, int param6, DoubleBuffer param7) {
GL11.glReadPixels(param1, param2, param3, param4, param5, param6, param7);
}
public void glReadPixels(int param1, int param2, int param3, int param4, int param5, int param6, ByteBuffer param7) {
GL11.glReadPixels(param1, param2, param3, param4, param5, param6, param7);
}
@ -304,54 +246,14 @@ public class LwjglGL implements GL, GL2 {
GL20.glStencilOpSeparate(param1, param2, param3, param4);
}
public void glTexImage2D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, IntBuffer param9) {
GL11.glTexImage2D(param1, param2, param3, param4, param5, param6, param7, param8, param9);
}
public void glTexImage2D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, FloatBuffer param9) {
GL11.glTexImage2D(param1, param2, param3, param4, param5, param6, param7, param8, param9);
}
public void glTexImage2D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, ShortBuffer param9) {
GL11.glTexImage2D(param1, param2, param3, param4, param5, param6, param7, param8, param9);
}
public void glTexImage2D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, long param9) {
GL11.glTexImage2D(param1, param2, param3, param4, param5, param6, param7, param8, param9);
}
public void glTexImage2D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, ByteBuffer param9) {
GL11.glTexImage2D(param1, param2, param3, param4, param5, param6, param7, param8, param9);
}
public void glTexImage2D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, DoubleBuffer param9) {
GL11.glTexImage2D(param1, param2, param3, param4, param5, param6, param7, param8, param9);
}
public void glTexImage3D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, FloatBuffer param10) {
GL12.glTexImage3D(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10);
}
public void glTexImage3D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, IntBuffer param10) {
GL12.glTexImage3D(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10);
}
public void glTexImage3D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, long param10) {
GL12.glTexImage3D(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10);
}
public void glTexImage3D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, DoubleBuffer param10) {
GL12.glTexImage3D(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10);
}
public void glTexImage3D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, ByteBuffer param10) {
GL12.glTexImage3D(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10);
}
public void glTexImage3D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, ShortBuffer param10) {
GL12.glTexImage3D(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10);
}
public void glTexParameterf(int param1, int param2, float param3) {
GL11.glTexParameterf(param1, param2, param3);
}
@ -360,54 +262,14 @@ public class LwjglGL implements GL, GL2 {
GL11.glTexParameteri(param1, param2, param3);
}
public void glTexSubImage2D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, FloatBuffer param9) {
GL11.glTexSubImage2D(param1, param2, param3, param4, param5, param6, param7, param8, param9);
}
public void glTexSubImage2D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, IntBuffer param9) {
GL11.glTexSubImage2D(param1, param2, param3, param4, param5, param6, param7, param8, param9);
}
public void glTexSubImage2D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, ShortBuffer param9) {
GL11.glTexSubImage2D(param1, param2, param3, param4, param5, param6, param7, param8, param9);
}
public void glTexSubImage2D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, long param9) {
GL11.glTexSubImage2D(param1, param2, param3, param4, param5, param6, param7, param8, param9);
}
public void glTexSubImage2D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, DoubleBuffer param9) {
GL11.glTexSubImage2D(param1, param2, param3, param4, param5, param6, param7, param8, param9);
}
public void glTexSubImage2D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, ByteBuffer param9) {
GL11.glTexSubImage2D(param1, param2, param3, param4, param5, param6, param7, param8, param9);
}
public void glTexSubImage3D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, int param10, IntBuffer param11) {
GL12.glTexSubImage3D(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11);
}
public void glTexSubImage3D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, int param10, long param11) {
GL12.glTexSubImage3D(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11);
}
public void glTexSubImage3D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, int param10, ShortBuffer param11) {
GL12.glTexSubImage3D(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11);
}
public void glTexSubImage3D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, int param10, FloatBuffer param11) {
GL12.glTexSubImage3D(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11);
}
public void glTexSubImage3D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, int param10, ByteBuffer param11) {
GL12.glTexSubImage3D(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11);
}
public void glTexSubImage3D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, int param10, DoubleBuffer param11) {
GL12.glTexSubImage3D(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11);
}
public void glUniform1(int param1, FloatBuffer param2) {
GL20.glUniform1(param1, param2);
}
@ -472,34 +334,10 @@ public class LwjglGL implements GL, GL2 {
GL20.glUseProgram(param1);
}
public void glVertexAttribPointer(int param1, int param2, boolean param3, boolean param4, int param5, ShortBuffer param6) {
GL20.glVertexAttribPointer(param1, param2, param3, param4, param5, param6);
}
public void glVertexAttribPointer(int param1, int param2, boolean param3, boolean param4, int param5, IntBuffer param6) {
GL20.glVertexAttribPointer(param1, param2, param3, param4, param5, param6);
}
public void glVertexAttribPointer(int param1, int param2, int param3, boolean param4, int param5, long param6) {
GL20.glVertexAttribPointer(param1, param2, param3, param4, param5, param6);
}
public void glVertexAttribPointer(int param1, int param2, int param3, boolean param4, int param5, ByteBuffer param6) {
GL20.glVertexAttribPointer(param1, param2, param3, param4, param5, param6);
}
public void glVertexAttribPointer(int param1, int param2, boolean param3, boolean param4, int param5, ByteBuffer param6) {
GL20.glVertexAttribPointer(param1, param2, param3, param4, param5, param6);
}
public void glVertexAttribPointer(int param1, int param2, boolean param3, int param4, FloatBuffer param5) {
GL20.glVertexAttribPointer(param1, param2, param3, param4, param5);
}
public void glVertexAttribPointer(int param1, int param2, boolean param3, int param4, DoubleBuffer param5) {
GL20.glVertexAttribPointer(param1, param2, param3, param4, param5);
}
public void glViewport(int param1, int param2, int param3, int param4) {
GL11.glViewport(param1, param2, param3, param4);
}
@ -515,4 +353,12 @@ public class LwjglGL implements GL, GL2 {
public void glShaderSource(int param1, String[] param2, IntBuffer param3) {
GL20.glShaderSource(param1, param2);
}
public String glGetProgramInfoLog(int program, int maxSize) {
return GL20.glGetProgramInfoLog(program, maxSize);
}
public String glGetShaderInfoLog(int shader, int maxSize) {
return GL20.glGetShaderInfoLog(shader, maxSize);
}
}

Loading…
Cancel
Save