summaryrefslogtreecommitdiffstats
path: root/src/core/frontend/emu_window.h
diff options
context:
space:
mode:
authorwwylele <wwylele@gmail.com>2017-08-09 01:57:42 +0200
committerwwylele <wwylele@gmail.com>2017-08-24 14:00:56 +0200
commit2617de1fe6f6f1fc846a8e038e1ea77a894554b2 (patch)
tree08c5cc339ed43241359c1e0b6d7331ca69408eb4 /src/core/frontend/emu_window.h
parentHID: use TouchDevice for touch pad (diff)
downloadyuzu-2617de1fe6f6f1fc846a8e038e1ea77a894554b2.tar
yuzu-2617de1fe6f6f1fc846a8e038e1ea77a894554b2.tar.gz
yuzu-2617de1fe6f6f1fc846a8e038e1ea77a894554b2.tar.bz2
yuzu-2617de1fe6f6f1fc846a8e038e1ea77a894554b2.tar.lz
yuzu-2617de1fe6f6f1fc846a8e038e1ea77a894554b2.tar.xz
yuzu-2617de1fe6f6f1fc846a8e038e1ea77a894554b2.tar.zst
yuzu-2617de1fe6f6f1fc846a8e038e1ea77a894554b2.zip
Diffstat (limited to 'src/core/frontend/emu_window.h')
-rw-r--r--src/core/frontend/emu_window.h31
1 files changed, 5 insertions, 26 deletions
diff --git a/src/core/frontend/emu_window.h b/src/core/frontend/emu_window.h
index 7bdee251c..c10dee51b 100644
--- a/src/core/frontend/emu_window.h
+++ b/src/core/frontend/emu_window.h
@@ -4,11 +4,10 @@
#pragma once
-#include <mutex>
+#include <memory>
#include <tuple>
#include <utility>
#include "common/common_types.h"
-#include "common/math_util.h"
#include "core/frontend/framebuffer_layout.h"
/**
@@ -69,17 +68,6 @@ public:
void TouchMoved(unsigned framebuffer_x, unsigned framebuffer_y);
/**
- * Gets the current touch screen state (touch X/Y coordinates and whether or not it is pressed).
- * @note This should be called by the core emu thread to get a state set by the window thread.
- * @todo Fix this function to be thread-safe.
- * @return std::tuple of (x, y, pressed) where `x` and `y` are the touch coordinates and
- * `pressed` is true if the touch screen is currently being pressed
- */
- std::tuple<u16, u16, bool> GetTouchState() const {
- return std::make_tuple(touch_x, touch_y, touch_pressed);
- }
-
- /**
* Returns currently active configuration.
* @note Accesses to the returned object need not be consistent because it may be modified in
* another thread
@@ -113,15 +101,8 @@ public:
void UpdateCurrentFramebufferLayout(unsigned width, unsigned height);
protected:
- EmuWindow() {
- // TODO: Find a better place to set this.
- config.min_client_area_size = std::make_pair(400u, 480u);
- active_config = config;
- touch_x = 0;
- touch_y = 0;
- touch_pressed = false;
- }
- virtual ~EmuWindow() {}
+ EmuWindow();
+ virtual ~EmuWindow();
/**
* Processes any pending configuration changes from the last SetConfig call.
@@ -177,10 +158,8 @@ private:
/// ProcessConfigurationChanges)
WindowConfig active_config; ///< Internal active configuration
- bool touch_pressed; ///< True if touchpad area is currently pressed, otherwise false
-
- u16 touch_x; ///< Touchpad X-position in native 3DS pixel coordinates (0-320)
- u16 touch_y; ///< Touchpad Y-position in native 3DS pixel coordinates (0-240)
+ class TouchState;
+ std::shared_ptr<TouchState> touch_state;
/**
* Clip the provided coordinates to be inside the touchscreen area.