3
« on: December 04, 2012, 12:57:50 am »
This is a general OpenGL question not directly related to jPCT but I would like to ask if anyone here is aware of any OpenGL ES1.x changes in Android 4.2 (JellyBean MR1)?
@Egon, did you need to make any modifications for Jellybean compatibility?
I have an app that uses pure OpenGL ES1.1 and the textures are all messed up on multiple 4.2 devices plus the emulator. If I load 5 textures, the last texture loaded is used for all 5 textures, but if I load only 2 textures, those 2 textures render fine. The texture clipping is also not working properly. The whole texture is rendered instead of the clipping region.
I create the textures by:
int[] textures = new int[5];
gl.glGenTextures(5, textures, 0);
Then load an image resource into a byteBuffer and upload it to the GPU:
gl.glBindTexture(GL11.GL_TEXTURE_2D, textures[n])
gl.glTexParameterf(GL10.GL_TEXTURE_2D,GL10.GL_TEXTURE_MAG_FILTER,GL10.GL_LINEAR)
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER,GL10.GL_LINEAR)
gl.glTexImage2D(GL10.GL_TEXTURE_2D, 0, GL10.GL_RGBA, 512, 512,0, GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE, byteBuffer)
Drawing:
textureCrop0[0] = 0// Left
textureCrop0[1] = 0 // Bottom
textureCrop0[2] = 512// Width
textureCrop0[3] = 512 // Height
gl.glTexParameteriv(GL11.GL_TEXTURE_2D, GL11Ext.GL_TEXTURE_CROP_RECT_OES, textureCrop0, 0)
Were any of these functions changed in 4.2?