本文整理汇总了Java中android.opengl.GLES10.glClearColor方法的典型用法代码示例。如果您正苦于以下问题:Java GLES10.glClearColor方法的具体用法?Java GLES10.glClearColor怎么用?Java GLES10.glClearColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.opengl.GLES10
的用法示例。
在下文中一共展示了GLES10.glClearColor方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onSurfaceCreated
import android.opengl.GLES10; //导入方法依赖的package包/类
@Override
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
super.onSurfaceCreated(gl,config);
// batch = new SpriteBatch();
// img = new Texture("world.png");
GLES10.glClearColor(0.0f, 0.0f, 0.0f, 0.f);
// Create the GLText
glText = new GLText( gl, context.getAssets() );
// Load the font from file (set size + padding), creates the texture
// NOTE: after a successful call to this the font is ready for rendering!
glText.load( "Roboto-Regular.ttf", 14, 2, 2 ); // Create Font (Height: 14 Pixels / X+Y Padding 2 Pixels)
}
示例2: onDrawFrame
import android.opengl.GLES10; //导入方法依赖的package包/类
@Override
public void onDrawFrame(GL10 gl) {
GLES10.glClearColor(0, 0, 0, 1);
GLES10.glClear(GL10.GL_DEPTH_BUFFER_BIT | GL10.GL_COLOR_BUFFER_BIT);
GLES10.glDepthFunc(GLES10.GL_LEQUAL);
GLES10.glEnable(GLES10.GL_DEPTH_TEST);
area.drawArea(drawcontext);
}
示例3: onSurfaceCreated
import android.opengl.GLES10; //导入方法依赖的package包/类
@Override
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
GLES10.glClearColor(0.4f, 0.4f, 0.4f, 1.0f);
gl.glDisable(GL10.GL_DITHER);
gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_FASTEST);
gl.glShadeModel(GL10.GL_SMOOTH);
gl.glEnable(GL10.GL_DEPTH_TEST);
gl.glEnable(GL10.GL_LIGHTING);
gl.glEnable(GL10.GL_LIGHT0);
float lightAmbient[] = new float[] { 0.5f, 0.5f, 0.5f, 1.0f };
float lightDiffuse[] = new float[] { 0.3f, 0.3f, 0.3f, 1.0f };
float lightSpecular[] = new float[] { 0.3f, 0.3f, 0.3f, 1.0f};
float[] lightPos = new float[] { 1, 1, 1, 1 };
gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_AMBIENT, lightAmbient, 0);
gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_DIFFUSE, lightDiffuse, 0);
gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_SPECULAR, lightSpecular, 0);
gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_POSITION, lightPos, 0);
/* set the materials to the same color values as the object (or at least one of the materials) */
float matAmbient[] = new float[] { 234/255f, 234/255f, 234/255f, 1 };
float matDiffuse[] = new float[] { 234/255f, 234/255f, 234/255f, 1 };
gl.glMaterialfv(GL10.GL_FRONT_AND_BACK, GL10.GL_AMBIENT, matAmbient, 0);
gl.glMaterialfv(GL10.GL_FRONT_AND_BACK, GL10.GL_DIFFUSE, matDiffuse, 0);
shapeDrawer = new ShapeDrawer(ctx);
}
示例4: onSurfaceCreated
import android.opengl.GLES10; //导入方法依赖的package包/类
public void onSurfaceCreated(GL10 unused, EGLConfig config) {
// Transparent background
GLES10.glClearColor(0.0f, 0.0f, 0.0f, 0.f);
}
示例5: onSurfaceCreated
import android.opengl.GLES10; //导入方法依赖的package包/类
public void onSurfaceCreated(GL10 unused, EGLConfig config) {
// Transparent background
GLES10.glClearColor(0.0f, 0.0f, 0.0f, 0.f);
}
示例6: onSurfaceCreated
import android.opengl.GLES10; //导入方法依赖的package包/类
public void onSurfaceCreated(GL10 unused, EGLConfig config) {
// Transparent background
GLES10.glClearColor(0.0f, 0.0f, 0.0f, 0.f);
// GLES20.glClearColor(0.0f, 0.0f, 0.0f, 0.f);
}