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