本文整理汇总了Java中javax.microedition.khronos.opengles.GL10.glClearDepthf方法的典型用法代码示例。如果您正苦于以下问题:Java GL10.glClearDepthf方法的具体用法?Java GL10.glClearDepthf怎么用?Java GL10.glClearDepthf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.microedition.khronos.opengles.GL10
的用法示例。
在下文中一共展示了GL10.glClearDepthf方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onSurfaceCreated
import javax.microedition.khronos.opengles.GL10; //导入方法依赖的package包/类
@Override
public void onSurfaceCreated(GL10 gl, EGLConfig eglConfig) {
mRenderListener.onSurfaceCreated(gl);
mEngine.getTextureLibrary().LoadTextures(gl);
gl.glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
// Enable Smooth Shading, default not really needed.
gl.glShadeModel(GL10.GL_SMOOTH);
// Depth buffer setup.
gl.glClearDepthf(1.0f);
// Enables depth testing.
gl.glEnable(GL10.GL_DEPTH_TEST);
// The type of depth testing to do.
gl.glDepthFunc(GL10.GL_LEQUAL); // Really nice perspective calculations.
gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_NICEST);
gl.glEnable(GL10.GL_ALPHA_TEST);
gl.glAlphaFunc(GL10.GL_GREATER, 0.1f);
}
示例2: onSurfaceCreated
import javax.microedition.khronos.opengles.GL10; //导入方法依赖的package包/类
@Override
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
// gl.glClearColor(0f, 0f, 0f, 0.5f);
//gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
gl.glEnable(GL10.GL_BLEND);
// gl.glEnable(GL10.GL_TEXTURE_2D);
// gl.glBlendFunc(GL10.GL_ONE, GL10.GL_SRC_COLOR);
gl.glClearDepthf(1.0f);
gl.glEnable(GL10.GL_DEPTH_TEST);
gl.glDepthFunc(GL10.GL_LEQUAL);
gl.glHint(3152, 4354);
gl.glEnable(GL10.GL_NORMALIZE);
gl.glShadeModel(GL10.GL_SMOOTH);
gl.glMatrixMode(GL10.GL_PROJECTION);
// Lighting
gl.glEnable(GL10.GL_LIGHTING);
gl.glLightModelfv(GL10.GL_LIGHT_MODEL_AMBIENT, getFloatBufferFromArray(new float[]{0.5f,0.5f,0.5f,1.0f}));// 全局环境光
gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_AMBIENT_AND_DIFFUSE, new float[]{0.3f, 0.3f, 0.3f, 1.0f}, 0);
gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_POSITION, new float[] { 1000f, 1000f, 1000f, 1.0f }, 0);
gl.glEnable(GL10.GL_LIGHT0);
}
示例3: onSurfaceCreated
import javax.microedition.khronos.opengles.GL10; //导入方法依赖的package包/类
@Override
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
gl.glGenTextures(NUMBER_OF_TEXTURES, mtextureMgr.mtextures, 0);
gl.glShadeModel(GL10.GL_SMOOTH); //Enable Smooth Shading
gl.glClearColor(0.0f, 0.0f, 0.0f, 0.5f); //Black Background
gl.glClearDepthf(1.0f); //Depth Buffer Setup
gl.glEnable(GL10.GL_DEPTH_TEST); //Enables Depth Testing
gl.glDepthFunc(GL10.GL_LEQUAL); //The Type Of Depth Testing To Do
//Really Nice Perspective Calculations
gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_NICEST);
}