W3DGameWindow.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. ** Command & Conquer Generals Zero Hour(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program 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. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. ////////////////////////////////////////////////////////////////////////////////
  19. // //
  20. // (c) 2001-2003 Electronic Arts Inc. //
  21. // //
  22. ////////////////////////////////////////////////////////////////////////////////
  23. // FILE: W3DGameWindow.h //////////////////////////////////////////////////////
  24. //-----------------------------------------------------------------------------
  25. //
  26. // Westwood Studios Pacific.
  27. //
  28. // Confidential Information
  29. // Copyright (C) 2001 - All Rights Reserved
  30. //
  31. //-----------------------------------------------------------------------------
  32. //
  33. // Project: RTS3
  34. //
  35. // File name: W3DGameWindow.h
  36. //
  37. // Created: Colin Day, June 2001
  38. //
  39. // Desc: W3D implemenations for the game windowing system
  40. //
  41. //-----------------------------------------------------------------------------
  42. ///////////////////////////////////////////////////////////////////////////////
  43. #pragma once
  44. #ifndef __W3DGAMEWINDOW_H_
  45. #define __W3DGAMEWINDOW_H_
  46. // SYSTEM INCLUDES ////////////////////////////////////////////////////////////
  47. // USER INCLUDES //////////////////////////////////////////////////////////////
  48. #include "GameClient/GameWindow.h"
  49. #include "WW3D2/Render2DSentence.h"
  50. // FORWARD REFERENCES /////////////////////////////////////////////////////////
  51. // TYPE DEFINES ///////////////////////////////////////////////////////////////
  52. // W3DGameWindow --------------------------------------------------------------
  53. /** W3D implemenation for a game window */
  54. // ----------------------------------------------------------------------------
  55. class W3DGameWindow : public GameWindow
  56. {
  57. MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(W3DGameWindow, "W3DGameWindow")
  58. public:
  59. W3DGameWindow( void );
  60. // already defined by MPO.
  61. //~W3DGameWindow( void );
  62. /// draw borders for this window only, NO child windows or anything else
  63. void winDrawBorder( void );
  64. Int winSetPosition( Int x, Int y ); ///< set window position
  65. Int winSetText( UnicodeString newText ); ///< set text string
  66. void winSetFont( GameFont *font ); ///< set font for window
  67. void getTextSize( Int *width, Int *height ); ///< get size of text
  68. void setTextLoc( Int x, Int y ); ///< set text screen coord loc
  69. void drawText( Color color ); ///< draw text in the text renderer
  70. protected:
  71. /// helper function to draw borders
  72. void blitBorderRect( Int x, Int y, Int width, Int height );
  73. Render2DSentenceClass m_textRenderer; ///< for drawing text
  74. ICoord2D m_textPos; ///< current text pos set in text renderer
  75. Color m_currTextColor; ///< current color used in text renderer
  76. Bool m_needPolyDraw; ///< TRUE need to redo the text polys
  77. Bool m_newTextPos; ///< TRUE when our window has moved and we need a new text pos
  78. }; // end class W3DGameWindow
  79. // INLINING ///////////////////////////////////////////////////////////////////
  80. // EXTERNALS //////////////////////////////////////////////////////////////////
  81. extern void W3DGameWinDefaultDraw( GameWindow *window,
  82. WinInstanceData *instData );
  83. #endif // __W3DGAMEWINDOW_H_