add mouse wheel support

main 0.1.0
cosmonaut 2021-03-26 12:20:05 -07:00
parent 3b83eb41da
commit 681e620477
2 changed files with 8 additions and 0 deletions

View File

@ -82,6 +82,8 @@ namespace MoonWorks
{
while (accumulator >= timestep)
{
Inputs.Mouse.Wheel = 0;
HandleSDLEvents();
Inputs.Update();
@ -112,6 +114,10 @@ namespace MoonWorks
case SDL.SDL_EventType.SDL_TEXTINPUT:
HandleTextInput(_event);
break;
case SDL.SDL_EventType.SDL_MOUSEWHEEL:
Inputs.Mouse.Wheel += _event.wheel.y;
break;
}
}
}

View File

@ -13,6 +13,8 @@ namespace MoonWorks.Input
public int DeltaX { get; private set; }
public int DeltaY { get; private set; }
public int Wheel { get; internal set; }
private bool relativeMode;
public bool RelativeMode
{