Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
paroj opened this issue Apr 14, 2013 · 0 comments
Open

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

paroj opened this issue Apr 14, 2013 · 0 comments

Comments

@paroj
Copy link
Owner

paroj commented Apr 14, 2013

Originally reported by: Inês Almeida (Bitbucket: brita, GitHub: brita)


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?

#!c++

    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."


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant