Enable VR on startup to specific runtime
-
- Posts: 2
- Joined: Fri May 10, 2019 10:02 am
Enable VR on startup to specific runtime
I'm working on automating a test scenario, and using EnableVirtualRealityOnStartup=1 to enable VR on startup. It seems to default to SteamVR, although I'd like to use another runtime. Where/how could I configure this?
- Beau Hollis
- Lockheed Martin
- Posts: 2452
- Joined: Wed Oct 06, 2010 3:25 pm
Re: Enable VR on startup to specific runtime
Unfortunately that setting currently enables VR with the SteamVR interface only. The IVRService in the SDK provides a function for enabling specific interfaces though. Using the SDK you could create a simple add-on dll to enable VR when loading is complete. For example, the add-on source to enable Varjo would look like this:
Beau
Thanks#include "initpdk.h"
#include "PdkPlugin.h"
class VRStartupPlugin : public P3D::PdkPlugin
{
---virtual void OnLoadComplete(P3D::IParameterListV400* pParams) override
---{
------P3D::PdkServices::GetVRService()->EnableVR(P3D::HMD_INTERFACES::VARJO);
---}
};
static VRStartupPlugin* s_pVRStartupPlugin = nullptr;
void __stdcall DLLStart(__in __notnull P3D::IPdk* pPdk)
{
---P3D::PdkServices::Init(pPdk);
---s_pVRStartupPlugin = new VRStartupPlugin();
}
void __stdcall DLLStop(void)
{
---if (s_pVRStartupPlugin != nullptr)
---{
------delete s_pVRStartupPlugin;
---}
---P3D::PdkServices::Shutdown();
}
Beau
Beau Hollis
Prepar3D Software Architect
Prepar3D Software Architect
-
- Posts: 2
- Joined: Fri May 10, 2019 10:02 am
Re: Enable VR on startup to specific runtime
Excellent, thank you!