當前位置: 首頁>>代碼示例>>Java>>正文


Java EGLExt.EGL_OPENGL_ES3_BIT_KHR屬性代碼示例

本文整理匯總了Java中android.opengl.EGLExt.EGL_OPENGL_ES3_BIT_KHR屬性的典型用法代碼示例。如果您正苦於以下問題:Java EGLExt.EGL_OPENGL_ES3_BIT_KHR屬性的具體用法?Java EGLExt.EGL_OPENGL_ES3_BIT_KHR怎麽用?Java EGLExt.EGL_OPENGL_ES3_BIT_KHR使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.opengl.EGLExt的用法示例。


在下文中一共展示了EGLExt.EGL_OPENGL_ES3_BIT_KHR屬性的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: filterConfigSpec

private int[] filterConfigSpec(int[] configSpec) {
    if (mEGLContextClientVersion != 2 && mEGLContextClientVersion != 3) {
        return configSpec;
    }
    /* We know none of the subclasses define EGL_RENDERABLE_TYPE.
     * And we know the configSpec is well formed.
     */
    int len = configSpec.length;
    int[] newConfigSpec = new int[len + 2];
    System.arraycopy(configSpec, 0, newConfigSpec, 0, len - 1);
    newConfigSpec[len - 1] = EGL10.EGL_RENDERABLE_TYPE;
    if (mEGLContextClientVersion == 2) {
        newConfigSpec[len] = EGL14.EGL_OPENGL_ES2_BIT;  /* EGL_OPENGL_ES2_BIT */
    } else {
        newConfigSpec[len] = EGLExt.EGL_OPENGL_ES3_BIT_KHR; /* EGL_OPENGL_ES3_BIT_KHR */
    }
    newConfigSpec[len + 1] = EGL10.EGL_NONE;
    return newConfigSpec;
}
 
開發者ID:uestccokey,項目名稱:EZFilter,代碼行數:19,代碼來源:GLSurfaceView.java

示例2: filterConfigSpec

private int[] filterConfigSpec(int[] configSpec) {
    if (contextClientVersion != 2 && contextClientVersion != 3) {
        return configSpec;
    }
    /* We know none of the subclasses define EGL_RENDERABLE_TYPE.
     * And we know the configSpec is well formed.
     */
    int len = configSpec.length;
    int[] newConfigSpec = new int[len + 2];
    System.arraycopy(configSpec, 0, newConfigSpec, 0, len - 1);
    newConfigSpec[len - 1] = EGL10.EGL_RENDERABLE_TYPE;
    if (contextClientVersion == 2) {
        newConfigSpec[len] = EGL14.EGL_OPENGL_ES2_BIT;  /* EGL_OPENGL_ES2_BIT */
    } else {
        newConfigSpec[len] = EGLExt.EGL_OPENGL_ES3_BIT_KHR; /* EGL_OPENGL_ES3_BIT_KHR */
    }
    newConfigSpec[len + 1] = EGL10.EGL_NONE;
    return newConfigSpec;
}
 
開發者ID:ChillingVan,項目名稱:android-openGL-canvas,代碼行數:19,代碼來源:GLThread.java

示例3: filterConfigSpec

private int[] filterConfigSpec(int[] configSpec)
{
   int majorGLVersion = eglContextGLESVersion.getMajorVersion();

   if (majorGLVersion != 2 && majorGLVersion != 3)
   {
      return configSpec;
   }
      /* We know none of the subclasses define EGL_RENDERABLE_TYPE.
       * And we know the configSpec is well formed.
       */
   int len = configSpec.length;
   int[] newConfigSpec = new int[len + 2];
   System.arraycopy(configSpec, 0, newConfigSpec, 0, len - 1);
   newConfigSpec[len - 1] = EGL14.EGL_RENDERABLE_TYPE;
   if (majorGLVersion == 2)
   {
      newConfigSpec[len] = EGL14.EGL_OPENGL_ES2_BIT;  /* EGL_OPENGL_ES2_BIT */
   }
   else
   {
      newConfigSpec[len] = EGLExt.EGL_OPENGL_ES3_BIT_KHR; /* EGL_OPENGL_ES3_BIT_KHR */
   }
   newConfigSpec[len + 1] = EGL14.EGL_NONE;
   return newConfigSpec;
}
 
開發者ID:modern-java-graphics,項目名稱:java6-android-glframework,代碼行數:26,代碼來源:GLSurfaceView2.java

示例4: getConfig

