summaryrefslogtreecommitdiff
path: root/src/core/frontend/framebuffer_layout.h
diff options
context:
space:
mode:
authorGravatar bunnei2020-02-17 22:02:18 -0500
committerGravatar GitHub2020-02-17 22:02:18 -0500
commit72d4c6fee0eed8bad5686f1db6043446900020d9 (patch)
tree70114ee835cd2e666290a678742d164ffe7fdd3f /src/core/frontend/framebuffer_layout.h
parentMerge pull request #3429 from brianclinkenbeard/fix-cmake-sdl2-arch (diff)
parentAdd 4:3 aspect ratio and address feedback (diff)
downloadyuzu-72d4c6fee0eed8bad5686f1db6043446900020d9.tar.gz
yuzu-72d4c6fee0eed8bad5686f1db6043446900020d9.tar.xz
yuzu-72d4c6fee0eed8bad5686f1db6043446900020d9.zip
Merge pull request #3412 from Morph1984/aspect-ratio
GUI: Add aspect ratio dropdown
Diffstat (limited to 'src/core/frontend/framebuffer_layout.h')
-rw-r--r--src/core/frontend/framebuffer_layout.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/core/frontend/framebuffer_layout.h b/src/core/frontend/framebuffer_layout.h
index d2370adde..1d39c1faf 100644
--- a/src/core/frontend/framebuffer_layout.h
+++ b/src/core/frontend/framebuffer_layout.h
@@ -18,6 +18,13 @@ enum ScreenDocked : u32 {
18 HeightDocked = 1080, 18 HeightDocked = 1080,
19}; 19};
20 20
21enum class AspectRatio {
22 Default,
23 R4_3,
24 R21_9,
25 StretchToWindow,
26};
27
21/// Describes the layout of the window framebuffer 28/// Describes the layout of the window framebuffer
22struct FramebufferLayout { 29struct FramebufferLayout {
23 u32 width{ScreenUndocked::Width}; 30 u32 width{ScreenUndocked::Width};
@@ -48,4 +55,12 @@ FramebufferLayout DefaultFrameLayout(u32 width, u32 height);
48 */ 55 */
49FramebufferLayout FrameLayoutFromResolutionScale(u32 res_scale); 56FramebufferLayout FrameLayoutFromResolutionScale(u32 res_scale);
50 57
58/**
59 * Convenience method to determine emulation aspect ratio
60 * @param aspect Represents the index of aspect ratio stored in Settings::values.aspect_ratio
61 * @param window_aspect_ratio Current window aspect ratio
62 * @return Emulation render window aspect ratio
63 */
64float EmulationAspectRatio(AspectRatio aspect, float window_aspect_ratio);
65
51} // namespace Layout 66} // namespace Layout