Search in sources :

Example 1 with EGLDisplay

use of javax.microedition.khronos.egl.EGLDisplay in project android_frameworks_base by ParanoidAndroid.

the class EGLLogWrapper method eglGetDisplay.

public EGLDisplay eglGetDisplay(Object native_display) {
    begin("eglGetDisplay");
    arg("native_display", native_display);
    end();
    EGLDisplay result = mEgl10.eglGetDisplay(native_display);
    returns(result);
    checkError();
    return result;
}
Also used : EGLDisplay(javax.microedition.khronos.egl.EGLDisplay)

Example 2 with EGLDisplay

use of javax.microedition.khronos.egl.EGLDisplay in project Rajawali by Rajawali.

the class Capabilities method checkGLVersion.

private static void checkGLVersion() {
    // Get an EGL context and display
    final EGL10 egl = (EGL10) EGLContext.getEGL();
    final EGLDisplay display = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
    final int[] version = new int[2];
    if (!egl.eglInitialize(display, version))
        throw new IllegalStateException("Failed to initialize an EGL context while getting device capabilities.");
    mEGLMajorVersion = version[0];
    mEGLMinorVersion = version[1];
    // RajLog.d("Device EGL Version: " + version[0] + "." + version[1]);
    // Assume GLES 2 by default
    mGLESMajorVersion = 2;
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
        // The API for GLES3 might exist, we need to check
        // RajLog.d("Attempting to get an OpenGL ES 3 config.");
        checkGLVersionIs3(egl, display);
    }
    egl.eglTerminate(display);
    // RajLog.d("Determined GLES Major version to be: " + mGLESMajorVersion);
    sGLChecked = true;
}
Also used : EGL10(javax.microedition.khronos.egl.EGL10) EGLDisplay(javax.microedition.khronos.egl.EGLDisplay)

Example 3 with EGLDisplay

use of javax.microedition.khronos.egl.EGLDisplay in project Signal-Android by WhisperSystems.

the class BitmapUtil method getMaxTextureSize.

public static int getMaxTextureSize() {
    final int IMAGE_MAX_BITMAP_DIMENSION = 2048;
    EGL10 egl = (EGL10) EGLContext.getEGL();
    EGLDisplay display = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
    int[] version = new int[2];
    egl.eglInitialize(display, version);
    int[] totalConfigurations = new int[1];
    egl.eglGetConfigs(display, null, 0, totalConfigurations);
    EGLConfig[] configurationsList = new EGLConfig[totalConfigurations[0]];
    egl.eglGetConfigs(display, configurationsList, totalConfigurations[0], totalConfigurations);
    int[] textureSize = new int[1];
    int maximumTextureSize = 0;
    for (int i = 0; i < totalConfigurations[0]; i++) {
        egl.eglGetConfigAttrib(display, configurationsList[i], EGL10.EGL_MAX_PBUFFER_WIDTH, textureSize);
        if (maximumTextureSize < textureSize[0])
            maximumTextureSize = textureSize[0];
    }
    egl.eglTerminate(display);
    return Math.max(maximumTextureSize, IMAGE_MAX_BITMAP_DIMENSION);
}
Also used : EGL10(javax.microedition.khronos.egl.EGL10) EGLDisplay(javax.microedition.khronos.egl.EGLDisplay) EGLConfig(javax.microedition.khronos.egl.EGLConfig)

Example 4 with EGLDisplay

use of javax.microedition.khronos.egl.EGLDisplay in project AndEngine by nicolasgramlich.

the class AndEngine method checkEGLConfigChooserSupport.

private static void checkEGLConfigChooserSupport() throws DeviceNotSupportedException {
    /* Get an EGL instance. */
    final EGL10 egl = (EGL10) EGLContext.getEGL();
    /* Get to the default display. */
    final EGLDisplay eglDisplay = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
    /* We can now initialize EGL for that display. */
    final int[] version = new int[2];
    egl.eglInitialize(eglDisplay, version);
    // TODO Doesn't correlate to possible multisampling request in EngineOptions...
    final ConfigChooser configChooser = new ConfigChooser(false);
    try {
        configChooser.chooseConfig(egl, eglDisplay);
    } catch (final IllegalArgumentException e) {
        throw new DeviceNotSupportedException(DeviceNotSupportedCause.EGLCONFIG_NOT_FOUND, e);
    }
}
Also used : EGL10(javax.microedition.khronos.egl.EGL10) ConfigChooser(org.andengine.opengl.view.ConfigChooser) EGLDisplay(javax.microedition.khronos.egl.EGLDisplay) DeviceNotSupportedException(org.andengine.util.exception.DeviceNotSupportedException)

Example 5 with EGLDisplay

use of javax.microedition.khronos.egl.EGLDisplay in project platform_frameworks_base by android.

the class EGLLogWrapper method eglGetDisplay.

public EGLDisplay eglGetDisplay(Object native_display) {
    begin("eglGetDisplay");
    arg("native_display", native_display);
    end();
    EGLDisplay result = mEgl10.eglGetDisplay(native_display);
    returns(result);
    checkError();
    return result;
}
Also used : EGLDisplay(javax.microedition.khronos.egl.EGLDisplay)

Aggregations

EGLDisplay (javax.microedition.khronos.egl.EGLDisplay)34 EGL10 (javax.microedition.khronos.egl.EGL10)16 EGLConfig (javax.microedition.khronos.egl.EGLConfig)12 EGLContext (javax.microedition.khronos.egl.EGLContext)8 EGLSurface (javax.microedition.khronos.egl.EGLSurface)8 SuppressLint (android.annotation.SuppressLint)1 Paint (android.graphics.Paint)1 TextPaint (android.text.TextPaint)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 ConfigChooser (org.andengine.opengl.view.ConfigChooser)1 DeviceNotSupportedException (org.andengine.util.exception.DeviceNotSupportedException)1