User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

annengine [2017/01/29 18:12] (current)
ybalrid created
Line 1: Line 1:
 +====== 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 :
 +
 +  - [[Singleton]] unicity check
 +  - [[ProcessPriority]] autoset (if not deactivated by the user)
 +  - [[VRRenderer]] selection
 +  - [[VRRenderer]] initialization process
 +  - [[AnnPlayer]] creation
 +  - [[SubSystem]] initialization
 +
 +===== Subsystem access =====
 +
 +AnnEngine it the object that keep track of the engine'​s [[subsystem]]s. 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 : 
 +
 +<code cpp>
 +AnnEngine::​Instance()->​getLevelManager()->​...
 +</​code>​
 +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 :
 +<code cpp>
 +AnnGetLevelManager()->​...
 +</​code>​
 +
 +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
 +
 +