OpenGL Learning notes-vertex arrays

Source: Internet
Author: User

1. Enable array

in the 1.1 glenableclientstate (Gl_vertex_array), and Gldisableclientstate (Gl_vertex_array);

Glenablevertexattribarray (*); and Gldisablevertexattribarray (*);

2. Specifying array data

Glvertexattribpointer (gluint index,glint size,glenum type,glboolean normalized, Glsizei stride,const GLvoid* pointer);

the index represents the attribute indexed value,size represents the number of components for each vertex property (this value must be 1, 2, 3, or 4).type represents the component data type,normalized represents whether the data type is normalized (normalized),When a value in an array is accessed and converted to a floating-point value, ifnormalizedis 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. stride represents the offset between successive vertex attributes, pointer the first address of the array.

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, thenPointerThe byte offset that is treated as the buffer object data store. to enable or disable array of vertex attributes, call Glenablevertexattribarray and Gldisablevertexattribarray incoming parametersIndex. If enabled, then whenGldrawarraysorGldrawelementswhen called, an array of vertex attributes is used.


This article from "Progress a little every day" blog, reproduced please contact the author!

OpenGL Learning notes-vertex arrays

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.