本文整理汇总了Java中android.opengl.GLES11.glBlendFunc方法的典型用法代码示例。如果您正苦于以下问题:Java GLES11.glBlendFunc方法的具体用法?Java GLES11.glBlendFunc怎么用?Java GLES11.glBlendFunc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.opengl.GLES11
的用法示例。
在下文中一共展示了GLES11.glBlendFunc方法的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);
}
}
示例2: render
import android.opengl.GLES11; //导入方法依赖的package包/类
public void render() {
GLES11.glEnable(GLES11.GL_TEXTURE_2D);
if (!textureManager.checkTexture(fileName)) {
textureManager.addTexture(fileName, bitmap);
}
GLES11.glEnableClientState(GLES11.GL_VERTEX_ARRAY);
GLES11.glEnableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);
GLES11.glVertexPointer(2, GLES11.GL_FLOAT, 0, vertexBuffer);
GLES11.glTexCoordPointer(2, GLES11.GL_FLOAT, 0, texCoordBuffer);
GLES11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
GLES11.glEnable(GLES11.GL_BLEND);
GLES11.glBlendFunc(GLES11.GL_SRC_ALPHA, GLES11.GL_ONE_MINUS_SRC_ALPHA);
textureManager.setTexture(fileName);
GLES11.glDrawArrays(GLES11.GL_TRIANGLE_STRIP, 0, 4);
GLES11.glDisable(GLES11.GL_BLEND);
GLES11.glDisable(GLES11.GL_TEXTURE_2D);
textureManager.setTexture(null);
GLES11.glDisableClientState(GLES11.GL_VERTEX_ARRAY);
GLES11.glDisableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);
}
示例3: 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);
}
示例4: 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);
}
示例5: 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);
}
示例6: performPresent
import android.opengl.GLES11; //导入方法依赖的package包/类
public void performPresent(float deltaTime) {
GLES11.glPointSize(2.0f);
GLES11.glBlendFunc(GLES11.GL_SRC_ALPHA, GLES11.GL_ONE_MINUS_SRC_ALPHA);
GLES11.glDisable(GLES11.GL_BLEND);
GLES11.glDisable(GLES11.GL_LIGHTING);
GLES11.glMatrixMode(GLES11.GL_TEXTURE);
GLES11.glTranslatef(0.0007f, -0.015f, 0.0f);
GLES11.glMatrixMode(GLES11.GL_MODELVIEW);
GLES11.glPushMatrix();
GLES11.glMultMatrixf(cylinder.getMatrix(), 0);
GLES11.glColor4f(red, green, blue, 1.0f);
cylinder.render();
GLES11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
GLES11.glPopMatrix();
GLES11.glPointSize(1.0f);
}
示例7: renderText
import android.opengl.GLES11; //导入方法依赖的package包/类
protected void renderText() {
if (currentLine != null) {
currentY = currentLine.getY();
currentHeight = currentLine.getHeight();
if (currentHeight != 0 && textData != null && textData.length > 0) {
currentHeight = textData[textData.length - 1].y + 30 - currentY;
if (currentY + currentHeight > 1080) {
AliteLog.e("Overfull VBox", "Attention: Overfull VBox for " + currentLine.getText() + " => " + (currentY + currentHeight));
}
currentLine.setHeight(currentHeight);
}
currentX = currentLine.getX();
currentWidth = currentLine.getWidth();
}
if (currentLine == null || currentLine.getText().isEmpty()) {
return;
}
Graphics g = alite.getGraphics();
GLES11.glBlendFunc(GLES11.GL_ONE, GLES11.GL_ONE_MINUS_SRC_ALPHA);
GLES11.glEnable(GLES11.GL_BLEND);
if (currentX != -1 && currentY != -1) {
g.gradientRect(currentX, currentY, currentWidth, currentHeight, true, true, AliteColors.get().tutorialBubbleDark(), AliteColors.get().tutorialBubbleLight());
}
GLES11.glDisable(GLES11.GL_BLEND);
if (currentX != -1 && currentY != -1) {
g.rec3d(currentX, currentY, currentWidth, currentHeight, 4, AliteColors.get().tutorialBubbleLight(), AliteColors.get().tutorialBubbleDark());
}
if (currentLine != null && textData != null) {
displayText(g, textData);
}
}
示例8: postNavigationRender
import android.opengl.GLES11; //导入方法依赖的package包/类
@Override
public void postNavigationRender(float deltaTime) {
if (currentLine != null) {
GLES11.glBlendFunc(GLES11.GL_ONE, GLES11.GL_ONE_MINUS_SRC_ALPHA);
GLES11.glEnable(GLES11.GL_BLEND);
currentLine.renderHighlights(deltaTime);
GLES11.glDisable(GLES11.GL_BLEND);
}
}
示例9: setUp
import android.opengl.GLES11; //导入方法依赖的package包/类
protected void setUp() {
GLES11.glDisable(GLES11.GL_LIGHTING);
GLES11.glEnableClientState(GLES11.GL_VERTEX_ARRAY);
GLES11.glEnableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);
GLES11.glVertexPointer(2, GLES11.GL_FLOAT, 0, vertexBuffer);
GLES11.glTexCoordPointer(2, GLES11.GL_FLOAT, 0, texCoordBuffer);
alite.getTextureManager().setTexture(textureFilename);
GLES11.glDisable(GLES11.GL_CULL_FACE);
GLES11.glEnable(GLES11.GL_BLEND);
GLES11.glBlendFunc(GLES11.GL_ONE, GLES11.GL_ONE_MINUS_SRC_ALPHA);
}
示例10: 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;
}
示例11: 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);
}
示例12: 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);
}
示例13: 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);
}
示例14: 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());
}
示例15: 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);
}