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) while (accumulator >= timestep)
{ {
Inputs.Mouse.Wheel = 0;
HandleSDLEvents(); HandleSDLEvents();
Inputs.Update(); Inputs.Update();
@ -112,6 +114,10 @@ namespace MoonWorks
case SDL.SDL_EventType.SDL_TEXTINPUT: case SDL.SDL_EventType.SDL_TEXTINPUT:
HandleTextInput(_event); HandleTextInput(_event);
break; 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 DeltaX { get; private set; }
public int DeltaY { get; private set; } public int DeltaY { get; private set; }
public int Wheel { get; internal set; }
private bool relativeMode; private bool relativeMode;
public bool RelativeMode public bool RelativeMode
{ {