We are trying to re-initialize OpenGL instance on Android in the
SurfaceFlinger. For this, I am calling an API in SurfaceFlinger
implemented by us. This API inturn speaks with OpenGL through
DisplayHardware.

Now, to re-initialize OpenGL, first I flush the existing OpenGL
instance & then recreate a new one. Following steps are followed to
flush the existing OpenGL instance:

    eglMakeCurrent(mDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE,
EGL_NO_CONTEXT);
    eglDestroySurface(mDisplay, mSurface);
    eglDestroyContext(mDisplay, mContext);

    eglTerminate(mDisplay);

    Then to re-initialize:
        EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
        eglInitialize(display, NULL, NULL);
        eglGetConfigs(display, NULL, 0, &numConfigs);
        surface = eglCreateWindowSurface(display, config,
mNativeWindow.get(), NULL);
        context = eglCreateContext(display, config, NULL,
contextAttributes);

The flushing thing works fine. But the problem comes when we
reinitialize OpenGL. The call to eglCreateWindowSurface() returns a
NULL Surface with an error code 0x3003 (EGL_BAD_ALLOC).

Any idea where am I doing anything wrong??

OR

Can you please tell me a sequence through which I can recreate a
OpenGL instance.

OR

Is there anything which I need to take care while deleting the OpenGL.

Thanks in advance. -Jigar

-- 
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

Reply via email to