本文整理汇总了Java中android.opengl.GLES11.glEnableClientState方法的典型用法代码示例。如果您正苦于以下问题:Java GLES11.glEnableClientState方法的具体用法?Java GLES11.glEnableClientState怎么用?Java GLES11.glEnableClientState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.opengl.GLES11
的用法示例。
在下文中一共展示了GLES11.glEnableClientState方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: render
import android.opengl.GLES11; //导入方法依赖的package包/类
public void render() {
GLES11.glNormalPointer(GLES11.GL_FLOAT, 0, normalBuffer);
GLES11.glVertexPointer(3, GLES11.GL_FLOAT, 0, vertexBuffer);
if (textureFilename != null) {
GLES11.glTexCoordPointer(2, GLES11.GL_FLOAT, 0, texCoordBuffer);
alite.getTextureManager().setTexture(textureFilename);
} else {
GLES11.glDisable(GLES11.GL_LIGHTING);
GLES11.glDisableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);
}
GLES11.glDrawArrays(glDrawMode, 0, numberOfVertices);
if (textureFilename == null) {
GLES11.glEnableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);
GLES11.glEnable(GLES11.GL_LIGHTING);
}
}
示例3: 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);
}
示例4: drawLine
import android.opengl.GLES11; //导入方法依赖的package包/类
@Override
public void drawLine(int x, int y, int x2, int y2, long color) {
x = transX(x);
y = transY(y);
x2 = transX(x2);
y2 = transY(y2);
GLES11.glLineWidth(5 * scaleFactor);
setGlColor(color);
lineBuffer.clear();
lineBuffer.put(x);
lineBuffer.put(y);
lineBuffer.put(x2);
lineBuffer.put(y2);
lineBuffer.position(0);
GLES11.glEnableClientState(GLES11.GL_VERTEX_ARRAY);
GLES11.glVertexPointer(2, GLES11.GL_FLOAT, 0, lineBuffer);
GLES11.glDrawArrays(GLES11.GL_LINES, 0, 2);
GLES11.glLineWidth(1);
}
示例5: 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);
}
示例6: render
import android.opengl.GLES11; //导入方法依赖的package包/类
public void render() {
if (hasNormals) {
GLES11.glEnableClientState(GLES11.GL_NORMAL_ARRAY);
GLES11.glNormalPointer(GLES11.GL_FLOAT, 0, normalBuffer);
} else {
GLES11.glDisableClientState(GLES11.GL_NORMAL_ARRAY);
}
GLES11.glVertexPointer(3, GLES11.GL_FLOAT, 0, vertexBuffer);
if (textureFilename != null) {
GLES11.glTexCoordPointer(2, GLES11.GL_FLOAT, 0, texCoordBuffer);
} else {
GLES11.glDisableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);
GLES11.glDisable(GLES11.GL_LIGHTING);
GLES11.glColor4f(r, g, b, a);
}
alite.getTextureManager().setTexture(textureFilename);
GLES11.glDrawArrays(glDrawMode, 0, numberOfVertices);
if (!hasNormals) {
GLES11.glEnableClientState(GLES11.GL_NORMAL_ARRAY);
}
if (textureFilename == null) {
GLES11.glEnableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);
GLES11.glEnable(GLES11.GL_LIGHTING);
GLES11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
}
}
示例7: 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);
}
示例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(cougar.getMatrix(), 0);
cougar.render();
GLES11.glPopMatrix();
GLES11.glDisable(GLES11.GL_DEPTH_TEST);
GLES11.glDisable(GLES11.GL_TEXTURE_2D);
setUpForDisplay(visibleArea);
}
示例9: 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);
}
示例10: 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);
}
}
示例11: 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);
}
示例12: render
import android.opengl.GLES11; //导入方法依赖的package包/类
@Override
public void render() {
GLES11.glDisableClientState(GLES11.GL_NORMAL_ARRAY);
GLES11.glVertexPointer(2, 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(GLES11.GL_TRIANGLE_STRIP, 0, 4);
GLES11.glEnableClientState(GLES11.GL_NORMAL_ARRAY);
GLES11.glEnable(GLES11.GL_LIGHTING);
}
示例13: 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);
}
示例14: 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);
}
示例15: render
import android.opengl.GLES11; //导入方法依赖的package包/类
public void render() {
alite.getTextureManager().setTexture(null);
GLES11.glDisableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);
GLES11.glEnableClientState(GLES11.GL_VERTEX_ARRAY);
GLES11.glVertexPointer(3, GLES11.GL_FLOAT, 0, vertexBuffer);
GLES11.glColor4f(r, g, b, a);
GLES11.glDisable(GLES11.GL_LIGHTING);
GLES11.glDrawArrays(GLES11.GL_TRIANGLES, 0, 36);
GLES11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
GLES11.glEnable(GLES11.GL_LIGHTING);
GLES11.glEnableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);
}