2 main improvements coming in here:
- Handling for nonstandard stride values, since some devices have
non-linear framebuffers, and the previous assumption, that
stride = width * bytesPerPixel, no longer necessarily holds true.
This distinction doesn't matter for many devices (and thus, it can
fall back to the former assumption if checking the real stride fails),
but for those where it does matter (e.g. the NVIDIA Jetson Orin Nano I
just tried it on), it does indeed make the game display correctly,
whereas it didn't before.
- Clean up the pointer math needed to center the image on screen a bit.
It was previously a bit of a mess, this version should be marginally
faster, and much easier to read/understand.