Binding a vertex array

Hi

Here’s my render function:


void Joint::render()
{
    glEnableClientState(GL_VERTEX_ARRAY);
    glEnableClientState(GL_NORMAL_ARRAY);

    this->changeCoordinates(); //don't care about this

    glBindVertexArray(vao);

    glDrawArrays(GL_TRIANGLES,0,sizeVertex/3);

    if(hasLogo())
    {
        glBindVertexArray(vaoLogo);

        glDrawArrays(GL_TRIANGLES,0,sizeVertexLogo/3);
    }

    glDisableClientState(GL_VERTEX_ARRAY);
    glDisableClientState(GL_NORMAL_ARRAY);

}

The point is when hasLogo() is true. In this case, the first DrawArrays doesn’t draw anything, do you know why?

These lines:

    glEnableClientState(GL_VERTEX_ARRAY);
    glEnableClientState(GL_NORMAL_ARRAY);

Affect the currently bound VAO, so you either should remove those lines + put them in the code that constructs vao + vaoLogo, or only use them after you have bound the VAO.

Ok, thanks!