本文整理汇总了Java中android.opengl.GLES11.glDrawArrays方法的典型用法代码示例。如果您正苦于以下问题:Java GLES11.glDrawArrays方法的具体用法?Java GLES11.glDrawArrays怎么用?Java GLES11.glDrawArrays使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.opengl.GLES11
的用法示例。
在下文中一共展示了GLES11.glDrawArrays方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
}
示例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);
}
示例3: fillRect
import android.opengl.GLES11; //导入方法依赖的package包/类
@Override
public void fillRect(int x, int y, int width, int height, long color) {
int x2 = transX(x + width - 1);
int ty2 = transY(y + height - 1);
x = transX(x);
y = transY(y);
int ty = y < 0 ? 0 : y;
if (ty2 < 0) {
return;
}
setGlColor(color);
rectBuffer.clear();
rectBuffer.put(x);
rectBuffer.put(ty);
rectBuffer.put(x2);
rectBuffer.put(ty);
rectBuffer.put(x2);
rectBuffer.put(ty2);
rectBuffer.put(x);
rectBuffer.put(ty2);
rectBuffer.position(0);
GLES11.glVertexPointer(2, GLES11.GL_FLOAT, 0, rectBuffer);
GLES11.glDrawArrays(GLES11.GL_TRIANGLE_FAN, 0, 4);
}
示例4: render
import android.opengl.GLES11; //导入方法依赖的package包/类
@Override
public void render() {
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.glEnable(GLES11.GL_BLEND);
GLES11.glBlendFunc(GLES11.GL_SRC_ALPHA, GLES11.GL_ONE);
GLES11.glDrawArrays(GLES11.GL_TRIANGLES, 0, numberOfVertices);
GLES11.glDisable(GLES11.GL_BLEND);
alite.getTextureManager().setTexture(null);
if (Settings.engineExhaust && exhaust != null && !exhaust.isEmpty() && getSpeed() < 0f) {
for (EngineExhaust ex: exhaust) {
ex.render();
}
}
}
示例5: render
import android.opengl.GLES11; //导入方法依赖的package包/类
public void render() {
alite.getTextureManager().setTexture(null);
GLES11.glDisable(GLES11.GL_CULL_FACE);
GLES11.glDisableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);
GLES11.glEnableClientState(GLES11.GL_VERTEX_ARRAY);
GLES11.glVertexPointer(3, GLES11.GL_FLOAT, 0, lineBuffer);
GLES11.glColor4f(r, g, b, a);
GLES11.glDisable(GLES11.GL_LIGHTING);
GLES11.glLineWidth(5);
GLES11.glDrawArrays(GLES11.GL_LINES, 0, 24);
GLES11.glLineWidth(1);
GLES11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
GLES11.glEnable(GLES11.GL_LIGHTING);
GLES11.glEnableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);
GLES11.glEnable(GLES11.GL_CULL_FACE);
}
示例6: drawCircle
import android.opengl.GLES11; //导入方法依赖的package包/类
@Override
public void drawCircle(int cx, int cy, int r, long color, int segments) {
if (segments > 64) {
segments = 64;
}
cx = transX(cx);
cy = transY(cy);
r = (int) (r * scaleFactor);
circleBuffer.clear();
float step = 360.0f / segments;
for (float i = 0; i < 360.0f; i += step) {
float ang = (float) Math.toRadians(i);
circleBuffer.put((float) (cx + Math.cos(ang) * r));
circleBuffer.put((float) (cy + Math.sin(ang) * r));
}
circleBuffer.position(0);
setGlColor(color);
GLES11.glVertexPointer(2, GLES11.GL_FLOAT, 0, circleBuffer);
GLES11.glDrawArrays(GLES11.GL_LINE_LOOP, 0, segments);
}
示例7: 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);
}
示例8: 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);
}
示例9: 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);
}
}
示例10: render
import android.opengl.GLES11; //导入方法依赖的package包/类
@Override
public void render() {
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);
alite.getTextureManager().setTexture(null);
if (Settings.engineExhaust && exhaust != null && !exhaust.isEmpty() && getSpeed() < 0f) {
for (EngineExhaust ex: exhaust) {
ex.render();
}
}
}
示例11: 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);
}
示例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);
}
示例13: 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);
}
示例14: 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();
}
示例15: justRender
import android.opengl.GLES11; //导入方法依赖的package包/类
public void justRender() {
GLES11.glVertexPointer(2, GLES11.GL_FLOAT, 0, vertexBuffer);
GLES11.glTexCoordPointer(2, GLES11.GL_FLOAT, 0, texCoordBuffer);
GLES11.glDrawArrays(GLES11.GL_TRIANGLE_STRIP, 0, 4);
}