From 2b1654ad9bbd8af53f22434d350704a1a1d0a285 Mon Sep 17 00:00:00 2001 From: James Rowe Date: Tue, 3 May 2016 00:07:17 -0600 Subject: Support additional screen layouts. Allows users to choose a single screen layout or a large screen layout. Adds a configuration option to change the prominent screen. --- src/common/emu_window.h | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) (limited to 'src/common/emu_window.h') diff --git a/src/common/emu_window.h b/src/common/emu_window.h index 67df63e06..6fac572f5 100644 --- a/src/common/emu_window.h +++ b/src/common/emu_window.h @@ -7,6 +7,7 @@ #include #include #include "common/common_types.h" +#include "common/framebuffer_layout.h" #include "common/math_util.h" #include "core/hle/service/hid/hid.h" @@ -38,23 +39,6 @@ public: std::pair min_client_area_size; }; - /// Describes the layout of the window framebuffer (size and top/bottom screen positions) - struct FramebufferLayout { - - /** - * Factory method for constructing a default 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 - */ - static FramebufferLayout DefaultScreenLayout(unsigned width, unsigned height); - - unsigned width; - unsigned height; - MathUtil::Rectangle top_screen; - MathUtil::Rectangle bottom_screen; - }; - /// Swap buffers to display the next frame virtual void SwapBuffers() = 0; @@ -211,10 +195,16 @@ public: * Gets the framebuffer layout (width, height, and screen regions) * @note This method is thread-safe */ - const FramebufferLayout& GetFramebufferLayout() const { + const Layout::FramebufferLayout& GetFramebufferLayout() const { return framebuffer_layout; } + /** + * Convenience method to update the VideoCore EmuWindow + * Read from the current settings to determine which layout to use. + */ + void UpdateCurrentFramebufferLayout(unsigned width, unsigned height); + protected: EmuWindow() { // TODO: Find a better place to set this. @@ -250,7 +240,7 @@ protected: * Update framebuffer layout with the given parameter. * @note EmuWindow implementations will usually use this in window resize event handlers. */ - void NotifyFramebufferLayoutChanged(const FramebufferLayout& layout) { + void NotifyFramebufferLayoutChanged(const Layout::FramebufferLayout& layout) { framebuffer_layout = layout; } @@ -274,7 +264,7 @@ private: // By default, ignore this request and do nothing. } - FramebufferLayout framebuffer_layout; ///< Current framebuffer layout + Layout::FramebufferLayout framebuffer_layout; ///< Current framebuffer layout unsigned client_area_width; ///< Current client width, should be set by window impl. unsigned client_area_height; ///< Current client height, should be set by window impl. -- cgit v1.2.3