games: jitter-free stepping via timerfd + clearer Snake playfield
Replace the select() timeout sleep with a Linux timerfd high-resolution timer. It fires on an absolute CLOCK_MONOTONIC deadline, so wakeups are no longer quantized to the kernel tick (a short final wait was rounded up to a whole tick, causing +-10-22ms jitter and lurches). The loop now select()s on both the X connection fd and the timer fd, so input still wakes it immediately and no busy-spin is needed -- the controls stay responsive. A select()-timeout fallback is kept for non-timerfd setups. Snake: draw a bright frame around the actual playfield so its boundary is unmistakable, and move the SCORE/BEST label down into the margin between the window frame and the playfield frame.
This commit is contained in:
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user