View Single Post
Old 27 July 2017, 13:16   #61
Registered User

Daedalus's Avatar
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 2,577
That's more or less it really. I don't know if you're a reader of Amiga Future, but these are the very topics I'm covering at the moment in the Blitz tutorial series - blitting methods and double buffering are coming up in the next issue, with scrolling, dual playfields and sprites the following issue. But the basics are:

0: n = 0
1: Draw graphics required to bitmap n
2: Wait for vertical blank
3: Display bitmap n
4: n = 1 - n ; swap n between 0 and 1
5: Goto 1

In this way, you never draw to the bitmap that's actually displayed on screen. This means you can take as long as you like drawing the next frame, and when it's ready put it on display and redraw the first one. You don't need separate screens to do this - just bitmaps, and using a variable (n in my example) means you don't have to have two separate bits of code for drawing the two frames; just Use Bitmap n and then draw as you need.

Triple buffering adds another buffer to the cycle so that your program can draw ahead without waiting for the second buffer to become displayed. But this is of limited use for typical Amiga games which generally run in sync with the vertical blank. Alternatively (and I think this is what idrougge is talking about), a third bitmap can be used to provide "fill-in" data when QBlit is used - sections of the third bitmap are copied back to the currently used bitmap when shapes are erased and re-blitted. This is similar to a buffered blit but gives you a bit more control.

Last edited by Daedalus; 27 July 2017 at 13:27.
Daedalus is offline  
AdSense AdSense  
Page generated in 0.05662 seconds with 10 queries