From 108f02e279505faef149aa5b00152f373bdc4859 Mon Sep 17 00:00:00 2001 From: Reece Mackie <20544390+Rover656@users.noreply.github.com> Date: Thu, 25 Apr 2019 18:22:33 +0100 Subject: [PATCH] Actually use mouse delta --- projects/VS2017.UWP/raylib.App.UWP/BaseApp.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/projects/VS2017.UWP/raylib.App.UWP/BaseApp.h b/projects/VS2017.UWP/raylib.App.UWP/BaseApp.h index 813840581..f46812413 100644 --- a/projects/VS2017.UWP/raylib.App.UWP/BaseApp.h +++ b/projects/VS2017.UWP/raylib.App.UWP/BaseApp.h @@ -151,7 +151,7 @@ namespace raylibUWP window->KeyDown += ref new TypedEventHandler(this, &BaseApp::OnKeyDown); window->KeyUp += ref new TypedEventHandler(this, &BaseApp::OnKeyUp); - //Windows::Devices::Input::MouseDevice::GetForCurrentView()->MouseMoved += ref new TypedEventHandler(this, &BaseApp::MouseMoved); + Windows::Devices::Input::MouseDevice::GetForCurrentView()->MouseMoved += ref new TypedEventHandler(this, &BaseApp::MouseMoved); DisplayInformation^ currentDisplayInformation = DisplayInformation::GetForCurrentView(); currentDisplayInformation->DpiChanged += ref new TypedEventHandler(this, &BaseApp::OnDpiChanged); @@ -227,7 +227,7 @@ namespace raylibUWP UWPMousePosition(x, y); } - //mouseDelta = { 0 ,0 }; + mouseDelta = { 0 ,0 }; } // Process Gamepads @@ -345,8 +345,11 @@ namespace raylibUWP UWPScrollWheel(args->CurrentPoint->Properties->MouseWheelDelta); } - //For mouse delta? - //void MouseMoved(Windows::Devices::Input::MouseDevice^ mouseDevice, Windows::Devices::Input::MouseEventArgs^ args); + void MouseMoved(Windows::Devices::Input::MouseDevice^ mouseDevice, Windows::Devices::Input::MouseEventArgs^ args) + { + mouseDelta.x += args->MouseDelta.X; + mouseDelta.y += args->MouseDelta.Y; + } void OnKeyDown(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::KeyEventArgs ^ args) {