raze/source/common/rendering/hwrenderer/data/hw_vrmodes.h

52 lines
1,023 B
C
Raw Normal View History

2020-04-26 21:17:54 +00:00
#pragma once
#include "matrix.h"
class DFrameBuffer;
enum
{
VR_MONO = 0,
VR_GREENMAGENTA = 1,
VR_REDCYAN = 2,
VR_SIDEBYSIDEFULL = 3,
VR_SIDEBYSIDESQUISHED = 4,
VR_LEFTEYEVIEW = 5,
VR_RIGHTEYEVIEW = 6,
VR_QUADSTEREO = 7,
2021-01-29 12:20:00 +00:00
VR_SIDEBYSIDELETTERBOX = 8,
2020-04-26 21:17:54 +00:00
VR_AMBERBLUE = 9,
VR_TOPBOTTOM = 11,
VR_ROWINTERLEAVED = 12,
VR_COLUMNINTERLEAVED = 13,
VR_CHECKERINTERLEAVED = 14,
VR_OPENXR = 15
2020-04-26 21:17:54 +00:00
};
struct VREyeInfo
{
float mShiftFactor;
float mScaleFactor;
VSMatrix GetProjection(float fov, float aspectRatio, float fovRatio) const;
DVector3 GetViewShift(FRotator angles) const;
VSMatrix GetHUDProjection(int width, int height) const;
VSMatrix GetPlayerSpriteProjection(int width, int height) const;
2020-04-26 21:17:54 +00:00
private:
float getShift() const;
int getEye() const;
2020-04-26 21:17:54 +00:00
};
struct VRMode
{
int mEyeCount;
float mHorizontalViewportScale;
float mVerticalViewportScale;
float mWeaponProjectionScale;
VREyeInfo mEyes[2];
static const VRMode *GetVRMode(bool toscreen = true);
void AdjustViewport(DFrameBuffer *fb) const;
};