home *** CD-ROM | disk | FTP | other *** search
/ Programming a Multiplayer FPS in DirectX / Programming a Multiplayer FPS in DirectX (Companion CD).iso / Source / Chapter 11 / Game / Game.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-10-01  |  1.6 KB  |  46 lines

  1. //-----------------------------------------------------------------------------
  2. // The derived game state where all the game's processing happens.
  3. //
  4. // Programming a Multiplayer First Person Shooter in DirectX
  5. // Copyright (c) 2004 Vaughan Young
  6. //-----------------------------------------------------------------------------
  7. #ifndef GAME_H
  8. #define GAME_H
  9.  
  10. //-----------------------------------------------------------------------------
  11. // State ID Define
  12. //-----------------------------------------------------------------------------
  13. #define STATE_GAME 1
  14.  
  15. //-----------------------------------------------------------------------------
  16. // Game Class
  17. //-----------------------------------------------------------------------------
  18. class Game : public State
  19. {
  20. public:
  21.     Game();
  22.  
  23.     virtual void Load();
  24.     virtual void Close();
  25.  
  26.     virtual void RequestViewer( ViewerSetup *viewer );
  27.     virtual void Update( float elapsed );
  28.     virtual void Render();
  29.  
  30.     void HandleNetworkMessage( ReceivedMessage *msg );
  31.  
  32. private:
  33.     Material *m_crosshair; // Material used to render the crosshair.
  34.  
  35.     char m_scoreBoardNames[MAX_PATH]; // Text for displaying the names of all the connected players.
  36.     char m_scoreBoardFrags[MAX_PATH]; // Text for displaying each player's frag count.
  37.     char m_scoreBoardDeaths[MAX_PATH]; // Text for displaying each player's death tally.
  38.     Font *m_scoreBoardFont; // Font used to render the score board.
  39. };
  40.  
  41. //-----------------------------------------------------------------------------
  42. // Externals
  43. //-----------------------------------------------------------------------------
  44. extern Game *g_game;
  45.  
  46. #endif