11 #include "Resolution.h" 12 #include "rendering/RenderSystem.h" 13 #include "threads/CriticalSection.h" 14 #include "utils/ColorUtils.h" 15 #include "utils/Geometry.h" 16 #include "utils/TransformMatrix.h" 24 #include "ServiceBroker.h" 25 #include "WinSystem.h" 27 #define D3DPRESENTFLAG_INTERLACED 1 28 #define D3DPRESENTFLAG_WIDESCREEN 2 29 #define D3DPRESENTFLAG_PROGRESSIVE 4 30 #define D3DPRESENTFLAG_MODE3DSBS 8 31 #define D3DPRESENTFLAG_MODE3DTB 16 34 #define D3DPRESENTFLAG_MODEMASK ( D3DPRESENTFLAG_INTERLACED \ 35 | D3DPRESENTFLAG_MODE3DSBS \ 36 | D3DPRESENTFLAG_MODE3DTB ) 38 enum VIEW_TYPE { VIEW_TYPE_NONE = 0,
52 enum AdjustRefreshRate
54 ADJUST_REFRESHRATE_OFF = 0,
55 ADJUST_REFRESHRATE_ALWAYS,
56 ADJUST_REFRESHRATE_ON_STARTSTOP,
57 ADJUST_REFRESHRATE_ON_START,
68 void SetFPS(
float fps);
69 float GetDisplayLatency()
const;
70 bool IsFullScreenRoot()
const;
71 void ToggleFullScreen();
72 void SetFullScreenVideo(
bool bOnOff);
73 bool IsFullScreenVideo()
const;
74 bool IsValidResolution(RESOLUTION res);
75 void SetVideoResolution(RESOLUTION res,
bool forceUpdate);
76 void ApplyModeChange(RESOLUTION res);
77 void ApplyWindowResize(
int newWidth,
int newHeight);
78 RESOLUTION GetVideoResolution()
const;
83 void Flip(
bool rendered,
bool videoLayer);
87 int GetHeight()
const;
88 bool SetViewPort(
float fx,
float fy ,
float fwidth,
float fheight,
bool intersectPrevious =
false);
89 void RestoreViewPort();
90 void SetScissors(
const CRect &rect);
92 const CRect &GetScissors()
const;
93 const CRect GetViewWindow()
const;
94 void SetViewWindow(
float left,
float top,
float right,
float bottom);
95 bool IsCalibrating()
const;
96 void SetCalibrating(
bool bOnOff);
97 void ResetOverscan(RESOLUTION res,
OVERSCAN &overscan);
99 void ResetScreenParameters(RESOLUTION res);
100 void CaptureStateBlock();
101 void ApplyStateBlock();
102 void Clear(UTILS::COLOR::Color color = 0);
103 void GetAllowedResolutions(std::vector<RESOLUTION> &res);
115 float GetScalingPixelRatio()
const;
116 void InvertFinalCoords(
float &x,
float &y)
const;
117 float ScaleFinalXCoord(
float x,
float y)
const;
118 float ScaleFinalYCoord(
float x,
float y)
const;
119 float ScaleFinalZCoord(
float x,
float y)
const;
120 void ScaleFinalCoords(
float &x,
float &y,
float &z)
const;
121 bool RectIsAngled(
float x1,
float y1,
float x2,
float y2)
const;
123 float GetGUIScaleX()
const;
124 float GetGUIScaleY()
const;
125 UTILS::COLOR::Color MergeAlpha(UTILS::COLOR::Color color)
const;
126 UTILS::COLOR::Color MergeColor(UTILS::COLOR::Color color)
const;
127 void SetOrigin(
float x,
float y);
128 void RestoreOrigin();
129 void SetCameraPosition(
const CPoint &camera);
130 void SetStereoView(RENDER_STEREO_VIEW view);
131 RENDER_STEREO_VIEW GetStereoView() {
return m_stereoView; }
132 void SetStereoMode(RENDER_STEREO_MODE mode) { m_nextStereoMode = mode; }
133 RENDER_STEREO_MODE GetStereoMode() {
return m_stereoMode; }
134 void RestoreCameraPosition();
135 void SetStereoFactor(
float factor);
136 void RestoreStereoFactor();
163 void RestoreClipRegion();
165 CRect GetClipRegion();
166 void AddGUITransform();
169 void SetTransform(
const TransformMatrix &matrix,
float scaleX,
float scaleY);
170 void RemoveTransform();
173 CRect StereoCorrection(
const CRect &rect)
const;
179 const std::string& GetMediaDir()
const;
180 void SetMediaDir(
const std::string& strMediaDir);
182 void SetTransferPQ(
bool PQ) { m_isTransferPQ = PQ; }
183 bool IsTransferPQ()
const {
return m_isTransferPQ; }
187 void UpdateCameraPosition(
const CPoint &camera,
const float &factor);
188 void SetVideoResolutionInternal(RESOLUTION res,
bool forceUpdate);
189 void ApplyVideoResolution(RESOLUTION res);
190 void UpdateInternalStateWithResolution(RESOLUTION res);
192 int m_iScreenHeight = 576;
193 int m_iScreenWidth = 720;
194 std::string m_strMediaDir;
196 bool m_bFullScreenRoot =
true;
197 bool m_bFullScreenVideo =
false;
198 bool m_bCalibrating =
false;
199 RESOLUTION m_Resolution = RES_INVALID;
200 float m_fFPSOverride = 0.0f;
203 std::stack<CPoint> m_cameras;
204 std::stack<CPoint> m_origins;
205 std::stack<CRect> m_clipRegions;
206 std::stack<float> m_stereoFactors;
207 std::stack<CRect> m_viewStack;
215 : matrix(m), scaleX(sX), scaleY(sY)
221 scaleX = scaleY = 1.0f;
231 std::stack<UITransform> m_transforms;
232 RENDER_STEREO_VIEW m_stereoView = RENDER_STEREO_VIEW_OFF;
233 RENDER_STEREO_MODE m_stereoMode = RENDER_STEREO_MODE_OFF;
234 RENDER_STEREO_MODE m_nextStereoMode = RENDER_STEREO_MODE_OFF;
236 bool m_isTransferPQ{
false};
void SetRenderingResolution(const RESOLUTION_INFO &res, bool needsScaling)
Sets scaling up for rendering.
Definition: GraphicContext.cpp:733
Provide info of a resolution.
Definition: Resolution.h:66
Definition: Resolution.h:26
void SetScalingResolution(const RESOLUTION_INFO &res, bool needsScaling)
Sets scaling up for skin loading etc.
Definition: GraphicContext.cpp:708
Definition: GraphicContext.h:210
bool SetClipRegion(float x, float y, float w, float h)
Set a region in which to clip all rendering Anything that is rendered after setting a clip region wil...
Definition: GraphicContext.cpp:53
Definition: GraphicContext.h:60