Contents Functions Classes Topics User Forum CVS

G3D::GApp Class Reference

#include <GApp.h>

List of all members.

Public Member Functions

const StopwatchgraphicsWatch () const
const StopwatchwaitWatch () const
const StopwatchlogicWatch () const
const StopwatchnetworkWatch () const
const StopwatchuserInputWatch () const
const StopwatchsimulationWatch () const
GWindowwindow () const
bool debugMode () const
virtual void setDebugMode (bool b)
virtual void debugPrintf (const char *fmt...)
virtual void renderDebugInfo ()
 GApp (const Settings &options=Settings(), GWindow *window=NULL)
virtual ~GApp ()
void run ()
virtual void addModule (const GModuleRef &module, GModuleManager::EventPriority p=GModuleManager::NORMAL_PRIORITY)
virtual void removeModule (const GModuleRef &module)

Public Attributes

std::string dataDir
LogdebugLog
RenderDevicerenderDevice
NetworkDevicenetworkDevice
CFontRef debugFont
UserInputuserInput
bool endProgram
TextureManager textureManager
GCamera debugCamera
ManualCameraController debugController
Array< std::string > debugText
bool debugShowText
bool debugQuitOnEscape
bool debugTabSwitchCamera
bool debugShowRenderingStats
bool autoResize
bool catchCommonExceptions

Protected Member Functions

virtual void main ()=0

Protected Attributes

Stopwatch m_graphicsWatch
Stopwatch m_logicWatch
Stopwatch m_networkWatch
Stopwatch m_userInputWatch
Stopwatch m_simulationWatch
Stopwatch m_waitWatch
GModuleManagerRef m_moduleManager

Friends

class GApplet

Classes

class  Settings


Detailed Description

See for a discussion of GApp and GApplet.


Constructor & Destructor Documentation

G3D::GApp::GApp const Settings options = Settings(),
GWindow window = NULL
 

Parameters:
window If null, a SDLWindow will be created for you. This argument is useful for substituting a different window system (e.g. GlutWindow)

virtual G3D::GApp::~GApp  )  [virtual]
 


Member Function Documentation

virtual void G3D::GApp::addModule const GModuleRef module,
GModuleManager::EventPriority  p = GModuleManager::NORMAL_PRIORITY
[virtual]
 

Installs a module. Actual insertion may be delayed until the next frame. See GApplet::addModule for further discussion.

BETA API Likely to receive incompatible changes in future releases.

bool G3D::GApp::debugMode  )  const
 

Returns the state of debugMode. All debugX options are only in effect when debugMode is also true. Default is false

virtual void G3D::GApp::debugPrintf const char *  fmt...  )  [virtual]
 

If app->debugShowText is true, prints to an on-screen buffer that is cleared every frame.

const Stopwatch& G3D::GApp::graphicsWatch  )  const [inline]
 

const Stopwatch& G3D::GApp::logicWatch  )  const [inline]
 

virtual void G3D::GApp::main  )  [protected, pure virtual]
 

Called from run. This is invoked inside of several exception handlers so that any G3D uncaught exceptions can be logged instead of crashing the application.

const Stopwatch& G3D::GApp::networkWatch  )  const [inline]
 

virtual void G3D::GApp::removeModule const GModuleRef module  )  [virtual]
 

The actual removal of the module may be delayed until the next frame. See GApplet::removeModule for further discussion.

BETA API Likely to receive incompatible changes in future releases.

virtual void G3D::GApp::renderDebugInfo  )  [virtual]
 

Called from GApplet::run immediately after doGraphics to render the debugging text. Does nothing if debugMode is false. It is not usually necessary to override this method.

void G3D::GApp::run  ) 
 

Call this to run the app. Subclasses should override main(), not run.

virtual void G3D::GApp::setDebugMode bool  b  )  [virtual]
 

Changes the state of debugMode. You must separately activate the debugController if you want events to go to it (by default, the TAB key activates it).

const Stopwatch& G3D::GApp::simulationWatch  )  const [inline]
 

const Stopwatch& G3D::GApp::userInputWatch  )  const [inline]
 

const Stopwatch& G3D::GApp::waitWatch  )  const [inline]
 

GWindow* G3D::GApp::window  )  const [inline]
 


Friends And Related Function Documentation

GApplet [friend]
 


Member Data Documentation

bool G3D::GApp::autoResize
 

When true and the window is resizable, automatically responds to SDL_RESIZE events by notifying the RenderDevice that the window has been resized and resetting the viewport to full screen. (default is true)

bool G3D::GApp::catchCommonExceptions
 

When true, there is an assertion failure if an exception is thrown during GApp::main().

Default is true.

std::string G3D::GApp::dataDir
 

Initialized to GApp::Settings::dataDir, or if that is "<AUTO>", to System::demoFindData(). To make your program distributable, override the default and copy all data files you need to a local directory. Recommended setting is "data/" or "./", depending on where you put your data relative to the executable.

Your data directory must contain the default debugging font, "console-small.fnt", unless you change it.

GCamera G3D::GApp::debugCamera
 

A default camera that is driven by the debugController.

ManualCameraController G3D::GApp::debugController
 

When in debugMode, this allows first person (Quake game-style) control using the arrow keys or W,A,S,D and the mouse.

Deprecated:
Will become a FirstPersonManipulatorRef in 7.00

CFontRef G3D::GApp::debugFont
 

NULL if not loaded

Log* G3D::GApp::debugLog
 

bool G3D::GApp::debugQuitOnEscape
 

When true and debugMode is true, an SDL_ESCAPE keydown event quits the program. (default is true)

bool G3D::GApp::debugShowRenderingStats
 

When debugMode is true and debugShowRenderingStats is true, renderDebugInfo prints the frame rate and other data to the screen.

bool G3D::GApp::debugShowText
 

When true and debugMode is true, debugPrintf prints to the screen. (default is true)

bool G3D::GApp::debugTabSwitchCamera
 

When true and debugMode is true, SDL_TAB keydown deactivates the camera and restores the mouse cursor. (default is true)

Array<std::string> G3D::GApp::debugText
 

Strings that have been printed with debugPrint.

bool G3D::GApp::endProgram
 

Stopwatch G3D::GApp::m_graphicsWatch [protected]
 

Stopwatch G3D::GApp::m_logicWatch [protected]
 

GModuleManagerRef G3D::GApp::m_moduleManager [protected]
 

Stopwatch G3D::GApp::m_networkWatch [protected]
 

Stopwatch G3D::GApp::m_simulationWatch [protected]
 

Stopwatch G3D::GApp::m_userInputWatch [protected]
 

Stopwatch G3D::GApp::m_waitWatch [protected]
 

NetworkDevice* G3D::GApp::networkDevice
 

RenderDevice* G3D::GApp::renderDevice
 

TextureManager G3D::GApp::textureManager
 

A global texture manager.

UserInput* G3D::GApp::userInput
 


The documentation for this class was generated from the following file:
Generated on Mon Jul 17 11:50:47 2006 for G3D by doxygen 1.4.5
Hosted by SourceForge.net Logo