Concept behind OpenGL’s ‘Bind’ functions

the commands in opengl don’t exist in isolation. they assume the existence of a context. one way to think of this is that there is, hidden in the background, an opengl object, and the functions are methods on that object.

so when you call a function, what it does depends on the arguments, of course, but also on the internal state of opengl – on the context/object.

this is very clear with bind, which says “set this as the current X”. then later functions modify the “current X” (where X might be buffer, for example). [update:] and as you say, the thing that is being set (the attribute in the object, or the “data member”) is the first argument to bind. so GL_ARRAY_BUFFER names a particular thing that you are setting.

and to answer the second part of the question – setting it to 0 simply clears the value so you don’t accidentally make unplanned changes elsewhere.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)