Code example for EGL10

Methods: eglGetConfigAttrib

0
        EGLConfig result = null;
 
        int[] value = new int[1];
 
        // Choose highest color size 
        egl.eglGetConfigAttrib(display, a, EGL10.EGL_RED_SIZE, value);
        int redA = value[0];
 
        egl.eglGetConfigAttrib(display, b, EGL10.EGL_RED_SIZE, value);
        int redB = value[0];
 
        if (redA > redB)
            result = a;
        else if (redA < redB)
            result = b;
        else // red size is equal 
        { 
            // Choose highest 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 
Stop searching for code, let great code find you!  Add Codota to your java IDE