ovr_sdk

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