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


Java GLES10.glVertexPointer方法代码示例

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


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

示例1: draw

import android.opengl.GLES10; //导入方法依赖的package包/类
@Override
	public void draw(final int texId, final float[] tex_matrix, final int offset) {
		// FIXME Matrixを適用
		GLES10.glEnableClientState(GLES10.GL_VERTEX_ARRAY);
		pVertex.position(0);
		GLES10.glVertexPointer(2, GLES10.GL_FLOAT, VERTEX_SZ, pVertex);
//--------------------------------------------------------------------------------
		GLES10.glEnableClientState(GLES10.GL_TEXTURE_COORD_ARRAY);
		pTexCoord.position(0);
		GLES10.glTexCoordPointer(VERTEX_NUM, GLES10.GL_FLOAT, VERTEX_SZ, pTexCoord);
		GLES10.glActiveTexture(GLES10.GL_TEXTURE0);
		GLES10.glBindTexture(mTexTarget, texId);
//--------------------------------------------------------------------------------
		GLES10.glDrawArrays(GLES10.GL_TRIANGLE_STRIP, 0, VERTEX_NUM);
//--------------------------------------------------------------------------------
		GLES10.glBindTexture(mTexTarget, 0);
		GLES10.glDisableClientState(GLES10.GL_TEXTURE_COORD_ARRAY);
//--------------------------------------------------------------------------------
		GLES10.glDisableClientState(GLES10.GL_VERTEX_ARRAY);
	}
 
开发者ID:saki4510t,项目名称:libcommon,代码行数:21,代码来源:GLDrawer2D.java

示例2: drawQuadWithTexture

import android.opengl.GLES10; //导入方法依赖的package包/类
@Override
public void drawQuadWithTexture(TextureHandle textureid, float[] geometry) {
	if (quadEleementBuffer == null) {
		generateQuadElementBuffer();
	}
	quadEleementBuffer.position(0);
	glBindTexture(textureid);

	FloatBuffer buffer = generateTemporaryFloatBuffer(geometry);

	GLES10.glVertexPointer(3, GLES10.GL_FLOAT, 5 * 4, buffer);
	FloatBuffer texbuffer = reuseableBufferDuplicate;
	texbuffer.position(3);
	GLES10.glTexCoordPointer(2, GLES10.GL_FLOAT, 5 * 4, texbuffer);

	GLES10.glDrawElements(GLES10.GL_TRIANGLES, 6, GLES10.GL_UNSIGNED_BYTE,
			quadEleementBuffer);
}
 
开发者ID:jsettlers,项目名称:settlers-remake,代码行数:19,代码来源:AndroidDrawContext.java

示例3: drawTrianglesWithTextureColored

import android.opengl.GLES10; //导入方法依赖的package包/类
@Override
public void drawTrianglesWithTextureColored(TextureHandle textureid, float[] geometry) {
	glBindTexture(textureid);

	GLES10.glEnableClientState(GLES10.GL_COLOR_ARRAY);

	FloatBuffer buffer = generateTemporaryFloatBuffer(geometry);

	GLES10.glVertexPointer(3, GLES10.GL_FLOAT, 9 * 4, buffer);
	FloatBuffer texbuffer = reuseableBufferDuplicate;
	texbuffer.position(3);
	GLES10.glTexCoordPointer(2, GLES10.GL_FLOAT, 9 * 4, texbuffer);
	FloatBuffer colorbuffer = buffer.duplicate(); // we need it selden enogh
													// to allocate a new one.
	colorbuffer.position(5);
	GLES10.glColorPointer(4, GLES10.GL_FLOAT, 9 * 4, colorbuffer);

	GLES10.glDrawArrays(GLES10.GL_TRIANGLES, 0, geometry.length / 9);
	GLES10.glDisableClientState(GLES10.GL_COLOR_ARRAY);
}
 
开发者ID:jsettlers,项目名称:settlers-remake,代码行数:21,代码来源:AndroidDrawContext.java

示例4: fillQuad

import android.opengl.GLES10; //导入方法依赖的package包/类
@Override
public void fillQuad(float x1, float y1, float x2, float y2) {
	quadDatas = new float[3 * 6];
	quadDatas[0] = x1;
	quadDatas[1] = y1;
	quadDatas[2] = 0;
	quadDatas[3] = x2;
	quadDatas[4] = y1;
	quadDatas[5] = 0;
	quadDatas[6] = x1;
	quadDatas[7] = y2;
	quadDatas[8] = 0;
	quadDatas[9] = x1;
	quadDatas[10] = y2;
	quadDatas[11] = 0;
	quadDatas[12] = x2;
	quadDatas[13] = y1;
	quadDatas[14] = 0;
	quadDatas[15] = x2;
	quadDatas[16] = y2;
	quadDatas[17] = 0;

	glBindTexture(null);
	FloatBuffer floatBuff = generateTemporaryFloatBuffer(quadDatas);

	GLES10.glDisableClientState(GLES10.GL_TEXTURE_COORD_ARRAY);
	GLES10.glVertexPointer(3, GLES10.GL_FLOAT, 3 * 4, floatBuff);
	GLES10.glDrawArrays(GLES10.GL_TRIANGLES, 0, quadDatas.length / 3);
	GLES10.glEnableClientState(GLES10.GL_TEXTURE_COORD_ARRAY);
}
 
开发者ID:jsettlers,项目名称:settlers-remake,代码行数:31,代码来源:AndroidDrawContext.java

示例5: drawLine

import android.opengl.GLES10; //导入方法依赖的package包/类
@Override
public void drawLine(float[] points, boolean loop) {
	if (points.length % 3 != 0) {
		throw new IllegalArgumentException(
				"Point array length needs to be multiple of 3.");
	}
	glBindTexture(null);
	FloatBuffer floatBuff = generateTemporaryFloatBuffer(points);
	GLES10.glDisableClientState(GLES10.GL_TEXTURE_COORD_ARRAY);
	GLES10.glVertexPointer(3, GLES10.GL_FLOAT, 0, floatBuff);
	GLES10.glDrawArrays(loop ? GLES10.GL_LINE_LOOP : GLES10.GL_LINE_STRIP,
			0, points.length / 3);
	GLES10.glEnableClientState(GLES10.GL_TEXTURE_COORD_ARRAY);
}
 
开发者ID:jsettlers,项目名称:settlers-remake,代码行数:15,代码来源:AndroidDrawContext.java

示例6: drawTrianglesWithTexture

import android.opengl.GLES10; //导入方法依赖的package包/类
@Override
public void drawTrianglesWithTexture(TextureHandle textureid, float[] geometry) {
	glBindTexture(textureid);

	FloatBuffer buffer = generateTemporaryFloatBuffer(geometry);

	GLES10.glVertexPointer(3, GLES10.GL_FLOAT, 5 * 4, buffer);
	FloatBuffer texbuffer = reuseableBufferDuplicate;
	texbuffer.position(3);
	GLES10.glTexCoordPointer(2, GLES10.GL_FLOAT, 5 * 4, texbuffer);
	GLES10.glDrawArrays(GLES10.GL_TRIANGLES, 0, geometry.length / 5);
}
 
开发者ID:jsettlers,项目名称:settlers-remake,代码行数:13,代码来源:AndroidDrawContext.java

示例7: draw

import android.opengl.GLES10; //导入方法依赖的package包/类
public void draw(GL10 unused) {
	
    
	GLES10.glColorPointer(4, GLES10.GL_FLOAT, 0, mColorBuffer);
	GLES10.glVertexPointer(3, GLES10.GL_FLOAT, 0, mVertexBuffer);
	
	GLES10.glEnableClientState(GLES10.GL_COLOR_ARRAY); 
	GLES10.glEnableClientState(GLES10.GL_VERTEX_ARRAY);
	
	GLES10.glDrawElements(GLES10.GL_TRIANGLES, 36, GLES10.GL_UNSIGNED_BYTE, mIndexBuffer);
    
	GLES10.glDisableClientState(GLES10.GL_COLOR_ARRAY); 
	GLES10.glDisableClientState(GLES10.GL_VERTEX_ARRAY);
    
}
 
开发者ID:yurisuzukiltd,项目名称:AR-Music-Kit,代码行数:16,代码来源:Cube.java

示例8: draw

import android.opengl.GLES10; //导入方法依赖的package包/类
public void draw(GL10 unused) {


        GLES10.glColorPointer(4, GLES10.GL_FLOAT, 0, mColorBuffer);
        GLES10.glVertexPointer(3, GLES10.GL_FLOAT, 0, mVertexBuffer);

        GLES10.glEnableClientState(GLES10.GL_COLOR_ARRAY);
        GLES10.glEnableClientState(GLES10.GL_VERTEX_ARRAY);

        GLES10.glDrawElements(GLES10.GL_TRIANGLES, 36, GLES10.GL_UNSIGNED_BYTE, mIndexBuffer);

        GLES10.glDisableClientState(GLES10.GL_COLOR_ARRAY);
        GLES10.glDisableClientState(GLES10.GL_VERTEX_ARRAY);

    }
 
开发者ID:norips,项目名称:Projet_MBA,代码行数:16,代码来源:Cube.java


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