Issues

Issue #100 open

Is "Hello, Triangle!" missing a cleanup bindBuffer?

Inês Almeida
created an issue

In the display function, in "Chapter 1. Hello, Triangle!", after glDrawArrays, the AttribPointer is disabled, as well as the program, but not the vertex buffer object. Is it missing?

    glUseProgram(theProgram);

    glBindBuffer(GL_ARRAY_BUFFER, positionBufferObject);
    glEnableVertexAttribArray(0);
    glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, 0);

    glDrawArrays(GL_TRIANGLES, 0, 3);

    glDisableVertexAttribArray(0);
    // glBindBuffer(GL_ARRAY_BUFFER, 0);  // ?
    glUseProgram(0);

--

Also, you have a minor typo at the very beginning of: "Chapter 2. Playing with Colors", in: "The methods are to using the fragment's position to compute a color and to using per-vertex data to compute a color."

Comments (1)

  1. Log in to comment