Initializing the World

HOOPS Luminate advanced real-time API is packaged into the ART namespace. This namespace co-exists with the RED namespace but also delivers its own application logic which operates at a higher level than HOOPS Luminate. We use a world (ART::IWorld) that runs a simulation (ART::IWorld::Start). Then, the world is synchronized (ART::IWorld::Update) and finally shutdown (ART::IWorld::Shutdown).

This is illustrated below:

RED::Object* world = ART::Factory::CreateInstance( CID_ARTWorld );
if( !world )
    RC_TEST( RED_ALLOC_FAILURE );

ART::IWorld* iworld = world->As< ART::IWorld >();

// Setup a simple planetary system:
RC_TEST( iworld->SetupEarthSystem() );

// Start the world:
RC_TEST( iworld->Start( window, NULL, NULL ) );

// Update the world, refresh the app every frame:
while( app_is_running )
{
    RC_TEST( iworld->Update() );
}

// Terminate:
RC_TEST( iworld->Shutdown() );