ovr_sdk

view LibOVR/Src/Displays/OVR_Linux_Display.h @ 0:1b39a1b46319

initial 0.4.4
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 14 Jan 2015 06:51:16 +0200
parents
children
line source
1 /************************************************************************************
3 Filename : OVR_Linux_Display.h
4 Content : Linux-specific Display declarations
5 Created : July 2, 2014
6 Authors : James Hughes
8 Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved.
10 Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License");
11 you may not use the Oculus VR Rift SDK except in compliance with the License,
12 which is provided at the time of installation or download, or which
13 otherwise accompanies this software in either electronic or hard copy form.
15 You may obtain a copy of the License at
17 http://www.oculusvr.com/licenses/LICENSE-3.2
19 Unless required by applicable law or agreed to in writing, the Oculus VR SDK
20 distributed under the License is distributed on an "AS IS" BASIS,
21 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 See the License for the specific language governing permissions and
23 limitations under the License.
25 *************************************************************************************/
27 #ifndef OVR_Linux_Display_h
28 #define OVR_Linux_Display_h
30 #include "OVR_Display.h"
32 namespace OVR { namespace Linux {
35 //-------------------------------------------------------------------------------------
36 // DisplayDesc
38 // Display information enumerable through OS .
39 // TBD: Should we just move this to public header, so it's a const member of Display?
40 struct DisplayDesc
41 {
42 HmdTypeEnum DeviceTypeGuess;
43 String DisplayID; // This is the device identifier string from MONITORINFO (for app usage)
44 String ModelName; // This is a "DK2" type string
45 String EdidSerialNumber;
46 Sizei LogicalResolutionInPixels;
47 Sizei NativeResolutionInPixels;
48 Vector2i DesktopDisplayOffset;
49 };
52 //-------------------------------------------------------------------------------------
53 // DisplayEDID
55 // Describes EDID information as reported from our display driver.
56 struct DisplayEDID
57 {
58 DisplayEDID() :
59 ModelNumber(0)
60 {}
62 String MonitorName;
63 UInt16 ModelNumber;
64 String VendorName;
65 String SerialNumber;
66 };
69 //-------------------------------------------------------------------------------------
70 // Linux Display Search Handle
71 class LinuxDisplaySearchHandle : public DisplaySearchHandle
72 {
73 public:
74 LinuxDisplaySearchHandle() :
75 extended(false),
76 application(false),
77 extendedDisplayCount(0),
78 applicationDisplayCount(0),
79 displayCount(0)
80 {}
81 virtual ~LinuxDisplaySearchHandle() {}
83 static const int DescArraySize = 16;
85 Linux::DisplayDesc cachedDescriptorArray[DescArraySize];
86 bool extended;
87 bool application;
88 int extendedDisplayCount;
89 int applicationDisplayCount;
90 int displayCount;
91 };
93 //-------------------------------------------------------------------------------------
94 // LinuxDisplayGeneric
96 // Describes Linux display in Compatibility mode, containing basic data
97 class LinuxDisplayGeneric : public Display
98 {
99 public:
100 LinuxDisplayGeneric( const DisplayDesc& dd ) :
101 Display(dd.DeviceTypeGuess,
102 dd.DisplayID,
103 dd.ModelName,
104 dd.EdidSerialNumber,
105 dd.LogicalResolutionInPixels,
106 dd.NativeResolutionInPixels,
107 dd.DesktopDisplayOffset,
108 0,
109 0,
110 false)
111 {
112 }
114 virtual ~LinuxDisplayGeneric()
115 {
116 }
118 virtual bool InCompatibilityMode() const
119 {
120 return true;
121 }
123 // Generic displays are not capable of mirroring
124 virtual MirrorMode SetMirrorMode( MirrorMode newMode )
125 {
126 OVR_UNUSED( newMode );
127 return MirrorDisabled;
128 }
129 };
131 }} // namespace OVR::Linux
133 #endif // OVR_Linux_Display_h