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


Java GLES11.glEnable方法代码示例

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


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

示例1: present

import android.opengl.GLES11; //导入方法依赖的package包/类
@Override
public void present(float deltaTime) {
	if (isGl) {
		Rect visibleArea = ((AndroidGraphics) game.getGraphics()).getVisibleArea();
		renderGlPart(deltaTime, visibleArea);
		setUpForDisplay(visibleArea);
	}
	if (currentLine != null) {
		currentLine.prePresent(deltaTime);
	}
	doPresent(deltaTime);
	GLES11.glBlendFunc(GLES11.GL_ONE, GLES11.GL_ONE_MINUS_SRC_ALPHA);
	GLES11.glEnable(GLES11.GL_BLEND);
	if (!hideCloseButton) {
		closeButton.render(alite.getGraphics());
	}
	GLES11.glDisable(GLES11.GL_BLEND);
	if (currentLine != null) {
		currentLine.postPresent(deltaTime);
	}
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:22,代码来源:TutorialScreen.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: render

import android.opengl.GLES11; //导入方法依赖的package包/类
public void render() {
	GLES11.glDisableClientState(GLES11.GL_NORMAL_ARRAY);
	GLES11.glEnableClientState(GLES11.GL_VERTEX_ARRAY);
	GLES11.glEnableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);
	GLES11.glDisable(GLES11.GL_CULL_FACE);
	
	GLES11.glVertexPointer(3, GLES11.GL_FLOAT, 0, vertexBuffer);
	GLES11.glTexCoordPointer(2, GLES11.GL_FLOAT, 0, texCoordBuffer);
	
	GLES11.glDisable(GLES11.GL_LIGHTING);
	GLES11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
	alite.getTextureManager().setTexture(textureFilename);
	GLES11.glDrawArrays(glDrawMode, 0, numberOfVertices);
	GLES11.glEnable(GLES11.GL_LIGHTING);
	
	GLES11.glEnable(GLES11.GL_CULL_FACE);
	GLES11.glDisableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);
	GLES11.glDisableClientState(GLES11.GL_VERTEX_ARRAY);
	GLES11.glBindTexture(GLES11.GL_TEXTURE_2D, 0);
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:21,代码来源:Skysphere.java

示例4: drawText

