212 Chapter 3 Renderers
Texture object is given its texture image and corresponding sampler information. The
image and sampler information are accessed by the graphics system when the texture
is loaded/enabled for drawing.
There is also a companion function to
OnLoadProgram named OnReleaseProgram.
This function simply decrements its reference to the shader program. If the shader
object is the last object to have a reference to the progr am, the program is automati-
cally destroyed.
The last line of code in
ShaderEffect::Load is a call to a virtual function Shader-
Effect::OnLoadPrograms
. This gives objects from a ShaderEffect-derived class to
perform postload operations. The most common operation is to provide local stor-
age for user-defined constants. ...