move UI plane when toggled in VR, fix vr start/stop on Quest
This commit is contained in:
@@ -141,6 +141,22 @@ void oculus_init_vr(EGLDisplay display, EGLContext context, ANativeWindow* surfa
|
||||
vrapi_SetPerfThread(ovr_context, VRAPI_PERF_THREAD_TYPE_RENDERER, 0);
|
||||
}
|
||||
|
||||
void oculus_release_vr()
|
||||
{
|
||||
vrapi_LeaveVrMode(ovr_context);
|
||||
ovr_context = nullptr;
|
||||
for (int eye = 0; eye < 2; eye++)
|
||||
{
|
||||
vrapi_DestroyTextureSwapChain(swap_chain[eye]);
|
||||
swap_chain[eye] = nullptr;
|
||||
for (int i = 0; i < swap_chain_count; i++)
|
||||
ovr_eyes[eye][i].destroy();
|
||||
}
|
||||
swap_chain_index = 0;
|
||||
swap_chain_count = 0;
|
||||
LOG("leave vr mode");
|
||||
}
|
||||
|
||||
void oculus_draw(float dt)
|
||||
{
|
||||
const double predictedDisplayTime = vrapi_GetPredictedDisplayTime(ovr_context, ovr_frame);
|
||||
|
||||
@@ -12,4 +12,5 @@
|
||||
|
||||
void oculus_init(JavaVM* vm, JNIEnv* jni, jobject activity_class);
|
||||
void oculus_init_vr(EGLDisplay display, EGLContext context, ANativeWindow* surface);
|
||||
void oculus_release_vr();
|
||||
void oculus_draw(float dt);
|
||||
|
||||
Reference in New Issue
Block a user