Unit 'Intuition' Package
[Overview][Constants][Types][Procedures and functions][Variables][Index] [#aros]

AllocScreenBuffer

Get a ScreenBuffer for double-buffering.

Declaration

Source position: intuition.pas line 3308

function AllocScreenBuffer(

  Screen: PScreen;

  Bitmap: PBitMap;

  Flags: LongWord

):PScreenBuffer;

Arguments

Screen

  

A pointer to the screen to double-buffer

Bitmap

  

For CUSTOMBITMAP_f screens, you may pre-allocate a BitMap matching the screen's BitMap's properties, and pass that in, to get a ScreenBuffer referring to that BitMap. Set this parameter to nil if you'd prefer that Intuition allocate the alternate buffer. This parameter must be nil for non-CUSTOMBITMAP_f screens.

Flags

  

Flags see list SB_*

Function result

Pointer to a valid ScreenBuffer structure, or nil if failure. You may render into the resulting BitMap as appropriate. You may use the TScreenBuffer.sb_DBufInfo field to access graphics.library ViewPort-buffering features such as learning when it is safe to reuse the previous BitMap. If not, you risk writing into the on-screen BitMap, which can damage menu or gadget rendering!

Description

Allocates a ScreenBuffer structure and usually a BitMap. This structure can be used for double (or multiple) buffering in Intuition screens. You may use this call to obtain a ScreenBuffer structure for the screen's initial BitMap, or for other BitMaps you intend to swap in.

AllocScreenBuffer() also allocates a graphics.library DBufInfo structure. The ScreenBuffer structure this call returns contains a pointer to that TDBufInfo structure, which is free for your use. See AllocDBufInfo() for full details on using this structure to achieve notification of when it is safe to render into an old buffer and when it is right to switch again.

Flags:

SB_SCREEN_BITMAP
to get a ScreenBuffer referring to the screen's actual BitMap. (For CUSTOMBITMAP screens, just set the BitMap parameter to the BitMap you passed to OpenScreen()).
SB_COPY_BITMAP
If you would like the screen's BitMap copied into this ScreenBuffer's BitMap. This is required to get any menu-bar or gadget imagery into each ScreenBuffer's BitMap. If the screen has no Intuition rendering, you may omit this flag. Also, when allocating a ScreenBuffer for the screen's initial BitMap, this flag should not be set.

See also

FreeScreenBuffer

  

Free a ScreenBuffer structure.

ChangeScreenBuffer

  

Swap the screen's BitMap.

AllocDBufInfo

  

Allocate structure for multi-buffered animation

ChangeVPBitMap

  

Change display memory address for multi-buffered animation


Documentation generated on: 2021-07-30