Wartbed:Manual/Booting and shutting down WARTBED

From Dark Omen Wiki

(Difference between revisions)
Jump to: navigation, search
(Basic instrutions)
(Booting the system)
Line 3: Line 3:
To initialise WARTBED you call the static createInstance method of the Wartbed singleton class.  
To initialise WARTBED you call the static createInstance method of the Wartbed singleton class.  
<div style="margin:2em;"><source lang="cpp">
<div style="margin:2em;"><source lang="cpp">
 +
#include "Wartbed.h"
 +
int main()
int main()
{
{

Revision as of 17:07, 20 January 2010

Contents

Booting the system

To initialise WARTBED you call the static createInstance method of the Wartbed singleton class.

#include "Wartbed.h"
 
int main()
{
    Wartbed &rWB = Wartbed::createInstance( "My WARTBED App Name" );
}

You can store the returned object reference for quick access, or you can obtain a reference to the Warbed object at any time after initialisation from the singleton's getSingelton method:

Wartbed &rWB = Wartbed::getSingleton();

Listeners, Input Bindings and Event Managers

Stub

namespace myapp
{
    // Forward definitions
    void ExecuteEvent( wb::input::MAPPING const &event, long data );
    struct FrameListener;
}
 
void someFunc()
{
    wartbed.setEventManager( myapp::ExecuteEvent );
    wartbed.setFrameListener( FRAMELISTENER_PTR(new myapp::FrameListener) );
    wartbed.readInputBindings( "../cfg/application.config" );
}

GUI and the Tableau

Stub

void SomeFunc()
{
    wartbed.initialiseGUI();
}

Resources

Stub

void SomeFunc()
{
    ADD_RESOURCE_LOCATION( "./ogre example skybox.zip", "Zip" );
    ADD_RESOURCE_LOCATION( "./Fonts", "FileSystem" );
 
    // This will be moved into the Wartbed class
    Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
}

Running the App

Stub

rWB.mainLoop();

Shutting down

Stub Send the message "quit" to the event manager. All deallocation is taken care of automatically.

Personal tools
communication