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


Java GLES11.glDepthFunc方法代码示例

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


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

示例1: 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

示例2: displayShip

import android.opengl.GLES11; //导入方法依赖的package包/类
public void displayShip() {
	Rect visibleArea = ((AndroidGraphics) game.getGraphics()).getVisibleArea();
	float aspectRatio = (float) visibleArea.width() / (float) visibleArea.height();
	GLES11.glEnable(GLES11.GL_TEXTURE_2D);
	GLES11.glEnable(GLES11.GL_CULL_FACE);				
	GLES11.glMatrixMode(GLES11.GL_PROJECTION);
	GLES11.glLoadIdentity();
	GlUtils.gluPerspective(game, 45.0f, aspectRatio, 1.0f, 900000.0f);
	GLES11.glMatrixMode(GLES11.GL_MODELVIEW);		
	GLES11.glLoadIdentity();
	
	GLES11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
	GLES11.glEnableClientState(GLES11.GL_NORMAL_ARRAY);
	GLES11.glEnableClientState(GLES11.GL_VERTEX_ARRAY);
	GLES11.glEnableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);

	GLES11.glEnable(GLES11.GL_DEPTH_TEST);
	GLES11.glDepthFunc(GLES11.GL_LESS);
	GLES11.glClear(GLES11.GL_DEPTH_BUFFER_BIT);
	GLES11.glPushMatrix();
	GLES11.glMultMatrixf(currentShip.getMatrix(), 0);
	currentShip.render();		
	GLES11.glPopMatrix();
	
	GLES11.glDisable(GLES11.GL_DEPTH_TEST);		
	GLES11.glDisable(GLES11.GL_TEXTURE_2D);
	setUpForDisplay(visibleArea);
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:29,代码来源:ShipEditorScreen.java

示例3: displayShip

import android.opengl.GLES11; //导入方法依赖的package包/类
public void displayShip() {
	Rect visibleArea = ((AndroidGraphics) game.getGraphics()).getVisibleArea();
	float aspectRatio = (float) visibleArea.width() / (float) visibleArea.height();
	GLES11.glEnable(GLES11.GL_TEXTURE_2D);
	GLES11.glEnable(GLES11.GL_CULL_FACE);				
	GLES11.glMatrixMode(GLES11.GL_PROJECTION);
	GLES11.glLoadIdentity();
	GlUtils.gluPerspective(game, 45.0f, aspectRatio, 1.0f, 100000.0f);
	GLES11.glMatrixMode(GLES11.GL_MODELVIEW);		
	GLES11.glLoadIdentity();
	
	GLES11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
	GLES11.glEnableClientState(GLES11.GL_NORMAL_ARRAY);
	GLES11.glEnableClientState(GLES11.GL_VERTEX_ARRAY);
	GLES11.glEnableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);

	GLES11.glEnable(GLES11.GL_DEPTH_TEST);
	GLES11.glDepthFunc(GLES11.GL_LESS);
	GLES11.glClear(GLES11.GL_DEPTH_BUFFER_BIT);
	GLES11.glPushMatrix();
	GLES11.glMultMatrixf(constrictor.getMatrix(), 0);
	constrictor.render();
	GLES11.glPopMatrix();
	
	GLES11.glDisable(GLES11.GL_DEPTH_TEST);		
	GLES11.glDisable(GLES11.GL_TEXTURE_2D);
	setUpForDisplay(visibleArea);
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:29,代码来源:ConstrictorScreen.java

示例4: displayShip

import android.opengl.GLES11; //导入方法依赖的package包/类
public void displayShip() {
	Rect visibleArea = ((AndroidGraphics) game.getGraphics()).getVisibleArea();
	float aspectRatio = (float) visibleArea.width() / (float) visibleArea.height();
	GLES11.glEnable(GLES11.GL_TEXTURE_2D);
	GLES11.glEnable(GLES11.GL_CULL_FACE);				
	GLES11.glMatrixMode(GLES11.GL_PROJECTION);
	GLES11.glLoadIdentity();
	GlUtils.gluPerspective(game, 45.0f, aspectRatio, 1.0f, 100000.0f);
	GLES11.glMatrixMode(GLES11.GL_MODELVIEW);		
	GLES11.glLoadIdentity();
	
	GLES11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
	GLES11.glEnableClientState(GLES11.GL_NORMAL_ARRAY);
	GLES11.glEnableClientState(GLES11.GL_VERTEX_ARRAY);
	GLES11.glEnableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);

	GLES11.glEnable(GLES11.GL_DEPTH_TEST);
	GLES11.glDepthFunc(GLES11.GL_LESS);
	GLES11.glClear(GLES11.GL_DEPTH_BUFFER_BIT);
	GLES11.glPushMatrix();
	GLES11.glMultMatrixf(cougar.getMatrix(), 0);
	cougar.render();
	GLES11.glPopMatrix();
	
	GLES11.glDisable(GLES11.GL_DEPTH_TEST);		
	GLES11.glDisable(GLES11.GL_TEXTURE_2D);
	setUpForDisplay(visibleArea);
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:29,代码来源:CougarScreen.java

