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


Java GLES11.glClearColor方法代码示例

本文整理汇总了Java中android.opengl.GLES11.glClearColor方法的典型用法代码示例。如果您正苦于以下问题:Java GLES11.glClearColor方法的具体用法?Java GLES11.glClearColor怎么用?Java GLES11.glClearColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.opengl.GLES11的用法示例。


在下文中一共展示了GLES11.glClearColor方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initializeGl

import android.opengl.GLES11; //导入方法依赖的package包/类
public void initializeGl(Rect visibleArea) {				
	float ratio = (float) windowWidth / (float) windowHeight;
     
	GlUtils.setViewport(visibleArea);
       GLES11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
       GLES11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
       GLES11.glPointSize(2.0f);

       GLES11.glTexEnvf(GLES11.GL_TEXTURE_ENV, GLES11.GL_TEXTURE_ENV_MODE, GLES11.GL_MODULATE);
       
    GLES11.glBlendFunc(GLES11.GL_SRC_ALPHA, GLES11.GL_ONE_MINUS_SRC_ALPHA);
       GLES11.glDisable(GLES11.GL_BLEND);

       GLES11.glMatrixMode(GLES11.GL_PROJECTION);
       GLES11.glLoadIdentity();
       GlUtils.gluPerspective(game, 120f, ratio, 0.01f, 100f);
       GLES11.glMatrixMode(GLES11.GL_MODELVIEW);
       GLES11.glLoadIdentity();        
       GLES11.glEnableClientState(GLES11.GL_VERTEX_ARRAY);
       GLES11.glEnableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);
       
       GLES11.glEnable(GLES11.GL_TEXTURE_2D);
       GLES11.glEnable(GLES11.GL_DEPTH_TEST);        
       ((Alite) game).getTextureManager().setTexture(textureFilename);
       GLES11.glDisable(GLES11.GL_LIGHTING);
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:27,代码来源:HyperspaceScreen.java

示例2: initializeGl

