OpenXR - Enable 6DoF mode when in game

This commit is contained in:
Lubos 2022-07-24 20:04:29 +02:00
parent b1e3d8beb3
commit 7a787bd6bf
3 changed files with 19 additions and 0 deletions

View File

@ -96,6 +96,10 @@ using namespace std::placeholders;
static AVIDump avi;
#endif
#ifdef OPENXR
#include <VR/VRRenderer.h>
#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");

View File

@ -48,6 +48,10 @@
#include "UI/OnScreenDisplay.h"
#include "UI/GameInfoCache.h"
#ifdef OPENXR
#include <VR/VRRenderer.h>
#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;

View File

@ -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];