Bound objects make the usage of objects that can be bound to a OpenGL binding point or "target" easier. This includes objects like Buffer, Texture, Renderbuffer or Framebuffer which have a target to which individual instances can be bound and operated on through the binding point. Generally Bound<Object>
classes re-implement those functions of Object
which have a target
parameter of the Object::Target
type. These re-implemented functions have all the other parameters of the original member functions, but lack the target
parameter and supply it to the original function call automatically.
For example to setup a texture object one might need to do the following:
The Bound
template class instantiated through the Bind
function allows to do things more conveniently:
The source code for the specializations of the Bound template class is not included automatically by including oglplus/all.hpp. In order to be able to use Bound
objects it is necessary to include the appropriate header: