1
0
mirror of https://github.com/borgesdan/xn65 synced 2024-12-29 21:54:47 +01:00

Remove implementações em Mouse::PlatformImplementation e add SetPosition

This commit is contained in:
Danilo 2024-08-01 11:01:49 -03:00
parent 73eb32b44f
commit 1805fbca97
3 changed files with 12 additions and 26 deletions

View File

@ -16,22 +16,6 @@ namespace xna {
return mstate;
}
bool Mouse::PlatformImplementation::IsConnected() const {
return _dxMouse->IsConnected();
}
bool Mouse::PlatformImplementation::IsVisible() const {
return _dxMouse->IsVisible();
}
void Mouse::PlatformImplementation::IsVisible(bool value) const {
_dxMouse->SetVisible(value);
}
void Mouse::PlatformImplementation::ResetScrollWheel() const {
_dxMouse->ResetScrollWheelValue();
}
void Mouse::Initialize(intptr_t handle) {
impl = unew<PlatformImplementation>();
windowHandle = handle;
@ -44,4 +28,9 @@ namespace xna {
impl->_dxMouse->SetWindow(hwnd);
}
//Sets the position of the mouse cursor relative to the upper - left corner of the window.
void Mouse::SetPosition(Int x, Int y) {
SetCursorPos(x, y);
}
}

View File

@ -40,6 +40,8 @@ namespace xna {
//Mouse coordinates returned by GetState are relative to the upper-left corner of this window.
static void WindowHandle(intptr_t value);
static void SetPosition(Int x, Int y);
private:
friend class Game;
static void Initialize(intptr_t windowHandle);

View File

@ -648,16 +648,11 @@ namespace xna {
_dxMouse = unew<DirectX::Mouse>();
}
void ProcessMessage(UINT message, WPARAM wParam, LPARAM lParam) const {
inline void ProcessMessage(UINT message, WPARAM wParam, LPARAM lParam) const {
if (_dxMouse)
_dxMouse->ProcessMessage(message, wParam, lParam);
}
bool IsConnected() const;
bool IsVisible() const;
void IsVisible(bool value) const;
void ResetScrollWheel() const;
uptr<DirectX::Mouse> _dxMouse = nullptr;
};