glDrawElements — 配列データからプリミティブを描画します
void glDrawElements(
|
GLenum mode, |
GLsizei count, | |
GLenum type, | |
const void * indices) ; |
mode
描画するプリミティブの種類を指定します。
シンボル定数は、
GL_POINTS
,
GL_LINE_STRIP
,
GL_LINE_LOOP
,
GL_LINES
,
GL_LINE_STRIP_ADJACENCY
,
GL_LINES_ADJACENCY
,
GL_TRIANGLE_STRIP
,
GL_TRIANGLE_FAN
,
GL_TRIANGLES
,
GL_TRIANGLE_STRIP_ADJACENCY
,
GL_TRIANGLES_ADJACENCY
,
GL_PATCHES
が利用できます。
count
描画する要素の数を指定します。
type
indices
の値の型を指定します。
GL_UNSIGNED_BYTE
または GL_UNSIGNED_SHORT
, GL_UNSIGNED_INT
でなければなりません。
indices
インデックスが保存されている場所へのポインタを指定します。
glDrawElements
は、非常に少ないサブルーチン呼び出しで複数の幾何プリミティブを指定します。
GL 関数を呼び出して個々の頂点、法線、テクスチャ座標、エッジフラグ、または色を渡す代わりに、頂点、法線などの個別の配列を事前に指定し、それらを使用して、1回の glDrawElements
の呼び出しでプリミティブのシーケンスを構築できます。
When glDrawElements
is called, it uses count
sequential elements from an
enabled array, starting at indices
to construct a sequence of
geometric primitives. mode
specifies what kind of primitives are
constructed and how the array elements construct these primitives. If
more than one array is enabled, each is used.
Vertex attributes that are modified by glDrawElements
have an
unspecified value after glDrawElements
returns. Attributes that aren't
modified maintain their previous values.
GL_LINE_STRIP_ADJACENCY
,
GL_LINES_ADJACENCY
,
GL_TRIANGLE_STRIP_ADJACENCY
and
GL_TRIANGLES_ADJACENCY
are available only if the GL version is 3.2 or greater.
GL_INVALID_ENUM
is generated if mode
is not an accepted value.
GL_INVALID_VALUE
is generated if count
is negative.
GL_INVALID_OPERATION
is generated if a geometry shader is active and mode
is incompatible with the input primitive type of the geometry shader in the currently installed program object.
GL_INVALID_OPERATION
is generated if a non-zero buffer object name is bound to an
enabled array or the element array and the buffer object's data store is currently mapped.
OpenGL Version | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Function / Feature Name | 2.0 | 2.1 | 3.0 | 3.1 | 3.2 | 3.3 | 4.0 | 4.1 | 4.2 | 4.3 | 4.4 | 4.5 |
glDrawElements
|
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
Copyright © 1991-2006 Silicon Graphics, Inc. Copyright © 2010-2014 Khronos Group. This document is licensed under the SGI Free Software B License. For details, see http://oss.sgi.com/projects/FreeB/.