Typically,
a computer game will use many textures.
You
can instruct OpenGL to make a particular texture current by binding the
texture, just like you can make a particular VAO current by binding it.
Binding
is done before the texture is passed to VRAM on the graphics card. The texture is also bound during rendering,
so OpenGL knows which texture to use.
To
bind a texture, the syntax is:
glBindTexture(target,
id
);- The
target is typically GL_TEXTURE_2D
- Once
bound, the texture becomes the active texture and is used by all texturing
calls until the next glBindTexture()
is
called.
In
the template code, you can bind a texture using
m_texture.Bind(), which calls
glBindTexture().