/**
 * Finds a suitable EGLConfig.
 *
 * @param flags Bit flags from constructor.
 * @param version Must be 2 or 3.
 */
private EGLConfig getConfig(int flags, int version) {
    int renderableType = EGL14.EGL_OPENGL_ES2_BIT;
    if (version >= 3) {
        renderableType |= EGLExt.EGL_OPENGL_ES3_BIT_KHR;
    }

    // The actual surface is generally RGBA or RGBX, so situationally omitting alpha
    // doesn't really help.  It can also lead to a huge performance hit on glReadPixels()
    // when reading into a GL_RGBA buffer.
    int[] attribList = {
            EGL14.EGL_RED_SIZE, 8,
            EGL14.EGL_GREEN_SIZE, 8,
            EGL14.EGL_BLUE_SIZE, 8,
            EGL14.EGL_ALPHA_SIZE, 8,
            //EGL14.EGL_DEPTH_SIZE, 16,
            //EGL14.EGL_STENCIL_SIZE, 8,
            EGL14.EGL_RENDERABLE_TYPE, renderableType,
            EGL14.EGL_NONE, 0,      // placeholder for recordable [@-3]
            EGL14.EGL_NONE
    };
    if ((flags & FLAG_RECORDABLE) != 0) {
        attribList[attribList.length - 3] = EGL_RECORDABLE_ANDROID;
        attribList[attribList.length - 2] = 1;
    }
    EGLConfig[] configs = new EGLConfig[1];
    int[] numConfigs = new int[1];
    if (!EGL14.eglChooseConfig(mEGLDisplay, attribList, 0, configs, 0, configs.length,
            numConfigs, 0)) {
        Log.w(TAG, "unable to find RGB8888 / " + version + " EGLConfig");
        return null;
    }
    return configs[0];
}
 
開發者ID:zhangyaqiang,項目名稱:Fatigue-Detection,代碼行數:39,代碼來源:EglCore.java

示例5: getConfig

/**
 * Finds a suitable EGLConfig.
 *
 * @param flags   Bit flags from constructor.
 * @param version Must be 2 or 3.
 */
private EGLConfig getConfig(int flags, int version) {
    int renderableType = EGL14.EGL_OPENGL_ES2_BIT;
    if (version >= 3) {
        renderableType |= EGLExt.EGL_OPENGL_ES3_BIT_KHR;
    }

    // The actual surface is generally RGBA or RGBX, so situationally omitting alpha
    // doesn't really help.  It can also lead to a huge performance hit on glReadPixels()
    // when reading into a GL_RGBA buffer.
    int[] attribList = {
            EGL14.EGL_RED_SIZE, 8,
            EGL14.EGL_GREEN_SIZE, 8,
            EGL14.EGL_BLUE_SIZE, 8,
            EGL14.EGL_ALPHA_SIZE, 8,
            //EGL14.EGL_DEPTH_SIZE, 16,
            //EGL14.EGL_STENCIL_SIZE, 8,
            EGL14.EGL_RENDERABLE_TYPE, renderableType,
            EGL14.EGL_NONE, 0,      // placeholder for recordable [@-3]
            EGL14.EGL_NONE
    };
    if ((flags & FLAG_RECORDABLE) != 0) {
        attribList[attribList.length - 3] = EGL_RECORDABLE_ANDROID;
        attribList[attribList.length - 2] = 1;
    }
    EGLConfig[] configs = new EGLConfig[1];
    int[] numConfigs = new int[1];
    if (!EGL14.eglChooseConfig(mEGLDisplay, attribList, 0, configs, 0, configs.length,
            numConfigs, 0)) {
        Log.w(TAG, "unable to find RGB8888 / " + version + " EGLConfig");
        return null;
    }
    return configs[0];
}
 
開發者ID:AgoraIO,項目名稱:Agora-Screen-Sharing-Android,代碼行數:39,代碼來源:EglCore.java

示例6: getConfig

/**
 * Finds a suitable EGLConfig.
 *
 * @param flags Bit flags from constructor.
 * @param version Must be 2 or 3.
 */
