diff options
Diffstat (limited to 'src/core/frontend/framebuffer_layout.h')
| -rw-r--r-- | src/core/frontend/framebuffer_layout.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/core/frontend/framebuffer_layout.h b/src/core/frontend/framebuffer_layout.h new file mode 100644 index 000000000..9a7738969 --- /dev/null +++ b/src/core/frontend/framebuffer_layout.h | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | // Copyright 2016 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include "common/math_util.h" | ||
| 8 | |||
| 9 | namespace Layout { | ||
| 10 | |||
| 11 | /// Describes the layout of the window framebuffer (size and top/bottom screen positions) | ||
| 12 | struct FramebufferLayout { | ||
| 13 | unsigned width; | ||
| 14 | unsigned height; | ||
| 15 | bool top_screen_enabled; | ||
| 16 | bool bottom_screen_enabled; | ||
| 17 | MathUtil::Rectangle<unsigned> top_screen; | ||
| 18 | MathUtil::Rectangle<unsigned> bottom_screen; | ||
| 19 | |||
| 20 | /** | ||
| 21 | * Returns the ration of pixel size of the top screen, compared to the native size of the 3DS | ||
| 22 | * screen. | ||
| 23 | */ | ||
| 24 | float GetScalingRatio() const; | ||
| 25 | }; | ||
| 26 | |||
| 27 | /** | ||
| 28 | * Factory method for constructing a default FramebufferLayout | ||
| 29 | * @param width Window framebuffer width in pixels | ||
| 30 | * @param height Window framebuffer height in pixels | ||
| 31 | * @param is_swapped if true, the bottom screen will be displayed above the top screen | ||
| 32 | * @return Newly created FramebufferLayout object with default screen regions initialized | ||
| 33 | */ | ||
| 34 | FramebufferLayout DefaultFrameLayout(unsigned width, unsigned height, bool is_swapped); | ||
| 35 | |||
| 36 | /** | ||
| 37 | * Factory method for constructing a FramebufferLayout with only the top or bottom screen | ||
| 38 | * @param width Window framebuffer width in pixels | ||
| 39 | * @param height Window framebuffer height in pixels | ||
| 40 | * @param is_swapped if true, the bottom screen will be displayed (and the top won't be displayed) | ||
| 41 | * @return Newly created FramebufferLayout object with default screen regions initialized | ||
| 42 | */ | ||
| 43 | FramebufferLayout SingleFrameLayout(unsigned width, unsigned height, bool is_swapped); | ||
| 44 | |||
| 45 | /** | ||
| 46 | * Factory method for constructing a Frame with the a 4x size Top screen with a 1x size bottom | ||
| 47 | * screen on the right | ||
| 48 | * This is useful in particular because it matches well with a 1920x1080 resolution monitor | ||
| 49 | * @param width Window framebuffer width in pixels | ||
| 50 | * @param height Window framebuffer height in pixels | ||
| 51 | * @param is_swapped if true, the bottom screen will be the large display | ||
| 52 | * @return Newly created FramebufferLayout object with default screen regions initialized | ||
| 53 | */ | ||
| 54 | FramebufferLayout LargeFrameLayout(unsigned width, unsigned height, bool is_swapped); | ||
| 55 | |||
| 56 | /** | ||
| 57 | * Factory method for constructing a custom FramebufferLayout | ||
| 58 | * @param width Window framebuffer width in pixels | ||
| 59 | * @param height Window framebuffer height in pixels | ||
| 60 | * @return Newly created FramebufferLayout object with default screen regions initialized | ||
| 61 | */ | ||
| 62 | FramebufferLayout CustomFrameLayout(unsigned width, unsigned height); | ||
| 63 | |||
| 64 | } // namespace Layout | ||