ovr_sdk

diff 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 diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/LibOVR/Src/Displays/OVR_Linux_Display.h	Wed Jan 14 06:51:16 2015 +0200
     1.3 @@ -0,0 +1,133 @@
     1.4 +/************************************************************************************
     1.5 +
     1.6 +Filename    :   OVR_Linux_Display.h
     1.7 +Content     :   Linux-specific Display declarations
     1.8 +Created     :   July 2, 2014
     1.9 +Authors     :   James Hughes
    1.10 +
    1.11 +Copyright   :   Copyright 2014 Oculus VR, LLC All Rights reserved.
    1.12 +
    1.13 +Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License"); 
    1.14 +you may not use the Oculus VR Rift SDK except in compliance with the License, 
    1.15 +which is provided at the time of installation or download, or which 
    1.16 +otherwise accompanies this software in either electronic or hard copy form.
    1.17 +
    1.18 +You may obtain a copy of the License at
    1.19 +
    1.20 +http://www.oculusvr.com/licenses/LICENSE-3.2 
    1.21 +
    1.22 +Unless required by applicable law or agreed to in writing, the Oculus VR SDK 
    1.23 +distributed under the License is distributed on an "AS IS" BASIS,
    1.24 +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    1.25 +See the License for the specific language governing permissions and
    1.26 +limitations under the License.
    1.27 +
    1.28 +*************************************************************************************/
    1.29 +
    1.30 +#ifndef OVR_Linux_Display_h
    1.31 +#define OVR_Linux_Display_h
    1.32 +
    1.33 +#include "OVR_Display.h"
    1.34 +
    1.35 +namespace OVR { namespace Linux {
    1.36 +
    1.37 +
    1.38 +//-------------------------------------------------------------------------------------
    1.39 +// DisplayDesc
    1.40 +
    1.41 +// Display information enumerable through OS .
    1.42 +// TBD: Should we just move this to public header, so it's a const member of Display?
    1.43 +struct DisplayDesc
    1.44 +{
    1.45 +    HmdTypeEnum DeviceTypeGuess;
    1.46 +    String      DisplayID; // This is the device identifier string from MONITORINFO (for app usage)
    1.47 +    String      ModelName; // This is a "DK2" type string
    1.48 +    String      EdidSerialNumber;
    1.49 +    Sizei       LogicalResolutionInPixels;
    1.50 +    Sizei       NativeResolutionInPixels;
    1.51 +    Vector2i    DesktopDisplayOffset;
    1.52 +};
    1.53 +
    1.54 +
    1.55 +//-------------------------------------------------------------------------------------
    1.56 +// DisplayEDID
    1.57 +
    1.58 +// Describes EDID information as reported from our display driver.
    1.59 +struct DisplayEDID
    1.60 +{
    1.61 +    DisplayEDID() :
    1.62 +        ModelNumber(0)
    1.63 +    {}
    1.64 +
    1.65 +    String MonitorName;
    1.66 +    UInt16 ModelNumber;
    1.67 +    String VendorName;
    1.68 +    String SerialNumber;
    1.69 +};
    1.70 +
    1.71 +
    1.72 +//-------------------------------------------------------------------------------------
    1.73 +// Linux Display Search Handle
    1.74 +class LinuxDisplaySearchHandle : public DisplaySearchHandle
    1.75 +{
    1.76 +public:
    1.77 +    LinuxDisplaySearchHandle() :
    1.78 +        extended(false),
    1.79 +        application(false),
    1.80 +        extendedDisplayCount(0),
    1.81 +        applicationDisplayCount(0),
    1.82 +        displayCount(0)
    1.83 +    {}
    1.84 +    virtual ~LinuxDisplaySearchHandle()   {}
    1.85 +
    1.86 +    static const int DescArraySize = 16;
    1.87 +
    1.88 +    Linux::DisplayDesc  cachedDescriptorArray[DescArraySize];
    1.89 +    bool                extended;
    1.90 +    bool                application;
    1.91 +    int                 extendedDisplayCount;
    1.92 +    int                 applicationDisplayCount;
    1.93 +    int                 displayCount;
    1.94 +};
    1.95 +
    1.96 +//-------------------------------------------------------------------------------------
    1.97 +// LinuxDisplayGeneric
    1.98 +
    1.99 +// Describes Linux display in Compatibility mode, containing basic data
   1.100 +class LinuxDisplayGeneric : public Display
   1.101 +{
   1.102 +public:
   1.103 +    LinuxDisplayGeneric( const DisplayDesc& dd ) :
   1.104 +        Display(dd.DeviceTypeGuess,
   1.105 +                dd.DisplayID,
   1.106 +                dd.ModelName,
   1.107 +                dd.EdidSerialNumber,
   1.108 +                dd.LogicalResolutionInPixels,
   1.109 +                dd.NativeResolutionInPixels,
   1.110 +                dd.DesktopDisplayOffset,
   1.111 +                0,
   1.112 +                0,
   1.113 +				false)
   1.114 +    {
   1.115 +    }
   1.116 +
   1.117 +    virtual ~LinuxDisplayGeneric()
   1.118 +    {
   1.119 +    }
   1.120 +
   1.121 +    virtual bool InCompatibilityMode() const
   1.122 +    {
   1.123 +        return true;
   1.124 +    }
   1.125 +
   1.126 +    // Generic displays are not capable of mirroring
   1.127 +    virtual MirrorMode SetMirrorMode( MirrorMode newMode ) 
   1.128 +    { 
   1.129 +        OVR_UNUSED( newMode ); 
   1.130 +        return MirrorDisabled; 
   1.131 +    } 
   1.132 +};
   1.133 +
   1.134 +}} // namespace OVR::Linux
   1.135 +
   1.136 +#endif // OVR_Linux_Display_h