BsLinuxVideoModeInfo.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsGLPrerequisites.h"
  5. #include "RenderAPI/BsVideoModeInfo.h"
  6. #include <X11/extensions/Xrandr.h>
  7. namespace bs { namespace ct
  8. {
  9. /** @addtogroup GL
  10. * @{
  11. */
  12. /** @copydoc VideoMode */
  13. class LinuxVideoMode : public VideoMode
  14. {
  15. public:
  16. LinuxVideoMode(UINT32 width, UINT32 height, float refreshRate, UINT32 outputIdx);
  17. /** Returns internal RandR video mode id. */
  18. RRMode _getModeID() const { return mModeID; }
  19. private:
  20. LinuxVideoMode(UINT32 width, UINT32 height, float refreshRate, UINT32 outputIdx, RRMode modeID);
  21. friend class LinuxVideoOutputInfo;
  22. RRMode mModeID;
  23. };
  24. /** @copydoc VideoOutputInfo */
  25. class LinuxVideoOutputInfo : public VideoOutputInfo
  26. {
  27. public:
  28. LinuxVideoOutputInfo(::Display* x11Display, INT32 screen, XRROutputInfo* outputInfo, XRRCrtcInfo* crtcInfo,
  29. XRRScreenResources* screenRes, RROutput outputID, UINT32 outputIdx);
  30. /** Returns internal RandR output device id. */
  31. RROutput _getOutputID() const { return mOutputID; }
  32. /** Returns X11 screen this output renders to. One screen can contain multiple output devices. */
  33. INT32 _getScreen() const { return mScreen;}
  34. private:
  35. RROutput mOutputID;
  36. INT32 mScreen;
  37. };
  38. /** @copydoc VideoModeInfo */
  39. class LinuxVideoModeInfo : public VideoModeInfo
  40. {
  41. public:
  42. LinuxVideoModeInfo();
  43. };
  44. /** @} */
  45. }}