nuclear@0: /************************************************************************************ nuclear@0: nuclear@0: Filename : OVR_Linux_Display.h nuclear@0: Content : Linux-specific Display declarations nuclear@0: Created : July 2, 2014 nuclear@0: Authors : James Hughes nuclear@0: nuclear@0: Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved. nuclear@0: nuclear@0: Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License"); nuclear@0: you may not use the Oculus VR Rift SDK except in compliance with the License, nuclear@0: which is provided at the time of installation or download, or which nuclear@0: otherwise accompanies this software in either electronic or hard copy form. nuclear@0: nuclear@0: You may obtain a copy of the License at nuclear@0: nuclear@0: http://www.oculusvr.com/licenses/LICENSE-3.2 nuclear@0: nuclear@0: Unless required by applicable law or agreed to in writing, the Oculus VR SDK nuclear@0: distributed under the License is distributed on an "AS IS" BASIS, nuclear@0: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. nuclear@0: See the License for the specific language governing permissions and nuclear@0: limitations under the License. nuclear@0: nuclear@0: *************************************************************************************/ nuclear@0: nuclear@0: #ifndef OVR_Linux_Display_h nuclear@0: #define OVR_Linux_Display_h nuclear@0: nuclear@0: #include "OVR_Display.h" nuclear@0: nuclear@0: namespace OVR { namespace Linux { nuclear@0: nuclear@0: nuclear@0: //------------------------------------------------------------------------------------- nuclear@0: // DisplayDesc nuclear@0: nuclear@0: // Display information enumerable through OS . nuclear@0: // TBD: Should we just move this to public header, so it's a const member of Display? nuclear@0: struct DisplayDesc nuclear@0: { nuclear@0: HmdTypeEnum DeviceTypeGuess; nuclear@0: String DisplayID; // This is the device identifier string from MONITORINFO (for app usage) nuclear@0: String ModelName; // This is a "DK2" type string nuclear@0: String EdidSerialNumber; nuclear@0: Sizei LogicalResolutionInPixels; nuclear@0: Sizei NativeResolutionInPixels; nuclear@0: Vector2i DesktopDisplayOffset; nuclear@0: }; nuclear@0: nuclear@0: nuclear@0: //------------------------------------------------------------------------------------- nuclear@0: // DisplayEDID nuclear@0: nuclear@0: // Describes EDID information as reported from our display driver. nuclear@0: struct DisplayEDID nuclear@0: { nuclear@0: DisplayEDID() : nuclear@0: ModelNumber(0) nuclear@0: {} nuclear@0: nuclear@0: String MonitorName; nuclear@0: UInt16 ModelNumber; nuclear@0: String VendorName; nuclear@0: String SerialNumber; nuclear@0: }; nuclear@0: nuclear@0: nuclear@0: //------------------------------------------------------------------------------------- nuclear@0: // Linux Display Search Handle nuclear@0: class LinuxDisplaySearchHandle : public DisplaySearchHandle nuclear@0: { nuclear@0: public: nuclear@0: LinuxDisplaySearchHandle() : nuclear@0: extended(false), nuclear@0: application(false), nuclear@0: extendedDisplayCount(0), nuclear@0: applicationDisplayCount(0), nuclear@0: displayCount(0) nuclear@0: {} nuclear@0: virtual ~LinuxDisplaySearchHandle() {} nuclear@0: nuclear@0: static const int DescArraySize = 16; nuclear@0: nuclear@0: Linux::DisplayDesc cachedDescriptorArray[DescArraySize]; nuclear@0: bool extended; nuclear@0: bool application; nuclear@0: int extendedDisplayCount; nuclear@0: int applicationDisplayCount; nuclear@0: int displayCount; nuclear@0: }; nuclear@0: nuclear@0: //------------------------------------------------------------------------------------- nuclear@0: // LinuxDisplayGeneric nuclear@0: nuclear@0: // Describes Linux display in Compatibility mode, containing basic data nuclear@0: class LinuxDisplayGeneric : public Display nuclear@0: { nuclear@0: public: nuclear@0: LinuxDisplayGeneric( const DisplayDesc& dd ) : nuclear@0: Display(dd.DeviceTypeGuess, nuclear@0: dd.DisplayID, nuclear@0: dd.ModelName, nuclear@0: dd.EdidSerialNumber, nuclear@0: dd.LogicalResolutionInPixels, nuclear@0: dd.NativeResolutionInPixels, nuclear@0: dd.DesktopDisplayOffset, nuclear@0: 0, nuclear@0: 0, nuclear@0: false) nuclear@0: { nuclear@0: } nuclear@0: nuclear@0: virtual ~LinuxDisplayGeneric() nuclear@0: { nuclear@0: } nuclear@0: nuclear@0: virtual bool InCompatibilityMode() const nuclear@0: { nuclear@0: return true; nuclear@0: } nuclear@0: nuclear@0: // Generic displays are not capable of mirroring nuclear@0: virtual MirrorMode SetMirrorMode( MirrorMode newMode ) nuclear@0: { nuclear@0: OVR_UNUSED( newMode ); nuclear@0: return MirrorDisabled; nuclear@0: } nuclear@0: }; nuclear@0: nuclear@0: }} // namespace OVR::Linux nuclear@0: nuclear@0: #endif // OVR_Linux_Display_h