示例5: initDisplay

import android.opengl.GLES11; //导入方法依赖的package包/类
private void initDisplay(final Rect visibleArea) {
	float aspectRatio = (float) visibleArea.width() / (float) visibleArea.height();
	GLES11.glEnable(GLES11.GL_TEXTURE_2D);
	GLES11.glEnable(GLES11.GL_CULL_FACE);
	GLES11.glMatrixMode(GLES11.GL_PROJECTION);
	GLES11.glLoadIdentity();
	GlUtils.gluPerspective(game, 45.0f, aspectRatio, 1.0f, 900000.0f);
	GLES11.glMatrixMode(GLES11.GL_MODELVIEW);
	GLES11.glLoadIdentity();

	GLES11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
	GLES11.glEnableClientState(GLES11.GL_NORMAL_ARRAY);
	GLES11.glEnableClientState(GLES11.GL_VERTEX_ARRAY);
	GLES11.glEnableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);
	GLES11.glPushMatrix();
	  GLES11.glMultMatrixf(skysphere.getMatrix(), 0);
      skysphere.render();
	GLES11.glPopMatrix();

	GLES11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
	GLES11.glEnableClientState(GLES11.GL_NORMAL_ARRAY);
	GLES11.glEnableClientState(GLES11.GL_VERTEX_ARRAY);
	GLES11.glEnableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);
	GLES11.glEnable(GLES11.GL_DEPTH_TEST);
	GLES11.glDepthFunc(GLES11.GL_LESS);
	GLES11.glClear(GLES11.GL_DEPTH_BUFFER_BIT);

	GLES11.glDisable(GLES11.GL_BLEND);
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:30,代码来源:ShipIntroScreen.java

示例6: afterDisplay

import android.opengl.GLES11; //导入方法依赖的package包/类
public void afterDisplay() {		
	Rect visibleArea = ((AndroidGraphics) game.getGraphics()).getVisibleArea();
	float aspectRatio = (float) visibleArea.width() / (float) visibleArea.height();
	GLES11.glEnable(GLES11.GL_TEXTURE_2D);
	GLES11.glEnable(GLES11.GL_CULL_FACE);				
	GLES11.glMatrixMode(GLES11.GL_PROJECTION);
	GLES11.glLoadIdentity();
	GlUtils.gluPerspective(game, 45.0f, aspectRatio, 20000.0f, 1000000.0f);
	GLES11.glMatrixMode(GLES11.GL_MODELVIEW);		
	GLES11.glLoadIdentity();
	
	GLES11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
	GLES11.glEnableClientState(GLES11.GL_NORMAL_ARRAY);
	GLES11.glEnableClientState(GLES11.GL_VERTEX_ARRAY);
	GLES11.glEnableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);

	GLES11.glEnable(GLES11.GL_DEPTH_TEST);
	GLES11.glDepthFunc(GLES11.GL_LESS);
	GLES11.glClear(GLES11.GL_DEPTH_BUFFER_BIT);
	GLES11.glPushMatrix();
	GLES11.glMultMatrixf(planet.getMatrix(), 0);
	planet.render();
	GLES11.glPopMatrix();
	
	GLES11.glDisable(GLES11.GL_DEPTH_TEST);		
	GLES11.glDisable(GLES11.GL_TEXTURE_2D);
	setUpForDisplay(visibleArea);
	
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:30,代码来源:PlanetScreen.java

示例7: render

import android.opengl.GLES11; //导入方法依赖的package包/类
public void render() {
	if (finished || rendered) {
		return;
	}
	GLES11.glColor4f(0.94f, 0, 0, 1.0f);
	GLES11.glDepthFunc(GLES11.GL_LESS);
	GLES11.glDepthMask(false);		
	GLES11.glEnable(GLES11.GL_BLEND);
	GLES11.glDisable(GLES11.GL_CULL_FACE);
	GLES11.glBlendFunc(GLES11.GL_SRC_ALPHA, GLES11.GL_ONE);		
	for (int i = 0; i < 3; i++) {
		if (explosions[i] == null) {
			continue;
		}
		GLES11.glPushMatrix();
		GLES11.glMultMatrixf(explosions[i].getMatrix(), 0);
		explosions[i].batchRender();
		GLES11.glPopMatrix();
	}		
	Alite.get().getTextureManager().setTexture(null);
	GLES11.glEnable(GLES11.GL_CULL_FACE);
	GLES11.glDepthFunc(GLES11.GL_LESS);
	GLES11.glDepthMask(true);
	GLES11.glDisable(GLES11.GL_BLEND);
	GLES11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
	rendered = true;
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:28,代码来源:Explosion.java

示例8: render

import android.opengl.GLES11; //导入方法依赖的package包/类
public void render() {
	GLES11.glDepthFunc(GLES11.GL_LESS);
	GLES11.glDepthMask(false);
	GLES11.glEnable(GLES11.GL_BLEND);
	GLES11.glDisable(GLES11.GL_CULL_FACE);
	GLES11.glDisableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);
	GLES11.glEnableClientState(GLES11.GL_COLOR_ARRAY);
	GLES11.glDisable(GLES11.GL_LIGHTING);
	GLES11.glBlendFunc(GLES11.GL_SRC_ALPHA, GLES11.GL_ONE);		
	MathHelper.copyMatrix(getMatrix(), saveMatrix);
	for (int i = 0; i < 2; i++) {
		GLES11.glPushMatrix();
		GLES11.glMultMatrixf(getMatrix(), 0);
	
		GLES11.glVertexPointer(3, GLES11.GL_FLOAT, 0, diskBuffer);
		GLES11.glColorPointer(4, GLES11.GL_FLOAT, 0, colorBuffer1);
		GLES11.glDrawArrays(GLES11.GL_TRIANGLE_FAN, 0, 10);
	
		GLES11.glVertexPointer(3, GLES11.GL_FLOAT, 0, cylinderBuffer);
		GLES11.glColorPointer(4, GLES11.GL_FLOAT, 0, colorBuffer2);
		GLES11.glDrawArrays(GLES11.GL_TRIANGLE_STRIP, 0, 18);
	
		GLES11.glPopMatrix();
		scale(0.4f, 0.4f, 1.2f);
	}
	MathHelper.copyMatrix(saveMatrix, currentMatrix);
	extractVectors();
	GLES11.glEnable(GLES11.GL_CULL_FACE);
	GLES11.glEnable(GLES11.GL_LIGHTING);
	GLES11.glEnableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);
	GLES11.glDisableClientState(GLES11.GL_COLOR_ARRAY);
	GLES11.glDepthFunc(GLES11.GL_LESS);
	GLES11.glDepthMask(true);
	GLES11.glDisable(GLES11.GL_BLEND);
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:36,代码来源:EngineExhaust.java

