Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

Application Class Reference

#include <application.h>

List of all members.


Detailed Description

Application is a high level definition.

Contains the main application loop and initializes the display as well as the input and sound, etc.

Definition at line 32 of file application.h.

Public Methods

 Application (string title="", int w=800, int h=600)
 Constructor.

 ~Application ()
 Destructor.

int Run ()
 Main Loop.

int step ()
 Single-Step through the game loop.


Private Methods

int init ()
 Actual initialization method.

int close ()
 Actual close method.


Private Attributes

Graphics GD
 The graphics device used in this application.

Input ID
 The Input device.

Sound SD
 The Sound device.

GameCurrentGame
 The implementation of our game.

int frame_count
 Keep track of how many frames (GameSteps) that we have done.


Constructor & Destructor Documentation

Application::Application string    title = "",
int    w = 800,
int    h = 600
 

Constructor.

Parameters:
title the string for the title bar
w the width of the window
h the height of the window

Definition at line 13 of file application.cpp.

References GD, Graphics::hideMouse(), init(), and NNCMath::MathInit().

Application::~Application  
 

Destructor.

Closes all relevant devices.

Definition at line 23 of file application.cpp.

References close().


Member Function Documentation

int Application::close   [private]
 

Actual close method.

closes the graphics device, etc.

Definition at line 39 of file application.cpp.

References CurrentGame.

Referenced by ~Application().

int Application::init   [private]
 

Actual initialization method.

Sets up the graphics context, etc.

Definition at line 29 of file application.cpp.

References CurrentGame, frame_count, GD, ID, and SD.

Referenced by Application().

int Application::Run  
 

Main Loop.

Sits in a main loop until it's time to exit.

Definition at line 46 of file application.cpp.

References CurrentGame, Input::FAST_QUIT, frame_count, ID, Input::IsPressed(), nnctime::msecs, nnctime::secs, Game::step(), Input::Update(), Util_DiffTime(), and Util_GetTime().

int Application::step  
 

Single-Step through the game loop.

Calls a Game-Step function once.


Member Data Documentation

Game* Application::CurrentGame [private]
 

The implementation of our game.

Definition at line 83 of file application.h.

Referenced by close(), init(), and Run().

int Application::frame_count [private]
 

Keep track of how many frames (GameSteps) that we have done.

Definition at line 86 of file application.h.

Referenced by init(), and Run().

Graphics Application::GD [private]
 

The graphics device used in this application.

Definition at line 74 of file application.h.

Referenced by Application(), and init().

Input Application::ID [private]
 

The Input device.

Definition at line 77 of file application.h.

Referenced by init(), and Run().

Sound Application::SD [private]
 

The Sound device.

Definition at line 80 of file application.h.

Referenced by init().


The documentation for this class was generated from the following files:
Generated on Sun Dec 8 12:02:21 2002 for nnc by doxygen1.3-rc1