While the Xbox 360 version of the SpeedTree SDK is a full port, from the Core library all the way to the full Reference Application, the developer can still choose any level of integration that makes sense for their title. An integration can range from importing meshes and skipping the SDK entirely to using the entire SDK to handle loading, culling, rendering, and animation chores.
There is a VS2010/VC10 solution in the [SDK]/Source/Applications/360/ folder. The solution contains five SpeedTree 360 projects: Core, Forest, Render Interface, 360 Renderer, and Reference Application. The Reference Application uses the AtgFramework provided with the XDK and its source is included in the solution as well.
Running the Reference Application
SpeedTree's portable Reference Application uses SFC files (SpeedTree Forest Configuration files) to set up and configure a fully populated world. By default, as defined in CMyCmdLineParser::Parse() in MyCmdLineOptions.cpp, the project will right as if the follow option was given:
The SFC contains everything necessary to set up the forest. Note that shadows are off by default. To enable the shadows, you'd need to recompile the Xbox 360 assets in the 360 SCS file with shadows enabled, then enable shadows in the SFC file. Note that our cascaded shadow system is merely a crude example compared to those normally used in shipping titles.
Controller To get around in the Reference Applications' world, use the following controls:
There are a few files and classes unique to the 360 Reference Application. It is based on the AtgFramework, which is set up so that the client application inherits from ATG::Application. A new class, C360Application, is used for this purpose. It inherits from ATG::Application and wraps the portable CMyApplication class that defines the Reference Application's behavior.
MyMainXbox360.cpp houses main() which handles the highest-level operations:
Of all the source that is provided, only the SDK files are intended to be used with your title. All of the code in MyApplication.h/cpp, 360Application.h/cpp, MyMainXbox360.cpp, as well as the rest of the code in the SpeedTreeRefApp_Xbox360 project, are intended to be examples of how to interface with the SDK. Use as much or as little of these files as you like, but pay particular attention to which calls are made when, especially in the population, culling, and rendering sections of the CMyApplication class.