OpenGL Homemade API (1)

Source: Internet
Author: User

glvertexattribpointer (gluint index, glint size, glenum type, Glboolean normalized, Glsizei stride,const GLvoid * POI nter); Parameters: PointerSpecifies a pointer to the first component of the first vertex property in the array. The initial value is 0. StrideSpecifies the offset between successive vertex attributes. If 0, the vertex properties are understood as: they are tightly aligned. The initial value is 0. normalizedSpecifies whether the fixed point data value should be normalized (gl_true) or converted directly to a fixed point value (gl_false) when accessed. typeSpecifies the data type of each component in the array. The available symbolic constants are Gl_byte, Gl_unsigned_byte, Gl_short,gl_unsigned_short, gl_fixed, and Gl_float, with an initial value of gl_float. sizeSpecifies the number of components for each vertex property. Must be 1, 2, 3, or 4. The initial value is 4. (Dream Dimension: If position is made up of 3 (x, Y, z), and the color is 4 (r,g,b,a)) IndexSpecifies the index value of the vertex property to be modified glvertexattribpointer specifies that the index value at render time is IndexThe data format and location of the array of vertex attributes. sizeSpecify the number of components for each property value and must be one of 1, 2, 3, 4. typeSpecifies the data format for each component, StrideSpecifies the step size between one property and the next (this allows the property value to be stored in a single array or in a different array). When a value in an array is accessed and converted to a floating-point value, if normalizedis set to Gl_true, which means that the value of the integer is mapped to the interval [ -1,1] (signed integer), or the interval [0,1] (unsigned integer), and conversely, these values are converted directly to floating point values without normalization. If a buffer object with a nonzero name is bound to the Gl_array_buffer target (see Glbindbuffer) and a fixed-point attribute array is specified, then PointerThe byte offset that is treated as the buffer object data store. Also, the Buffer object binding (gl_array_buffer_binding) is saved as an indexed IndexThe vertex attribute array client state (gl_vertex_attrib_array_buffer_binding); (Also, the BUFFER object BINDING (gl_array_buffer_binding) is Saved as generic vertex attribute array client-side State (gl_vertex_attrib_array_buffer_binding) for index Index.) When a vertex attribute array is specified, in addition to the current vertex array buffer object bindings, size, type, normalized, StrideAnd Pointerwill also be saved as client state to enable or disable array of vertex attributes, call Glenablevertexattribarray and Gldisablevertexattribarray incoming parameters Index。 If enabled, an array of vertex attributes is used when gldrawarrays or gldrawelements are called.Gldrawarrays (glenum mode, glint first, glsizei count);Function prototypes: Gl_apicall void Gl_apientry gldrawarrays (glenum mode, glint first, glsizei count); functions with similar functions are gldrawelements. Parameter description: Mode, drawing method, OpenGL2.0 provide the following parameters: Gl_points, Gl_lines, Gl_line_loop, Gl_line_strip, Gl_triangles, Gl_triangle_strip, Gl_triangle_fan. First, which is drawn from the array cache, typically 0. Count, the number of vertices in the array. provides drawing functionality. Use this function when drawing a drawing with a top-count group. The function is drawn based on the coordinate data in the vertex array and the specified pattern. Call this function before you call Glenablevertexattribarray, Glvertexattribpointer, and so on to set vertex properties and data.

OpenGL Homemade API (1)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.