User Tools


AnnEngine

The AnnEngine class it the main class of the engine. Creating an AnnEngine object will start the engine.

AnnEngine is a singleton, meaning that you can only have one instance of this class “alive” at the same time.

A process could start, stop and then start again the engine, but there's not really any point of doing this IMO.

The user is intended to use the macro AnnMain, AnnInit and AnnQuit to prepare the execution environement of Annwvyn. You can obviously do everything by hand, but you'll need to proviede an hmdIdentifier string to AnnEngine's constructor.

Engine intialization process

Here's the list of of operation realized by the AnnEngine constructor :

  1. Singleton unicity check
  2. ProcessPriority autoset (if not deactivated by the user)
  3. VRRenderer selection
  4. VRRenderer initialization process
  5. AnnPlayer creation
  6. SubSystem initialization

Subsystem access

AnnEngine it the object that keep track of the engine's subsystems. Access to the subsystems is done via the AnnEngine object.

AnnEngine is a singleton class, and access to a pointer to the current engine instance is done by calling AnnEngine::Instance().

This could result in syntax heavy calls like this :

AnnEngine::Instance()->getLevelManager()->...

To make everything easyer, the AnnGetter.h header provide you static getter function that will give you easy access to any part of the engine you need to touch :

AnnGetLevelManager()->...

You can also get to the AnnEngine instace directly via “AnnGetEngine()”

Statically accessible utilities

AnnEngine give you some publicly static member you can use for special operation :

  • static bool autosetProcessPriorityHigh : see ProcessPriority
  • static void setProcessPriorityNormal() : see ProcessPriority
  • static void setProcessPriorityHigh() : set ProcessPriority
  • static AnnEngine* Instance() : get pointer to singleton