Created
June 17, 2014 21:46
-
-
Save tachang/401daae7a41802311341 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Generates a frame of data using GL commands. | |
*/ | |
private void generateSurfaceFrame(int frameIndex) { | |
frameIndex %= 8; | |
int startX, startY; | |
if (frameIndex < 4) { | |
// (0,0) is bottom-left in GL | |
startX = frameIndex * (mWidth / 4); | |
startY = mHeight / 2; | |
} else { | |
startX = (7 - frameIndex) * (mWidth / 4); | |
startY = 0; | |
} | |
GLES20.glDisable(GLES20.GL_SCISSOR_TEST); | |
GLES20.glClearColor(TEST_R0 / 255.0f, TEST_G0 / 255.0f, TEST_B0 / 255.0f, 1.0f); | |
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT); | |
GLES20.glEnable(GLES20.GL_SCISSOR_TEST); | |
GLES20.glScissor(startX, startY, mWidth / 4, mHeight / 2); | |
GLES20.glClearColor(TEST_R1 / 255.0f, TEST_G1 / 255.0f, TEST_B1 / 255.0f, 1.0f); | |
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment