Core Library
The SpeedTree SDK makes several accesses to the host system's file system (specifically: textures, tree models, and shaders), but every access is routed through an overrideable interface, giving the client application a chance to intercept the request and provide the file data through a custom implementation. Most commonly, games may have one or more large files that house a conglomeration of different files, compiled together when packaging the game's assets.
Specifically, the following class interface is available to be overridden:
By default, the SDK provides definitions for these functions that implement standard file read()/open()-level functionality.
Some notes about this interface class:
The reference application contains a full example of how to override the CFileSystem interface in MyFileSystem.h. Once the class is defined, as in CMyFileSystem in the reference application, the SDK can be notified of it using the following approach:
A global variable is normally used like this to ensure that the interface is established as early as possible (before main() is invoked).