Hi Craig, Thanks for sharing that. My OpenGL stuff is all GLSurfaceView-based, so I don't think this affects me, but hopefully it will benefit others. And my 3D graphics seem to be running OK in the emulator, so I'm hopeful it will on a real device too.
String On Oct 28, 9:32 pm, CraigsRace <[email protected]> wrote: > Don't mind at all. > > The new Android 2.0 phones would log EGL_BAD_SURFACE and show nothing > on the screen. > > Problem was with my GL initialisation (which I think I copied from a > Google Android 1.1 Open GL example): > > int[] configSpec = { > EGL10.EGL_RED_SIZE, 5, > EGL10.EGL_GREEN_SIZE, 6, > EGL10.EGL_BLUE_SIZE, 5, > EGL10.EGL_DEPTH_SIZE, 16, > EGL10.EGL_NONE}; > > EGLConfig[] configs = new EGLConfig[1]; > int[] num_config = new int[1]; > egl.eglChooseConfig(dpy, configSpec, configs, 1, num_config); > > And here is their solution e-mail (I hope they don't mind me posting > it): > > Craig, > After doing some testing and speaking with some of the other Android > engineers, I believe I found the problem. > > In your EGL configSpec, you've specified the following: > > EGL10.EGL_RED_SIZE, 5, > EGL10.EGL_GREEN_SIZE, 6, > EGL10.EGL_BLUE_SIZE, 5, > > With those three parameters, the sample app I was running displayed a > black screen. If I removed them, it worked fine. > > When you specify the EGL_*_SIZE, it means you want AT LEAST that value > for the component. Also, EGL specifies that the EGLConfig are sorted > such that the highest total number of bits are first. Hence, the 8888 > config will come first when you request (at least) 5 6 5. > > The EGL spec also says that if EGL_*_SIZE is not specified or is > EGL_DONT_CARE, then the configs are sorted in order of the LOWEST > EGL_BUFFER_SIZE, so 5 6 5 will come first (unless there is 555 or > 444). > > We had a bug in previous versions of android where we were not sorting > the configs properly. > > It's better to use GLSurfaceView to make sure things work properly. If > you insist on wanting to use eglChooseConfig yourself, you MUST go > through the list of returned configs and pick the one that matches > 5,6,5 (or whatever the window format you selected). > > You can also use EGL_DONT_CARE, which has a greater chance of > returning 565. > > Let me know if this helps. > > On Oct 28, 8:50 pm, String <[email protected]> wrote: > > > > > On Oct 28, 7:20 am, CraigsRace <[email protected]> wrote: > > > > I should also mention that Google were very helpful in tracking down > > > the reason that Android 2.0 broke my apps. Thanks Google! :) > > > Lucky you. Mind sharing what the problem was? I've filed a report on > > one of the regression bugs that broke my app, but am still nailing > > down the second one. > > > Thanks, > > > String --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

