Move ivrinput into openvr folder

Doesn't make sense for it to have it's own folder when there's an openvr
folder now.
This commit is contained in:
Vasily
2019-03-10 23:12:26 +01:00
committed by username223
parent b7ff972997
commit dd5ae97b62
8 changed files with 7 additions and 8 deletions
+44
View File
@@ -0,0 +1,44 @@
#pragma once
#include <QStandardPaths>
#include <openvr.h>
#include <easylogging++.h>
namespace input
{
/*!
Initializes IVRInput to point at the correct manifest. Can't be done in the
constructor body since objects being initialized require this to be set.
*/
class Manifest
{
public:
Manifest()
{
QString actionManifestPath = QStandardPaths::locate(
QStandardPaths::AppDataLocation,
QStringLiteral( "action_manifest.json" ) );
auto error = vr::VRInput()->SetActionManifestPath(
actionManifestPath.toStdString().c_str() );
if ( error != vr::EVRInputError::VRInputError_None )
{
LOG( ERROR ) << "Error setting action manifest path: "
<< actionManifestPath << ". OpenVR Error: " << error;
}
}
// Explicitly deleted because this object should do nothing but run the
// constructor during initialization.
// Destructor left blank on purpose since there are no terminating calls.
~Manifest() {}
// Copy constructor
Manifest( const Manifest& ) = delete;
// Copy assignment
Manifest& operator=( const Manifest& ) = delete;
// Move constructor
Manifest( const Manifest&& ) = delete;
// Move assignment
Manifest& operator=( const Manifest&& ) = delete;
};
} // namespace input