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


Java EGL10.EGL_STENCIL_SIZE屬性代碼示例

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


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

示例1: ComponentSizeChooser

public ComponentSizeChooser(int redSize, int greenSize, int blueSize,
                            int alphaSize, int depthSize, int stencilSize) {
    super(new int[] {
            EGL10.EGL_RED_SIZE, redSize,
            EGL10.EGL_GREEN_SIZE, greenSize,
            EGL10.EGL_BLUE_SIZE, blueSize,
            EGL10.EGL_ALPHA_SIZE, alphaSize,
            EGL10.EGL_DEPTH_SIZE, depthSize,
            EGL10.EGL_STENCIL_SIZE, stencilSize,
            EGL10.EGL_NONE});
    mValue = new int[1];
    mRedSize = redSize;
    mGreenSize = greenSize;
    mBlueSize = blueSize;
    mAlphaSize = alphaSize;
    mDepthSize = depthSize;
    mStencilSize = stencilSize;
}
 
開發者ID:pavelsemak,項目名稱:alpha-movie,代碼行數:18,代碼來源:GLTextureView.java

示例2: getConfig

private EGLConfig getConfig() {
    int renderableType = 4; // EGL14.EGL_OPENGL_ES2_BIT;
    int[] attribList = {
            EGL10.EGL_DEPTH_SIZE, 0, EGL10.EGL_STENCIL_SIZE, 0, EGL10.EGL_RED_SIZE, 8,
            EGL10.EGL_GREEN_SIZE, 8, EGL10.EGL_BLUE_SIZE, 8, EGL10.EGL_ALPHA_SIZE, 8,
            EGL10.EGL_RENDERABLE_TYPE, renderableType, EGL10.EGL_NONE
    };

    EGLConfig[] configs = new EGLConfig[1];
    int[] numConfigs = new int[1];

    if (!mEGL.eglChooseConfig(mEGLDisplay, attribList, configs, configs.length, numConfigs)) {
        Log.w("ImageEglSurface", "unable to find RGB8888  EGLConfig");
        return null;
    }
    return configs[0];
}
 
開發者ID:hoanganhtuan95ptit,項目名稱:EditPhoto,代碼行數:17,代碼來源:ImageEglSurface.java

示例3: ComponentSizeChooser

public ComponentSizeChooser(int redSize, int greenSize, int blueSize,
                            int alphaSize, int depthSize, int stencilSize) {
    super(new int[]{
            EGL10.EGL_RED_SIZE, redSize,
            EGL10.EGL_GREEN_SIZE, greenSize,
            EGL10.EGL_BLUE_SIZE, blueSize,
            EGL10.EGL_ALPHA_SIZE, alphaSize,
            EGL10.EGL_DEPTH_SIZE, depthSize,
            EGL10.EGL_STENCIL_SIZE, stencilSize,
            EGL10.EGL_NONE});
    mValue = new int[1];
    mRedSize = redSize;
    mGreenSize = greenSize;
    mBlueSize = blueSize;
    mAlphaSize = alphaSize;
    mDepthSize = depthSize;
    mStencilSize = stencilSize;
}
 
開發者ID:uestccokey,項目名稱:EZFilter,代碼行數:18,代碼來源:GLSurfaceView.java

示例4: ComponentSizeChooser

public ComponentSizeChooser(int redSize, int greenSize, int blueSize,
		int alphaSize, int depthSize, int stencilSize, int eglContextClientVersion) {
	super(new int[] { EGL10.EGL_RED_SIZE, redSize,
			EGL10.EGL_GREEN_SIZE, greenSize, EGL10.EGL_BLUE_SIZE,
			blueSize, EGL10.EGL_ALPHA_SIZE, alphaSize,
			EGL10.EGL_DEPTH_SIZE, depthSize, EGL10.EGL_STENCIL_SIZE,
			stencilSize, EGL10.EGL_NONE }, eglContextClientVersion);
	mValue = new int[1];
	mRedSize = redSize;
	mGreenSize = greenSize;
	mBlueSize = blueSize;
	mAlphaSize = alphaSize;
	mDepthSize = depthSize;
	mStencilSize = stencilSize;
}
 
開發者ID:biezhihua,項目名稱:Android_OpenGL_Demo,代碼行數:15,代碼來源:GLWallpaperService.java

示例5: ComponentSizeChooser

public ComponentSizeChooser(int redSize, int greenSize, int blueSize, int alphaSize, int depthSize, int stencilSize) {
  super(new int[]{EGL10.EGL_RED_SIZE, redSize, EGL10.EGL_GREEN_SIZE, greenSize, EGL10.EGL_BLUE_SIZE, blueSize, EGL10.EGL_ALPHA_SIZE, alphaSize, EGL10.EGL_DEPTH_SIZE, depthSize, EGL10.EGL_STENCIL_SIZE, stencilSize, EGL10.EGL_NONE});
  mValue = new int[1];
  mRedSize = redSize;
  mGreenSize = greenSize;
  mBlueSize = blueSize;
  mAlphaSize = alphaSize;
  mDepthSize = depthSize;
  mStencilSize = stencilSize;
}
 
開發者ID:coding-dream,項目名稱:TPlayer,代碼行數:10,代碼來源:EGL.java

示例6: initGL