private EGLConfig getConfig(int flags, int version) {
    int renderableType = EGL14.EGL_OPENGL_ES2_BIT;
    if (version >= 3) {
        renderableType |= EGLExt.EGL_OPENGL_ES3_BIT_KHR;
    }

    // The actual surface is generally RGBA or RGBX, so situationally omitting alpha
    // doesn't really help.  It can also lead to a huge performance hit on glReadPixels()
    // when reading into a GL_RGBA buffer.
    int[] attribList = {
            EGL14.EGL_RED_SIZE, 8, EGL14.EGL_GREEN_SIZE, 8, EGL14.EGL_BLUE_SIZE, 8,
            EGL14.EGL_ALPHA_SIZE, 8,
            //EGL14.EGL_DEPTH_SIZE, 16,
            //EGL14.EGL_STENCIL_SIZE, 8,
            EGL14.EGL_RENDERABLE_TYPE, renderableType, EGL14.EGL_NONE, 0,
            // placeholder for recordable [@-3]
            EGL14.EGL_NONE
    };
    if ((flags & FLAG_RECORDABLE) != 0) {
        attribList[attribList.length - 3] = EGL_RECORDABLE_ANDROID;
        attribList[attribList.length - 2] = 1;
    }
    EGLConfig[] configs = new EGLConfig[1];
    int[] numConfigs = new int[1];
    if (!EGL14.eglChooseConfig(mEGLDisplay, attribList, 0, configs, 0, configs.length,
            numConfigs, 0)) {
        Log.w(TAG, "unable to find RGB8888 / " + version + " EGLConfig");
        return null;
    }
    return configs[0];
}
 
開發者ID:hoanganhtuan95ptit,項目名稱:EditPhoto,代碼行數:37,代碼來源:EglCore.java

示例7: chooseConfig

@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
public android.opengl.EGLConfig chooseConfig(android.opengl.EGLDisplay display, boolean recordable) {
    int renderableType = EGL14.EGL_OPENGL_ES2_BIT;
    if (contextClientVersion >= 3) {
        renderableType |= EGLExt.EGL_OPENGL_ES3_BIT_KHR;
    }

    // The actual surface is generally RGBA or RGBX, so situationally omitting alpha
    // doesn't really help.  It can also lead to a huge performance hit on glReadPixels()
    // when reading into a GL_RGBA buffer.
    int[] attribList = {
            EGL14.EGL_RED_SIZE, 8,
            EGL14.EGL_GREEN_SIZE, 8,
            EGL14.EGL_BLUE_SIZE, 8,
            EGL14.EGL_ALPHA_SIZE, 8,
            //EGL14.EGL_DEPTH_SIZE, 16,
            //EGL14.EGL_STENCIL_SIZE, 8,
            EGL14.EGL_RENDERABLE_TYPE, renderableType,
            EGL14.EGL_NONE, 0,      // placeholder for recordable [@-3]
            EGL14.EGL_NONE
    };
    if (recordable) {
        attribList[attribList.length - 3] = EGL_RECORDABLE_ANDROID;
        attribList[attribList.length - 2] = 1;
    }
    android.opengl.EGLConfig[] configs = new android.opengl.EGLConfig[1];
    int[] numConfigs = new int[1];
    if (!EGL14.eglChooseConfig(display, attribList, 0, configs, 0, configs.length,
            numConfigs, 0)) {
        Log.w("GLThread", "unable to find RGB8888 / " + contextClientVersion + " EGLConfig");
        return null;
    }
    return configs[0];
}
 
開發者ID:ChillingVan,項目名稱:android-openGL-canvas,代碼行數:34,代碼來源:GLThread.java

示例8: getConfig

/**
 * Finds a suitable EGLConfig.
 *
 * @param flags   Bit flags from constructor.
 * @param version Must be 2 or 3.
 */
private EGLConfig getConfig(int flags, int version) {
    int renderableType = EGL14.EGL_OPENGL_ES2_BIT;
    if (version >= 3) {
        renderableType |= EGLExt.EGL_OPENGL_ES3_BIT_KHR;
    }

    // The actual surface is generally RGBA or RGBX, so situationally omitting alpha
    // doesn't really help.  It can also lead to a huge performance hit on glReadPixels()
    // when reading into a GL_RGBA buffer.
    int[] attribList = {
            EGL14.EGL_RED_SIZE, 8,
            EGL14.EGL_GREEN_SIZE, 8,
            EGL14.EGL_BLUE_SIZE, 8,
            EGL14.EGL_ALPHA_SIZE, 8,
            //EGL14.EGL_DEPTH_SIZE, 16,
            //EGL14.EGL_STENCIL_SIZE, 8,
            EGL14.EGL_RENDERABLE_TYPE, renderableType,
            EGL14.EGL_NONE, 0,      // placeholder for recordable [@-3]
            EGL14.EGL_NONE
    };
    if ((flags & FLAG_RECORDABLE) != 0) {
        attribList[attribList.length - 3] = EGL_RECORDABLE_ANDROID;
        attribList[attribList.length - 2] = 1;
    }
    EGLConfig[] configs = new EGLConfig[1];
    int[] numConfigs = new int[1];
    if (!EGL14.eglChooseConfig(eGLDisplay, attribList, 0, configs, 0, configs.length,
            numConfigs, 0)) {
        Log.w(TAG, "unable to find RGB8888 / " + version + " EGLConfig");
        return null;
    }
    return configs[0];
}
 
