Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
2.4 KiB

  1. //====== Copyright � 1996-2005, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef GAMEUISYSTEM_H
  7. #define GAMEUISYSTEM_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "tier1/timeutils.h"
  12. #include "materialsystem/imaterialsystem.h"
  13. #include "gameuidefinition.h"
  14. //-----------------------------------------------------------------------------
  15. // Forward declarations
  16. //-----------------------------------------------------------------------------
  17. class IGameUIScreenController;
  18. class CUtlBuffer;
  19. class IRenderContext;
  20. class IRenderDevice;
  21. class KeyValues;
  22. struct RenderViewport_t;
  23. //-----------------------------------------------------------------------------
  24. // Class to render a zillion ui elements
  25. //-----------------------------------------------------------------------------
  26. class CGameUISystem : public IGameUISystem
  27. {
  28. public:
  29. CGameUISystem();
  30. virtual ~CGameUISystem();
  31. virtual char const * GetName();
  32. virtual bool Init( KeyValues *kvLoadSettings );
  33. virtual void Release();
  34. virtual void Render( const Rect_t &viewport );
  35. virtual void Render( IRenderContext *pRenderContext, const Rect_t &viewport );
  36. virtual void LoadEmptyGameUI( const char *pName );
  37. virtual bool LoadGameUIDefinition( CUtlBuffer &buf, const char *pFileName );
  38. CGameUIDefinition &Definition() { return m_GameUIDef; }
  39. virtual bool ExecuteScript( KeyValues *kvEvent, KeyValues **ppResult = NULL );
  40. virtual void SetStageSize( int nWide, int nTall );
  41. virtual void GetStageSize( Vector2D &stageSize );
  42. virtual int32 GetScriptHandle() { return m_iScriptHandle; }
  43. static CGameUISystem * FromScriptHandle( int32 iScriptHandle );
  44. private:
  45. void GenerateUIMesh( IMatRenderContext *pRenderContext, IMesh* pMesh, CUtlVector< CRenderGeometry > &renderGeometry, CSheet *pSheet );
  46. void RenderStaticLayer( LayerRenderLists_t &renderList, int geometryIndex );
  47. void RenderStaticLayer( IRenderContext *pRenderContext, LayerRenderLists_t &renderList, int geometryIndex );
  48. void RenderDynamicLayer( LayerRenderLists_t &renderList, int geometryIndex );
  49. void RenderTextLayer( CUtlVector< CRenderGeometry > &renderGeometry );
  50. void RenderTextLayer( IRenderContext *pRenderContext, CUtlVector< CRenderGeometry > &renderGeometry );
  51. CGameUIDefinition m_GameUIDef;
  52. int32 m_iScriptHandle;
  53. bool m_bDrawReport;
  54. };
  55. #endif // GAMEUISYSTEM_H