I´m trying to adapt a particular sourcecode-example, but have trouble to understand how it keeps control over the main-loop:
// Combine some macros together to create a single macro
// to launch a class containing a run method
#define RUN_OVR_APP(AppClass) \
MAIN_DECL { \
if (!ovr_Initialize()) { \
SAY_ERR("Failed to initialize the Oculus SDK"); \
return -1; \
} \
int result = -1; \
try { \
result = AppClass().run(); \
} catch (std::exception & error) { \
SAY_ERR(error.what()); \
} catch (std::string & error) { \
SAY_ERR(error.c_str()); \
} \
ovr_Shutdown(); \
return result; \
}
I know stackoverflow doesnt want links, but in the this particular case it might be necceassary, in order to get more information on the used commands: https://github.com/OculusRiftInAction/OculusRiftInAction/blob/master/examples/cpp/common/ovr/OvrUtils.h