diff options
| author | 2014-10-12 18:14:57 +0200 | |
|---|---|---|
| committer | 2014-11-18 13:09:01 +0100 | |
| commit | bd8f491e4c08e9b9a7b852de0b50c144da8ac8c8 (patch) | |
| tree | b1f350a3506289263c3652f46946baf267cb27f8 /src/common | |
| parent | Viewport scaling and display density independence (diff) | |
| download | yuzu-bd8f491e4c08e9b9a7b852de0b50c144da8ac8c8.tar.gz yuzu-bd8f491e4c08e9b9a7b852de0b50c144da8ac8c8.tar.xz yuzu-bd8f491e4c08e9b9a7b852de0b50c144da8ac8c8.zip | |
Fixup EmuWindow interface and implementations thereof.
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/emu_window.h | 61 |
1 files changed, 33 insertions, 28 deletions
diff --git a/src/common/emu_window.h b/src/common/emu_window.h index ba9d4fa76..72c40c6a4 100644 --- a/src/common/emu_window.h +++ b/src/common/emu_window.h | |||
| @@ -43,54 +43,59 @@ public: | |||
| 43 | static void KeyReleased(KeyMap::HostDeviceKey key); | 43 | static void KeyReleased(KeyMap::HostDeviceKey key); |
| 44 | 44 | ||
| 45 | WindowConfig GetConfig() const { | 45 | WindowConfig GetConfig() const { |
| 46 | return m_config; | 46 | return config; |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | void SetConfig(const WindowConfig& val) { | 49 | void SetConfig(const WindowConfig& val) { |
| 50 | m_config = val; | 50 | config = val; |
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | /// Gets the size of the window in pixels | 53 | /** |
| 54 | virtual void GetFramebufferSize(int* fbWidth, int* fbHeight) = 0; | 54 | * Gets the size of the framebuffer in pixels |
| 55 | 55 | */ | |
| 56 | int GetClientAreaWidth() const { | 56 | const std::pair<unsigned,unsigned> GetFramebufferSize() const { |
| 57 | return m_client_area_width; | 57 | return framebuffer_size; |
| 58 | } | ||
| 59 | |||
| 60 | void SetClientAreaWidth(const int val) { | ||
| 61 | m_client_area_width = val; | ||
| 62 | } | 58 | } |
| 63 | 59 | ||
| 64 | int GetClientAreaHeight() const { | 60 | /** |
| 65 | return m_client_area_height; | 61 | * Gets window client area width in logical coordinates |
| 62 | */ | ||
| 63 | std::pair<unsigned,unsigned> GetClientAreaSize() const { | ||
| 64 | return std::make_pair(client_area_width, client_area_height); | ||
| 66 | } | 65 | } |
| 67 | 66 | ||
| 68 | void SetClientAreaHeight(const int val) { | 67 | std::string GetWindowTitle() const { |
| 69 | m_client_area_height = val; | 68 | return window_title; |
| 70 | } | 69 | } |
| 71 | 70 | ||
| 72 | std::string GetWindowTitle() const { | 71 | void SetWindowTitle(const std::string& val) { |
| 73 | return m_window_title; | 72 | window_title = val; |
| 74 | } | ||
| 75 | |||
| 76 | void SetWindowTitle(std::string val) { | ||
| 77 | m_window_title = val; | ||
| 78 | } | 73 | } |
| 79 | 74 | ||
| 80 | protected: | 75 | protected: |
| 81 | EmuWindow(): | 76 | EmuWindow() : // TODO: What the hell... -.- - don't hardcode dimensions here without applying them in a sensible manner... |
| 82 | m_window_title(Common::StringFromFormat("Citra | %s-%s", Common::g_scm_branch, Common::g_scm_desc)), | 77 | window_title(Common::StringFromFormat("Citra | %s-%s", Common::g_scm_branch, Common::g_scm_desc)) |
| 83 | m_client_area_width(640), | 78 | m_client_area_width(640), |
| 84 | m_client_area_height(480) | 79 | m_client_area_height(480), |
| 85 | {} | 80 | {} |
| 86 | virtual ~EmuWindow() {} | 81 | virtual ~EmuWindow() {} |
| 87 | 82 | ||
| 88 | std::string m_window_title; ///< Current window title, should be used by window impl. | 83 | std::pair<unsigned,unsigned> NotifyFramebufferSizeChanged(const std::pair<unsigned,unsigned>& size) { |
| 84 | framebuffer_size = size; | ||
| 85 | } | ||
| 89 | 86 | ||
| 90 | int m_client_area_width; ///< Current client width, should be set by window impl. | 87 | void NotifyClientAreaSizeChanged(std::pair<unsigned,unsigned> size) { |
| 91 | int m_client_area_height; ///< Current client height, should be set by window impl. | 88 | client_area_width = size.first; |
| 89 | client_area_height = size.second; | ||
| 90 | } | ||
| 92 | 91 | ||
| 93 | private: | 92 | private: |
| 94 | WindowConfig m_config; ///< Internal configuration | 93 | std::string window_title; ///< Current window title, should be used by window impl. |
| 94 | |||
| 95 | std::pair<unsigned,unsigned> framebuffer_size; | ||
| 96 | |||
| 97 | unsigned client_area_width; ///< Current client width, should be set by window impl. | ||
| 98 | unsigned client_area_height; ///< Current client height, should be set by window impl. | ||
| 95 | 99 | ||
| 100 | WindowConfig config; ///< Internal configuration | ||
| 96 | }; | 101 | }; |