Hey all you Allegro guys! You may or may not have a problem in your project where it seems to flicker – this is casue by it attempting to clear and redraw the screen a hojillion times per second. We can solve this using a technique known as double buffering. Remember how we were drawing directly to the magical “screen” bitmap before? We set up another bitmap, the same SIZE as the screen, and draw onto that instead – and then once every frame we copy that bitmap to the screen. That way we don’t redraw the screen more times than necessary. Ready? Let’s begin!
If we’re going to write a video game, or a program of any sort, we’ll need to look into some of the tools of the trade. I’ve worked in several different environments, and you are going to end up doing the same (trust me), but for now I’m going to pick out two specifically that I’ve grown strikingly familiar with. If you install either of these two you’ll be able to follow along fairly easily with the tutorials I give, although I’ll be descriptive enough that with some finesse you can work in whichever you like. So, if you have your favorite programming environment set up, you can probably skip most of this post and come back toward the end.