jsgoller1 / sprawl

2D Game Engine
GNU General Public License v3.0
0 stars 0 forks source link

Input management overhaul #48

Closed jsgoller1 closed 1 year ago

jsgoller1 commented 1 year ago

This PR addresses two issues: 1) #38 (input lag) - this PR implements the suggested solution where we keep track of what keys we've gotten an SDL_KEYDOWN event for, and releasing them after we get the corresponding SDL_KEYUP event. 2) #43 (refactoring input system) - this PR now has the input subsystem emit an opaque collection of opaque events (mouse button presses, mouse moves, and keyboard presses). Right now, we don't support keybinding or a UI, but this refactor will make that much easier.

Additionally, this breaks any dependency in the rest of the engine on SDL's use for input. We'd need to refactor out other places as well to completely break that dependency, but there's no reason to do that now (or probably ever).