当前位置: 首页>>代码示例>>Java>>正文


Java EGLExt类代码示例

本文整理汇总了Java中android.opengl.EGLExt的典型用法代码示例。如果您正苦于以下问题:Java EGLExt类的具体用法?Java EGLExt怎么用?Java EGLExt使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


EGLExt类属于android.opengl包,在下文中一共展示了EGLExt类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: filterConfigSpec

import android.opengl.EGLExt; //导入依赖的package包/类
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,代码行数:20,代码来源:GLSurfaceView.java

示例2: filterConfigSpec

import android.opengl.EGLExt; //导入依赖的package包/类
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,代码行数:20,代码来源:GLThread.java

示例3: filterConfigSpec

import android.opengl.EGLExt; //导入依赖的package包/类
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,代码行数:27,代码来源:GLSurfaceView2.java

示例4: getConfig

import android.opengl.EGLExt; //导入依赖的package包/类
/**
 * 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,代码行数:40,代码来源:EglCore.java

示例5: setPresentationTime

import android.opengl.EGLExt; //导入依赖的package包/类
/**
 * Sends the presentation time stamp to EGL.
 * @param display an EGL display connection instance
 * @param surface an EGL rendering surface
 * @param nSecs time is expressed in nanoseconds.
 */
public static void setPresentationTime(@NonNull EGLDisplay display,
        @NonNull EGLSurface surface, long nSecs) {
    //noinspection StatementWithEmptyBody
    if (!EGLExt.eglPresentationTimeANDROID(display, surface, nSecs)) {
        logError();
        throw new RuntimeException("Unable to set presentation time (" + nSecs +"ns)." +
                getDisplayString(display) + "; " + getSurfaceString(surface));
    } else {/*
        logDebug("Set presentation time (" + nSecs +"ns)." +
                getDisplayString(display) + "; " + getSurfaceString(surface));*/
    }
}
 
开发者ID:Nik-Gleb,项目名称:mpeg-encoder,代码行数:19,代码来源:GLTools.java

示例6: getConfig

import android.opengl.EGLExt; //导入依赖的package包/类
/**
 * 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,代码行数:40,代码来源:EglCore.java

示例7: swapBuffers

import android.opengl.EGLExt; //导入依赖的package包/类
@Override
public void swapBuffers(long timeStampNs) {
  checkIsNotReleased();
  if (eglSurface == EGL14.EGL_NO_SURFACE) {
    throw new RuntimeException("No EGLSurface - can't swap buffers");
  }
  synchronized (EglBase.lock) {
    // See
    // https://android.googlesource.com/platform/frameworks/native/+/tools_r22.2/opengl/specs/EGL_ANDROID_presentation_time.txt
    EGLExt.eglPresentationTimeANDROID(eglDisplay, eglSurface, timeStampNs);
    EGL14.eglSwapBuffers(eglDisplay, eglSurface);
  }
}
 
开发者ID:Piasy,项目名称:AppRTC-Android,代码行数:14,代码来源:EglBase14.java

示例8: getConfig

import android.opengl.EGLExt; //导入依赖的package包/类
/**
 * 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,代码行数:38,代码来源:EglCore.java

示例9: swapBuffers

import android.opengl.EGLExt; //导入依赖的package包/类
public void swapBuffers(long timeStampNs) {
  checkIsNotReleased();
  if (eglSurface == EGL14.EGL_NO_SURFACE) {
    throw new RuntimeException("No EGLSurface - can't swap buffers");
  }
  synchronized (EglBase.lock) {
    // See
    // https://android.googlesource.com/platform/frameworks/native/+/tools_r22.2/opengl/specs/EGL_ANDROID_presentation_time.txt
    EGLExt.eglPresentationTimeANDROID(eglDisplay, eglSurface, timeStampNs);
    EGL14.eglSwapBuffers(eglDisplay, eglSurface);
  }
}
 
开发者ID:lgyjg,项目名称:AndroidRTC,代码行数:13,代码来源:EglBase14.java

示例10: swapBuffers

import android.opengl.EGLExt; //导入依赖的package包/类
@Override
public void swapBuffers(long timestampNs) {
  checkIsNotReleased();
  if (eglSurface == EGL14.EGL_NO_SURFACE) {
    throw new RuntimeException("No EGLSurface - can't swap buffers");
  }
  synchronized (EglBase.lock) {
    // See
    // https://android.googlesource.com/platform/frameworks/native/+/tools_r22.2/opengl/specs/EGL_ANDROID_presentation_time.txt
    if (timestampNs != -1) {
      EGLExt.eglPresentationTimeANDROID(eglDisplay, eglSurface, timestampNs);
    }
    EGL14.eglSwapBuffers(eglDisplay, eglSurface);
  }
}
 
开发者ID:Piasy,项目名称:VideoCRE,代码行数:16,代码来源:EglBase14.java

示例11: setPresentationTime

import android.opengl.EGLExt; //导入依赖的package包/类
/**
 * Sends the presentation time stamp to EGL.
 *
 * @param nsecs Timestamp, in nanoseconds.
 */
@Override
public void setPresentationTime(long nsecs) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2 && nsecs != 0) {
        EGLExt.eglPresentationTimeANDROID(mEglDisplay, mEglSurface, nsecs);
    }
}
 
开发者ID:ChillingVan,项目名称:android-openGL-canvas,代码行数:12,代码来源:EglHelperAPI17.java

示例12: chooseConfig

import android.opengl.EGLExt; //导入依赖的package包/类
@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,代码行数:35,代码来源:GLThread.java

示例13: swap

import android.opengl.EGLExt; //导入依赖的package包/类
private int swap(final EGLSurface surface, final long presentationTimeNs) {
//		if (DEBUG) Log.v(TAG, "swap:");
		EGLExt.eglPresentationTimeANDROID(mEglDisplay, surface, presentationTimeNs);
        if (!EGL14.eglSwapBuffers(mEglDisplay, surface)) {
        	final int err = EGL14.eglGetError();
//        	if (DEBUG) Log.w(TAG, "swap:err=" + err);
            return err;
        }
        return EGL14.EGL_SUCCESS;
	}
 
开发者ID:saki4510t,项目名称:libcommon,代码行数:11,代码来源:EGLBase14.java

示例14: getConfig

import android.opengl.EGLExt; //导入依赖的package包/类
/**
 * 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,代码行数:40,代码来源:EglCore.java

示例15: checkGLVersion

import android.opengl.EGLExt; //导入依赖的package包/类
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,代码行数:32,代码来源:Capabilities.java


注:本文中的android.opengl.EGLExt类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。