ssolie wrote:Grzegorz Kraszewski wrote:Regarding the bitmap, on MorphOS I allocate it with BMF_DISPLAYABLE. It has an effect of bitmap data being stored in graphics card memory, so blits from it are much faster. Does the flag has the same effect on AmigaOS 4?
Generally, you shouldn't try to outsmart the graphics subsystem with flags if you can avoid it. It will store bitmaps in VRAM and swap them in and out of VRAM as needed to speed up operations. Just allocate your bitmap and make sure to specify the friend bitmap (e.g. destination Screen) correctly so the system can handle everything for you.
Supplying a friend bitmap or display ID is indeed the only way to force the bitmap to be allocated in VRAM. These items indicate which graphics card the bitmap should be on (in a multi-graphics-card system). However, bitmaps will be paged into VRAM when needed,** so it doesn't matter.
Whether a friend bitmap is supplied or not, the BMF_DISPLAYABLE should still be set for bitmaps that you want to end up in VRAM. Here's the relevant autodoc snippet:
BMF_DISPLAYABLE to specify that this bitmap data should
be allocated in such a manner that it can be displayed.
Displayable data has more severe alignment restrictions
than non-displayable data in some systems.
Having said that, using a friend bitmap or display ID is still a good idea as, that way, the allocation should fail if your bitmap is incompatible with the chosen graphics card (e.g., too big, or an unsupported pixel format).
Hans
** Unless the bitmap is in a format unsupported by the graphics card, declared as user-private, or locked. In those cases it isn't possible to move the bitmap to VRAM.