Initialization
A CForestRI (RI stands for Render Interface) object cannot be instantiated by itself.
Read time 1 minuteLast updated 2 hours ago
CForestRI is essentially a shell, making graphics calls in the correct sequence, but has no knowledge of any particular graphics system. It is given this knowledge using template parameters. These parameters are known as policy classes (a concept introduced by Andrei Alexandrescu in his 2001 book Modern C++ Design), and they fill out the implementations of the class interfaces defined by . Objects like , , and provide the necessary functionality for the Render Interface classes to carry out a full scene render. This technique enables client applications to replace any of the default SpeedTree implementations without changing the Runtime SDK library source.
CForestRICTextureRICRenderStateRICGeometryBufferRIThere are dozens of configurable parameters for the object and most are stored in the structure. Example parameters include the shader filename, fogging data, lighting parameters, shadow values, and more. Once these have been set using , the graphics system is ready to be initialized.
CForestRISForestRenderInfoCForestRI::SetRenderInfo()CForestRI::InitGfx()