You can compile/test a Rift app without a Rift...
In case it helps any new Rift developer (like me), here's a hint of how to develop in Direct Mode *without* always needing the actual headset. This will be obvious to anyone that already knows it, but to a noob it isn't, trust me.
If you're using Direct Mode it is possible to use the Oculus driver 'ovrHmdCap_NoMirrorToWindow' flag to control whether or not the Rift view is mirrored to your desktop. Default is mirroring 'ON', anyway. With a small extra step (particularly useful during early development) you can have your app mirror to the desktop even if you do NOT actually have the Rift connected.
Within your initialization code you test to see whether your ovrHmd variable (here HMD) was successfully initialized with ovrHmd_Create(0), and if NOT then you initialize with ovrHmd_CreateDebug(ovrHmd_DK2) instead. That gives you a dummy debug HMD so the rest of your code works (although you won't get headset position updates). You can keep programming if what you're doing is workable via the view in the distorted desktop window.
I modified the Win32_OculusRoomTiny.cpp with the couple of lines below and bingo, you can compile and run the executable without the headset.
I'm actually trying to get a programming template that gives me a window with a single viewpoint, without the distortion (i.e. render the backbuffer directly to a normal window within the app code) but I didn't realise at least getting the distorted binary view is a simple one-line-mod...
If you're using Direct Mode it is possible to use the Oculus driver 'ovrHmdCap_NoMirrorToWindow' flag to control whether or not the Rift view is mirrored to your desktop. Default is mirroring 'ON', anyway. With a small extra step (particularly useful during early development) you can have your app mirror to the desktop even if you do NOT actually have the Rift connected.
Within your initialization code you test to see whether your ovrHmd variable (here HMD) was successfully initialized with ovrHmd_Create(0), and if NOT then you initialize with ovrHmd_CreateDebug(ovrHmd_DK2) instead. That gives you a dummy debug HMD so the rest of your code works (although you won't get headset position updates). You can keep programming if what you're doing is workable via the view in the distorted desktop window.
I modified the Win32_OculusRoomTiny.cpp with the couple of lines below and bingo, you can compile and run the executable without the headset.
I'm actually trying to get a programming template that gives me a window with a single viewpoint, without the distortion (i.e. render the backbuffer directly to a normal window within the app code) but I didn't realise at least getting the distorted binary view is a simple one-line-mod...
int Init()
{
// Initializes LibOVR, and the Rift
ovr_Initialize();
if (!HMD)
{
HMD = ovrHmd_Create(0);
/************* NEW CODE HERE *************/
if (!HMD)
{
HMD = ovrHmd_CreateDebug(ovrHmd_DK2);
}
/*************** END OF NEW CODE **********/
if (!HMD)
{
MessageBoxA(NULL, "Oculus Rift not detected.?", "", MB_OK);
return(1);
}
