本文整理汇总了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);
}
示例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");
}
}
示例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);
}