Amos Professional Manual  Contents  Index

Blitter Objects


Any complexities of this technique are completely automatic, so once DOUBLE BUFFER has been engaged, you can relax.

Since hardware Sprites are overlaid directly onto your television display, double buffering will hive no effect at all on any existing Sprite animations.

The double buffering system works equally well in all of the Amiga's graphics modes, and can also be used in conjunction with dual playfields. You should be aware that double buffering requires two separate areas of memory, one for the logical and one for the physical screen. So it will double the amount of memory required, for example an extra 32k will be needed for a standard 16-colour screen. This means that if you try and DOUBLE BUFFER too many screens, available memory will be exhausted.

In practice, double buffering is invaluable, and the additional memory required is well spent. It can be exploited for advanced three-dimensional routines, and is especially useful for scrolling screen effects, because the new areas of display are copied straight into the invisible background without corrupting the current display.

As an optional extra, AMOS Professional provides total control over the entire DOUBLE BUFFER system, and a full explanation may be found in the next Chapter. For a rapid insight into the effect of not using DOUBLE BUFFER, make sure you run the HELP_26 demonstration program.

That demonstration produces a horrible flickering effect. Whenever a Bob moves around the screen, the graphics beneath it are replaced at their original position. Unfortunately, since Bobs are updated at the same time as the screen images, this sort of flickering effect is generated. By including a DOUBLE BUFFER command, screens are switched after the drawing process is complete, and as explained above, the process is completely automatic.

GET BOB
instruction: grab an image from part of screen
Get Bob image,x1,x2 To x2,y2
Get Bob screen number,image,x1,y1 To x2,y2

This command grabs a selected part from the current screen and copies it straight into the Object Bank. After giving the image number to be created, set the area to be grabbed from the top left-hand corner to the bottom right-hand coordinates. If your chosen image number already exists, the existing image will be replaced by the new picture, otherwise the new picture will be added to the bank.

An optional screen number may be given immediately after the GET BOB command, allowing an image to be grabbed from a specific screen. Here is an example:

E> Curs Off : Cls 0 : Double Buffer : Flash Off
   Text 50,10, "AMOS Professional Basic!"
   Get Bob 1,50,0 To 250,20
   For B=0 To 180
    Bob 1,50,B,1
    Wait Vbl
   Next B
Back    Next
07.02.07