Texture widgets render OpenGL example. SurfaceTexture should be passed to eglCreateWindowSurface, while OpenGL stack is being configured.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | private void initGL() { egl = (EGL10) EGLContext.getEGL(); eglDisplay = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY); int[] version = new int[2]; egl.eglInitialize(eglDisplay, version); EGLConfig eglConfig = chooseEglConfig(); eglContext = createContext(egl, eglDisplay, eglConfig); eglSurface = egl.eglCreateWindowSurface(eglDisplay, eglConfig, texture, null); egl.eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext); } |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.