From 594716896626c4c2190dc620ed66bd69c858031d Mon Sep 17 00:00:00 2001 From: Lubos Date: Sun, 24 Apr 2022 20:25:19 +0200 Subject: [PATCH] OpenXR minor fixes --- android/app/src/main/cpp/code/vr/vr_input.c | 1 - android/app/src/main/cpp/code/vr/vr_renderer.c | 4 ++-- android/app/src/main/cpp/code/vr/vr_types.c | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/android/app/src/main/cpp/code/vr/vr_input.c b/android/app/src/main/cpp/code/vr/vr_input.c index a8058948..3a8bfeec 100644 --- a/android/app/src/main/cpp/code/vr/vr_input.c +++ b/android/app/src/main/cpp/code/vr/vr_input.c @@ -234,7 +234,6 @@ void QuatToYawPitchRoll(XrQuaternionf q, vec3_t rotation, vec3_t out) { //0 = left, 1 = right float vibration_channel_duration[2] = {0.0f, 0.0f}; float vibration_channel_intensity[2] = {0.0f, 0.0f}; -//TODO:ovrDeviceID controllerIDs[2]; void VR_Vibrate( int duration, int chan, float intensity ) { diff --git a/android/app/src/main/cpp/code/vr/vr_renderer.c b/android/app/src/main/cpp/code/vr/vr_renderer.c index a94d3b78..fab7af7c 100644 --- a/android/app/src/main/cpp/code/vr/vr_renderer.c +++ b/android/app/src/main/cpp/code/vr/vr_renderer.c @@ -295,8 +295,6 @@ void VR_DrawFrame( engine_t* engine ) { 30.0f, 30.0f, 0.0f, 0.0f, 1.0f, 0.0f ); const ovrMatrix4f projectionMatrix = ovrMatrix4f_CreateProjectionFov( vr.fov_x / vr.weapon_zoomLevel, vr.fov_y / vr.weapon_zoomLevel, 0.0f, 0.0f, 1.0f, 0.0f ); - re.SetVRHeadsetParms(projectionMatrix.M, monoVRMatrix.M, - engine->appState.Renderer.FrameBuffer.FrameBuffers[engine->appState.Renderer.FrameBuffer.TextureSwapChainIndex]); GLboolean stageBoundsDirty = GL_TRUE; ovrApp_HandleXrEvents(&engine->appState); @@ -394,6 +392,8 @@ void VR_DrawFrame( engine_t* engine ) { ovrFramebuffer* frameBuffer = &engine->appState.Renderer.FrameBuffer; ovrFramebuffer_Acquire(frameBuffer); ovrFramebuffer_SetCurrent(frameBuffer); + re.SetVRHeadsetParms(projectionMatrix.M, monoVRMatrix.M, + engine->appState.Renderer.FrameBuffer.FrameBuffers[engine->appState.Renderer.FrameBuffer.TextureSwapChainIndex]); Com_Frame(); ovrFramebuffer_Resolve(frameBuffer); ovrFramebuffer_Release(frameBuffer); diff --git a/android/app/src/main/cpp/code/vr/vr_types.c b/android/app/src/main/cpp/code/vr/vr_types.c index 825d19a9..6286c958 100644 --- a/android/app/src/main/cpp/code/vr/vr_types.c +++ b/android/app/src/main/cpp/code/vr/vr_types.c @@ -287,7 +287,7 @@ void ovrRenderer_Create( ovrFramebuffer_Create( session, &renderer->FrameBuffer, - GL_SRGB8_ALPHA8, + GL_RGBA8, suggestedEyeTextureWidth, suggestedEyeTextureHeight, NUM_MULTI_SAMPLES);