diff --git a/Projects/Android/jni/Android.mk b/Projects/Android/jni/Android.mk index af3fae1..9eeacef 100644 --- a/Projects/Android/jni/Android.mk +++ b/Projects/Android/jni/Android.mk @@ -17,7 +17,8 @@ LOCAL_LDLIBS := -llog -landroid -lGLESv3 -lEGL -lOpenSLES # include default l LOCAL_C_INCLUDES := ../QuakeQuestSrc/ \ ../darkplaces/ \ $(SUPPORT_LIBS)/liboggvorbis/include \ - $(TOP_DIR)/../../../../../3rdParty/khronos/openxr/OpenXR-SDK/include + $(TOP_DIR)/../../../../../3rdParty/khronos/openxr/OpenXR-SDK/include \ + $(TOP_DIR)/../../../../../OpenXR/Include LOCAL_SHARED_LIBRARIES := openxr_loader libvorbis libogg libvorbis-jni diff --git a/Projects/Android/jni/QuakeQuestSrc/OpenXrInput_MetaQuest.c b/Projects/Android/jni/QuakeQuestSrc/OpenXrInput_MetaQuest.c index dc34be0..39b8c51 100644 --- a/Projects/Android/jni/QuakeQuestSrc/OpenXrInput_MetaQuest.c +++ b/Projects/Android/jni/QuakeQuestSrc/OpenXrInput_MetaQuest.c @@ -1,7 +1,8 @@ -#include "VrCommon.h" #ifdef META_QUEST +#include "VrCommon.h" + extern ovrApp gAppState; XrSpace CreateActionSpace(XrAction poseAction, XrPath subactionPath) { diff --git a/Projects/Android/jni/QuakeQuestSrc/OpenXrInput_PicoXR.c b/Projects/Android/jni/QuakeQuestSrc/OpenXrInput_PicoXR.c index 30b6b48..667b3a8 100644 --- a/Projects/Android/jni/QuakeQuestSrc/OpenXrInput_PicoXR.c +++ b/Projects/Android/jni/QuakeQuestSrc/OpenXrInput_PicoXR.c @@ -1,7 +1,7 @@ -#include "VrCommon.h" - #ifdef PICO_XR +#include "VrCommon.h" + extern ovrApp gAppState; XrResult CheckXrResult(XrResult res, const char* originator) { diff --git a/Projects/Android/jni/QuakeQuestSrc/QuakeQuest_OpenXR.c b/Projects/Android/jni/QuakeQuestSrc/QuakeQuest_OpenXR.c index dc74af6..132bde3 100644 --- a/Projects/Android/jni/QuakeQuestSrc/QuakeQuest_OpenXR.c +++ b/Projects/Android/jni/QuakeQuestSrc/QuakeQuest_OpenXR.c @@ -305,7 +305,14 @@ void * AppThreadFunction(void * parm ) { TBXR_submitFrame(); } - + + { + TBXR_LeaveVR(); + //Ask Java to shut down + VR_Shutdown(); + + exit(0); // in case Java doesn't do the job + } return NULL; } diff --git a/Projects/Android/jni/QuakeQuestSrc/TBXR_Common.h b/Projects/Android/jni/QuakeQuestSrc/TBXR_Common.h index 643a401..3074418 100644 --- a/Projects/Android/jni/QuakeQuestSrc/TBXR_Common.h +++ b/Projects/Android/jni/QuakeQuestSrc/TBXR_Common.h @@ -320,6 +320,7 @@ void TBXR_InitialiseOpenXR(); void TBXR_WaitForSessionActive(); void TBXR_InitRenderer(); void TBXR_EnterVR(); +void TBXR_LeaveVR( ); void TBXR_GetScreenRes(int *width, int *height); void TBXR_InitActions( void ); void TBXR_Vibrate(int duration, int channel, float intensity );