This may be a bit of an overlap with another question I asked earlier (and which is still in progress) but perhaps this is a better way to ask it:
When you call glDrawXXX(), several different pieces of data are referenced implicitly, even though they’re not parameters to the draw command. These include:
[ol]
[li]The vertex data (xyz/uv/normal) in a VBO via glBindBuffer
[/li][li]The index list into the vertex array(56,58,59,56) if one has been specified. These are “passed down” to the context in a VBO by glBindBuffer and (possibly) glAttribPointer. At least, I think so.
[/li][li]The shader program, if any. This is “passed down”, not in VBOs, but just by number, to the context by glUseProgram()
[/li][li]Textures(grass1.png, fur11.png). These are passed down in a VBO via glTextureBuffer() and glTexBuffer(), which are different but not clearly differentiated.
[/li][li]Probably other stuff as well?
[/li][/ol]
Several of the function definitions come close to confirming this.
Under gluseProgram it says
glUseProgram installs the program object specified by program as part of current rendering state
under glTexBuffer() it says
glTexBuffer attaches the data store of a specified buffer object to a specified texture object
But neither of these actually defines “install” or “attach”, so it’s still unclear. Likewise “current rendering state” may also mean “OpenGL context”, but that’s not clear either.
I see that several of these calls take a “target” parameter, but the meaning isn’t immediately obvious. glBindTexture takes a “target”, one of which can be GL_TEXTURE_2D, but I know you can have more than one 2D texture used to draw an object, so that has to be a “type” and not a “purpose”.
I expect that things are set up the way they are so the maximum amount of reuse can take place (set up a texture, which gets inhaled into the graphics card, then use it over and over for various glDraw calls) although just as obviously, the integer buffer identifiers, integer texture identifiers, and integer program identifiers could be explicit parameters, and the graphics card could do an internal lookup. I’m thinking there’s something in here I’m just not getting.
I’m just trying to chase down all the “implicit” stuff so I can get my arms around the general concept.
Can someone tell me if I’m pointed in the right direction?
Thanks in advance for any insight.
-Jeff