al_set_new_bitmap_flags(3)
okay so bestie, this page is al_set_new_bitmap_flags(3) from the Allegro reference manual β Library Functions Manual, section 3 β and itβs all about telling Allegro what kind of bitmap energy you want for newly created bitmaps. π
π NAME π
al_set_new_bitmap_flags β Allegro 5 API. Thatβs the whole vibe: it sets the flags for newly created bitmaps.
β¨ SYNOPSIS β¨
okay so you include this and call it like this, exactly:
#include <allegro5/allegro.h>
void al_set_new_bitmap_flags(int flags)
π DESCRIPTION π
This function sets the flags to use for newly created bitmaps. The valid flags are literally this menu, bestie:
ALLEGRO_MEMORY_BITMAPβ creates a bitmap that lives in system memory. Operations on and with memory bitmaps will not be hardware accelerated. But direct pixel access can be relatively quick compared to video bitmaps, which depend on the display driver in use. Note: Allegroβs software rendering routines are currently somewhat unoptimised. Note: combiningALLEGRO_VIDEO_BITMAPandALLEGRO_MEMORY_BITMAPflags is invalid.ALLEGRO_VIDEO_BITMAPβ creates a bitmap that resides in the video card memory. These types of bitmaps receive the greatest benefit from hardware acceleration. Note: creating a video bitmap will fail if there is no current display or the current display driver cannot create the bitmap. The latter will happen if, for example, the format or dimensions are not supported. Note: bitmaps created with this flag will be converted to memory bitmaps when the last display is destroyed. In most cases it is therefore easier to use theALLEGRO_CONVERT_BITMAPflag instead. Note: combiningALLEGRO_VIDEO_BITMAPandALLEGRO_MEMORY_BITMAPflags is invalid.ALLEGRO_CONVERT_BITMAPβ this is the default. It will try to create a video bitmap and, if that fails, create a memory bitmap. Bitmaps created with this flag when there is no active display will be converted to video bitmaps next time a display is created. They also will remain video bitmaps if the last display is destroyed and then another is created again. Since 5.1.0. Note: you can combine this flag withALLEGRO_MEMORY_BITMAPorALLEGRO_VIDEO_BITMAPto force the initial type (and fail in the latter case if no video bitmap can be created) β but usually neither of those combinations is very useful. You can use the display optionALLEGRO_AUTO_CONVERT_BITMAPSto control which displays will try to auto-convert bitmaps.ALLEGRO_FORCE_LOCKINGβ does nothing since 5.1.8. Kept for backwards compatibility only. rip to a real one, but itβs just vibing there now. πALLEGRO_NO_PRESERVE_TEXTUREβ normally, every effort is taken to preserve the contents of bitmaps, since some platforms may forget them. This can take extra processing time. If you know it doesnβt matter if a bitmap keeps its pixel data β for example when itβs a temporary buffer β use this flag to tell Allegro not to attempt to preserve its contents.ALLEGRO_ALPHA_TESTβ this is a driver hint only. It tells the graphics driver to do alpha testing instead of alpha blending on bitmaps created with this flag. Alpha testing is usually faster and preferred if your bitmaps have only one level of alpha (0). This flag is currently not widely implemented (i.e., only for memory bitmaps).ALLEGRO_MIN_LINEARβ when drawing a scaled down version of the bitmap, use linear filtering. This usually looks better. You can also combine it with theMIPMAPflag for even better quality. β¨ALLEGRO_MAG_LINEARβ when drawing a magnified version of a bitmap, use linear filtering. This will cause the picture to get blurry instead of creating a big rectangle for each pixel. It depends on how you want things to look like whether you want to use this or not.ALLEGRO_MIPMAPβ this can only be used for bitmaps whose width and height is a power of two. In that case, it will generate mipmaps and use them when drawing scaled down versions. For example, if the bitmap is64x64, then extra bitmaps of sizes32x32,16x16,8x8,4x4,2x2and1x1will be created always containing a scaled down version of the original. π
π¦ SEE ALSO π¦
cute sign-off time π«Ά: source/version is the Allegro reference manual, page al_set_new_bitmap_flags(3). Date? Not printed on this page, so weβre not inventing one, bestie. πΈ
π¦ where this page comes from
- arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms