gopxl / pixel

A hand-crafted 2D game library in Go.
MIT License
242 stars 10 forks source link

Input handler internal #86

Closed bhperry closed 4 months ago

bhperry commented 4 months ago

Moving the InputHandler to backends/internal package. This accomplishes a couple things

Embedding InputHandler directly in Window rather than using a pointer. Since the handler is never accessed outside of Window, there is no reason for it to be a pointer. This gives a 17-20% increase in access speed according to benchmarks.

Moved the JoystickState struct into the internal package to further differentiate between opengl package specifics and generic backend utilities.