Streaming a DAG to a .red file

Once you get a pointer to the root of your DAG (and your file is properly created), you can stream its whole content to a .red file very easily:

// root is a pointer to a DAG root (or any other shape into a DAG)
// ired_file is a pointer to a RED::IREDFile interface
// resmgr is a pointer to the RED resource manager

RED::StreamingPolicy policy;
RC_TEST( ired_file->WriteDAG( root, policy, resmgr ) );

This call ensures that all the dependencies are saved together with the DAG data (including materials, shaders, textures and so on). You get the whole thing into a single compressed archive which can be reloaded by any other REDsdk-based application, on any platform.


You can customize the way data are compressed by specifying additional parameter values to the RED::StreamingPolicy instance (see Defining .red file policy for further details)