XmlApp Class Reference

A class to make game development very easy and fast. More...

#include <xmlapp.h>

Inheritance diagram for XmlApp:

Inheritance graph
[legend]
Collaboration diagram for XmlApp:

Collaboration graph
[legend]
List of all members.

Public Member Functions

DECLSPEC XmlApp (int argc, char *argv[], const char *xmlfile=NULL)
DECLSPEC int init (const char *fn=NULL)
virtual DECLSPEC void destroy ()
 Call destroy to quit the application.
virtual DECLSPEC long mainLoop ()
 Never returns, but exits the application.
TiXmlHandle getXmlHandle ()
TiXmlHandle getXmlHandleUser ()

Static Public Member Functions

static void quitApplication (void *, BasicObject *, void *)

Protected Member Functions

virtual DECLSPEC void onInit ()

Detailed Description

A class to make game development very easy and fast.

The class XmlApp makes it possible to change the look of your app in a xml-file. You do not need to recompile the application, when changing XML-data.

See also:
An example of a main.cpp-file with the class XmlApp


Constructor & Destructor Documentation

XmlApp::XmlApp ( int  argc,
char *  argv[],
const char *  xmlfile = NULL 
)

Constructor.

Parameters:
xmlfile the path to the XML file to be used for initialisation The followin events can be specified in the xml root element: DoBeforeInit, DoAfterCreation, DoAfterInit; further attributes can be: UserXML (path to user's xml-file), UserdataPath (path to user's data directory), CanGrabInput (bool), Caption (string), WaitOnStart (ulong).


Member Function Documentation

int XmlApp::init ( const char *  fn = NULL  ) 

Initializes the application. After loading the specified XML file, BasicApp::init() is called with the loaded data's root element as param.

Parameters:
fn filename of the XML file to use for initialisation, if NULL the filename specified on creation is used
Returns:
zero on success, otherwise an error id

TiXmlHandle XmlApp::getXmlHandle (  )  [inline]

Returns:
a XML handle for application specific data. The data is loaded from the filename as specified in the constructor XmlApp() when init() is called.

TiXmlHandle XmlApp::getXmlHandleUser (  )  [inline]

Returns:
a XML handle for user specific data. You can use this data for user settings. The data is automatically loaded when init() is called and saved when destroy() is called.

void XmlApp::onInit (  )  [protected, virtual]

Initializes the object's variables by reading data from the XML element. If there were no XML data used for creation, nothing is done. This function calls onInit() of its children recursively (after it has inited itself). It is highly recommended to call BasicObject::onInit(), usually at the end of the onInit() method, when overwriting it in a derived class.

Reimplemented from BasicApp.


The documentation for this class was generated from the following files:
Generated on Wed May 9 17:36:38 2007 for netrinjo by  doxygen 1.5.1