#Algorithm

4 posts tagged Algorithm

Easier Game Controller Input in SDL with SDL_GameController

Game controllers on computers are somewhat irritating to manage compared to a console. Has the user plugged in an XBox controller? A PS4 controller, or have they obtained some random USB controller they found on eBay?

Coping with this in SDL was difficult, with SDL just telling you “button 13 pressed” or “joystick axis 4 moved”, which is great except all your code really wants to know is “did the user just press the A button?”.

SDL_GameController fixes all this, and it needs better documentation, so this is my attempt at providing some useful information.

Text printing using bitmap characters in C++ and SDL

Back in the mists of history, sometime around the 90s it was quite common for games and demos to display text on the screen. Since we’re talking about old computers with barely any usable RAM, the text was stored as images. A giant single image with every character placed within it. To display words programmers had to be a bit inventive. That’s the topic of today’s post.