qzdoom/src/hwrenderer/utility/hw_vrmodes.h
Christoph Oelckers 491898fe2c - fixed calculation of projection matrix for weapon sprites.
- fixed color mask for green/magenta.
- fixed crash when initializing video, because it was accessing 'screen' before it was set from within the framebuffer's constructor.
2018-06-24 17:16:07 +02:00

47 lines
876 B
C++

#pragma once
#include "r_data/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,
VR_AMBERBLUE = 9,
VR_TOPBOTTOM = 11,
VR_ROWINTERLEAVED = 12,
VR_COLUMNINTERLEAVED = 13,
VR_CHECKERINTERLEAVED = 14
};
struct VREyeInfo
{
float mShiftFactor;
float mScaleFactor;
VSMatrix GetProjection(float fov, float aspectRatio, float fovRatio) const;
DVector3 GetViewShift(float yaw) const;
private:
float getShift() const;
};
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;
VSMatrix GetHUDSpriteProjection() const;
};