private boolean initGL() {
    egl10 = (EGL10) EGLContext.getEGL();

    eglDisplay = egl10.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
    if (eglDisplay == EGL10.EGL_NO_DISPLAY) {
        FileLog.e("tmessages", "eglGetDisplay failed " + GLUtils.getEGLErrorString(egl10.eglGetError()));
        finish();
        return false;
    }

    int[] version = new int[2];
    if (!egl10.eglInitialize(eglDisplay, version)) {
        FileLog.e("tmessages", "eglInitialize failed " + GLUtils.getEGLErrorString(egl10.eglGetError()));
        finish();
        return false;
    }

    int[] configsCount = new int[1];
    EGLConfig[] configs = new EGLConfig[1];
    int[] configSpec = new int[]{
            EGL10.EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
            EGL10.EGL_RED_SIZE, 8,
            EGL10.EGL_GREEN_SIZE, 8,
            EGL10.EGL_BLUE_SIZE, 8,
            EGL10.EGL_ALPHA_SIZE, 8,
            EGL10.EGL_DEPTH_SIZE, 0,
            EGL10.EGL_STENCIL_SIZE, 0,
            EGL10.EGL_NONE
    };
    if (!egl10.eglChooseConfig(eglDisplay, configSpec, configs, 1, configsCount)) {
        FileLog.e("tmessages", "eglChooseConfig failed " + GLUtils.getEGLErrorString(egl10.eglGetError()));
        finish();
        return false;
    } else if (configsCount[0] > 0) {
        eglConfig = configs[0];
    } else {
        FileLog.e("tmessages", "eglConfig not initialized");
        finish();
        return false;
    }

    int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE};
    eglContext = egl10.eglCreateContext(eglDisplay, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list);
    if (eglContext == null) {
        FileLog.e("tmessages", "eglCreateContext failed " + GLUtils.getEGLErrorString(egl10.eglGetError()));
        finish();
        return false;
    }

    if (surfaceTexture instanceof SurfaceTexture) {
        eglSurface = egl10.eglCreateWindowSurface(eglDisplay, eglConfig, surfaceTexture, null);
    } else {
        finish();
        return false;
    }

    if (eglSurface == null || eglSurface == EGL10.EGL_NO_SURFACE) {
        FileLog.e("tmessages", "createWindowSurface failed " + GLUtils.getEGLErrorString(egl10.eglGetError()));
        finish();
        return false;
    }
    if (!egl10.eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext)) {
        FileLog.e("tmessages", "eglMakeCurrent failed " + GLUtils.getEGLErrorString(egl10.eglGetError()));
        finish();
        return false;
    }

    GLES20.glEnable(GLES20.GL_BLEND);
    GLES20.glDisable(GLES20.GL_DITHER);
    GLES20.glDisable(GLES20.GL_STENCIL_TEST);
    GLES20.glDisable(GLES20.GL_DEPTH_TEST);

    painting.setupShaders();
    checkBitmap();
    painting.setBitmap(bitmap);

    Utils.HasGLError();

    return true;
}
 
開發者ID:pooyafaroka,項目名稱:PlusGram,代碼行數:80,代碼來源:RenderView.java

示例7: initGL

private void initGL(SurfaceTexture texture) {
    egl10 = (EGL10) EGLContext.getEGL();

    eglDisplay = egl10.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
    if (eglDisplay == EGL10.EGL_NO_DISPLAY) {
        throw new RuntimeException("eglGetDisplay failed " +
                android.opengl.GLUtils.getEGLErrorString(egl10.eglGetError()));
    }

    int[] version = new int[2];
    if (!egl10.eglInitialize(eglDisplay, version)) {
        throw new RuntimeException("eglInitialize failed " +
                android.opengl.GLUtils.getEGLErrorString(egl10.eglGetError()));
    }

    int[] configsCount = new int[1];
    EGLConfig[] configs = new EGLConfig[1];
    int[] configSpec = {
            EGL10.EGL_RENDERABLE_TYPE,
            EGL_OPENGL_ES2_BIT,
            EGL10.EGL_RED_SIZE, 8,
            EGL10.EGL_GREEN_SIZE, 8,
            EGL10.EGL_BLUE_SIZE, 8,
            EGL10.EGL_ALPHA_SIZE, 8,
            EGL10.EGL_DEPTH_SIZE, 0,
            EGL10.EGL_STENCIL_SIZE, 0,
            EGL10.EGL_NONE
    };

    EGLConfig eglConfig = null;
    if (!egl10.eglChooseConfig(eglDisplay, configSpec, configs, 1, configsCount)) {
        throw new IllegalArgumentException("eglChooseConfig failed " +
                android.opengl.GLUtils.getEGLErrorString(egl10.eglGetError()));
    } else if (configsCount[0] > 0) {
        eglConfig = configs[0];
    }
    if (eglConfig == null) {
        throw new RuntimeException("eglConfig not initialized");
    }

    int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE};
    eglContext = egl10.eglCreateContext(eglDisplay, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list);
    eglSurface = egl10.eglCreateWindowSurface(eglDisplay, eglConfig, texture, null);

    if (eglSurface == null || eglSurface == EGL10.EGL_NO_SURFACE) {
        int error = egl10.eglGetError();
        if (error == EGL10.EGL_BAD_NATIVE_WINDOW) {
            Log.e(TAG, "eglCreateWindowSurface returned EGL10.EGL_BAD_NATIVE_WINDOW");
            return;
        }
        throw new RuntimeException("eglCreateWindowSurface failed " +
                android.opengl.GLUtils.getEGLErrorString(error));
    }

    if (!egl10.eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext)) {
        throw new RuntimeException("eglMakeCurrent failed " +
                android.opengl.GLUtils.getEGLErrorString(egl10.eglGetError()));
    }
}
 
開發者ID:SimonCherryGZ,項目名稱:face-landmark-android,代碼行數:59,代碼來源:MyCameraRenderer.java


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