OpenGL ES 2.0 / GLSL 1.0
Vertices
最終更新:
opengles
-
view
Current Vertex State [2.7]
void VertexAttrib{1234}{f}(uint index, T values);
void VertexAttrib{1234}{f}v(uint index, T values);
Vertex Arrays [2.8]
Vertex data may be sourced from arrays that are stored in application memory (via a pointer) or faster GPU memory (in a buffer object).
void VertexAttribPointer(uint index, int size, enum type, boolean normalized, sizei stride, const void *pointer);
// type: BYTE, UNSIGNED_BYTE, SHORT, UNSIGNED_SHORT, FIXED, FLOAT
// index: [0, MAX_VERTEX_ATTRIBS - 1]
If an ARRAY_BUFFER is bound, the attribute will be read from the bound buffer, and pointer is treated as an offset within the buffer.
void EnableVertexAttribArray(uint index);
void DisableVertexAttribArray(uint index);
// index: [0, MAX_VERTEX_ATTRIBS - 1]
void DrawArrays(enum mode, int first, sizei count);
void DrawElements(enum mode, sizei count, enum type, void *indices);
// mode: POINTS, LINE_STRIP, LINE_LOOP, LINES, TRIANGLE_STRIP, TRIANGLE_FAN, TRIANGLES
// type: UNSIGNED_BYTE, UNSIGNED_SHORT
If an ELEMENT_ARRAY_BUFFER is bound, the indices will be read from the bound buffer, and indices is treated as an offset within the buffer.