glDrawElements function
来源:互联网 发布:数据库存储过程教程 编辑:程序博客网 时间:2024/05/23 01:19
Applies to: desktop apps only
The glDrawElements function renders primitives from array data.
Syntax
void WINAPI glDrawElements( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
Parameters
- mode
The kind of primitives to render. It can assume one of the following symbolic values: GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_TRIANGLES, GL_QUAD_STRIP, GL_QUADS, and GL_POLYGON.
- count
The number of elements to be rendered.
- type
The type of the values in indices. Must be one of GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT, or GL_UNSIGNED_INT.
- indices
A pointer to the location where the indices are stored.
Return value
This function does not return a value.
Error codes
The following error codes can be retrieved by theglgetError function.
- GL_INVALID_ENUM
mode was not an accepted value.
- GL_INVALID_VALUE
count was a negative value.
- GL_INVALID_OPERATION
The function was called between a call to glBegin and the corresponding call to glEnd.
Remarks
The glDrawElements function enables you to specify multiple geometric primitives with very few function calls. Instead of calling an OpenGL function to pass each individual vertex, normal, or color, you can specify separate arrays of vertices, normals, and colors beforehand and use them to define a sequence of primitives (all of the same type) with a single call toglDrawElements.
When you call the glDrawElements function, it uses count sequential elements from indices to construct a sequence of geometric primitives. The mode parameter specifies what kind of primitives are constructed, and how the array elements are used to construct these primitives. If GL_VERTEX_ARRAY is not enabled, no geometric primitives are generated.
Vertex attributes that are modified by glDrawElements have an unspecified value after glDrawElements returns. For example, if GL_COLOR_ARRAY is enabled, the value of the current color is undefined after glDrawElements executes. Attributes that aren't modified remain unchanged.
You can include the glDrawElements function in display lists. When glDrawElements is included in a display list, the necessary array data (determined by the array pointers and enables) is also entered into the display list. Because the array pointers and enables are client-side state variables, their values affect display lists when the lists are created, not when the lists are executed.
Note The glDrawElements function is only available in OpenGL version 1.1 or later.
Requirements
Minimum supported client
Minimum supported server
Header
- Gl.h
Library
- Opengl32.lib
DLL
- Opengl32.dll
- glDrawElements function
- glDrawElements
- glDrawElements 参数
- glDrawElements(函数)
- glDrawArrays, glDrawElements
- OpenGL API glDrawElements
- [转载] glDrawArrays, glDrawElements
- glDrawElements函数应用
- 推荐的网址(glDrawElements)
- glDrawArrays 和 glDrawElements 区别?
- 关于glDrawElements的使用
- glDrawArrays,glDrawElements用法
- opengl glDrawElements和glDrawArray
- glDrawArrays、glDrawElements区别
- glDrawElements和glDrawArrays
- OpenGL: glDrawArrays & glDrawElements
- glDrawArrays与glDrawElements
- glDrawArrays 和 glDrawElements 区别?
- SpringMVC 文件上传配置,多文件上传,使用的MultipartFile
- Android 不同版本间的兼容性
- java学习中的疑难杂症(三)
- /bin/sh^M: bad interpreter的解决方法
- SIFT算法的MATLAB实现
- glDrawElements function
- java基础之集合Set
- ztree使用系列一(需求分析)
- 阅读优秀代码是提高开发人员修为的一种捷径
- 《计算机程序的构造与解释》(五)
- 《C++ Primer第四版》标准库类型(三) - vector类型
- 明星软件工程师的10种特质
- Android输入系统之InputChannel(上)
- 向高级程序员转变