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


Java GLES11.glBindTexture方法代码示例

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


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

示例1: setTexture

import android.opengl.GLES11; //导入方法依赖的package包/类
public void setTexture(String fileName) {
	if (fileName == null) {
		GLES11.glBindTexture(GLES11.GL_TEXTURE_2D, 0);			
		return;
	}
	Texture texture = textures.get(fileName);
	if (texture == null || !texture.isValid()) {		
		addTexture(fileName);
		texture = textures.get(fileName);
	}
	if (texture != null) {
		if (!texture.isValid()) {
			texture.index[0] = addTexture(fileName);
		}
		
		if (texture.index[0] != 0) {
			GLES11.glBindTexture(GLES11.GL_TEXTURE_2D, texture.index[0]);
		} 
	} 
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:21,代码来源:TextureManager.java

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

示例3: setUpForDisplay

import android.opengl.GLES11; //导入方法依赖的package包/类
protected final void setUpForDisplay(Rect visibleArea) {		
	GLES11.glDisable(GLES11.GL_CULL_FACE);
	GLES11.glDisable(GLES11.GL_LIGHTING);
	GLES11.glBindTexture(GLES11.GL_TEXTURE_2D, 0);
	GLES11.glDisable(GLES11.GL_TEXTURE_2D);

	GLES11.glMatrixMode(GLES11.GL_PROJECTION);
	GLES11.glLoadIdentity();
	GlUtils.ortho(game, visibleArea);

	GLES11.glMatrixMode(GLES11.GL_MODELVIEW);
	GLES11.glLoadIdentity();

	GLES11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);	
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:16,代码来源:AliteScreen.java

示例4: freeTexture

import android.opengl.GLES11; //导入方法依赖的package包/类
public void freeTexture(String fileName) {
	Texture texture = textures.get(fileName);
	if (texture != null && texture.isValid()) {			
		GLES11.glBindTexture(GLES11.GL_TEXTURE_2D, 0);
		GLES11.glDeleteTextures(1, texture.index, 0);			
		GLES11.glFinish();
		textures.put(fileName, null);
		bitmaps.remove(fileName);
		texturePool.free(texture);
	}
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:12,代码来源:TextureManager.java

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

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

示例7: render

import android.opengl.GLES11; //导入方法依赖的package包/类
@Override
public void render() {
	
	setUp();
	GLES11.glColor4f(Settings.alpha, Settings.alpha, Settings.alpha, Settings.alpha);
	GLES11.glDrawArrays(GLES11.GL_TRIANGLE_STRIP, 0, 4);

	computeLaser();
	if (currentLaserIndex >= 0) {
		laser.simpleRender();
	}
	if (!witchSpace) {
		compass.render();
	}

	infoGauges.render();
	GLES11.glColor4f(Settings.alpha, Settings.alpha, Settings.alpha, Settings.alpha);
	aliteText.justRender();
	if (safeZone) {
		safeIcon.justRender();
	}
	if (System.currentTimeMillis() < ecmActive) {
		ecmIcon.justRender();
	}
	
	if (Settings.controlMode == ShipControl.CONTROL_PAD && controlPad != null) {
		controlPad.render();
	} else if ((Settings.controlMode == ShipControl.CURSOR_BLOCK || Settings.controlMode == ShipControl.CURSOR_SPLIT_BLOCK) && controlKeys != null) {
		controlKeys.render();
	}
	
	GLES11.glBlendFunc(GLES11.GL_ONE, GLES11.GL_ONE);
	switch (viewDirection) {
		case 0: frontViewport.justRender(); break;
		case 1: rightViewport.justRender(); break;
		case 2: rearViewport.justRender();  break;
		case 3: leftViewport.justRender();  break;
	}
	
	GLES11.glDisableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);
	GLES11.glBindTexture(GLES11.GL_TEXTURE_2D, 0);			
	renderLollipops();
	if (zoomFactor > 1.5f && zoomFactor < 3.0f) {
		GLES11.glColor4f(0.94f * Settings.alpha, 0.94f * Settings.alpha, 0.0f, 0.6f * Settings.alpha);
		alite.getFont().drawText("x2", RADAR_X1 + 20, RADAR_Y1 + 20, false, 1.0f);			
	} else if (zoomFactor > 3.0f) {
		GLES11.glColor4f(0.94f * Settings.alpha, 0.94f * Settings.alpha, 0.0f, 0.6f * Settings.alpha);
		alite.getFont().drawText("x4", RADAR_X1 + 20, RADAR_Y1 + 20, false, 1.0f);				
	}
	GLES11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
	GLES11.glDisable(GLES11.GL_BLEND);
	GLES11.glEnable(GLES11.GL_CULL_FACE);
	GLES11.glEnable(GLES11.GL_LIGHTING);

	GLES11.glDisableClientState(GLES11.GL_VERTEX_ARRAY);
	cleanUp();
	
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:59,代码来源:AliteHud.java

示例8: loadTexture

import android.opengl.GLES11; //导入方法依赖的package包/类
private final void loadTexture(Bitmap bitmap, int index) {				
	GLES11.glBindTexture(GLES11.GL_TEXTURE_2D, index);
	GLES11.glTexParameterf(GLES11.GL_TEXTURE_2D, GLES11.GL_TEXTURE_MAG_FILTER, GLES11.GL_LINEAR);
	GLES11.glTexParameterf(GLES11.GL_TEXTURE_2D, GLES11.GL_TEXTURE_MIN_FILTER, GLES11.GL_LINEAR);
	GLUtils.texImage2D(GLES11.GL_TEXTURE_2D, 0, bitmap, 0);
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:7,代码来源:TextureManager.java

示例9: performPresent

import android.opengl.GLES11; //导入方法依赖的package包/类
@Override
public void performPresent(float deltaTime) {
	if (isDisposed) {
		return;
	}
	GLES11.glClear(GLES11.GL_COLOR_BUFFER_BIT | GLES11.GL_DEPTH_BUFFER_BIT);
       GLES11.glClearDepthf(1.0f);

       GLES11.glMatrixMode(GLES11.GL_MODELVIEW);
       GLES11.glLoadIdentity();                    

       GLES11.glEnable(GLES11.GL_TEXTURE_2D);
	GLES11.glMatrixMode(GLES11.GL_PROJECTION);
	GLES11.glPushMatrix();		
	GLES11.glLoadIdentity();
	Rect visibleArea = ((AndroidGraphics) ((Alite) game).getGraphics()).getVisibleArea();
	GlUtils.ortho(game, visibleArea);		
	
	GLES11.glMatrixMode(GLES11.GL_MODELVIEW);
	GLES11.glLoadIdentity();
	GLES11.glDisable(GLES11.GL_DEPTH_TEST);		
	GLES11.glColor4f(globalAlpha, globalAlpha, globalAlpha, globalAlpha);
	background.render();
       GLES11.glColor4f(globalAlpha * alpha, globalAlpha * alpha, globalAlpha * alpha, globalAlpha * alpha);
       aliteLogo.render();
       if (y < 1200) {
       	int i = 0;
       	for (TextData text: texts) {
       		i++;
       		if (y + text.y > -120) {
           		if (y + text.y > 1080) {
           			break;
           		}
           		setGlColor(text.color);
           		font.drawText(text.text, text.x, y + text.y, true, text.scale);
           		if (y + text.y < 525 && i == texts.size() - 1) {
           			end = true;
           		}
       		}
       	}
       }
       GLES11.glColor4f(globalAlpha, globalAlpha, globalAlpha, globalAlpha);
       ((Alite) game).getFont().drawText("Alite Version " + Alite.VERSION_STRING, 0, 1030, false, 1.0f);
	GLES11.glDisable(GLES11.GL_CULL_FACE);
	GLES11.glMatrixMode(GLES11.GL_PROJECTION);
	GLES11.glPopMatrix();
	GLES11.glMatrixMode(GLES11.GL_MODELVIEW);
	GLES11.glEnable(GLES11.GL_DEPTH_TEST);
	
       GLES11.glDisable(GLES11.GL_TEXTURE_2D);
	GLES11.glBindTexture(GLES11.GL_TEXTURE_2D, 0);
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:53,代码来源:AboutScreen.java

示例10: beginBatch

import android.opengl.GLES11; //导入方法依赖的package包/类
public void beginBatch(int textureId)  {
 GLES11.glBindTexture(GLES11.GL_TEXTURE_2D, textureId); // Bind Texture
   numSprites = 0;                                 // Empty Sprite Counter
   bufferIndex = 0;                                // Reset Buffer Index (Empty)
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:6,代码来源:SpriteBatch.java


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