import android.opengl.GLES11; //导入方法依赖的package包/类
private void initializeGl() {
	float ratio = (float) windowWidth / (float) windowHeight;	     
       GLES11.glMatrixMode(GLES11.GL_PROJECTION);
       GlUtils.setViewport(visibleArea);
       GLES11.glLoadIdentity();
       GlUtils.gluPerspective(game, 45.0f, ratio, 10.0f, 1000.0f);
       GLES11.glMatrixMode(GLES11.GL_MODELVIEW);
       GLES11.glLoadIdentity();        
       GLES11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
       GLES11.glClear(GLES11.GL_COLOR_BUFFER_BIT | GLES11.GL_DEPTH_BUFFER_BIT);
       GLES11.glHint(GLES11.GL_PERSPECTIVE_CORRECTION_HINT, GLES11.GL_NICEST);		        
       GLES11.glEnable(GLES11.GL_DEPTH_TEST);
       GLES11.glDepthFunc(GLES11.GL_LEQUAL);
	GLES11.glEnable(GLES11.GL_BLEND);
	GLES11.glBlendFunc(GLES11.GL_ONE, GLES11.GL_ONE);
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:17,代码来源:AboutScreen.java

示例3: clear

import android.opengl.GLES11; //导入方法依赖的package包/类
@Override
public void clear(long color) {
	int alpha = (int) ((color & 0xFF000000l) >> 24);
	int red   = (int) (color & 0x00FF0000) >> 16;
	int green = (int) (color & 0x0000FF00) >>  8;
	int blue  = (int) (color & 0x000000FF);
	
	GLES11.glClearColor(red / 255.0f, green / 255.0f, blue / 255.0f, alpha / 255.0f);
	GLES11.glClear(GLES11.GL_COLOR_BUFFER_BIT);
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:11,代码来源:AndroidGraphics.java

示例4: initGl

import android.opengl.GLES11; //导入方法依赖的package包/类
private void initGl() {
	Rect visibleArea = ((AndroidGraphics) game.getGraphics()).getVisibleArea();
	int windowWidth = visibleArea.width();
	int windowHeight = visibleArea.height();

	float ratio = (float) windowWidth / (float) windowHeight;
	GlUtils.setViewport(visibleArea);
	GLES11.glDisable(GLES11.GL_FOG);
	GLES11.glPointSize(1.0f);
       GLES11.glLineWidth(1.0f);

       GLES11.glBlendFunc(GLES11.GL_ONE, GLES11.GL_ONE_MINUS_SRC_ALPHA);
       GLES11.glDisable(GLES11.GL_BLEND);
       
	GLES11.glMatrixMode(GLES11.GL_PROJECTION);
	GLES11.glLoadIdentity();
	GlUtils.gluPerspective(game, 45.0f, ratio, 1.0f, 900000.0f);
	GLES11.glMatrixMode(GLES11.GL_MODELVIEW);
	GLES11.glLoadIdentity();

	GLES11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
	GLES11.glShadeModel(GLES11.GL_SMOOTH);
	
	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_AMBIENT, lightAmbient, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_DIFFUSE, lightDiffuse, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_SPECULAR, lightSpecular, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_POSITION, lightPosition, 0);
	GLES11.glEnable(GLES11.GL_LIGHT1);

	GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_AMBIENT, sunLightAmbient, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_DIFFUSE, sunLightDiffuse, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_SPECULAR, sunLightSpecular, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_POSITION, sunLightPosition, 0);
	GLES11.glEnable(GLES11.GL_LIGHT2);

	GLES11.glEnable(GLES11.GL_LIGHTING);
	
	GLES11.glClear(GLES11.GL_COLOR_BUFFER_BIT);
	GLES11.glHint(GLES11.GL_PERSPECTIVE_CORRECTION_HINT, GLES11.GL_NICEST);
	GLES11.glHint(GLES11.GL_POLYGON_SMOOTH_HINT, GLES11.GL_NICEST);
	GLES11.glEnable(GLES11.GL_CULL_FACE);	
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:43,代码来源:ShipEditorScreen.java

示例5: initGl

import android.opengl.GLES11; //导入方法依赖的package包/类
private void initGl() {
	Rect visibleArea = ((AndroidGraphics) game.getGraphics()).getVisibleArea();
	int windowWidth = visibleArea.width();
	int windowHeight = visibleArea.height();

	float ratio = (float) windowWidth / (float) windowHeight;
	GlUtils.setViewport(visibleArea);
	GLES11.glDisable(GLES11.GL_FOG);
	GLES11.glPointSize(1.0f);
   GLES11.glLineWidth(1.0f);

   GLES11.glBlendFunc(GLES11.GL_ONE, GLES11.GL_ONE_MINUS_SRC_ALPHA);
   GLES11.glDisable(GLES11.GL_BLEND);

	GLES11.glMatrixMode(GLES11.GL_PROJECTION);
	GLES11.glLoadIdentity();
	GlUtils.gluPerspective(game, 45.0f, ratio, 1.0f, 900000.0f);
	GLES11.glMatrixMode(GLES11.GL_MODELVIEW);
	GLES11.glLoadIdentity();

	GLES11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
	GLES11.glShadeModel(GLES11.GL_SMOOTH);

	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_AMBIENT, lightAmbient, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_DIFFUSE, lightDiffuse, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_SPECULAR, lightSpecular, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_POSITION, lightPosition, 0);
	GLES11.glEnable(GLES11.GL_LIGHT1);

	GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_AMBIENT, sunLightAmbient, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_DIFFUSE, sunLightDiffuse, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_SPECULAR, sunLightSpecular, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_POSITION, sunLightPosition, 0);
	GLES11.glEnable(GLES11.GL_LIGHT2);

	GLES11.glEnable(GLES11.GL_LIGHTING);

	GLES11.glClear(GLES11.GL_COLOR_BUFFER_BIT);
	GLES11.glHint(GLES11.GL_PERSPECTIVE_CORRECTION_HINT, GLES11.GL_NICEST);
	GLES11.glHint(GLES11.GL_POLYGON_SMOOTH_HINT, GLES11.GL_NICEST);
	GLES11.glEnable(GLES11.GL_CULL_FACE);
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:43,代码来源:ShipIntroScreen.java

