當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。