dtGame::GameEntryPoint Class Reference

A class for specifying the entry point into a Game so that the entire game can be defined in a Game library and loaded at runtime. More...

#include <gameentrypoint.h>

List of all members.

Public Member Functions

 GameEntryPoint ()
virtual ~GameEntryPoint ()
 The destructor of the GameEntryPoint.
virtual void Initialize (GameApplication &app, int argc, char **argv)
 Called to initialize the game application.
virtual void OnStartup (GameApplication &app)=0
 Called after all startup related code is run.
virtual void OnShutdown (GameApplication &app)
 This is the notice to the GameEntryPoint that the application is quitting.


Detailed Description

A class for specifying the entry point into a Game so that the entire game can be defined in a Game library and loaded at runtime.

Typically, a derivative of this class is compiled into a dynamic library, which gets loaded by a dtGame::GameApplication instance.

Note: If a dtGame::GameApplication is used to load this as a dynamic library, be sure to implement the two C functions as shown, typically in the .cpp file:

 extern "C" API_EXPORT dtGame::GameEntryPoint* CreateGameEntryPoint()
 {
   return new MyGameEntryPoint();
 }

 extern "C" API_EXPORT void DestroyGameEntryPoint(dtGame::GameEntryPoint *entryPoint)
 {
   delete entryPoint;
 }
See also:
dtGame::GameApplication::Config()

Constructor & Destructor Documentation

dtGame::GameEntryPoint::GameEntryPoint (  )  [inline]

virtual dtGame::GameEntryPoint::~GameEntryPoint (  )  [inline, virtual]

The destructor of the GameEntryPoint.


Member Function Documentation

virtual void dtGame::GameEntryPoint::Initialize ( GameApplication app,
int  argc,
char **  argv 
) [inline, virtual]

Called to initialize the game application.

This gets called from the dtGame::GameApplication::Config() method, but before dtABC::Application::Config(). This allows some defining of the default Camera and Window, such as setting up stencil buffers. Note: If you want to replace the GameManager the GameApplication uses, this is a good place to hand it off.

Parameters:
app the current application
argc number of startup arguments.
argv array of string pointers to the arguments.
See also:
dtGame::GameApplication::SetGameManager()

virtual void dtGame::GameEntryPoint::OnStartup ( GameApplication app  )  [pure virtual]

Called after all startup related code is run.

At this point, the dtGame::GameApplication has been configured and ready to be used. Override this method to perform any specific start up functionality that the GameEntryPoint needs to do.

virtual void dtGame::GameEntryPoint::OnShutdown ( GameApplication app  )  [inline, virtual]

This is the notice to the GameEntryPoint that the application is quitting.

Perform any cleanup that needs to be done here.

Note:
This is called from the GameApplication destructor and is followed by the GameEntryPoint destructor.


http://www.delta3d.org
2.0.0 generated 14 Feb 2008