diff options
| author | 2017-05-27 16:10:25 -0700 | |
|---|---|---|
| committer | 2017-05-27 16:10:25 -0700 | |
| commit | d1bf7919daf830befd8c2166f3844fcdb56d68fa (patch) | |
| tree | 60ab4434e7a0503d7ca5f5d195d4709fe634f3c1 /src/core/frontend/framebuffer_layout.h | |
| parent | Merge pull request #2732 from yuriks/add-fmt (diff) | |
| download | yuzu-d1bf7919daf830befd8c2166f3844fcdb56d68fa.tar.gz yuzu-d1bf7919daf830befd8c2166f3844fcdb56d68fa.tar.xz yuzu-d1bf7919daf830befd8c2166f3844fcdb56d68fa.zip | |
Move framebuffer_layout from Common to Core
This removes a dependency inversion between core and common. It's also
the proper place for the file since it makes screen layout decisions
specific to the 3DS.
Diffstat (limited to 'src/core/frontend/framebuffer_layout.h')
| -rw-r--r-- | src/core/frontend/framebuffer_layout.h | 55 |
1 files changed, 55 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..f1df5c55a --- /dev/null +++ b/src/core/frontend/framebuffer_layout.h | |||
| @@ -0,0 +1,55 @@ | |||
| 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 | namespace Layout { | ||
| 9 | /// Describes the layout of the window framebuffer (size and top/bottom screen positions) | ||
| 10 | struct FramebufferLayout { | ||
| 11 | unsigned width; | ||
| 12 | unsigned height; | ||
| 13 | bool top_screen_enabled; | ||
| 14 | bool bottom_screen_enabled; | ||
| 15 | MathUtil::Rectangle<unsigned> top_screen; | ||
| 16 | MathUtil::Rectangle<unsigned> bottom_screen; | ||
| 17 | }; | ||
| 18 | |||
| 19 | /** | ||
| 20 | * Factory method for constructing a default FramebufferLayout | ||
| 21 | * @param width Window framebuffer width in pixels | ||
| 22 | * @param height Window framebuffer height in pixels | ||
| 23 | * @param is_swapped if true, the bottom screen will be displayed above the top screen | ||
| 24 | * @return Newly created FramebufferLayout object with default screen regions initialized | ||
| 25 | */ | ||
| 26 | FramebufferLayout DefaultFrameLayout(unsigned width, unsigned height, bool is_swapped); | ||
| 27 | |||
| 28 | /** | ||
| 29 | * Factory method for constructing a FramebufferLayout with only the top or bottom screen | ||
| 30 | * @param width Window framebuffer width in pixels | ||
| 31 | * @param height Window framebuffer height in pixels | ||
| 32 | * @param is_swapped if true, the bottom screen will be displayed (and the top won't be displayed) | ||
| 33 | * @return Newly created FramebufferLayout object with default screen regions initialized | ||
| 34 | */ | ||
| 35 | FramebufferLayout SingleFrameLayout(unsigned width, unsigned height, bool is_swapped); | ||
| 36 | |||
| 37 | /** | ||
| 38 | * Factory method for constructing a Frame with the a 4x size Top screen with a 1x size bottom | ||
| 39 | * screen on the right | ||
| 40 | * This is useful in particular because it matches well with a 1920x1080 resolution monitor | ||
| 41 | * @param width Window framebuffer width in pixels | ||
| 42 | * @param height Window framebuffer height in pixels | ||
| 43 | * @param is_swapped if true, the bottom screen will be the large display | ||
| 44 | * @return Newly created FramebufferLayout object with default screen regions initialized | ||
| 45 | */ | ||
| 46 | FramebufferLayout LargeFrameLayout(unsigned width, unsigned height, bool is_swapped); | ||
| 47 | |||
| 48 | /** | ||
| 49 | * Factory method for constructing a custom FramebufferLayout | ||
| 50 | * @param width Window framebuffer width in pixels | ||
| 51 | * @param height Window framebuffer height in pixels | ||
| 52 | * @return Newly created FramebufferLayout object with default screen regions initialized | ||
| 53 | */ | ||
| 54 | FramebufferLayout CustomFrameLayout(unsigned width, unsigned height); | ||
| 55 | } | ||