Java Code Examples for javax.microedition.khronos.egl.EGL10#EGL_BAD_SURFACE

The following examples show how to use javax.microedition.khronos.egl.EGL10#EGL_BAD_SURFACE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EGL.java    From MyHearts with Apache License 2.0 6 votes vote down vote up
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;
}
 
Example 2
Source File: EGL.java    From HPlayer with Apache License 2.0 6 votes vote down vote up
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;
}
 
Example 3
Source File: EGL.java    From video-player with MIT License 6 votes vote down vote up
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;
}
 
Example 4
Source File: EGL.java    From NetEasyNews with GNU General Public License v3.0 6 votes vote down vote up
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;
}
 
Example 5
Source File: EGL.java    From react-native-android-vitamio with MIT License 6 votes vote down vote up
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;
}
 
Example 6
Source File: EGL.java    From Vitamio with Apache License 2.0 6 votes vote down vote up
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;
}
 
Example 7
Source File: EGL.java    From BambooPlayer with Apache License 2.0 6 votes vote down vote up
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;
}
 
Example 8
Source File: RendererUtil.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
/**
 * Checks for an EGL error and throws a {@link RendererException} if there
 * is one. Ignores the value of {@link RendererUtil#ENABLE_ERROR_CHECKING}.
 */
public static void checkEGLError(EGL10 egl) {
    int error = egl.eglGetError();
    if (error != EGL10.EGL_SUCCESS) {
        String errorMessage;
        switch (error) {
            case EGL10.EGL_SUCCESS:
                return;
            case EGL10.EGL_NOT_INITIALIZED:
                errorMessage = "EGL is not initialized, or could not be "
                        + "initialized, for the specified EGL display connection. ";
                break;
            case EGL10.EGL_BAD_ACCESS:
                errorMessage = "EGL cannot access a requested resource "
                        + "(for example a context is bound in another thread). ";
                break;
            case EGL10.EGL_BAD_ALLOC:
                errorMessage = "EGL failed to allocate resources for the requested operation.";
                break;
            case EGL10.EGL_BAD_ATTRIBUTE:
                errorMessage = "An unrecognized attribute or attribute "
                        + "value was passed in the attribute list. ";
                break;
            case EGL10.EGL_BAD_CONTEXT:
                errorMessage = "An EGLContext argument does not name a valid EGL rendering context. ";
                break;
            case EGL10.EGL_BAD_CONFIG:
                errorMessage = "An EGLConfig argument does not name a valid EGL frame buffer configuration. ";
                break;
            case EGL10.EGL_BAD_CURRENT_SURFACE:
                errorMessage = "The current surface of the calling thread "
                        + "is a window, pixel buffer or pixmap that is no longer valid. ";
                break;
            case EGL10.EGL_BAD_DISPLAY:
                errorMessage = "An EGLDisplay argument does not name a valid EGL display connection. ";
                break;
            case EGL10.EGL_BAD_SURFACE:
                errorMessage = "An EGLSurface argument does not name a "
                        + "valid surface (window, pixel buffer or pixmap) configured for GL rendering. ";
                break;
            case EGL10.EGL_BAD_MATCH:
                errorMessage = "Arguments are inconsistent (for example, a "
                        + "valid context requires buffers not supplied by a valid surface). ";
                break;
            case EGL10.EGL_BAD_PARAMETER:
                errorMessage = "One or more argument values are invalid.";
                break;
            case EGL10.EGL_BAD_NATIVE_PIXMAP:
                errorMessage = "A NativePixmapType argument does not refer to a valid native pixmap. ";
                break;
            case EGL10.EGL_BAD_NATIVE_WINDOW:
                errorMessage = "A NativeWindowType argument does not refer to a valid native window. ";
                break;
            case EGL11.EGL_CONTEXT_LOST:
                errorMessage = "A power management event has occurred. "
                        + "The application must destroy all contexts and reinitialise "
                        + "OpenGL ES state and objects to continue rendering. ";
                break;
            default:
                errorMessage = "Unknown";
        }
        
        throw new RendererException("EGL error 0x" + Integer.toHexString(error) + ": " + errorMessage);
    }
}