geGame

From GriffinEngine
Jump to: navigation, search

Usage

The geGame object is the game object which is built by the Engine. It contains a stack which keeps track of the current state of the game, which can be pushed and popped to manipulate which game state should be active.

Inheritance

Base classes


Reference

Methods

  •  static void Init( int windowWidth=800, int windowHeight=600, bool fullscreen=false, double _maxFPS = 200 );
Param Purpose Default
windowWidth Width of the game window (resolution) 800
windowHeight Height of the game window (resolution) 600
fullscreen If true, go fullscreen at (windowWidth x windowHeight) resolution false
maxFPS Maximum frames-per-second.

If the game runs too fast, an FPS limiter will kick in.

The default value of 200 means pretty much unlimited FPS.

200
  •  static void Run(); // start the drawing loop
  •  static void Quit( char* message = NULL ); // quit the game (and optionally print a message)
Note: It is necessary to call Quit() before game exits. If you don't, game's audio can lock up and loop indefinitely until you restart Windows.

States

  •  static void PushState( geIState* state ); // add state to the stack
  •  static geIState* PopState();  // remove state from the stack
  •  static geIState* PeekState(); // get state
  •  static geObject3D* getRoot(); // get root object of the current state

Graphics settings

  •  static UINT getWindowWidth();  // get current resolution width, in pixels
  •  static UINT getWindowHeight(); // get current resolution height, in pixels
  •  static double getMaxFPS();                      // get FPS limiter threshold
  •  static void setMaxFPS( double _maxFPS );        // set FPS limiter threshold
  •  static void EnableFog( color _fogColor );       // enable fog; the alpha component of the fog specifies density
  •  static void DisableFog();                       // disable fog
  •  static void setClearColor( color _clearColor ); // set clear (background) color; alpha component has no effect