OpenGL ES中几个重要函数

 

glVertexPointer

void glVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)

Parameters:
size Specifies the number of coordinates per vertex. Must be 2, 3, or 4. The
initial value is 4.
type Specifies the data type of each vertex coordinate in the array. Symbolic
constants GL_BYTE, GL_SHORT, and GL_FIXED, are accepted. However, the
initial value is GL FLOAT.
The common profile accepts the symbolic constant GL FLOAT as well.
stride Specifies the byte offset between consecutive vertices. If stride is 0, the
vertices are understood to be tightly packed in the array. The initial value
is 0.
pointer Specifies a pointer to the first coordinate of the first vertex in the array.
The initial value is 0.


参数:
size:指定了每个顶点对应的坐标个数,只能是2,3,4中的一个,默认值是4
type:指定了数组中每个顶点坐标的数据类型,可取常量:GL_BYTE, GL_SHORT,GL_FIXED,GL_FLOAT;
stride:指定了连续顶点间的字节排列方式,如果为0,数组中的顶点就会被认为是按照紧凑方式排列的,默认值为0
pointer:制订了数组中第一个顶点的首地址,默认值为0,对于我们的android,大家可以不用去管什么地址的,一般给一个IntBuffer就可以了。


Description
glVertexPointer specifies the location and data of an array of vertex coordinates
to use when rendering. size specifies the number of coordinates per vertex and type
the data type of the coordinates. stride specifies the byte stride from one vertex to
the next allowing vertices and attributes to be packed into a single array or stored
in separate arrays. (Single-array storage may be more efficient on some implementations.)
When a vertex array is specified, size, type, stride, and pointer are saved as
client-side state.
If the vertex array is enabled, it is used when glDrawArrays, or glDrawElements
is called. To enable and disable the vertex array, call glEnableClientState
and glDisableClientState with the argument GL VERTEX ARRAY. The vertex array
is initially disabled and isn’t accessed when glDrawArrays or glDrawElements is
called.
Use glDrawArrays to construct a sequence of primitives (all of the same type)
from prespecified vertex and vertex attribute arrays. Use glDrawElements to construct
a sequence of primitives by indexing vertices and vertex attributes.

If the vertex array is enabled, it is used when glDrawArrays, or glDrawElements
is called. To enable and disable the vertex array, call glEnableClientState
and glDisableClientState with the argument GL_VERTEX ARRAY. The vertex array
is initially disabled and isn’t accessed when g

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值