Here I come with my first question: In my 2D platformer game I would like to have multiple cameras (e.g. for split screens). I already got this working, but I'm not sure if my solution is good, so I'm asking for your advice.

So basically each camera has its own bitmap where it renders to. All these camera bitmaps are rendered to the display backbuffer in a final step.

Is this a good approach? One minor drawback of this approach is that I have to resize/recreate all camera bitmaps (almost) whenever the display resolution changes. I also have to recreate the bitmaps in order to change the size (width/height) of a camera. Is there any better way of doing this?

One minor drawback of this approach is that I have to resize/recreate all camera bitmaps (almost) whenever the display resolution changes. I also have to recreate the bitmaps in order to change the size (width/height) of a camera.

One thought would be to have a couple XY values for the bounding box of each camera, then when it comes time to render a camera, simply render to the backbuffer after making a call to al_set_clipping_rectangle(). That way, you only have to recreate the backbuffer on each display change and not every camera's bitmaps, since they would no longer require one.

One thought would be to have a couple XY values for the bounding box of each camera, then when it comes time to render a camera, simply render to the backbuffer after making a call to al_set_clipping_rectangle(). That way, you only have to recreate the backbuffer on each display change and not every camera's bitmaps, since they would no longer require one.

This works great, thanks. I have tried that before, but unfortunately I forgot to reset the clipping rectangle to the target bitmap size and this caused some rendering glitches. That was a rookie mistake, I guess.