Integration Phase 1b: Setting up the BaseSystem

The first thing to do in your code is to initialize the Autodesk Navigation BaseSystem when you initialize your game, and to close it when you close your game.

The BaseSystem provides Autodesk Navigation components with a set of basic services and information, such as memory management and logging.

For example: [code from Tutorial_FirstIntegration.cpp]

#include "gwnavruntime/basesystem/basesystem.h"
...

class MyGame
{
public:
    bool Initialize(bool doVisualDebugTutorial);
    ...
    void Destroy(); 
    ...
};
 
bool MyGame::Initialize(bool doVisualDebugTutorial)
{
    // Create a configuration object.
    Kaim::BaseSystem::Config config;

    Kaim::BaseSystem::Init(config);

    if (Kaim::BaseSystem::IsInitialized() == false)
    {
        Kaim::BaseSystem::Destroy();
        return false;
    }
    ...
}
...
 
void MyGame::Destroy()
{
    ...
    Kaim::BaseSystem::Destroy();
}

Note that the BaseSystem can also be used as scoped object ~C++ bool GameLoop() { Kaim::BaseSystem::Config config; Kaim::BaseSystem baseSystem(config); // calls Kaim::BaseSystem::Init(config) if (Kaim::BaseSystem::IsInitialized() == false) return false; // baseSystem is destroyed calling Kaim::BaseSystem::Destroy()

// Game loop
for (!GameEnded()) {
    ...
}

return true; // baseSystem is destroyed calling Kaim::BaseSystem::Destroy()

} ~