本文整理匯總了Java中android.opengl.GLES20.glFrontFace方法的典型用法代碼示例。如果您正苦於以下問題:Java GLES20.glFrontFace方法的具體用法?Java GLES20.glFrontFace怎麽用?Java GLES20.glFrontFace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.opengl.GLES20
的用法示例。
在下文中一共展示了GLES20.glFrontFace方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: draw
import android.opengl.GLES20; //導入方法依賴的package包/類
@Override
public void draw(GL10 gl){
gl.glRotatef(45f,0,0,0);
GLES20.glFrontFace(GL10.GL_CCW);
GLES20.glEnable(GL10.GL_CULL_FACE);
GLES20.glCullFace(GL10.GL_BACK);
gl.glEnableClientState(GL10.GL_COLOR_ARRAY);
gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
gl.glVertexPointer(3, GL10.GL_FLOAT,0,mVertexBuffer);
gl.glColorPointer(4,GL10.GL_FIXED,0,mColorBuffer);
// gl.glDrawArrays(GL10.GL_TRIANGLES,0,3);
GLES20.glDrawElements(GL10.GL_TRIANGLES,indices.length,GL10.GL_UNSIGNED_SHORT,mIndexBuffer);
// gl.glDrawElements(GL10.GL_COLOR_ARRAY,colors.length,GL10.GL_FLOAT,mColorBuffer);
gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);
gl.glDisableClientState(GL10.GL_COLOR_ARRAY);
GLES20.glDisable(GL10.GL_CULL_FACE);
}
示例2: draw
import android.opengl.GLES20; //導入方法依賴的package包/類
void draw(MatrixManager matrixManager) {
if (checkRunOnDraw(matrixManager)) {
if (isVisible()) {
mIsCurrent.value(true);
GLES20.glDisable(GLES20.GL_CULL_FACE);
GLES20.glFrontFace(GLES20.GL_CCW);
if (mEnableDepthTest) {
GLES20.glEnable(GLES20.GL_DEPTH_TEST);
GLES20.glDepthFunc(GLES20.GL_LEQUAL);
GLES20.glDepthMask(true);
} else {
GLES20.glDisable(GLES20.GL_DEPTH_TEST);
}
if (mEnableBlend) {
GLES20.glEnable(GLES20.GL_BLEND);
GLES20.glBlendFunc(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA);
} else {
GLES20.glDisable(GLES20.GL_BLEND);
}
drawModel(matrixManager);
GLES20.glDisable(GLES20.GL_DEPTH_TEST);
GLES20.glDisable(GLES20.GL_BLEND);
mIsCurrent.value(false);
}
doUpdaterStartedAndStopped();
}
}
示例3: initGLComponents
import android.opengl.GLES20; //導入方法依賴的package包/類
public void initGLComponents() {
mEyeGLProgram = OpenGLUtils.createProgram(EYE_VERTEX_SHADER, EYE_FRAGMENT_SHADER);
mUIOverlayProgram = OpenGLUtils.createProgram(EYE_VERTEX_SHADER, EYE_FRAGMENT_SHADER);
if (FISH_EYE_CORRECTION) {
mSceneGLProgram = OpenGLUtils.createProgram(SCENE_VERTEX_SHADER, SCENE_FRAGMENT_SHADER);
GLES20.glGenTextures(3, textures, 0);
}
else
GLES20.glGenTextures(2, textures, 0);
mVideoTexture = textures[0];
mUIOverlayTexture = textures[1];
if (FISH_EYE_CORRECTION) {
mFBOTexture = textures[2];
GLES20.glActiveTexture(GLES20.GL_TEXTURE2);
if (CHECK_GL_ERRORS) OpenGLUtils.checkGlError("glActiveTexture");
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mFBOTexture);
// set texture parameters
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S,GLES20.GL_CLAMP_TO_EDGE);
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T,GLES20.GL_CLAMP_TO_EDGE);
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER,GLES20.GL_LINEAR);
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER,GLES20.GL_LINEAR);
}
if (CHECK_GL_ERRORS) OpenGLUtils.checkGlError("initialization");
GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
if (CHECK_GL_ERRORS) OpenGLUtils.checkGlError("setup");
GLES20.glBindTexture(GL_TEXTURE_EXTERNAL_OES, mVideoTexture);
if (CHECK_GL_ERRORS) OpenGLUtils.checkGlError("setup");
GLES20.glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR);
GLES20.glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);
GLES20.glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
GLES20.glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);
GLES20.glActiveTexture(GLES20.GL_TEXTURE1);
if (CHECK_GL_ERRORS) OpenGLUtils.checkGlError("setup");
GLES20.glBindTexture(GL_TEXTURE_EXTERNAL_OES, mUIOverlayTexture);
if (CHECK_GL_ERRORS) OpenGLUtils.checkGlError("setup");
GLES20.glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR);
GLES20.glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);
GLES20.glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
GLES20.glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);
GLES20.glFrontFace(GLES20.GL_CW);
GLES20.glEnable(GLES20.GL_SCISSOR_TEST);
}