Static Protected Attributes

Detailed Description

Application framework class.

This class provides a handy object-oriented wrapper around the Crystal Space initialization and start-up functions. It encapsulates a callback paradigm which provides methods such as OnInitialize() and OnExit() which you can override to customize the framework's behavior. You should also consider using csBaseEventHandler (csutil/csbaseeventh.h), which provides the same sort of object-oriented wrapper for the Crystal Space event mechanism; providing methods such as OnMouseClick(), OnKeyboard(), OnBroadcast(), etc.

In order to properly use this class, you must derive your own class from it, providing a constructor and implementation for the OnInitialize() and Application() methods. You may only have one csApplicationFramework derived object in existence at any time (and generally, you will only have one such object in your application). In your source code create a global instance of the overridden object, as follows:

It is possible that upon return of this method the application did not quite but rather only requested a restart. Hence, a loop should be used that checks the return value of DoRestart() and, if requested, recreates the application object and runs Main() again. The csApplicationRunner<> is a convenient way to implement this.

virtual void csApplicationFramework::OnCommandLineHelp

(

)

[protected, virtual]

Print out command line help.

This method is called in the event of the user requesting command line help via the '-help' argument. If the application supports command line options, it should override this method to print out a list of the supported options.

virtual void csApplicationFramework::OnExit

(

)

[protected, virtual]

Perform any end of program processing.

Remarks:

This method is called after the crystal space engine has been shut down, just before the framework is about to end the program. Unlike the other overridables of this class, you need not bother overriding this method. In general, this is provided to allow end of program debugging support.

You must override this function in the derived class. It will be called after the framework has performed all necessary framework initialization.

This method is where the user application should load any plug-ins via RequestPlugins() and initialize any global application variables or class members. Do not attempt to set or initialize any other Crystal Space structures or objects in this method.

This string is used by DisplayError() and DisplayInfo() to identify the source of a message as generated by the user application (as opposed to one generated by code within the framework library or other code with the Crystal Space libraries and plugins).

Generally, you will call this function once in the constructor for your derived csApplicationFramework class, but it is safe to call it any number of times.

The string should be in the form "vendor.application-name". Spaces should be avoided.