summaryrefslogtreecommitdiffstats
path: root/src/core/frontend/framebuffer_layout.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-01-10 04:36:07 +0100
committerbunnei <bunneidev@gmail.com>2018-01-11 05:28:43 +0100
commit482cf8a005a3c13ac7239995fdbe2e78d12984b9 (patch)
tree0e29fe56ada3a97a1f753ad68e1430e98f66e303 /src/core/frontend/framebuffer_layout.h
parentNV: Move the nv device nodes to their own directory and namespace. (diff)
downloadyuzu-482cf8a005a3c13ac7239995fdbe2e78d12984b9.tar
yuzu-482cf8a005a3c13ac7239995fdbe2e78d12984b9.tar.gz
yuzu-482cf8a005a3c13ac7239995fdbe2e78d12984b9.tar.bz2
yuzu-482cf8a005a3c13ac7239995fdbe2e78d12984b9.tar.lz
yuzu-482cf8a005a3c13ac7239995fdbe2e78d12984b9.tar.xz
yuzu-482cf8a005a3c13ac7239995fdbe2e78d12984b9.tar.zst
yuzu-482cf8a005a3c13ac7239995fdbe2e78d12984b9.zip
Diffstat (limited to '')
-rw-r--r--src/core/frontend/framebuffer_layout.h66
1 files changed, 14 insertions, 52 deletions
diff --git a/src/core/frontend/framebuffer_layout.h b/src/core/frontend/framebuffer_layout.h
index 4983cf103..b06999e1b 100644
--- a/src/core/frontend/framebuffer_layout.h
+++ b/src/core/frontend/framebuffer_layout.h
@@ -1,4 +1,4 @@
-// Copyright 2016 Citra Emulator Project
+// Copyright 2018 Yuzu Emulator Team
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
@@ -8,68 +8,30 @@
namespace Layout {
-/// Describes the layout of the window framebuffer (size and top/bottom screen positions)
+enum ScreenUndocked : unsigned { Width = 1280, Height = 720 };
+
+/// Describes the layout of the window framebuffer
struct FramebufferLayout {
- unsigned width;
- unsigned height;
- bool top_screen_enabled;
- bool bottom_screen_enabled;
- MathUtil::Rectangle<unsigned> top_screen;
- MathUtil::Rectangle<unsigned> bottom_screen;
+ unsigned width{ScreenUndocked::Width};
+ unsigned height{ScreenUndocked::Height};
+
+ MathUtil::Rectangle<unsigned> screen;
/**
- * Returns the ration of pixel size of the top screen, compared to the native size of the 3DS
- * screen.
+ * Returns the ration of pixel size of the screen, compared to the native size of the undocked
+ * Switch screen.
*/
- float GetScalingRatio() const;
+ float GetScalingRatio() const {
+ return static_cast<float>(screen.GetWidth()) / ScreenUndocked::Width;
+ }
};
/**
* Factory method for constructing a default FramebufferLayout
* @param width Window framebuffer width in pixels
* @param height Window framebuffer height in pixels
- * @param is_swapped if true, the bottom screen will be displayed above the top screen
- * @return Newly created FramebufferLayout object with default screen regions initialized
- */
-FramebufferLayout DefaultFrameLayout(unsigned width, unsigned height, bool is_swapped);
-
-/**
- * Factory method for constructing a FramebufferLayout with only the top or bottom screen
- * @param width Window framebuffer width in pixels
- * @param height Window framebuffer height in pixels
- * @param is_swapped if true, the bottom screen will be displayed (and the top won't be displayed)
- * @return Newly created FramebufferLayout object with default screen regions initialized
- */
-FramebufferLayout SingleFrameLayout(unsigned width, unsigned height, bool is_swapped);
-
-/**
- * Factory method for constructing a Frame with the a 4x size Top screen with a 1x size bottom
- * screen on the right
- * This is useful in particular because it matches well with a 1920x1080 resolution monitor
- * @param width Window framebuffer width in pixels
- * @param height Window framebuffer height in pixels
- * @param is_swapped if true, the bottom screen will be the large display
- * @return Newly created FramebufferLayout object with default screen regions initialized
- */
-FramebufferLayout LargeFrameLayout(unsigned width, unsigned height, bool is_swapped);
-
-/**
-* Factory method for constructing a Frame with the Top screen and bottom
-* screen side by side
-* This is useful for devices with small screens, like the GPDWin
-* @param width Window framebuffer width in pixels
-* @param height Window framebuffer height in pixels
-* @param is_swapped if true, the bottom screen will be the left display
-* @return Newly created FramebufferLayout object with default screen regions initialized
-*/
-FramebufferLayout SideFrameLayout(unsigned width, unsigned height, bool is_swapped);
-
-/**
- * Factory method for constructing a custom FramebufferLayout
- * @param width Window framebuffer width in pixels
- * @param height Window framebuffer height in pixels
* @return Newly created FramebufferLayout object with default screen regions initialized
*/
-FramebufferLayout CustomFrameLayout(unsigned width, unsigned height);
+FramebufferLayout DefaultFrameLayout(unsigned width, unsigned height);
} // namespace Layout