mirror of
https://github.com/mii443/rust-openvr.git
synced 2025-08-23 00:35:31 +00:00
inital
This commit is contained in:
43
wrapper.cpp
Normal file
43
wrapper.cpp
Normal file
@ -0,0 +1,43 @@
|
||||
#include "OVR.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
void OVR_system_init(void)
|
||||
{
|
||||
OVR::System::Init(OVR::Log::ConfigureDefaultLog(OVR::LogMask_All));
|
||||
}
|
||||
|
||||
OVR::DeviceManager* OVR_DeviceManager_Create(void)
|
||||
{
|
||||
return OVR::DeviceManager::Create();
|
||||
}
|
||||
|
||||
OVR::HMDDevice* OVR_DeviceManager_EnumerateDevices(OVR::DeviceManager* pManager)
|
||||
{
|
||||
return pManager->EnumerateDevices<OVR::HMDDevice>().CreateDevice();
|
||||
}
|
||||
|
||||
// not pointer on purpose!
|
||||
OVR::HMDInfo* OVR_HDMDevice_GetDeviceInfo(OVR::HMDDevice* pHMD)
|
||||
{
|
||||
OVR::HMDInfo *hdm = new OVR::HMDInfo;
|
||||
pHMD->GetDeviceInfo(hdm);
|
||||
return hdm;
|
||||
}
|
||||
|
||||
OVR::SensorDevice* OVR_HDMDevice_GetSensor(OVR::HMDDevice* pHMD)
|
||||
{
|
||||
return pHMD->GetSensor();
|
||||
}
|
||||
|
||||
OVR::SensorFusion* OVR_SensorFusion(OVR::HMDDevice* pHMD)
|
||||
{
|
||||
OVR::SensorFusion* SFusion = new OVR::SensorFusion;
|
||||
return SFusion;
|
||||
}
|
||||
|
||||
bool OVR_SensorFusion_AttachToSensor(OVR::SensorFusion* SFusion, OVR::SensorDevice *pSensor)
|
||||
{
|
||||
return (*SFusion).AttachToSensor(pSensor);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user