Files
OpenVR-AdvancedSettings-frame/src/overlaycontroller/openvr_init.h
T
Vasily 706f21ebea Add ability to change IVRInput bindings, move openvr_init into namespace
openvr_init was not in a namespace. This led to it being globally
available. This was not intended.

The solution to overlays not showing up in the bindings interface was
chosen for ease of implementation and relative ease of end user use.
The Kinect2VR project are using a solution where there is a button to
shutdown background mode and use scene mode temporarily. This did not
work for our project for unknown reasons. The IVRInput system would
become non responsive and spam error messages when VR was shut down.
Implementation is here:
https://github.com/sharkyh20/KinectToVR/blob/12aeb8b33ab20eeb588c72c5d5186dd4d87784d7/SFMLProject/inc/GUIHandler.h#L700

The command line flag will be represented as a .bat file for the end
user, like desktop mode and restarting the VR server.

When Valve solves the issue of overlays not showing up in the bindings
menu, the entire function can essentially be deleted.
Official issues here:
https://github.com/ValveSoftware/openvr/issues/914
https://github.com/ValveSoftware/openvr/issues/926
https://github.com/ValveSoftware/openvr/issues/879

It is also possible to make the app appear by changing the
C:\Program Files (x86)\Steam\config\vrappconfig\*.vrappconfig file for
the project to have a "last_launch_time" of something greater than zero.
From experimentation it seems that there's a cutoff time around 2 weeks
before the current time. Setting it to the day before seems to be a good bet.
(In unix time).
2019-01-20 22:05:21 +01:00

41 lines
1.3 KiB
C++

#pragma once
namespace openvr_init
{
[[noreturn]] void openBindingsMenu();
/*!
Initializes OpenVR and checks validity of interface versions. Shuts down OpenVR
when destroyed.
This object should be declared above all other objects in the class file that
use OpenVR calls, since the order of declaration decides which objects are
initialized first.
The comment/tooltips have not been provided for the constructor/destructor since
they do not need explanation due to the straightforward nature of their
implementation.
*/
class OpenVR_Init
{
public:
OpenVR_Init();
~OpenVR_Init();
// As per the Rule of Five, the following constructors and assignments can
// be created by the compiler automatically if they are used in the code.
// The compiler will not be able to correctly create this class and it
// wouldn't make sense to copy a class that just starts OpenVR.
// They are explicitly deleted to make sure they aren't used, and to
// document that they shouldn't be used.
// Copy constructor
OpenVR_Init( const OpenVR_Init& ) = delete;
// Copy assignment
const OpenVR_Init& operator=( const OpenVR_Init& ) = delete;
// Move constructor
OpenVR_Init( OpenVR_Init&& ) = delete;
// Move assignment
const OpenVR_Init operator=( OpenVR_Init&& ) = delete;
};
} // namespace openvr_init