OpenGL Function Names

Many OpenGL functions are variations of each other, differing mostly in the data types of their arguments. Some functions differ in the number of related arguments and whether those arguments can be specified as a vector or must be specified separately in a list. For example, if you use the glVertex2f function, you need to supply x- and y-coordinates as 32-bit floating-point numbers; with glVertex3sv, you must supply an array of three short (16-bit) integer values for x, y, and z. Only the base name of the function is used in the topics that follow.

许多OpenGL函数是彼此的变体,它们的参数的数据类型大多不同。有些函数在相关参数的数量上有所不同,这些参数是可以指定为向量,还是必须在列表中单独指定。例如,如果使用glVertex2f函数,需要将x和y坐标作为32位浮点数提供;使用glVertex3sv,您必须为x、y和z提供一个由三个短(16位)整数值组成的数组。

An asterisk indicates that there may be more to the actual function name than is shown. For example, glVertex* stands for all the variations of the function you use to specify vertices: glVertex2d, glVertex2f, glVertex2i, and so on.

星号表示实际函数名可能比显示的更多。例如,glVertex*表示用于指定顶点的函数的所有变体:glVertex2d、glVertex2f、glVertex2i等等。

The effect of an OpenGL function can vary depending on whether certain modes are enabled. For example, you need to enable lighting if the lighting-related functions are to produce a properly lit object. To enable a particular mode, use the glEnable function and supply the appropriate constant to identify the mode (for example, GL_LIGHTING). To disable a mode, use glDisable. See glEnable for a complete list of the modes that can be enabled.

OpenGL函数的效果取决于是否启用某些模式。例如,如果要生成正确照明的对象,需要启用照明功能。要启用特定模式,请使用glEnable函数并提供适当的常量来标识模式(例如,GL_LIGHTING)。若要禁用模式,请使用glDisable。有关可以启用的模式的完整列表,请参见glEnable。

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容