In my game I used a 16 bit Z-buffer configuration that suited all previous Android phones (HTC G1, Magic, Hero, Samsung Galaxy, Motorola Dext, Huawei Pulse), but on the Droid I received comments about the fact that the game is unplayable because of 'ghosting'. I don't have the phone, which is an Android 2.0. After digging on the internet I found that the Droid 'likes' a 24-bit Z-buffer. So I tried this fix:
Using java Syntax Highlighting
- int[] attributes=new int[]{
- EGL10.EGL_DEPTH_SIZE,
- 24,
- EGL10.EGL_NONE };
- int[] attributes2=new int[]{
- EGL10.EGL_DEPTH_SIZE,
- 16,
- EGL10.EGL_NONE };
- EGLConfig[] configs=new EGLConfig[1];
- int[] result=new int[1];
- egl.eglChooseConfig(display,attributes,configs,1,result);
- if(result[0] < 1 )
- egl.eglChooseConfig(display,attributes2,configs,1,result);
Parsed in 0.032 seconds, using GeSHi 1.0.8.4
Basically I request a 24-bit Z-buffer (for Droid) and if it fails (on previous android phones it does) then I select the common 16 bit Z-buffer. I posted the update on the Market and i received a comment that 'it works on Droid'. I cannot test the code myself but it seems it works...
Can anyone confirm this is a good solution to support all the Android phones released until now?



