2.14 Bitmap information

Hollywood supports two different kinds of bitmaps: Software bitmaps and hardware bitmaps. Software bitmaps, often also called device-independent bitmaps (DIBs), are bitmaps that are usually allocated in CPU memory. Hollywood will often need to read from and write to these bitmaps. That's why it's advised that they are stored in memory that the CPU can access efficiently. The downside of software bitmaps is that it is quite slow to draw them to the screen and that it's not possible to apply hardware-accelerated transformations like scaling, rotating, blending, etc. to them. This is only possible with hardware bitmaps.

Hardware bitmaps, on the other hand, are usually stored in GPU memory. They are often also called video or device-dependent bitmaps (DDBs). Hardware bitmaps are optimized for efficient blitting to the display and for hardware-accelerated transformations. Hollywood will never modify the pixels of hardware bitmaps using the CPU because this would be too slow. Instead, hardware bitmaps are uploaded to GPU memory once and then only the GPU is used to access hardware bitmaps. Only the Amiga versions of Hollywood have inbuilt support for hardware bitmaps. On all other systems hardware bitmap support is not available in Hollywood but can be provided by third party plugins by installing a display adapter using hw_SetDisplayAdapter() and setting the HWSDAFLAGS_VIDEOBITMAPADAPTER flag.

Software bitmaps always store the color and transparency channels in separate bitmaps. This is because Hollywood is still compatible with 15-bit and 16-bit screen modes which do not have enough room for an 8-bit alpha channel that carries transparency information. Thus, software bitmaps, even if they use 32-bits per pixel, will never contain alpha channel information in their most significant bits. This is always stored in a separate bitmap. Plugins which want to override Hollywood's inbuilt software bitmap handler by setting the HWSDAFLAGS_BITMAPADAPTER flag need to adhere to this design as well and allocate color and transparency channels separately. See AllocBitMap for details.

Hardware bitmaps, on the other hand, can store color and transparency channels in any way they like because Hollywood will never access the pixels of hardware bitmaps directly. The way a plugin allocates hardware bitmaps is completely up to the plugin. A limitation of hardware bitmaps is that they can only be drawn when Hollywood is in hardware double-buffer mode. Thus, if you want to write a plugin which offers support for hardware bitmaps, you also have to set the HWSDAFLAGS_DOUBLEBUFFERADAPTER flag along with HWSDAFLAGS_VIDEOBITMAPADAPTER or your hardware bitmap support won't be of much use.

If you want to replace Hollywood's inbuilt bitmap handler with your custom versions, you have to write a display adapter plugin. See Display adapter plugins for details.


Show TOC