diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index aa08576467..e04fc031fb 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -96,6 +96,10 @@ using namespace std::placeholders; static AVIDump avi; #endif +#ifdef OPENXR +#include +#endif + // TODO: Ugly! static bool frameStep_; static int lastNumFlips; @@ -821,6 +825,9 @@ protected: }; void EmuScreen::CreateViews() { +#ifdef OPENXR + VR_SetMode(VR_MODE_MONO_6DOF); +#endif using namespace UI; auto dev = GetI18NCategory("Developer"); diff --git a/UI/PauseScreen.cpp b/UI/PauseScreen.cpp index 339409ed6e..03fc98a451 100644 --- a/UI/PauseScreen.cpp +++ b/UI/PauseScreen.cpp @@ -48,6 +48,10 @@ #include "UI/OnScreenDisplay.h" #include "UI/GameInfoCache.h" +#ifdef OPENXR +#include +#endif + AsyncImageFileView::AsyncImageFileView(const Path &filename, UI::ImageSizeMode sizeMode, UI::LayoutParams *layoutParams) : UI::Clickable(layoutParams), canFocus_(true), filename_(filename), color_(0xFFFFFFFF), sizeMode_(sizeMode), textureFailed_(false), fixedSizeW_(0.0f), fixedSizeH_(0.0f) {} @@ -364,6 +368,10 @@ GamePauseScreen::~GamePauseScreen() { } void GamePauseScreen::CreateViews() { +#ifdef OPENXR + VR_SetMode(VR_MODE_FLAT_SCREEN); +#endif + static const int NUM_SAVESLOTS = 5; using namespace UI; diff --git a/VR/VRRenderer.cpp b/VR/VRRenderer.cpp index 12fb37cf7b..53d6452ffd 100644 --- a/VR/VRRenderer.cpp +++ b/VR/VRRenderer.cpp @@ -422,6 +422,10 @@ void VR_EndFrame( engine_t* engine ) { } } +void VR_SetMode( VRMode mode ) { + vrMode = mode; +} + void VR_BindFramebuffer( engine_t* engine, int eye ) { if (!initialized) return; ovrFramebuffer* frameBuffer = &engine->appState.Renderer.FrameBuffer[eye];