35 namespace OVR {
namespace Linux {
41 DisplayDeviceName(displayDeviceName),
45 DeviceId = DisplayDeviceName;
50 ScreenSizeInMeters =
Sizef(0.0f);
51 VCenterFromTopInMeters = 0.0f;
52 LensSeparationInMeters = 0.0f;
57 DeviceId(other.DeviceId), DisplayDeviceName(other.DisplayDeviceName),
58 Contents(other.Contents),
59 DisplayId(other.DisplayId)
61 Desktop.X = other.Desktop.X;
62 Desktop.Y = other.Desktop.Y;
63 ResolutionInPixels = other.ResolutionInPixels;
64 ScreenSizeInMeters = other.ScreenSizeInMeters;
65 VCenterFromTopInMeters = other.VCenterFromTopInMeters;
66 LensSeparationInMeters = other.LensSeparationInMeters;
70 DeviceCreateDesc** pcandidate)
const
114 if (s2.DeviceId.IsEmpty())
141 if (s2.DeviceId.IsEmpty())
157 if (newDeviceFlag) *newDeviceFlag =
true;
172 if (newDeviceFlag) *newDeviceFlag =
true;
176 if (newDeviceFlag) *newDeviceFlag =
false;
201 bool foundHMD =
false;
202 Display* display = XOpenDisplay(
NULL);
203 XRRScreenResources *screen = XRRGetScreenResources(display, DefaultRootWindow(display));
204 for (
int iscres = screen->noutput - 1; iscres >= 0; --iscres) {
205 RROutput output = screen->outputs[iscres];
211 XRROutputInfo * info = XRRGetOutputInfo (display, screen, output);
224 if (info->connection == RR_Connected && info->crtc) {
225 XRRCrtcInfo * crtc_info = XRRGetCrtcInfo (display, screen, info->crtc);
232 XRRFreeCrtcInfo(crtc_info);
236 String deviceID = device_id;
240 if (
strstr(device_id,
"OVR0003"))
242 hmdCreateDesc.SetScreenParameters(mx, my, 1920, 1080, 0.12576f, 0.07074f, 0.12576f*0.5f, 0.0635f );
244 else if (
strstr(device_id,
"OVR0002"))
246 hmdCreateDesc.SetScreenParameters(mx, my, 1920, 1080, 0.12096f, 0.06804f, 0.06804f*0.5f, 0.0635f );
250 hmdCreateDesc.SetScreenParameters(mx, my, mwidth, mheight, 0.14976f, 0.0936f, 0.0936f*0.5f, 0.0635f);
254 hmdCreateDesc.SetScreenParameters(mx, my, mwidth, mheight, 0.14976f, 0.0936f, 0.0936f*0.5f, 0.0635f);
258 hmdCreateDesc.SetScreenParameters(mx, my, mwidth, mheight, 0.12096f, 0.0756f, 0.0756f*0.5f, 0.0635f);
270 XRRFreeOutputInfo(info);
273 XRRFreeScreenResources(screen);
283 hmdDevDesc->Enumerated =
true;
virtual void EnumerateDevices(EnumerateVisitor &visitor)
DeviceFactory *const pFactory
char dsc_product_name[14]
virtual MatchResult MatchDevice(const DeviceCreateDesc &other, DeviceCreateDesc **) const
__BEGIN_NAMESPACE_STD void * memcpy(void *__restrict __dest, const void *__restrict __src, size_t __n) __THROW __nonnull((1
Ptr< DeviceCreateDesc > FindDevice(const String &path, DeviceType=Device_None)
int memcmp(const void *__s1, const void *__s2, size_t __n) __THROW __attribute_pure__ __nonnull((1
HMDDeviceCreateDesc(DeviceFactory *factory, const String &displayDeviceName, long dispId)
virtual bool UpdateMatchedCandidate(const DeviceCreateDesc &, bool *newDeviceFlag=NULL)
#define OVR_DEBUG_LOG_TEXT(args)
struct OVR::Linux::HMDDeviceCreateDesc::@37 Desktop
virtual void Visit(const DeviceCreateDesc &createDesc)=0
DeviceCreateDesc(DeviceFactory *factory, DeviceType type)
MonitorInfo * read_edid_data(Display *disp, RROutput id)
char manufacturer_code[4]
UPInt OVR_CDECL OVR_sprintf(char *dest, UPInt destsize, const char *format,...)
static HMDDeviceFactory & GetInstance()
DeviceManager * getManager() const
static int OVR_STDCALL CompareNoCase(const char *a, const char *b)
__END_NAMESPACE_STD __BEGIN_NAMESPACE_STD size_t size_t char char * strstr(const char *__haystack, const char *__needle) __THROW __attribute_pure__ __nonnull((1