diff --git a/framework/platform-dx/mouse.cpp b/framework/platform-dx/mouse.cpp index 90094fa..17c4f10 100644 --- a/framework/platform-dx/mouse.cpp +++ b/framework/platform-dx/mouse.cpp @@ -14,23 +14,7 @@ namespace xna { mstate.ScroolWheelValue = state.scrollWheelValue; 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(); @@ -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); + } } \ No newline at end of file diff --git a/inc/xna/input/mouse.hpp b/inc/xna/input/mouse.hpp index 2b8f0a3..4a9ea53 100644 --- a/inc/xna/input/mouse.hpp +++ b/inc/xna/input/mouse.hpp @@ -38,7 +38,9 @@ namespace xna { //Gets or sets the window used for mouse processing. //Mouse coordinates returned by GetState are relative to the upper-left corner of this window. - static void WindowHandle(intptr_t value); + static void WindowHandle(intptr_t value); + + static void SetPosition(Int x, Int y); private: friend class Game; diff --git a/inc/xna/xna-dx.hpp b/inc/xna/xna-dx.hpp index d10d9e4..a943583 100644 --- a/inc/xna/xna-dx.hpp +++ b/inc/xna/xna-dx.hpp @@ -645,18 +645,13 @@ namespace xna { struct Mouse::PlatformImplementation { PlatformImplementation() { - _dxMouse = unew(); + _dxMouse = unew(); } - 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 _dxMouse = nullptr; };