v0.4.2: various performance improvements to core classes

This commit is contained in:
Evan Debenham
2016-08-29 15:40:28 -04:00
parent 71c7c264ac
commit 926b02ce65
4 changed files with 31 additions and 42 deletions
@@ -47,14 +47,14 @@ public class Attribute {
}
public void vertexPointer( int size, int stride, FloatBuffer ptr ) {
GLES20.glVertexAttribPointer( location, size, GLES20.GL_FLOAT, false, stride * Float.SIZE / 8, ptr );
GLES20.glVertexAttribPointer( location, size, GLES20.GL_FLOAT, false, stride * 4, ptr );
}
public void vertexBuffer( int size, int stride, int offset) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
GLES20.glVertexAttribPointer(location, size, GLES20.GL_FLOAT, false, stride * Float.SIZE / 8, offset * Float.SIZE / 8);
GLES20.glVertexAttribPointer(location, size, GLES20.GL_FLOAT, false, stride * 4, offset * 4);
} else {
FroyoGLES20Fix.glVertexAttribPointer(location, size, GLES20.GL_FLOAT, false, stride * Float.SIZE / 8, offset * Float.SIZE / 8);
FroyoGLES20Fix.glVertexAttribPointer(location, size, GLES20.GL_FLOAT, false, stride * 4, offset * 4);
}
}
}