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


Java EGL14.eglGetCurrentDisplay方法代码示例

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


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

示例1: logCurrent

import android.opengl.EGL14; //导入方法依赖的package包/类
/**
 * Writes the current display, context, and surface to the log.
 */
public static void logCurrent(String msg) {
    EGLDisplay display;
    EGLContext context;
    EGLSurface surface;

    display = EGL14.eglGetCurrentDisplay();
    context = EGL14.eglGetCurrentContext();
    surface = EGL14.eglGetCurrentSurface(EGL14.EGL_DRAW);
    Log.i(TAG, "Current EGL (" + msg + "): display=" + display + ", context=" + context +
            ", surface=" + surface);
}
 
开发者ID:zhangyaqiang,项目名称:Fatigue-Detection,代码行数:15,代码来源:EglCore.java

示例2: draw

import android.opengl.EGL14; //导入方法依赖的package包/类
void draw() {
    EGLDisplay mSavedEglDisplay = EGL14.eglGetCurrentDisplay();
    EGLSurface mSavedEglDrawSurface = EGL14.eglGetCurrentSurface(EGL14.EGL_DRAW);
    EGLSurface mSavedEglReadSurface = EGL14.eglGetCurrentSurface(EGL14.EGL_READ);
    EGLContext mSavedEglContext = EGL14.eglGetCurrentContext();
    {
        AndroidUntil.checkGlError("draw_S");
        if (mRecorderImpl.isFirstSetup()) {
            mRecorderImpl.startSwapAsync();
            mRecorderImpl.makeCurrent();
            AndroidUntil.checkGlError("initGL_S");

            mProgram = AndroidUntil.createProgram();
            maPositionHandle = GLES20.glGetAttribLocation(mProgram, "position");
            maTextCodeHandle = GLES20.glGetAttribLocation(mProgram, "inputTextureCoordinate");
            muSamplerHandle = GLES20.glGetUniformLocation(mProgram, "uSampler");
            muPosMtxHandle = GLES20.glGetUniformLocation(mProgram, "uPosMtx");

            Matrix.scaleM(mSymmetryMtx, 0, -1, 1, 1);
            GLES20.glDisable(GLES20.GL_DEPTH_TEST);
            GLES20.glDisable(GLES20.GL_CULL_FACE);
            GLES20.glDisable(GLES20.GL_BLEND);
            AndroidUntil.checkGlError("initGL_E");
        } else {
            mRecorderImpl.makeCurrent();
        }
        GLES20.glViewport(0, 0, mVideoWidth, mVideoHeight);
        GLES20.glClearColor(0f, 0f, 0f, 1f);
        GLES20.glClear(GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT);
        GLES20.glUseProgram(mProgram);
        mNormalVtxBuf.position(0);
        GLES20.glVertexAttribPointer(maPositionHandle,
                3, GLES20.GL_FLOAT, false, 4 * 3, mNormalVtxBuf);
        GLES20.glEnableVertexAttribArray(maPositionHandle);
        mCameraVertexCoordinatesBuffer.position(0);
        GLES20.glVertexAttribPointer(maTextCodeHandle,
                2, GLES20.GL_FLOAT, false, 4 * 2, mCameraVertexCoordinatesBuffer);
        GLES20.glEnableVertexAttribArray(maTextCodeHandle);
        GLES20.glUniform1i(muSamplerHandle, 0);
        GLES20.glUniformMatrix4fv(muPosMtxHandle, 1, false, mNormalMtx, 0);
        GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
        GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mFboTexId);
        GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);

        mRecorderImpl.swapBuffers();
        AndroidUntil.checkGlError("draw_E");
    }
    if (!EGL14.eglMakeCurrent(
            mSavedEglDisplay,
            mSavedEglDrawSurface,
            mSavedEglReadSurface,
            mSavedEglContext)) {
        throw new RuntimeException("eglMakeCurrent failed");
    }
}
 
开发者ID:wuyisheng,项目名称:libRtmp,代码行数:56,代码来源:RendererImpl.java

示例3: logCurrent

import android.opengl.EGL14; //导入方法依赖的package包/类
public static void logCurrent(String msg) {
    EGLDisplay display = EGL14.eglGetCurrentDisplay();
    EGLContext context = EGL14.eglGetCurrentContext();
    EGLSurface surface = EGL14.eglGetCurrentSurface(EGL14.EGL_DRAW);
    Log.i("EglCore", "Current EGL (" + msg + "): display=" + display + ", context=" + context + ", surface=" + surface);
}
 
开发者ID:AgoraIO,项目名称:Agora-Screen-Sharing-Android,代码行数:7,代码来源:EglCore.java


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