gfx_capabilities(3)
β¨ gfx_capabilities(3) β¨
okay bestie, this is a page from the Allegro manual β the game programming library β and it's about a lil global int that tells you what your graphics driver and video hardware can actually do. let's get into it π
πΈ SYNOPSIS πΈ
#include <allegro.h>
extern int gfx_capabilities;
π DESCRIPTION π
So gfx_capabilities is a bitfield describing the capabilities of the current graphics driver and video hardware. It can contain any combination of these flags, and every single one is listed below, no skipping, we're doing all of them π«Ά
GFX_CAN_SCROLLβ tells you thescroll_screen()function may be used with this driver. cute.GFX_CAN_TRIPLE_BUFFERβ tells you therequest_scroll()andpoll_scroll()functions may be used with this driver. If this flag is not set, it's possible that theenable_triple_buffer()function may be able to activate it. so like, not over yet.GFX_HW_CURSORβ tells you a hardware mouse cursor is in use. When this flag is set, it's safe to draw onto the screen without hiding the mouse pointer first π±οΈβ¨ But heads up: not every cursor graphic can be implemented in hardware. In particular, VBE/AF only supports 2-color images up to32x32in size, where the second color is an exact inverse of the first. This means Allegro may need to switch between hardware and software cursors at any point during the execution of your program, so do not assume this flag will stay constant for long periods of time. It only tells you whether a hardware cursor is in use at the current time, and it may change whenever you hide/redisplay the pointer. it's giving main character with commitment issues πGFX_SYSTEM_CURSORβ tells you the mouse cursor is the default system cursor, not Allegro's custom cursor.GFX_HW_HLINEβ tells you the normal opaque version of thehline()function is implemented using a hardware accelerator. This improves performance not only ofhline()itself, but also of tons of other functions that use it as a workhorse, for examplecirclefill(),triangle(), andfloodfill(). one little line function carrying the whole team fr fr πGFX_HW_HLINE_XORβ tells you the XOR version of thehline()function, and any other functions that use it as a workhorse, are implemented using a hardware accelerator.GFX_HW_HLINE_SOLID_PATTERNβ tells you the solid and masked pattern modes of thehline()function, and any other functions that use it as a workhorse, are implemented using a hardware accelerator (see the note below π).GFX_HW_HLINE_COPY_PATTERNβ tells you the copy pattern mode of thehline()function, and any other functions that use it as a workhorse, are implemented using a hardware accelerator (see the note below π).GFX_HW_FILLβ tells you the opaque version of therectfill()function, theclear_bitmap()routine, andclear_to_color(), are implemented using a hardware accelerator.GFX_HW_FILL_XORβ tells you the XOR version of therectfill()function is implemented using a hardware accelerator.GFX_HW_FILL_SOLID_PATTERNβ tells you the solid and masked pattern modes of therectfill()function are implemented using a hardware accelerator (see the note below π).GFX_HW_FILL_COPY_PATTERNβ tells you the copy pattern mode of therectfill()function is implemented using a hardware accelerator (see the note below π).GFX_HW_LINEβ tells you the opaque modeline()andvline()functions are implemented using a hardware accelerator.GFX_HW_LINE_XORβ tells you the XOR version of theline()andvline()functions are implemented using a hardware accelerator.GFX_HW_TRIANGLEβ tells you the opaque modetriangle()function is implemented using a hardware accelerator.GFX_HW_TRIANGLE_XORβ tells you the XOR version of thetriangle()function is implemented using a hardware accelerator.GFX_HW_GLYPHβ tells you monochrome character expansion (for text drawing) is implemented using a hardware accelerator π€GFX_HW_VRAM_BLITβ tells you blitting from one part of the screen to another is implemented using a hardware accelerator. If this flag is set, blitting within the video memory will almost certainly be the fastest possible way to display an image, so it may be worth storing some of your more frequently used graphics in an offscreen portion of the video memory. storage hack, we love it.GFX_HW_VRAM_BLIT_MASKEDβ tells you themasked_blit()routine is capable of a hardware accelerated copy from one part of video memory to another, and thatdraw_sprite()will use a hardware copy when given a sub-bitmap of the screen or a video memory bitmap as the source image. If this flag is set, copying within the video memory will almost certainly be the fastest possible way to display an image, so it may be worth storing some of your more frequently used sprites in an offscreen portion of the video memory.
β οΈ Warning: if this flag is not set,masked_blit()anddraw_sprite()will not work correctly when used with a video memory source image! You must only try to use these functions to copy within the video memory if they are supported in hardware. like, do not play with this one bestie π
GFX_HW_MEM_BLITβ tells you blitting from a memory bitmap onto the screen is being accelerated in hardware.GFX_HW_MEM_BLIT_MASKEDβ tells you themasked_blit()anddraw_sprite()functions are being accelerated in hardware when the source image is a memory bitmap and the destination is the physical screen.GFX_HW_SYS_TO_VRAM_BLITβ tells you blitting from a system bitmap onto the screen is being accelerated in hardware. Note that some acceleration may be present even if this flag is not set, because system bitmaps can benefit from normal memory to screen blitting as well. This flag will only be set if system bitmaps have further acceleration above and beyond what is provided byGFX_HW_MEM_BLIT.GFX_HW_SYS_TO_VRAM_BLIT_MASKEDβ tells you themasked_blit()anddraw_sprite()functions are being accelerated in hardware when the source image is a system bitmap and the destination is the physical screen. Note that some acceleration may be present even if this flag is not set, because system bitmaps can benefit from normal memory to screen blitting as well. This flag will only be set if system bitmaps have further acceleration above and beyond what is provided byGFX_HW_MEM_BLIT_MASKED.GFX_HW_VRAM_STRETCH_BLITβ tells you stretched blitting of video bitmaps onto the screen is implemented using hardware acceleration.GFX_HW_SYS_STRETCH_BLITβ tells you stretched blitting of system bitmaps onto the screen is implemented using hardware acceleration.GFX_HW_VRAM_STRETCH_BLIT_MASKEDβ tells you masked stretched blitting (includingstretch_sprite) of video bitmaps onto the screen is implemented using hardware acceleration. π NOTE: some display drivers may show artifacts when this function is used. If the image does not look correct, try updating your video drivers. not the drivers catching strays πGFX_HW_SYS_STRETCH_BLIT_MASKEDβ tells you masked stretched blitting (includingstretch_sprite) of system bitmaps onto the screen is implemented using hardware acceleration. π NOTE: some display drivers may show artifacts when this function is used. If the image does not look correct, try updating your video drivers.
- π Note: even if the capabilities information says that patterned drawing is supported by the hardware, it will not be possible for every size of pattern. VBE/AF only supports patterns up to
8x8in size, so Allegro will fall back on the original non-accelerated drawing routines whenever you use a pattern larger than this. - π Note2: these hardware acceleration features will only take effect when you are drawing directly onto the screen bitmap, a video memory bitmap, or a sub-bitmap thereof. Accelerated hardware is most useful in a page flipping or triple buffering setup, and is unlikely to make any difference to the classic "draw onto a memory bitmap, then blit to the screen" system. iykyk.
π¦ SEE ALSO π¦
screen(3), create_video_bitmap(3), scroll_screen(3), request_scroll(3), show_mouse(3), enable_triple_buffer(3), ex3buf(3), exaccel(3), exsyscur(3), exupdate(3)
and that's the whole page bestie, you ate it π this one came straight out of the Allegro era, version 4.4.3 β go forth and vibe check your hardware, mwah ππβ¨
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms