本文整理匯總了Java中android.opengl.GLES10.glTexCoordPointer方法的典型用法代碼示例。如果您正苦於以下問題:Java GLES10.glTexCoordPointer方法的具體用法?Java GLES10.glTexCoordPointer怎麽用?Java GLES10.glTexCoordPointer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.opengl.GLES10
的用法示例。
在下文中一共展示了GLES10.glTexCoordPointer方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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);
}
示例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);
}
示例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);
}
示例4: 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);
}