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


Java EGL14.eglQueryContext方法代码示例

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


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

示例1: init

import android.opengl.EGL14; //导入方法依赖的package包/类
private void init(EGLContext shared_context, final boolean with_depth_buffer, final boolean isRecordable) {
	if (DEBUG) Log.v(TAG, "init:");
       if (mEglDisplay != EGL14.EGL_NO_DISPLAY) {
           throw new RuntimeException("EGL already set up");
       }

       mEglDisplay = EGL14.eglGetDisplay(EGL14.EGL_DEFAULT_DISPLAY);
       if (mEglDisplay == EGL14.EGL_NO_DISPLAY) {
           throw new RuntimeException("eglGetDisplay failed");
       }

	final int[] version = new int[2];
       if (!EGL14.eglInitialize(mEglDisplay, version, 0, version, 1)) {
       	mEglDisplay = null;
           throw new RuntimeException("eglInitialize failed");
       }

	shared_context = shared_context != null ? shared_context : EGL14.EGL_NO_CONTEXT;
       if (mEglContext == EGL14.EGL_NO_CONTEXT) {
           mEglConfig = getConfig(with_depth_buffer, isRecordable);
           if (mEglConfig == null) {
               throw new RuntimeException("chooseConfig failed");
           }
           // create EGL rendering context
        mEglContext = createContext(shared_context);
       }
       // confirm whether the EGL rendering context is successfully created
       final int[] values = new int[1];
       EGL14.eglQueryContext(mEglDisplay, mEglContext, EGL14.EGL_CONTEXT_CLIENT_VERSION, values, 0);
       if (DEBUG) Log.d(TAG, "EGLContext created, client version " + values[0]);
       makeDefault();	// makeCurrent(EGL14.EGL_NO_SURFACE);
}
 
开发者ID:zhangyaqiang,项目名称:Fatigue-Detection,代码行数:33,代码来源:EGLBase.java

示例2: init

import android.opengl.EGL14; //导入方法依赖的package包/类
private void init(EGLContext sharedContext, final boolean withDepthBuffer) {
    if (mEglDisplay != EGL14.EGL_NO_DISPLAY) {
        throw new RuntimeException("EGL already set up");
    }

    mEglDisplay = EGL14.eglGetDisplay(EGL14.EGL_DEFAULT_DISPLAY);
    if (mEglDisplay == EGL14.EGL_NO_DISPLAY) {
        throw new RuntimeException("eglGetDisplay failed");
    }

    final int[] version = new int[2];
    if (!EGL14.eglInitialize(mEglDisplay, version, 0, version, 1)) {
        mEglDisplay = null;
        throw new RuntimeException("eglInitialize failed");
    }

    sharedContext = sharedContext != null ? sharedContext : EGL14.EGL_NO_CONTEXT;
    if (mEglContext == EGL14.EGL_NO_CONTEXT) {
        mEglConfig = getConfig(withDepthBuffer);
        if (mEglConfig == null) {
            throw new RuntimeException("chooseConfig failed");
        }
        // create EGL rendering context
        mEglContext = createContext(sharedContext);
    }
    // confirm whether the EGL rendering context is successfully created
    final int[] values = new int[1];
    EGL14.eglQueryContext(mEglDisplay, mEglContext, EGL14.EGL_CONTEXT_CLIENT_VERSION, values, 0);
    makeDefault();
}
 
开发者ID:uestccokey,项目名称:EZFilter,代码行数:31,代码来源:EGLEnvironment.java


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