texture dosn`t bind to p-buffer at first time
I`m trying to work with p-buffer, and now i have some strange situation.
I do next:
eglMakeCurrent(eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT) ;
eglMakeCurrent(eglDisplay, eglPBuffer, eglPBuffer, vglContext); //binding p-buffer and openvg context
//now i draw something to p-buffer via OpenVG
eglBindTexImage(eglDisplay, eglPBuffer, EGL_BACK_BUFFER);
//now i draw something and use p-buffer as texture via OpenGL ES
eglReleaseTexImage(eglDisplay, eglPBuffer, EGL_BACK_BUFFER);
It works fine, but! At first time texture contains some thrash, but not that i had drawn.
At second time of cycle, and after, it works properly.
Maybe it is because drawing goes to back buffer, and texture are binding to front buffer?
But third parameter of eglBindTexImage can be only EGL_BACK_BUFFER.
I`d try to set vgFinish or eglSwapBuffers but it doesn`t help.