import android.opengl.GLES11; //导入方法依赖的package包/类
@Override
public void drawText(String text, int x, int y, long color, GLText font) {
	if (font == null) {
		return;
	}
	float alpha = (float) ((((long) color) & (long) 0xFF000000) >> 24) / 255.0f;
	float red   = ((color & 0x00FF0000) >> 16) / 255.0f;
	float green = ((color & 0x0000FF00) >>  8) / 255.0f;
	float blue  =  (color & 0x000000FF)        / 255.0f;
    GLES11.glEnable(GLES11.GL_BLEND);
    GLES11.glBlendFunc(GLES11.GL_ONE, GLES11.GL_ONE);
	font.begin(red, green, blue, alpha);
	y -= (int) (font.getSize());
	font.draw(text, transX(x), transY(y));
	font.end();
	GLES11.glDisable(GLES11.GL_BLEND);
	textureManager.setTexture(null);
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:19,代码来源:AndroidGraphics.java

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

示例6: renderTargetBox

import android.opengl.GLES11; //导入方法依赖的package包/类
public void renderTargetBox(float distSq) {
	if (!Settings.targetBox || targetBox == null || distSq <= SpaceObjectAI.SHOOT_DISTANCE_SQ) {
		return;
	}
	float alpha = (distSq - SpaceObjectAI.SHOOT_DISTANCE_SQ) / (LaserManager.MAX_ENEMY_DISTANCE_SQ - SpaceObjectAI.SHOOT_DISTANCE_SQ);
	targetBox.setAlpha(alpha);
	GLES11.glEnable(GLES11.GL_BLEND);
	GLES11.glBlendFunc(GLES11.GL_SRC_ALPHA, GLES11.GL_ONE);
	targetBox.render();
	GLES11.glDisable(GLES11.GL_BLEND);
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:12,代码来源:SpaceObject.java

示例7: render

import android.opengl.GLES11; //导入方法依赖的package包/类
@Override
public void render() {		
	GLES11.glDisable(GLES11.GL_LIGHTING);
	planet.render();
	GLES11.glDisable(GLES11.GL_DEPTH_TEST);
	GLES11.glEnable(GLES11.GL_BLEND);
	GLES11.glBlendFunc(GLES11.GL_SRC_ALPHA, GLES11.GL_ONE_MINUS_SRC_ALPHA);
	if (clouds != null) {
		clouds.render();
	}				
	GLES11.glEnable(GLES11.GL_BLEND);
	GLES11.glDisable(GLES11.GL_CULL_FACE);
	GLES11.glBlendFunc(GLES11.GL_ONE, GLES11.GL_ONE);
	GLES11.glEnable(GLES11.GL_DEPTH_TEST);
	atmosphere.render();

	GLES11.glEnable(GLES11.GL_LIGHTING);		
	GLES11.glBlendFunc(GLES11.GL_SRC_ALPHA, GLES11.GL_ONE_MINUS_SRC_ALPHA);
	if (rings != null) {			
		rings.render();
		ringShadow.render();			
	}	
	GLES11.glDisable(GLES11.GL_DEPTH_TEST);
	
	GLES11.glEnable(GLES11.GL_CULL_FACE);
	alite.getTextureManager().setTexture(null);				
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:28,代码来源:PlanetSpaceObject.java

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

示例9: cleanUp

import android.opengl.GLES11; //导入方法依赖的package包/类
protected void cleanUp() {
	GLES11.glDisable(GLES11.GL_BLEND);
	GLES11.glEnable(GLES11.GL_CULL_FACE);
	GLES11.glEnable(GLES11.GL_LIGHTING);

	GLES11.glDisableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);
	GLES11.glDisableClientState(GLES11.GL_VERTEX_ARRAY);
	GLES11.glBindTexture(GLES11.GL_TEXTURE_2D, 0);
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:10,代码来源:Sprite.java

示例10: render

import android.opengl.GLES11; //导入方法依赖的package包/类
void render() {
	boolean enabled = GLES11.glIsEnabled(GLES11.GL_CULL_FACE);
	if (enabled) {
		GLES11.glDisable(GLES11.GL_CULL_FACE);
	}
	alite.getTextureManager().setTexture(textureFilename);
	GLES11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
	GLES11.glVertexPointer(3, GLES11.GL_FLOAT, 0, vertexBuffer);
	GLES11.glNormalPointer(GLES11.GL_FLOAT, 0, normalBuffer);
	GLES11.glTexCoordPointer(2, GLES11.GL_FLOAT, 0, texCoordBuffer);		
	GLES11.glDrawArrays(GLES11.GL_TRIANGLES, 0, numberOfVertices);
	if (enabled) {
		GLES11.glEnable(GLES11.GL_CULL_FACE);
	}		
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:16,代码来源:DockingBay.java

示例11: presentTradeGoods

import android.opengl.GLES11; //导入方法依赖的package包/类
public void presentTradeGoods(float deltaTime) {
	Graphics g = game.getGraphics();
	
	for (int y = 0; y < ROWS; y++) {
		for (int x = 0; x < COLUMNS; x++) {
			if (tradeButton[x][y] == null) {
				continue;
			}
			if (selection == tradeButton[x][y]) {
				if (Settings.animationsEnabled) {
					computeCurrentFrame();
				}
				//tradeButton[x][y].setBorderColors(AliteColors.get().selectedColoredFrameLight(), AliteColors.get().selectedColoredFrameDark());
				tradeButton[x][y].render(g, currentFrame);
				GLES11.glEnable(GLES11.GL_BLEND);
				GLES11.glBlendFunc(GLES11.GL_ONE, GLES11.GL_ONE);
				GLES11.glEnableClientState(GLES11.GL_VERTEX_ARRAY);
				g.fillRect(tradeButton[x][y].getX(), tradeButton[x][y].getY(), tradeButton[x][y].getWidth(), tradeButton[x][y].getHeight(), AliteColors.get().highlightColor());
				GLES11.glDisable(GLES11.GL_BLEND);
				if (errorText == null) {
					presentSelection(y, x);
				}
			} else {
				//tradeButton[x][y].setBorderColors(AliteColors.get().coloredFrameLight(), AliteColors.get().coloredFrameDark());
				tradeButton[x][y].render(g);
			}				
			String price = getCost(y, x);	
			int halfWidth =  g.getTextWidth(price, Assets.regularFont) >> 1;
			g.drawText(price, x * GAP_X + X_OFFSET + (SIZE >> 1) - halfWidth, y * GAP_Y + Y_OFFSET + SIZE + 35, AliteColors.get().price(), Assets.regularFont);
			drawAdditionalTradeGoodInformation(y, x, deltaTime);
		}
	}
	if (errorText != null) {
		game.getGraphics().drawText(errorText, X_OFFSET, 1050, AliteColors.get().message(), Assets.regularFont);
	}
	if (cashLeft != null) {
		g.drawText(cashLeft, X_OFFSET, 1050, AliteColors.get().message(), Assets.regularFont);
	}
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:40,代码来源:TradeScreen.java

示例12: render

import android.opengl.GLES11; //导入方法依赖的package包/类
void render() {		
       GLES11.glEnable(GLES11.GL_FOG);
	GLES11.glDisable(GLES11.GL_CULL_FACE);
       GLES11.glDisable(GLES11.GL_LIGHTING);
	GLES11.glDisableClientState(GLES11.GL_NORMAL_ARRAY);
	GLES11.glEnableClientState(GLES11.GL_VERTEX_ARRAY);
	GLES11.glDisableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);
	GLES11.glDisableClientState(GLES11.GL_COLOR_ARRAY);
	GLES11.glEnableClientState(GLES11.GL_POINT_SIZE_ARRAY_OES);		
	GLES11.glVertexPointer(3, GLES11.GL_FLOAT, 0, dustParticles);
	GLES11.glPointSizePointerOES(GLES11.GL_FLOAT, 0, particleSizes);
	GLES11.glColor4f(0.7f, 0.7f, 1.0f, 0.8f);
	alite.getTextureManager().setTexture("textures/glow_mask.png");
       GLES11.glEnable(GLES11.GL_POINT_SPRITE_OES);
       GLES11.glTexEnvf(GLES11.GL_POINT_SPRITE_OES, GLES11.GL_COORD_REPLACE_OES, GLES11.GL_TRUE);
       GLES11.glEnable(GLES11.GL_BLEND);
       GLES11.glBlendFunc(GLES11.GL_ONE, GLES11.GL_ONE);
       GLES11.glHint(GLES11.GL_POINT_SMOOTH_HINT, GLES11.GL_NICEST);
	GLES11.glDisable(GLES11.GL_DEPTH_TEST);
	GLES11.glDrawArrays(GLES11.GL_POINTS, 0, particleCount);
	GLES11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
	GLES11.glPointSize(1.0f);
	GLES11.glDisableClientState(GLES11.GL_POINT_SIZE_ARRAY_OES);
	GLES11.glDisableClientState(GLES11.GL_COLOR_ARRAY);
	GLES11.glEnableClientState(GLES11.GL_NORMAL_ARRAY);
	GLES11.glEnableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);
	GLES11.glEnable(GLES11.GL_LIGHTING);
	GLES11.glEnable(GLES11.GL_CULL_FACE);
	GLES11.glDisable(GLES11.GL_BLEND);
	GLES11.glDisable(GLES11.GL_FOG);
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:32,代码来源:StarDust.java

示例13: setClip

import android.opengl.GLES11; //导入方法依赖的package包/类
@Override
public void setClip(int x1, int y1, int x2, int y2) {
	if (x1 == -1 && y1 == -1 && x2 == -1 && y2 == -1) {
		GLES11.glDisable(GLES11.GL_SCISSOR_TEST);
		return;
	}
	x1 = x1 == -1 ? Math.max(visibleArea.left - 1, 0) : transX(x1);
	y1 = y1 == -1 ? Math.max(visibleArea.top  - 1, 0) : transY(y1);
	x2 = x2 == -1 ? Math.min(visibleArea.right + 1, visibleArea.width()) : transX(x2);
	y2 = y2 == -1 ? Math.min(visibleArea.bottom + 1, visibleArea.height()) : transY(y2);			
	GLES11.glEnable(GLES11.GL_SCISSOR_TEST);
	GLES11.glScissor(x1, y1, x2 - x1 + 1, y2 - y1 + 1);
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:14,代码来源:AndroidGraphics.java

示例14: performPresent

import android.opengl.GLES11; //导入方法依赖的package包/类
@Override
public void performPresent(float deltaTime) {
	if (isDisposed) {
		return;
	}
	GLES11.glDisable(GLES11.GL_CULL_FACE);
       GLES11.glClear(GLES11.GL_COLOR_BUFFER_BIT | GLES11.GL_DEPTH_BUFFER_BIT);
       
       counter += 0.72f;
       if (counter > 360) {
       	counter = 0;
       }
       switch (increase) {
       	case 0: red += 0.002f; if (red > 1.0f) red = 1.0f; break;
       	case 1: green += 0.002f; if (green > 1.0f) green = 1.0f; break;
       	case 2: blue += 0.002f; if (blue > 1.0f) blue = 1.0f; break;
       }
       GLES11.glLoadIdentity();
       lookAt(-3.5f, 0, 0,
       	   -3.5f, 1.0f, 0,
       	   (float) Math.sin(Math.toRadians(counter)), 0.0f, (float) Math.cos(Math.toRadians(counter)));
       
       GLES11.glRotatef(counter * 2, 0.0f, 0.0f, 1.0f);
   	GLES11.glVertexPointer(3, GLES11.GL_FLOAT, 0, vertexBuffer);
   	GLES11.glTexCoordPointer(2, GLES11.GL_FLOAT, 0, textureBuffer); 
   	
   	GLES11.glMatrixMode(GLES11.GL_TEXTURE);
   	GLES11.glTranslatef(0.0f, -0.015f, 0.0f);
   	GLES11.glMatrixMode(GLES11.GL_MODELVIEW);

   	GLES11.glColor4f(red, green, blue, 1.0f);
   	GLES11.glDrawArrays(GLES11.GL_TRIANGLE_STRIP, 0, totalIndices);
   	GLES11.glEnable(GLES11.GL_CULL_FACE);
   	GLES11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:36,代码来源:HyperspaceScreen.java

示例15: begin

import android.opengl.GLES11; //导入方法依赖的package包/类
public void begin(float red, float green, float blue, float alpha) {
	GLES11.glColor4f(red, green, blue, alpha); // Set Color+Alpha
	GLES11.glEnable(GLES11.GL_TEXTURE_2D);
	GLES11.glBindTexture(GLES11.GL_TEXTURE_2D, textureId); // Bind the
															// Texture
	batch.beginBatch(); // Begin Batch
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:8,代码来源:GLText.java


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