当前位置: 首页>>代码示例>>Java>>正文


Java GLES10.glClearColor方法代码示例

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

    }
 
开发者ID:harua8n,项目名称:CodeSamples,代码行数:17,代码来源:SimpleRenderer.java

示例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);
}
 
开发者ID:jsettlers,项目名称:settlers-remake,代码行数:11,代码来源:GOSurfaceView.java

示例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);
}
 
开发者ID:ektodorov,项目名称:OpenGlDraw_Android,代码行数:29,代码来源:RendererDraw.java

示例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);
}
 
开发者ID:yurisuzukiltd,项目名称:AR-Music-Kit,代码行数:6,代码来源:ARRenderer.java

示例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);
    }
 
开发者ID:norips,项目名称:Projet_MBA,代码行数:6,代码来源:ARRenderer.java

示例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);
    }
 
开发者ID:harua8n,项目名称:CodeSamples,代码行数:7,代码来源:ARRenderer.java


注:本文中的android.opengl.GLES10.glClearColor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。