This page details the preliminary steps that you must carry out in your code in order to begin using the Beast API, and how to release allocated resources when you are finished using the API. All other calls you make to the functions of the Beast API — such as those described under Creating a Scene, Rendering the Scene and Retrieving the Rendered Output — will be done in between the initialization and termination events outlined below.
Initializing the Beast API usually involves the following steps.
To initialize the Beast Manager, create a new ILBManagerHandle and set it up through a call to ILBCreateManager().
// Send errors to stderr and info to stdout. ILBSetLogTarget(ILB_LT_ERROR, ILB_LS_STDERR, 0); ILBSetLogTarget(ILB_LT_INFO, ILB_LS_NULL, 0); // Initialize the Beast Manager. ILBManagerHandle bmh; ILBCreateManager("C:/temp/myProject", ILB_CS_LOCAL,"LICENSE_KEY", &bmh); // Set the path to the Beast executables. ILBSetBeastPath(bmh, "../../../bin"); // Clear the disk cache maintained by the Beast Manager. ILBClearCache(bmh);
The Beast API does not absolutely require any global termination steps in all cases. However, you may need to carry out some additional steps depending on how you use the API.
You can destroy or clear some kinds of handles explicitly if you need to clear the memory they are using at a certain point in your code. For more information, see Working With Object Handles. Note that when the Beast Manager handle passes out of scope or when you destroy it explicitly, all of the handles you initialized through that Manager (such as scenes, light sources, render jobs, etc.) are automatically invalidated. Therefore, destroying the Manager handle is typically the last thing you do through the API.