DK2 - ovrHmd_BeginFrameTiming called multiple times.
Hey guys!
first post here, so I apologize if Im posting in the wrong topic.
I´m trying to build an application using both libcinder and the oculus rift sdk2 by following the "Minimal Oculus Application" tutorial. After some tries linking the libraries I managed to make the application build. Now the problem is that, following the code from the tutorial I get this exception: Assert: ovrHmd_BeginFrameTiming called multiple times.
If I run on release mode, the exception is not thrown, but I dont get any info from the device either.
here is my code:
the same happens if I put ovrHmd_EndFrameTiming(mHmd) outside the "if" bracket. the exception is not thrown, but no info either...
any help?
thanks!
first post here, so I apologize if Im posting in the wrong topic.
I´m trying to build an application using both libcinder and the oculus rift sdk2 by following the "Minimal Oculus Application" tutorial. After some tries linking the libraries I managed to make the application build. Now the problem is that, following the code from the tutorial I get this exception: Assert: ovrHmd_BeginFrameTiming called multiple times.
If I run on release mode, the exception is not thrown, but I dont get any info from the device either.
here is my code:
#include "cinder/app/AppNative.h"
#include "cinder/gl/gl.h"
#include "OVR_CAPI.h"
#include "Kernel\OVR_Math.h"
using namespace ci;
using namespace ci::app;
using namespace std;
class OculusApp : public AppNative {
public:
void setup();
void shutdown();
void mouseDown( MouseEvent event );
void update();
void draw();
// Oculur Objects ------
ovrHmd mHmd;
ovrFrameTiming frameTiming;
};
void OculusApp::setup()
{
// cinder setup class, this is called once at the begining
ovr_Initialize();
mHmd = ovrHmd_Create(0);
if(!mHmd){
console() << "could not initialize" << endl;
return;
}
ovrHmd_ConfigureTracking(mHmd, 1, 0);
while(mHmd){
frameTiming = ovrHmd_BeginFrameTiming(mHmd, 0);
ovrTrackingState ts = ovrHmd_GetTrackingState(mHmd, frameTiming.ScanoutMidpointSeconds);
if (ts.StatusFlags & (ovrStatus_OrientationTracked | ovrStatus_PositionTracked)) {
// The cpp compatibility layer is used to convert ovrPosef to Posef (see OVR_Math.h)
OVR::Posef pose = ts.HeadPose.ThePose;
float yaw, pitch, roll;
pose.Rotation.GetEulerAngles<OVR::Axis_Y, OVR::Axis_X, OVR::Axis_Z>(&yaw, &pitch, &roll);
console() << "yaw: " << OVR::RadToDegree(yaw) << endl;
console() << "pitch: " << OVR::RadToDegree(pitch) << endl;
console() << "roll: " << OVR::RadToDegree(roll) << endl;
Sleep(150);
ovrHmd_EndFrameTiming(mHmd);
}
}
}
the same happens if I put ovrHmd_EndFrameTiming(mHmd) outside the "if" bracket. the exception is not thrown, but no info either...
any help?
thanks!
