Search in sources :

Example 1 with ConfigChooser

use of org.andengine.opengl.view.ConfigChooser 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)

Aggregations

EGL10 (javax.microedition.khronos.egl.EGL10)1 EGLDisplay (javax.microedition.khronos.egl.EGLDisplay)1 ConfigChooser (org.andengine.opengl.view.ConfigChooser)1 DeviceNotSupportedException (org.andengine.util.exception.DeviceNotSupportedException)1