示例6: initGl

import android.opengl.GLES11; //导入方法依赖的package包/类
private void initGl() {		
		Rect visibleArea = ((AndroidGraphics) game.getGraphics()).getVisibleArea();
		int windowWidth = visibleArea.width();
		int windowHeight = visibleArea.height();

		float ratio = (float) windowWidth / (float) windowHeight;
		GlUtils.setViewport(visibleArea);
		GLES11.glDisable(GLES11.GL_FOG);
		GLES11.glPointSize(1.0f);
        GLES11.glLineWidth(1.0f);

        GLES11.glBlendFunc(GLES11.GL_ONE, GLES11.GL_ONE_MINUS_SRC_ALPHA);
        GLES11.glDisable(GLES11.GL_BLEND);
        
		GLES11.glMatrixMode(GLES11.GL_PROJECTION);
		GLES11.glLoadIdentity();
		GlUtils.gluPerspective(game, 45.0f, ratio, 1.0f, 900000.0f);
		GLES11.glMatrixMode(GLES11.GL_MODELVIEW);
		GLES11.glLoadIdentity();

		GLES11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
		GLES11.glShadeModel(GLES11.GL_SMOOTH);
		
		GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_AMBIENT, lightAmbient, 0);
		GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_DIFFUSE, lightDiffuse, 0);
		GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_SPECULAR, lightSpecular, 0);
		GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_POSITION, lightPosition, 0);
		GLES11.glEnable(GLES11.GL_LIGHT1);

		GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_AMBIENT, sunLightAmbient, 0);
		GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_DIFFUSE, sunLightDiffuse, 0);
		GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_SPECULAR, sunLightSpecular, 0);
		GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_POSITION, sunLightPosition, 0);
		GLES11.glEnable(GLES11.GL_LIGHT2);

		GLES11.glEnable(GLES11.GL_LIGHTING);
		

		GLES11.glClear(GLES11.GL_COLOR_BUFFER_BIT);
		GLES11.glHint(GLES11.GL_PERSPECTIVE_CORRECTION_HINT, GLES11.GL_NICEST);
		GLES11.glHint(GLES11.GL_POLYGON_SMOOTH_HINT, GLES11.GL_NICEST);
//		GLES11.glEnable(GLES11.GL_TEXTURE_2D);
		GLES11.glEnable(GLES11.GL_CULL_FACE);	
		
	}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:46,代码来源:PlanetScreen.java

示例7: initializeGl

import android.opengl.GLES11; //导入方法依赖的package包/类
public void initializeGl(final Rect visibleArea) {		
	float ratio = (float) windowWidth / (float) windowHeight;
	GlUtils.setViewport(visibleArea);
	GLES11.glDisable(GLES11.GL_FOG);
	GLES11.glPointSize(1.0f);
       GLES11.glLineWidth(1.0f);

       GLES11.glTexEnvf(GLES11.GL_TEXTURE_ENV, GLES11.GL_TEXTURE_ENV_MODE, GLES11.GL_MODULATE);
       
    GLES11.glBlendFunc(GLES11.GL_SRC_ALPHA, GLES11.GL_ONE_MINUS_SRC_ALPHA);
       GLES11.glDisable(GLES11.GL_BLEND);
       
	GLES11.glMatrixMode(GLES11.GL_PROJECTION);
	GLES11.glLoadIdentity();
	GlUtils.gluPerspective(game, 45.0f, ratio, 1.0f, 900000.0f);
	GLES11.glMatrixMode(GLES11.GL_MODELVIEW);
	GLES11.glLoadIdentity();

	GLES11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
	GLES11.glShadeModel(GLES11.GL_SMOOTH);
	
	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_AMBIENT, lightAmbient, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_DIFFUSE, lightDiffuse, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_SPECULAR, lightSpecular, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_POSITION, lightPosition, 0);
	GLES11.glEnable(GLES11.GL_LIGHT1);

	GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_AMBIENT, sunLightAmbient, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_DIFFUSE, sunLightDiffuse, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_SPECULAR, sunLightSpecular, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_POSITION, sunLightPosition, 0);
	GLES11.glEnable(GLES11.GL_LIGHT2);

	GLES11.glEnable(GLES11.GL_LIGHTING);
	
	GLES11.glClear(GLES11.GL_COLOR_BUFFER_BIT);
	GLES11.glHint(GLES11.GL_PERSPECTIVE_CORRECTION_HINT, GLES11.GL_NICEST);
	GLES11.glHint(GLES11.GL_POLYGON_SMOOTH_HINT, GLES11.GL_NICEST);
	GLES11.glEnable(GLES11.GL_TEXTURE_2D);
	GLES11.glEnable(GLES11.GL_CULL_FACE);			
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:42,代码来源:FlightScreen.java

