Console.h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. ===========================================================================
  3. Doom 3 BFG Edition GPL Source Code
  4. Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company.
  5. This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").
  6. Doom 3 BFG Edition Source Code is free software: you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. Doom 3 BFG Edition Source Code is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with Doom 3 BFG Edition Source Code. If not, see <http://www.gnu.org/licenses/>.
  16. In addition, the Doom 3 BFG Edition Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code. If not, please request a copy in writing from id Software at the address below.
  17. If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
  18. ===========================================================================
  19. */
  20. #ifndef __CONSOLE_H__
  21. #define __CONSOLE_H__
  22. enum justify_t {
  23. JUSTIFY_LEFT,
  24. JUSTIFY_RIGHT,
  25. JUSTIFY_CENTER_LEFT,
  26. JUSTIFY_CENTER_RIGHT
  27. };
  28. class idOverlayHandle {
  29. friend class idConsoleLocal;
  30. public:
  31. idOverlayHandle() : index( -1 ), time( 0 ) {}
  32. private:
  33. int index;
  34. int time;
  35. };
  36. /*
  37. ===============================================================================
  38. The console is strictly for development and advanced users. It should
  39. never be used to convey actual game information to the user, which should
  40. always be done through a GUI.
  41. The force options are for the editor console display window, which
  42. doesn't respond to pull up / pull down
  43. ===============================================================================
  44. */
  45. class idConsole {
  46. public:
  47. virtual ~idConsole() {}
  48. virtual void Init() = 0;
  49. virtual void Shutdown() = 0;
  50. virtual bool ProcessEvent( const sysEvent_t * event, bool forceAccept ) = 0;
  51. // the system code can release the mouse pointer when the console is active
  52. virtual bool Active() = 0;
  53. // clear the timers on any recent prints that are displayed in the notify lines
  54. virtual void ClearNotifyLines() = 0;
  55. // some console commands, like timeDemo, will force the console closed before they start
  56. virtual void Close() = 0;
  57. virtual void Draw( bool forceFullScreen ) = 0;
  58. virtual void Print( const char *text ) = 0;
  59. virtual void PrintOverlay( idOverlayHandle & handle, justify_t justify, VERIFY_FORMAT_STRING const char * text, ... ) = 0;
  60. virtual idDebugGraph * CreateGraph( int numItems ) = 0;
  61. virtual void DestroyGraph( idDebugGraph * graph ) = 0;
  62. };
  63. extern idConsole * console; // statically initialized to an idConsoleLocal
  64. #endif /* !__CONSOLE_H__ */