private void throwEglException(String function) { throwEglException(function, mEgl.eglGetError()); }
public boolean swap() { if (!mEgl.eglSwapBuffers(mEglDisplay, mEglSurface)) { int error = mEgl.eglGetError(); switch (error) { case EGL11.EGL_CONTEXT_LOST: return false; case EGL10.EGL_BAD_NATIVE_WINDOW: Log.e("EglHelper", "eglSwapBuffers returned EGL_BAD_NATIVE_WINDOW. tid=" + Thread.currentThread().getId()); break; case EGL10.EGL_BAD_SURFACE: Log.e("EglHelper", "eglSwapBuffers returned EGL_BAD_SURFACE. tid=" + Thread.currentThread().getId()); return false; default: throwEglException("eglSwapBuffers", error); } } return true; }
public GL createSurface(Surface surface) { if (mEgl == null) throw new RuntimeException("egl not initialized"); if (mEglDisplay == null) throw new RuntimeException("eglDisplay not initialized"); if (mEglConfig == null) throw new RuntimeException("mEglConfig not initialized"); if (mEglSurface != null && mEglSurface != EGL10.EGL_NO_SURFACE) { mEgl.eglMakeCurrent(mEglDisplay, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_CONTEXT); mEGLWindowSurfaceFactory.destroySurface(mEgl, mEglDisplay, mEglSurface); } mEglSurface = mEGLWindowSurfaceFactory.createWindowSurface(mEgl, mEglDisplay, mEglConfig, surface); if (mEglSurface == null || mEglSurface == EGL10.EGL_NO_SURFACE) { int error = mEgl.eglGetError(); if (error == EGL10.EGL_BAD_NATIVE_WINDOW) { Log.e("EglHelper", "createWindowSurface returned EGL_BAD_NATIVE_WINDOW."); return null; } throwEglException("createWindowSurface", error); } if (!mEgl.eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface, mEglContext)) { throwEglException("eglMakeCurrent"); } GL gl = mEglContext.getGL(); return gl; }
public void start() { mEgl = (EGL10) EGLContext.getEGL(); mEglDisplay = mEgl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY); if (mEglDisplay == EGL10.EGL_NO_DISPLAY) { throw new RuntimeException("eglGetDisplay failed"); } int[] version = new int[2]; if (!mEgl.eglInitialize(mEglDisplay, version)) { throw new RuntimeException("eglInitialize failed"); } mEglConfig = mEGLConfigChooser.chooseConfig(mEgl, mEglDisplay); mEglContext = mEGLContextFactory.createContext(mEgl, mEglDisplay, mEglConfig); if (mEglContext == null || mEglContext == EGL10.EGL_NO_CONTEXT) { mEglContext = null; throwEglException("createContext"); } mEglSurface = null; }
private void throwEglException(String function) { throwEglException(function, mEgl.eglGetError()); }
private void throwEglException(String function) { throwEglException(function, mEgl.eglGetError()); }
private void throwEglException(String function) { throwEglException(function, mEgl.eglGetError()); }
private void throwEglException(String function) { throwEglException(function, mEgl.eglGetError()); }
private void throwEglException(String function) { throwEglException(function, mEgl.eglGetError()); }
public boolean swap() { if (!mEgl.eglSwapBuffers(mEglDisplay, mEglSurface)) { int error = mEgl.eglGetError(); switch (error) { case EGL11.EGL_CONTEXT_LOST: return false; case EGL10.EGL_BAD_NATIVE_WINDOW: Log.e("EglHelper", "eglSwapBuffers returned EGL_BAD_NATIVE_WINDOW. tid=" + Thread.currentThread().getId()); break; case EGL10.EGL_BAD_SURFACE: Log.e("EglHelper", "eglSwapBuffers returned EGL_BAD_SURFACE. tid=" + Thread.currentThread().getId()); return false; default: throwEglException("eglSwapBuffers", error); } } return true; }
public boolean swap() { if (!mEgl.eglSwapBuffers(mEglDisplay, mEglSurface)) { int error = mEgl.eglGetError(); switch (error) { case EGL11.EGL_CONTEXT_LOST: return false; case EGL10.EGL_BAD_NATIVE_WINDOW: Log.e("EglHelper", "eglSwapBuffers returned EGL_BAD_NATIVE_WINDOW. tid=" + Thread.currentThread().getId()); break; case EGL10.EGL_BAD_SURFACE: Log.e("EglHelper", "eglSwapBuffers returned EGL_BAD_SURFACE. tid=" + Thread.currentThread().getId()); return false; default: throwEglException("eglSwapBuffers", error); } } return true; }
public boolean swap() { if (!mEgl.eglSwapBuffers(mEglDisplay, mEglSurface)) { int error = mEgl.eglGetError(); switch (error) { case EGL11.EGL_CONTEXT_LOST: return false; case EGL10.EGL_BAD_NATIVE_WINDOW: Log.e("EglHelper", "eglSwapBuffers returned EGL_BAD_NATIVE_WINDOW. tid=" + Thread.currentThread().getId()); break; case EGL10.EGL_BAD_SURFACE: Log.e("EglHelper", "eglSwapBuffers returned EGL_BAD_SURFACE. tid=" + Thread.currentThread().getId()); return false; default: throwEglException("eglSwapBuffers", error); } } return true; }
public boolean swap() { if (!mEgl.eglSwapBuffers(mEglDisplay, mEglSurface)) { int error = mEgl.eglGetError(); switch (error) { case EGL11.EGL_CONTEXT_LOST: return false; case EGL10.EGL_BAD_NATIVE_WINDOW: Log.e("EglHelper", "eglSwapBuffers returned EGL_BAD_NATIVE_WINDOW. tid=" + Thread.currentThread().getId()); break; case EGL10.EGL_BAD_SURFACE: Log.e("EglHelper", "eglSwapBuffers returned EGL_BAD_SURFACE. tid=" + Thread.currentThread().getId()); return false; default: throwEglException("eglSwapBuffers", error); } } return true; }
public boolean swap() { if (!mEgl.eglSwapBuffers(mEglDisplay, mEglSurface)) { int error = mEgl.eglGetError(); switch (error) { case EGL11.EGL_CONTEXT_LOST: return false; case EGL10.EGL_BAD_NATIVE_WINDOW: Log.e("EglHelper", "eglSwapBuffers returned EGL_BAD_NATIVE_WINDOW. tid=" + Thread.currentThread().getId()); break; case EGL10.EGL_BAD_SURFACE: Log.e("EglHelper", "eglSwapBuffers returned EGL_BAD_SURFACE. tid=" + Thread.currentThread().getId()); return false; default: throwEglException("eglSwapBuffers", error); } } return true; }
public GL createSurface(Surface surface) { if (mEgl == null) throw new RuntimeException("egl not initialized"); if (mEglDisplay == null) throw new RuntimeException("eglDisplay not initialized"); if (mEglConfig == null) throw new RuntimeException("mEglConfig not initialized"); if (mEglSurface != null && mEglSurface != EGL10.EGL_NO_SURFACE) { mEgl.eglMakeCurrent(mEglDisplay, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_CONTEXT); mEGLWindowSurfaceFactory.destroySurface(mEgl, mEglDisplay, mEglSurface); } mEglSurface = mEGLWindowSurfaceFactory.createWindowSurface(mEgl, mEglDisplay, mEglConfig, surface); if (mEglSurface == null || mEglSurface == EGL10.EGL_NO_SURFACE) { int error = mEgl.eglGetError(); if (error == EGL10.EGL_BAD_NATIVE_WINDOW) { Log.e("EglHelper", "createWindowSurface returned EGL_BAD_NATIVE_WINDOW."); return null; } throwEglException("createWindowSurface", error); } if (!mEgl.eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface, mEglContext)) { throwEglException("eglMakeCurrent"); } GL gl = mEglContext.getGL(); return gl; }
public void start() { mEgl = (EGL10) EGLContext.getEGL(); mEglDisplay = mEgl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY); if (mEglDisplay == EGL10.EGL_NO_DISPLAY) { throw new RuntimeException("eglGetDisplay failed"); } int[] version = new int[2]; if (!mEgl.eglInitialize(mEglDisplay, version)) { throw new RuntimeException("eglInitialize failed"); } mEglConfig = mEGLConfigChooser.chooseConfig(mEgl, mEglDisplay); mEglContext = mEGLContextFactory.createContext(mEgl, mEglDisplay, mEglConfig); if (mEglContext == null || mEglContext == EGL10.EGL_NO_CONTEXT) { mEglContext = null; throwEglException("createContext"); } mEglSurface = null; }
public void start() { mEgl = (EGL10) EGLContext.getEGL(); mEglDisplay = mEgl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY); if (mEglDisplay == EGL10.EGL_NO_DISPLAY) { throw new RuntimeException("eglGetDisplay failed"); } int[] version = new int[2]; if (!mEgl.eglInitialize(mEglDisplay, version)) { throw new RuntimeException("eglInitialize failed"); } mEglConfig = mEGLConfigChooser.chooseConfig(mEgl, mEglDisplay); mEglContext = mEGLContextFactory.createContext(mEgl, mEglDisplay, mEglConfig); if (mEglContext == null || mEglContext == EGL10.EGL_NO_CONTEXT) { mEglContext = null; throwEglException("createContext"); } mEglSurface = null; }
public void start() { mEgl = (EGL10) EGLContext.getEGL(); mEglDisplay = mEgl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY); if (mEglDisplay == EGL10.EGL_NO_DISPLAY) { throw new RuntimeException("eglGetDisplay failed"); } int[] version = new int[2]; if (!mEgl.eglInitialize(mEglDisplay, version)) { throw new RuntimeException("eglInitialize failed"); } mEglConfig = mEGLConfigChooser.chooseConfig(mEgl, mEglDisplay); mEglContext = mEGLContextFactory.createContext(mEgl, mEglDisplay, mEglConfig); if (mEglContext == null || mEglContext == EGL10.EGL_NO_CONTEXT) { mEglContext = null; throwEglException("createContext"); } mEglSurface = null; }
public void start() { mEgl = (EGL10) EGLContext.getEGL(); mEglDisplay = mEgl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY); if (mEglDisplay == EGL10.EGL_NO_DISPLAY) { throw new RuntimeException("eglGetDisplay failed"); } int[] version = new int[2]; if (!mEgl.eglInitialize(mEglDisplay, version)) { throw new RuntimeException("eglInitialize failed"); } mEglConfig = mEGLConfigChooser.chooseConfig(mEgl, mEglDisplay); mEglContext = mEGLContextFactory.createContext(mEgl, mEglDisplay, mEglConfig); if (mEglContext == null || mEglContext == EGL10.EGL_NO_CONTEXT) { mEglContext = null; throwEglException("createContext"); } mEglSurface = null; }
public void start() { mEgl = (EGL10) EGLContext.getEGL(); mEglDisplay = mEgl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY); if (mEglDisplay == EGL10.EGL_NO_DISPLAY) { throw new RuntimeException("eglGetDisplay failed"); } int[] version = new int[2]; if (!mEgl.eglInitialize(mEglDisplay, version)) { throw new RuntimeException("eglInitialize failed"); } mEglConfig = mEGLConfigChooser.chooseConfig(mEgl, mEglDisplay); mEglContext = mEGLContextFactory.createContext(mEgl, mEglDisplay, mEglConfig); if (mEglContext == null || mEglContext == EGL10.EGL_NO_CONTEXT) { mEglContext = null; throwEglException("createContext"); } mEglSurface = null; }