本文整理汇总了Java中android.opengl.GLES11.glLineWidth方法的典型用法代码示例。如果您正苦于以下问题:Java GLES11.glLineWidth方法的具体用法?Java GLES11.glLineWidth怎么用?Java GLES11.glLineWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.opengl.GLES11
的用法示例。
在下文中一共展示了GLES11.glLineWidth方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例2: 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);
}
示例3: drawRect
import android.opengl.GLES11; //导入方法依赖的package包/类
@Override
public void drawRect(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;
}
GLES11.glLineWidth(5 * scaleFactor);
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_LINE_LOOP, 0, 4);
GLES11.glLineWidth(1);
}
示例4: 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);
}
示例5: 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);
}
示例6: 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_TEXTURE_2D);
GLES11.glEnable(GLES11.GL_CULL_FACE);
}
示例7: initializeGl
import android.opengl.GLES11; //导入方法依赖的package包/类
public void initializeGl(final Rect visibleArea) {
float ratio = (float) windowWidth / (float) windowHeight;
GlUtils.setViewport(visibleArea);
GLES11.glDisable(GLES11.GL_FOG);
GLES11.glPointSize(1.0f);
GLES11.glLineWidth(1.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, 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_TEXTURE_2D);
GLES11.glEnable(GLES11.GL_CULL_FACE);
}
示例8: 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());
}