示例9: render

import android.opengl.GLES11; //导入方法依赖的package包/类
public void render(Alite alite) {
	if (!visible) {
		return;
	}
	GLES11.glDepthFunc(GLES11.GL_LEQUAL);
	GLES11.glDepthMask(false);
	GLES11.glDisable(GLES11.GL_CULL_FACE);
	if (textureFilename != null) {
		GLES11.glEnableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);
		GLES11.glEnable(GLES11.GL_LIGHTING);
		alite.getTextureManager().setTexture(textureFilename);
	} else {
		GLES11.glDisableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);
		GLES11.glDisable(GLES11.GL_LIGHTING);
		alite.getTextureManager().setTexture(null);
	}			
	GLES11.glEnableClientState(GLES11.GL_NORMAL_ARRAY);
	
	GLES11.glEnable(GLES11.GL_BLEND);
	GLES11.glBlendFunc(GLES11.GL_ONE, GLES11.GL_ONE);
	GLES11.glColor4f(emission[0], emission[1], emission[2], emission[3]);
	for (int i = 0; i < 2; i++) {
		GLES11.glPushMatrix();
		GLES11.glMultMatrixf(getMatrix(), 0);
	
		GLES11.glVertexPointer(3, GLES11.GL_FLOAT, 0, diskBuffer1);
		GLES11.glNormalPointer(GLES11.GL_FLOAT, 0, normalBuffer[0]);
		if (textureFilename != null) {
			GLES11.glTexCoordPointer(2, GLES11.GL_FLOAT, 0, texCoordBuffer[0]);
		}
		GLES11.glDrawArrays(GLES11.GL_TRIANGLE_FAN, 0, 10);
				
		GLES11.glVertexPointer(3, GLES11.GL_FLOAT, 0, cylinderBuffer);
		GLES11.glNormalPointer(GLES11.GL_FLOAT, 0, normalBuffer[1]);
		if (textureFilename != null) {
			GLES11.glTexCoordPointer(2, GLES11.GL_FLOAT, 0, texCoordBuffer[1]);
		}
		GLES11.glDrawArrays(GLES11.GL_TRIANGLE_STRIP, 0, 18);
	
		GLES11.glVertexPointer(3, GLES11.GL_FLOAT, 0, diskBuffer2);
		GLES11.glNormalPointer(GLES11.GL_FLOAT, 0, normalBuffer[2]);
		if (textureFilename != null) {
			GLES11.glTexCoordPointer(2, GLES11.GL_FLOAT, 0, texCoordBuffer[2]);
		}
		GLES11.glDrawArrays(GLES11.GL_TRIANGLE_FAN, 0, 10);

		GLES11.glPopMatrix();
		MathHelper.copyMatrix(getMatrix(), saveMatrix);
		scale(0.7f, 0.7f, 0.7f);			
		GLES11.glColor4f(1.0f, 1.0f, 1.0f, 0.8f);
	}
	MathHelper.copyMatrix(saveMatrix, currentMatrix);
	extractVectors();
	GLES11.glEnable(GLES11.GL_CULL_FACE);
	GLES11.glEnable(GLES11.GL_LIGHTING);
	GLES11.glEnableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);
	alite.getTextureManager().setTexture(null);
	GLES11.glDepthFunc(GLES11.GL_LESS);
	GLES11.glDepthMask(true);
	GLES11.glDisable(GLES11.GL_BLEND);
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:62,代码来源:LaserCylinder.java


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