Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

csInitializer Class Reference

This class contains several static member functions that can help setup an application. More...

#include <initapp.h>

List of all members.

Static Public Methods

iObjectRegistryCreateEnvironment (int argc, char const *const argv[])
 Create everything needed to get a CS application operational. More...

bool InitializeSCF ()
 This very important function initializes the SCF sub-system. More...

iObjectRegistryCreateObjectRegistry ()
 This function should be called second. More...

iPluginManagerCreatePluginManager (iObjectRegistry *)
 You will almost certainly want to call this function. More...

iEventQueueCreateEventQueue (iObjectRegistry *)
 This essential function creates the event queue which is the main driving force between the event-driven CS model. More...

iVirtualClockCreateVirtualClock (iObjectRegistry *)
 Create the virtual clock. More...

iCommandLineParserCreateCommandLineParser (iObjectRegistry *, int argc, char const *const argv[])
 Create the commandline parser. More...

iConfigManagerCreateConfigManager (iObjectRegistry *)
 Create the config manager. More...

bool CreateInputDrivers (iObjectRegistry *)
 This function will create the three common input drivers (csKeyboardDriver, csMouseDriver, and csJoystickDriver) and register them with the object registry. More...

bool SetupConfigManager (iObjectRegistry *, const char *configName, const char *ApplicationID="Noname")
 Setup the config manager. More...

bool RequestPlugins (iObjectRegistry *,...)
 Request a few widely used standard plugins and also read the standard config file and command line for potential other plugins. More...

bool OpenApplication (iObjectRegistry *)
 Send the cscmdOpen command to all loaded plugins. More...

void CloseApplication (iObjectRegistry *)
 Send the cscmdClose command to all loaded plugins.

bool SetupEventHandler (iObjectRegistry *, iEventHandler *, unsigned int eventmask)
 Initialize an event handler for the application. More...

bool SetupEventHandler (iObjectRegistry *, csEventHandlerFunc, unsigned int eventmask=CSMASK_Nothing|CSMASK_Broadcast|CSMASK_MouseUp|CSMASK_MouseDown|CSMASK_MouseMove|CSMASK_KeyDown|CSMASK_KeyUp|CSMASK_MouseClick|CSMASK_MouseDoubleClick|CSMASK_JoystickMove|CSMASK_JoystickDown|CSMASK_JoystickUp)
 Initialize an event handler function. More...

void DestroyApplication (iObjectRegistry *)
 Destroy the application.<. More...


Detailed Description

This class contains several static member functions that can help setup an application.

It is possible to do all the setup on your own but using the functions below will help considerably.


Member Function Documentation

iCommandLineParser * csInitializer::CreateCommandLineParser ( iObjectRegistry *,
int argc,
char const *const argv[] ) [static]
 

Create the commandline parser.

This function will register the created commandline parser with the object registry as the default parser (using NULL tag).

iConfigManager * csInitializer::CreateConfigManager ( iObjectRegistry * ) [static]
 

Create the config manager.

This function will register the created config manager with the object registry as the default config manager (using NULL tag).

iObjectRegistry * csInitializer::CreateEnvironment ( int argc,
char const *const argv[] ) [static]
 

Create everything needed to get a CS application operational.

This function is completely equivalent to calling:

This function will return the pointer to the object registry where all the created objects will be registered.

iEventQueue * csInitializer::CreateEventQueue ( iObjectRegistry * ) [static]
 

This essential function creates the event queue which is the main driving force between the event-driven CS model.

In addition this function will register the created event queue with the object registry as the default event queue (using NULL tag).

bool csInitializer::CreateInputDrivers ( iObjectRegistry * ) [static]
 

This function will create the three common input drivers (csKeyboardDriver, csMouseDriver, and csJoystickDriver) and register them with the object registry.

Note that this function must be called after creating the config manager (CreateConfigManager()).

iObjectRegistry * csInitializer::CreateObjectRegistry ( ) [static]
 

This function should be called second.

It will create the object registry and return a pointer to it. If there is a problem it will return NULL.

iPluginManager * csInitializer::CreatePluginManager ( iObjectRegistry * ) [static]
 

You will almost certainly want to call this function.

It will create the plugin manager which is essential for nearly everything. The created plugin manager will be registered with the object registry as the default plugin manager (using NULL tag).

iVirtualClock * csInitializer::CreateVirtualClock ( iObjectRegistry * ) [static]
 

Create the virtual clock.

This clock is responsible for keeping track of virtual time in the game system. This function will register the created virtual clock with the object registry as the default virtual clock (using NULL tag).

void csInitializer::DestroyApplication ( iObjectRegistry * ) [static]
 

Destroy the application.<.

p> Undo all of the initialization done by CreateEnvironment() or any of the other setup functions.

bool csInitializer::InitializeSCF ( ) [static]
 

This very important function initializes the SCF sub-system.

Without this you can do almost nothing in CS.

bool csInitializer::OpenApplication ( iObjectRegistry * ) [static]
 

Send the cscmdOpen command to all loaded plugins.

This should be done after initializing them (Initialize()).

bool csInitializer::RequestPlugins ( iObjectRegistry *,
... ) [static]
 

Request a few widely used standard plugins and also read the standard config file and command line for potential other plugins.

This routine must be called before Initialize().

The variable arguments should contain three entries for every plugin you want to load: name, scfID, and version. To make this easier it is recommended you use one of the CS_REQUEST_xxx macros above. WARNING Make sure to end the list with CS_REQUEST_END!

bool csInitializer::SetupConfigManager ( iObjectRegistry *,
const char * configName,
const char * ApplicationID = "Noname" ) [static]
 

Setup the config manager.

If you have no config file then you can still call this routine using a NULL parameter. If you don't call this then either RequestPlugins() or Initialize() will call this routine with NULL parameter. The 'ApplicationID' parameter is used to determine the correct user-specific domain. It is possibly overriden by the application config file option "System.ApplicationID".

bool csInitializer::SetupEventHandler ( iObjectRegistry *,
csEventHandlerFunc,
unsigned int eventmask = CSMASK_Nothing | CSMASK_Broadcast | CSMASK_MouseUp | CSMASK_MouseDown | CSMASK_MouseMove | CSMASK_KeyDown | CSMASK_KeyUp | CSMASK_MouseClick | CSMASK_MouseDoubleClick | CSMASK_JoystickMove | CSMASK_JoystickDown | CSMASK_JoystickUp ) [static]
 

Initialize an event handler function.

This is an easier version of SetupEventHandler() that takes a function and will register an event handler to call that function for all relevant events if `eventmask' is not specified, or for the requested event types if it is specified.

bool csInitializer::SetupEventHandler ( iObjectRegistry *,
iEventHandler *,
unsigned int eventmask ) [static]
 

Initialize an event handler for the application.

This is the most general routine. This event handler will receive all events that are sent through the event manager. Use this function to know about keyboard, mouse and other events. Note that you also have to use this function to be able to render something as rendering happens as a result of one event (cscmdProcess).


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000