當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。