Skip to main content
Up and Coming
July 22, 2015

PerfHudMode

I'm trying to implement the 0.6.0.1 performance HUD in my application and so far it works great if I enable it once I'm already up and rendering but I'm having trouble making the setting persistent. When I try to restore the setting at initialization time (after my ovrHmd_Create call) the ovrHmd_SetInt returns true however the setting doesn't stick; the ovrHmd_GetInt call in my code below returns -1:

   
if (theHMD)
{
ovrBool result = ovrHmd_SetInt(theHMD, "PerfHudMode", mode);
if (!result)
{
std::cout << "Can't set performance HUD" << std::endl;
}
else
{
int newValue = ovrHmd_GetInt(theHMD, "PerfHudMode", -1);
if (newValue != mode)
{
std::cout << "setPerformanceHUDMode didn't take " << std::endl;
}
}
}


It seems like there's a bug here; if ovrHmd_SetInt returns true retrieving the value immediately afterwards with ovrHmd_GetInt should work. If for some reason it's too early to set the value than ovrHmd_SetInt should have returned false.

Does anyone know at what point it's safe to enable PerfHudMode?

Thanks,
Jeff

    1 reply

    Meta Employee
    July 22, 2015
    Hi Jeff,

    At the moment, you'd need to call SubmitFrame at least once before calling SetInt(). In the very near future, we will have the ability to toggle the perf hud modes externally from the ConfigUtil so you won't have to call SetInt() for this, although we won't remove that capability either.