Rendering a window contents

// First, get our resource manager and access its interface.
RED::Object* resmgr = RED::Factory::CreateInstance( CID_REDResourceManager );
RED::IResourceManager* iresmgr = resmgr->As< RED::IResourceManager >();

// Close our transaction first, otherwise our changes won't be commited!
RC_TEST( iresmgr->EndState() );

// Assuming that 'window' is our REDsdk window address:
RED::IWindow* iwindow = window->As< RED::IWindow >();

// Rendering method (GPU rendering):
RC_TEST( iwindow->FrameDrawing() );

// Rendering method (CPU rendering or hybrid CPU / GPU rendering):
bool complete = false;
while( complete == false )
  RC_TEST( iwindow->FrameTracing( complete ) );
  // Refresh user interface, poll application events here.

// Rendering is over, start a new transaction to record changes:

The first important point here is about closing the current transaction before calling one of the RED::IWindow rendering methods. If the current transaction is not closed before drawing, then all changes done recorded during that transaction will be ignored. See the Transaction management chapter for details on how transaction work in REDsdk.

Then, draw. Depending on the cluster's rendering setup (Software startup), one of the two methods indicated in the code above can be chosen. RED::IWindow::FrameDrawing is preferred for pure GPU accelerated rendering. RED::IWindow::FrameTracing is used for CPU side image processing using REDsdk's software ray-tracer, possibly mixed with hardware GPU rendering.

Then, once drawn, re-open a transaction. All changes in the engine will fail if a transaction is not open to record changes.