Code example for EGL10

Methods: eglGetConfigAttrib

0
        EGLConfig result = null;
 
        int[] value = new int[1];
 
        // Choose 565 color size 
        egl.eglGetConfigAttrib(display, a, EGL10.EGL_GREEN_SIZE, value);
        int greenA = value[0];
 
        egl.eglGetConfigAttrib(display, b, EGL10.EGL_GREEN_SIZE, value);
        int greenB = value[0];
 
        if ((greenA == 6) && (greenB != 6))
            result = a;
        else if ((greenA != 6) && (greenB == 6))
            result = b;
        else // green size is equal 
        { 
            // Choose lowest depth size 
            egl.eglGetConfigAttrib(display, a, EGL10.EGL_DEPTH_SIZE, value);
            int depthA = value[0];
 
            egl.eglGetConfigAttrib(display, b, EGL10.EGL_DEPTH_SIZE, value);
            int depthB = value[0];
 
            if (depthA < depthB)
                result = a;
            else if (depthA > depthB)
                result = b;
            else // depth is equal 
            { 
                // Choose lowest alpha size 
                egl.eglGetConfigAttrib(display, a, EGL10.EGL_ALPHA_SIZE, value);
                int alphaA = value[0];
 
                egl.eglGetConfigAttrib(display, b, EGL10.EGL_ALPHA_SIZE, value);
                int alphaB = value[0];
 
                if (alphaA < alphaB)
                    result = a;
                else if (alphaA > alphaB)
                    result = b;
                else // alpha is equal 
                { 
                    // Choose lowest stencil size 
                    egl.eglGetConfigAttrib(display, a, EGL10.EGL_STENCIL_SIZE, value);
                    int stencilA = value[0];
 
                    egl.eglGetConfigAttrib(display, b, EGL10.EGL_STENCIL_SIZE, value);
                    int stencilB = value[0];
 
                    if (stencilA < stencilB)
                        result = a;
                    else