|
|
@ -23,38 +23,38 @@ public: |
|
|
explicit EmuWindow_SDL2(InputCommon::InputSubsystem* input_subsystem); |
|
|
explicit EmuWindow_SDL2(InputCommon::InputSubsystem* input_subsystem); |
|
|
~EmuWindow_SDL2(); |
|
|
~EmuWindow_SDL2(); |
|
|
|
|
|
|
|
|
/// Polls window events |
|
|
|
|
|
void PollEvents() override; |
|
|
|
|
|
|
|
|
|
|
|
/// Whether the window is still open, and a close request hasn't yet been sent |
|
|
/// Whether the window is still open, and a close request hasn't yet been sent |
|
|
bool IsOpen() const; |
|
|
bool IsOpen() const; |
|
|
|
|
|
|
|
|
/// Returns if window is shown (not minimized) |
|
|
/// Returns if window is shown (not minimized) |
|
|
bool IsShown() const override; |
|
|
bool IsShown() const override; |
|
|
|
|
|
|
|
|
|
|
|
/// Wait for the next event on the main thread. |
|
|
|
|
|
void WaitEvent(); |
|
|
|
|
|
|
|
|
protected: |
|
|
protected: |
|
|
/// Called by PollEvents when a key is pressed or released. |
|
|
|
|
|
|
|
|
/// Called by WaitEvent when a key is pressed or released. |
|
|
void OnKeyEvent(int key, u8 state); |
|
|
void OnKeyEvent(int key, u8 state); |
|
|
|
|
|
|
|
|
/// Called by PollEvents when the mouse moves. |
|
|
|
|
|
|
|
|
/// Called by WaitEvent when the mouse moves. |
|
|
void OnMouseMotion(s32 x, s32 y); |
|
|
void OnMouseMotion(s32 x, s32 y); |
|
|
|
|
|
|
|
|
/// Called by PollEvents when a mouse button is pressed or released |
|
|
|
|
|
|
|
|
/// Called by WaitEvent when a mouse button is pressed or released |
|
|
void OnMouseButton(u32 button, u8 state, s32 x, s32 y); |
|
|
void OnMouseButton(u32 button, u8 state, s32 x, s32 y); |
|
|
|
|
|
|
|
|
/// Translates pixel position (0..1) to pixel positions |
|
|
/// Translates pixel position (0..1) to pixel positions |
|
|
std::pair<unsigned, unsigned> TouchToPixelPos(float touch_x, float touch_y) const; |
|
|
std::pair<unsigned, unsigned> TouchToPixelPos(float touch_x, float touch_y) const; |
|
|
|
|
|
|
|
|
/// Called by PollEvents when a finger starts touching the touchscreen |
|
|
|
|
|
|
|
|
/// Called by WaitEvent when a finger starts touching the touchscreen |
|
|
void OnFingerDown(float x, float y); |
|
|
void OnFingerDown(float x, float y); |
|
|
|
|
|
|
|
|
/// Called by PollEvents when a finger moves while touching the touchscreen |
|
|
|
|
|
|
|
|
/// Called by WaitEvent when a finger moves while touching the touchscreen |
|
|
void OnFingerMotion(float x, float y); |
|
|
void OnFingerMotion(float x, float y); |
|
|
|
|
|
|
|
|
/// Called by PollEvents when a finger stops touching the touchscreen |
|
|
|
|
|
|
|
|
/// Called by WaitEvent when a finger stops touching the touchscreen |
|
|
void OnFingerUp(); |
|
|
void OnFingerUp(); |
|
|
|
|
|
|
|
|
/// Called by PollEvents when any event that may cause the window to be resized occurs |
|
|
|
|
|
|
|
|
/// Called by WaitEvent when any event that may cause the window to be resized occurs |
|
|
void OnResize(); |
|
|
void OnResize(); |
|
|
|
|
|
|
|
|
/// Called when user passes the fullscreen parameter flag |
|
|
/// Called when user passes the fullscreen parameter flag |
|
|
|