| 1 | //************************************ bs::framework - Copyright 2018 Marko Pintera **************************************// |
| 2 | //*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********// |
| 3 | #pragma once |
| 4 | |
| 5 | #include "BsGLPrerequisites.h" |
| 6 | #include "RenderAPI/BsVideoModeInfo.h" |
| 7 | #include <X11/extensions/Xrandr.h> |
| 8 | |
| 9 | namespace bs::ct |
| 10 | { |
| 11 | /** @addtogroup GL |
| 12 | * @{ |
| 13 | */ |
| 14 | |
| 15 | /** @copydoc VideoMode */ |
| 16 | class LinuxVideoMode : public VideoMode |
| 17 | { |
| 18 | public: |
| 19 | LinuxVideoMode(UINT32 width, UINT32 height, float refreshRate, UINT32 outputIdx); |
| 20 | |
| 21 | /** Returns internal RandR video mode id. */ |
| 22 | RRMode _getModeID() const { return mModeID; } |
| 23 | |
| 24 | private: |
| 25 | LinuxVideoMode(UINT32 width, UINT32 height, float refreshRate, UINT32 outputIdx, RRMode modeID); |
| 26 | friend class LinuxVideoOutputInfo; |
| 27 | |
| 28 | RRMode mModeID; |
| 29 | }; |
| 30 | |
| 31 | /** @copydoc VideoOutputInfo */ |
| 32 | class LinuxVideoOutputInfo : public VideoOutputInfo |
| 33 | { |
| 34 | public: |
| 35 | LinuxVideoOutputInfo(::Display* x11Display, INT32 screen, XRROutputInfo* outputInfo, XRRCrtcInfo* crtcInfo, |
| 36 | XRRScreenResources* screenRes, RROutput outputID, UINT32 outputIdx); |
| 37 | |
| 38 | /** Returns internal RandR output device id. */ |
| 39 | RROutput _getOutputID() const { return mOutputID; } |
| 40 | |
| 41 | /** Returns X11 screen this output renders to. One screen can contain multiple output devices. */ |
| 42 | INT32 _getScreen() const { return mScreen;} |
| 43 | private: |
| 44 | RROutput mOutputID; |
| 45 | INT32 mScreen; |
| 46 | }; |
| 47 | |
| 48 | /** @copydoc VideoModeInfo */ |
| 49 | class LinuxVideoModeInfo : public VideoModeInfo |
| 50 | { |
| 51 | public: |
| 52 | LinuxVideoModeInfo(); |
| 53 | }; |
| 54 | |
| 55 | /** @} */ |
| 56 | } |
| 57 | |
| 58 | |