home *** CD-ROM | disk | FTP | other *** search
/ Programming a Multiplayer FPS in DirectX / Programming a Multiplayer FPS in DirectX (Companion CD).iso / Source / Chapter 7 / Engine / State.h < prev   
Encoding:
C/C++ Source or Header  |  2005-03-29  |  1.5 KB  |  48 lines

  1. //-----------------------------------------------------------------------------
  2. // Base state functionality. Applications must derive new states from this
  3. // class to add to the engine.
  4. //
  5. // Programming a Multiplayer First Person Shooter in DirectX
  6. // Copyright (c) 2004 Vaughan Young
  7. //-----------------------------------------------------------------------------
  8. #ifndef STATE_H
  9. #define STATE_H
  10.  
  11. //-----------------------------------------------------------------------------
  12. // Viewer Setup Structure
  13. //-----------------------------------------------------------------------------
  14. struct ViewerSetup
  15. {
  16.     unsigned long viewClearFlags; // Flags used for clearing the view.
  17.  
  18.     //-------------------------------------------------------------------------
  19.     // The viewer setup structure constructor.
  20.     //-------------------------------------------------------------------------
  21.     ViewerSetup()
  22.     {
  23.         viewClearFlags = 0;
  24.     };
  25. };
  26.  
  27. //-----------------------------------------------------------------------------
  28. // State Class
  29. //-----------------------------------------------------------------------------
  30. class State
  31. {
  32. public:
  33.     State( unsigned long id = 0 );
  34.  
  35.     virtual void Load();
  36.     virtual void Close();
  37.  
  38.     virtual void RequestViewer( ViewerSetup *viewer );
  39.     virtual void Update( float elapsed );
  40.     virtual void Render();
  41.  
  42.     unsigned long GetID();
  43.  
  44. private:
  45.     unsigned long m_id; // Application defined ID (must be unique for state switching).
  46. };
  47.  
  48. #endif