The flipping of the
buffers is performed using the flip method of the current Manager object, which you would normally
use at the end of a loop block. This will ensure that any data written to the back buffer will be displayed
successively.
mng.flip();
Part III: Extending the Possibilities
536
Upon flipping the buffers, the newly appointed back buffer will still contain the artifacts of the previous
render. Therefore, before you write the next set of graphics to the buffer, it ??™ s often best to perform a wipe
of the back buffer, first. You do this using the clear method of the Manager class, passing the color
you ??™ d like it cleared with, as represented by a hex value.
var bgColor : Int = 0x000000;
mng.clear( bgColor );
Slowing the Rate of Refresh
If you ran the previous example, you should have been presented with a small window showing a
numeric value in the top left, as shown in Figure 19 - 1 .
Figure 19-1
This value represents the current number of frames per second being drawn to the display buffer.
Pages:
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999