You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In most case, the code is following the order "glVertexAttribPointer" first and then "glEnableVertexAttribArray". I think the interface "glVertexAttribPointer" is used to connect the buffer (managed by OpenGL) and the attrib (shader mananged by the pipeline), while the "glEnableVertexAttribArray" is used to submit the attachment to VAO then VAO can dispatch the buffer to related attribute, or vise vista.
But in Line 94 of "09-teapot.cpp"(and also the code for chapter 12 has the inverse order), the program is arranged in the inverse order
"void TeapotExample::Initialize(const char * title)
{
....
Line 94:
glEnableVertexAttribArray( vPosition );
glVertexAttribPointer( vPosition, 3, GL_FLOAT, GL_FALSE, 0,
BUFFER_OFFSET(0) );
"
well, is the latter usage correct, or what happen when glEnableVertexAttribArray is called?
The text was updated successfully, but these errors were encountered:
In most case, the code is following the order "glVertexAttribPointer" first and then "glEnableVertexAttribArray". I think the interface "glVertexAttribPointer" is used to connect the buffer (managed by OpenGL) and the attrib (shader mananged by the pipeline), while the "glEnableVertexAttribArray" is used to submit the attachment to VAO then VAO can dispatch the buffer to related attribute, or vise vista.
But in Line 94 of "09-teapot.cpp"(and also the code for chapter 12 has the inverse order), the program is arranged in the inverse order
"void TeapotExample::Initialize(const char * title)
{
....
Line 94:
glEnableVertexAttribArray( vPosition );
glVertexAttribPointer( vPosition, 3, GL_FLOAT, GL_FALSE, 0,
BUFFER_OFFSET(0) );
"
well, is the latter usage correct, or what happen when glEnableVertexAttribArray is called?
The text was updated successfully, but these errors were encountered: