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


Java GL11.glBindBuffer方法代码示例

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


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

示例1: beginDrawingStrips

import javax.microedition.khronos.opengles.GL11; //导入方法依赖的package包/类
public void beginDrawingStrips(GL10 gl, boolean useTexture) {
    beginDrawing(gl, useTexture);
    if (!mUseHardwareBuffers) {
        gl.glVertexPointer(3, mCoordinateType, 0, mVertexBuffer);

        if (useTexture) {
            gl.glTexCoordPointer(2, mCoordinateType, 0, mTexCoordBuffer);
        } 
        
    } else {
        GL11 gl11 = (GL11)gl;
        // draw using hardware buffers
        gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, mVertBufferIndex);
        gl11.glVertexPointer(3, mCoordinateType, 0, 0);
        
        gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, mTextureCoordBufferIndex);
        gl11.glTexCoordPointer(2, mCoordinateType, 0, 0);
        
        gl11.glBindBuffer(GL11.GL_ELEMENT_ARRAY_BUFFER, mIndexBufferIndex);
    }
}
 
开发者ID:gogas,项目名称:replicaisland,代码行数:22,代码来源:Grid.java

示例2: draw

import javax.microedition.khronos.opengles.GL11; //导入方法依赖的package包/类
public void draw(GL10 gl, boolean useTexture, boolean useColor) {
    if (!mUseHardwareBuffers) {
        gl.glVertexPointer(3, mCoordinateType, 0, mVertexBuffer);

        if (useTexture) {
            gl.glTexCoordPointer(2, mCoordinateType, 0, mTexCoordBuffer);
        }
        
        if (useColor) {
            gl.glColorPointer(4, mCoordinateType, 0, mColorBuffer);
        }

        gl.glDrawElements(GL10.GL_TRIANGLES, mIndexCount,
                GL10.GL_UNSIGNED_SHORT, mIndexBuffer);
    } else {
        GL11 gl11 = (GL11)gl;
        // draw using hardware buffers
        gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, mVertBufferIndex);
        gl11.glVertexPointer(3, mCoordinateType, 0, 0);
        
        if (useTexture) {
         gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, mTextureCoordBufferIndex);
         gl11.glTexCoordPointer(2, mCoordinateType, 0, 0);
        }
        
        if (useColor) {
         gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, mColorBufferIndex);
         gl11.glColorPointer(4, mCoordinateType, 0, 0);
        }
        
        gl11.glBindBuffer(GL11.GL_ELEMENT_ARRAY_BUFFER, mIndexBufferIndex);
        gl11.glDrawElements(GL11.GL_TRIANGLES, mIndexCount,
                GL11.GL_UNSIGNED_SHORT, 0);
        
        gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, 0);
        gl11.glBindBuffer(GL11.GL_ELEMENT_ARRAY_BUFFER, 0);


    }
}
 
开发者ID:tgmarinho,项目名称:apps-for-android,代码行数:41,代码来源:Grid.java

示例3: draw

import javax.microedition.khronos.opengles.GL11; //导入方法依赖的package包/类
public void draw(GL10 gl, boolean useTexture) {
    if (!mUseHardwareBuffers) {
        gl.glVertexPointer(3, mCoordinateType, 0, mVertexBuffer);

        if (useTexture) {
            gl.glTexCoordPointer(2, mCoordinateType, 0, mTexCoordBuffer);
        } 

        gl.glDrawElements(GL10.GL_TRIANGLES, mIndexCount,
                GL10.GL_UNSIGNED_SHORT, mIndexBuffer);
    } else {
        GL11 gl11 = (GL11)gl;
        // draw using hardware buffers
        gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, mVertBufferIndex);
        gl11.glVertexPointer(3, mCoordinateType, 0, 0);
        
        gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, mTextureCoordBufferIndex);
        gl11.glTexCoordPointer(2, mCoordinateType, 0, 0);
        
        gl11.glBindBuffer(GL11.GL_ELEMENT_ARRAY_BUFFER, mIndexBufferIndex);
        gl11.glDrawElements(GL11.GL_TRIANGLES, mIndexCount,
                GL11.GL_UNSIGNED_SHORT, 0);
        
        gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, 0);
        gl11.glBindBuffer(GL11.GL_ELEMENT_ARRAY_BUFFER, 0);


    }
}
 
开发者ID:gogas,项目名称:replicaisland,代码行数:30,代码来源:Grid.java


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