Skip to content

Commit abf6330

Browse files
committed
Improvement: support for launching in a window
1 parent 44b2591 commit abf6330

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

OpenVR/FreeTrack/samples/driver_sample/driver_sample.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,10 @@ class CSampleDeviceDriver : public vr::ITrackedDeviceServerDriver, public vr::IV
343343

344344
virtual bool IsDisplayRealDisplay()
345345
{
346-
return true; //Support working on extended display
347-
//return false;
346+
if (m_nWindowX == 0 && m_nWindowY == 0)
347+
return false;
348+
else
349+
return true; //Support working on extended display
348350
}
349351

350352
virtual void GetRecommendedRenderTargetSize( uint32_t *pnWidth, uint32_t *pnHeight )

OpenVR/UDP/samples/driver_sample/driver_sample.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,12 @@ class CSampleDeviceDriver : public vr::ITrackedDeviceServerDriver, public vr::IV
301301
return true;
302302
}
303303

304-
virtual bool IsDisplayRealDisplay()
304+
virtual bool IsDisplayRealDisplay()
305305
{
306-
return true; //Support working on extended display
307-
//return false;
306+
if (m_nWindowX == 0 && m_nWindowY == 0)
307+
return false;
308+
else
309+
return true; //Support working on extended display
308310
}
309311

310312
virtual void GetRecommendedRenderTargetSize( uint32_t *pnWidth, uint32_t *pnHeight )

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ DebugMode | Debug mode, locked at 30 FPS. After checking, it is recommended to s
3131

3232
## Known Issues
3333
1. Red screen. You can fix this by selecting the "Headset Window" window.
34-
2. The keyboard, mouse and gamepad do not work when using the driver on one monitor (The game window should be in focus). On systems with multiple monitors, you can move the application to second monitor and select it, then everything will work.
34+
2. The keyboard, mouse and gamepad don't work when using the driver on one monitor (The game window should be in focus). On systems with multiple monitors, you can move the application to second monitor and select it, then everything will work.
3535

3636
## Download
3737
>Version for x86 и x64.<br>

0 commit comments

Comments
 (0)