示例8: initializeGl

import android.opengl.GLES11; //导入方法依赖的package包/类
private void initializeGl(final Rect visibleArea) {
	AliteLog.d("Ship Intro Screen", "Initialize GL. glError: " + GLES11.glGetError());
	
	float ratio = (float) windowWidth / (float) windowHeight;
	GlUtils.setViewport(visibleArea);
	GLES11.glDisable(GLES11.GL_FOG);
	GLES11.glPointSize(1.0f);
       GLES11.glLineWidth(1.0f);

       AliteLog.d("Ship Intro Screen", "Initialize GL lineWidth. glError: " + GLES11.glGetError());
       GLES11.glBlendFunc(GLES11.GL_ONE, GLES11.GL_ONE_MINUS_SRC_ALPHA);
       GLES11.glDisable(GLES11.GL_BLEND);
       AliteLog.d("SIS", "Blending: " + GLES11.glGetError());
       
	GLES11.glMatrixMode(GLES11.GL_PROJECTION);
	GLES11.glLoadIdentity();
	GlUtils.gluPerspective(game, 45.0f, ratio, 1.0f, 900000.0f);
	GLES11.glMatrixMode(GLES11.GL_MODELVIEW);
	GLES11.glLoadIdentity();
	AliteLog.d("SIS", "Matrix Setup: " + GLES11.glGetError());
	
	GLES11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
	GLES11.glShadeModel(GLES11.GL_SMOOTH);
	AliteLog.d("SIS", "Clear Color & Shading Model: " + GLES11.glGetError());
	
	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_AMBIENT, lightAmbient, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_DIFFUSE, lightDiffuse, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_SPECULAR, lightSpecular, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_POSITION, lightPosition, 0);
	GLES11.glEnable(GLES11.GL_LIGHT1);
	AliteLog.d("SIS", "Defined Light 1: " + GLES11.glGetError());

	GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_AMBIENT, sunLightAmbient, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_DIFFUSE, sunLightDiffuse, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_SPECULAR, sunLightSpecular, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_POSITION, sunLightPosition, 0);
	GLES11.glEnable(GLES11.GL_LIGHT2);
	AliteLog.d("SIS", "Defined Light 2: " + GLES11.glGetError());
	
	GLES11.glEnable(GLES11.GL_LIGHTING);
	AliteLog.d("SIS", "After Enable Lighting: " + GLES11.glGetError());
	
    AliteLog.d("SIS", "After Lighting: " + GLES11.glGetError());
    
	GLES11.glClear(GLES11.GL_COLOR_BUFFER_BIT);
	GLES11.glEnable(GLES11.GL_TEXTURE_2D);
	GLES11.glEnable(GLES11.GL_CULL_FACE);
	
	
	AliteLog.d("SIS", "End of Init: " + GLES11.glGetError());
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:52,代码来源:ControlledShipIntroScreen.java


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