move UI plane when toggled in VR, fix vr start/stop on Quest

This commit is contained in:
2019-06-01 22:59:45 +02:00
parent 78f453f89c
commit e5c7a35fd2
5 changed files with 52 additions and 16 deletions

View File

@@ -492,6 +492,10 @@ static int engine_init_display(struct engine* engine) {
g_display = display;
g_context = context;
#ifdef __QUEST__
oculus_init_vr(display, context, engine->app->window);
#endif
if (resuming_context)
{
LOG("RESUME APP");
@@ -588,9 +592,6 @@ static int engine_init_display(struct engine* engine) {
LOG("PROP Brand: %s", os_props["ro.product.brand"].c_str());
LOG("PROP Maker: %s", os_props["ro.product.manufacturer"].c_str());
LOG("PROP Mode: %s", os_props["ro.product.model"].c_str());
//LOG("PROP: %s", os_props[""].c_str());
//LOG("PROP: %s", os_props[""].c_str());
//LOG("PROP: %s", os_props[""].c_str());
// Initialize GL state.
@@ -619,7 +620,6 @@ static int engine_init_display(struct engine* engine) {
App::I.redraw = true;
App::I.init();
App::I.resize(1024, 1024);
oculus_init_vr(display, context, engine->app->window);
App::I.vr_active = true;
App::I.has_vr = true;
App::I.vr_only = true;
@@ -706,6 +706,9 @@ static void engine_term_display(struct engine* engine) {
engine->display = EGL_NO_DISPLAY;
engine->context = EGL_NO_CONTEXT;
engine->surface = EGL_NO_SURFACE;
#ifdef __QUEST__
oculus_release_vr();
#endif
}
/**