Wartbed:Manual/Booting and shutting down WARTBED

From Dark Omen Wiki

(Difference between revisions)
Jump to: navigation, search
(Booting the system)
Line 64: Line 64:
Stub
Stub
Send the message "quit" to the event manager. All deallocation is taken care of automatically.
Send the message "quit" to the event manager. All deallocation is taken care of automatically.
 +
 +
[[category:Manual]]

Revision as of 17:24, 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