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.

134 lines
3.8 KiB

  1. #ifndef GLMDISPLAYDB_H
  2. #define GLMDISPLAYDB_H
  3. #include "tier1/utlvector.h"
  4. //===============================================================================
  5. // modes, displays, and renderers
  6. //===============================================================================
  7. // GLMDisplayModeInfoFields is in glmdisplay.h
  8. class GLMDisplayMode
  9. {
  10. public:
  11. GLMDisplayModeInfoFields m_info;
  12. GLMDisplayMode( uint width, uint height, uint refreshHz );
  13. GLMDisplayMode() { };
  14. ~GLMDisplayMode( void );
  15. void Init( uint width, uint height, uint refreshHz );
  16. void Dump( int which );
  17. };
  18. //===============================================================================
  19. // GLMDisplayInfoFields is in glmdisplay.h
  20. class GLMDisplayInfo
  21. {
  22. public:
  23. GLMDisplayInfoFields m_info;
  24. CUtlVector< GLMDisplayMode* > *m_modes; // starts out NULL, set by PopulateModes
  25. GLMDisplayMode m_DesktopMode;
  26. #ifdef OSX
  27. GLMDisplayInfo( CGDirectDisplayID displayID, CGOpenGLDisplayMask displayMask );
  28. #else
  29. GLMDisplayInfo( void );
  30. #endif
  31. ~GLMDisplayInfo( void );
  32. void PopulateModes( void );
  33. void Dump( int which );
  34. #ifdef OSX
  35. private:
  36. int m_display;
  37. #endif
  38. };
  39. //===============================================================================
  40. // GLMRendererInfoFields is in glmdisplay.h
  41. class GLMRendererInfo
  42. {
  43. public:
  44. GLMRendererInfoFields m_info;
  45. #ifdef OSX
  46. CUtlVector< GLMDisplayInfo* > *m_displays; // starts out NULL, set by PopulateDisplays
  47. #else
  48. GLMDisplayInfo *m_display;
  49. #endif
  50. #ifdef OSX
  51. GLMRendererInfo ( GLMRendererInfoFields *info );
  52. #else
  53. GLMRendererInfo ();
  54. #endif
  55. ~GLMRendererInfo ( void );
  56. #ifndef OSX
  57. void Init( GLMRendererInfoFields *info );
  58. #endif
  59. void PopulateDisplays();
  60. void Dump( int which );
  61. };
  62. //===============================================================================
  63. #ifdef OSX
  64. // this is just a tuple describing fake adapters which are really renderer/display pairings.
  65. // dxabstract bridges the gap between the d3d adapter-centric world and the GL renderer+display world.
  66. // this makes it straightforward to handle cases like two video cards with two displays on one, and one on the other -
  67. // you get three fake adapters which represent each useful screen.
  68. // the constraint that dxa will have to follow though, is that if the user wants to change their
  69. // display selection for full screen, they would only be able to pick on that has the same underlying renderer.
  70. // can't change fakeAdapter from one to another with different GL renderer under it. Screen hop but no card hop.
  71. struct GLMFakeAdapter
  72. {
  73. int m_rendererIndex;
  74. int m_displayIndex;
  75. };
  76. #endif
  77. class GLMDisplayDB
  78. {
  79. public:
  80. #ifdef OSX
  81. CUtlVector< GLMRendererInfo* > *m_renderers; // starts out NULL, set by PopulateRenderers
  82. CUtlVector< GLMFakeAdapter > m_fakeAdapters;
  83. #else
  84. GLMRendererInfo m_renderer;
  85. #endif
  86. GLMDisplayDB ( void );
  87. ~GLMDisplayDB ( void );
  88. virtual void PopulateRenderers( void );
  89. virtual void PopulateFakeAdapters( uint realRendererIndex ); // fake adapters = one real adapter times however many displays are on it
  90. virtual void Populate( void );
  91. // The info-get functions return false on success.
  92. virtual int GetFakeAdapterCount( void );
  93. virtual bool GetFakeAdapterInfo( int fakeAdapterIndex, int *rendererOut, int *displayOut, GLMRendererInfoFields *rendererInfoOut, GLMDisplayInfoFields *displayInfoOut );
  94. virtual int GetRendererCount( void );
  95. virtual bool GetRendererInfo( int rendererIndex, GLMRendererInfoFields *infoOut );
  96. virtual int GetDisplayCount( int rendererIndex );
  97. virtual bool GetDisplayInfo( int rendererIndex, int displayIndex, GLMDisplayInfoFields *infoOut );
  98. virtual int GetModeCount( int rendererIndex, int displayIndex );
  99. virtual bool GetModeInfo( int rendererIndex, int displayIndex, int modeIndex, GLMDisplayModeInfoFields *infoOut );
  100. virtual void Dump( void );
  101. };
  102. #endif // GLMDISPLAYDB_H