Files
ppsspp/Common/VR/PPSSPPVR.h

65 lines
1.6 KiB
C
Raw Permalink Normal View History

2022-08-27 17:33:37 +02:00
#pragma once
#include <cstddef>
2023-03-29 12:03:03 +02:00
struct AxisInput;
struct TouchInput;
struct KeyInput;
2022-08-27 17:33:37 +02:00
2022-09-12 23:01:44 +02:00
enum VRCompatFlag {
2022-09-08 18:25:10 +02:00
//compatibility tweaks
VR_COMPAT_SKYPLANE,
//render state
VR_COMPAT_FBO_CLEAR,
2022-09-08 18:25:10 +02:00
//uniforms
VR_COMPAT_FOG_COLOR,
//end
VR_COMPAT_MAX
};
2022-11-17 12:19:17 +01:00
enum VRAppMode {
2022-11-17 19:13:04 +01:00
VR_CONTROLLER_MAPPING_MODE,
2022-11-17 15:25:35 +01:00
VR_DIALOG_MODE,
2022-11-17 12:19:17 +01:00
VR_GAME_MODE,
VR_MENU_MODE,
};
2022-08-27 17:33:37 +02:00
// VR app flow integration
bool IsVREnabled();
void InitVROnAndroid(void* vm, void* activity, const char* system, int version, const char* name);
2022-09-14 19:53:55 +02:00
void EnterVR(bool firstStart, void* vulkanContext);
2022-08-27 17:33:37 +02:00
void GetVRResolutionPerEye(int* width, int* height);
void SetVRCallbacks(void(*axis)(const AxisInput *axis, size_t count), bool(*key)(const KeyInput &key), void(*touch)(const TouchInput &touch));
2022-11-17 12:19:17 +01:00
// VR input integration
void SetVRAppMode(VRAppMode mode);
void UpdateVRInput(bool haptics, float dp_xscale, float dp_yscale);
bool UpdateVRAxis(const AxisInput &axis);
bool UpdateVRKeys(const KeyInput &key);
2022-08-27 17:33:37 +02:00
// VR games compatibility
void PreprocessStepVR(void* step);
2022-09-12 23:01:44 +02:00
void SetVRCompat(VRCompatFlag flag, long value);
2022-08-27 17:33:37 +02:00
// VR rendering integration
2022-10-12 16:21:54 +02:00
void* BindVRFramebuffer();
bool StartVRRender();
void FinishVRRender();
void PreVRFrameRender(int fboIndex);
void PostVRFrameRender();
int GetVRFBOIndex();
int GetVRPassesCount();
bool IsMultiviewSupported();
bool IsPassthroughSupported();
bool IsFlatVRGame();
2022-08-27 17:33:37 +02:00
bool IsFlatVRScene();
bool IsGameVRScene();
2022-08-27 17:33:37 +02:00
bool Is2DVRObject(float* projMatrix, bool ortho);
void UpdateVRParams(float* projMatrix);
2022-08-27 17:33:37 +02:00
void UpdateVRProjection(float* projMatrix, float* leftEye, float* rightEye);
void UpdateVRView(float* leftEye, float* rightEye);
void UpdateVRViewMatrices();