開發者ID:muneikh,項目名稱:MockCamera,代碼行數:39,代碼來源:EglCore.java

示例9: 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 and EGL context while getting device capabilities.");
    mEGLMajorVersion = version[0];
    mEGLMinorVersion = version[1];
    // RajLog.d("Device EGL Version: " + version[0] + "." + version[1]);

    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) {
        // The API for GLES3 doesnt exist on this device
        // RajLog.d("Device is API level cannot support OpenGL ES 3.");
        mGLESMajorVersion = 2;
    } else {
        // The API for GLES3 might exist, we need to check
        // RajLog.d("Attempting to get an OpenGL ES 3 config.");
        final int[] configAttribs = {EGL10.EGL_RED_SIZE, 4, EGL10.EGL_GREEN_SIZE, 4, EGL10.EGL_BLUE_SIZE, 4,
            EGL10.EGL_RENDERABLE_TYPE, EGLExt.EGL_OPENGL_ES3_BIT_KHR, EGL10.EGL_NONE};

        final EGLConfig[] configs = new EGLConfig[10];
        final int[] num_config = new int[1];
        egl.eglChooseConfig(display, configAttribs, configs, 10, num_config);
        egl.eglTerminate(display);
        mGLESMajorVersion = num_config[0] > 0 ? 3 : 2;
    }

    // RajLog.d("Determined GLES Major version to be: " + mGLESMajorVersion);
    sGLChecked = true;
}
 
開發者ID:sujitkjha,項目名稱:360-Video-Player-for-Android,代碼行數:31,代碼來源:Capabilities.java

示例10: makeConfigSpecES3

@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
private void makeConfigSpecES3() {
    mConfigSpec[11] = EGLExt.EGL_OPENGL_ES3_BIT_KHR;
}
 
開發者ID:sujitkjha,項目名稱:360-Video-Player-for-Android,代碼行數:4,代碼來源:RajawaliEGLConfigChooser.java

示例11: 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.");

        // Find out how many EGLConfigs exist
        final int[] num_config = new int[1];
        egl.eglGetConfigs(display, null, 0, num_config);

        // Allocate and retrieve the EGLConfigs/handles
        int configCount = num_config[0];
        final EGLConfig[] configs = new EGLConfig[configCount];
        egl.eglGetConfigs(display, configs, configCount, num_config);

        // Check for a config that supports GLES 3 (using a manual search rather than
        // eglChooseConfig(), which may simply ignore the new ES3 bit on older versions)
        final int value[] = new int[1];
        for (EGLConfig config : configs) {
            egl.eglGetConfigAttrib(display, config, EGL10.EGL_RENDERABLE_TYPE, value);
            if ((value[0] & EGLExt.EGL_OPENGL_ES3_BIT_KHR) != 0) {
                // TODO is this secondary check for color sizes useful?
                // We have at least one GLES 3 config, can now use eglChooseConfig()
                // to see if one of them has at least 4 bits per color
                final int[] configAttribs = {
                        EGL10.EGL_RED_SIZE, 4, EGL10.EGL_GREEN_SIZE, 4, EGL10.EGL_BLUE_SIZE, 4,
                        EGL10.EGL_RENDERABLE_TYPE, EGLExt.EGL_OPENGL_ES3_BIT_KHR, EGL10.EGL_NONE};
                value[0] = 0;
                egl.eglChooseConfig(display, configAttribs, configs, 1, value);
                mGLESMajorVersion = value[0] > 0 ? 3 : 2;
                break;
            }
        }
    }
    egl.eglTerminate(display);
    // RajLog.d("Determined GLES Major version to be: " + mGLESMajorVersion);
    sGLChecked = true;
}
 
開發者ID:godstale,項目名稱:VR-Defense-Game,代碼行數:52,代碼來源:Capabilities.java


注:本文中的android.opengl.EGLExt.EGL_OPENGL_ES3_BIT_KHR屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。