show_video_bitmap(3alleg4)
β¨ show_video_bitmap β¨
okay bestie, welcome to the Allegro manual π this one's from the 3alleg4 girlies, and it's literally about flipping your hardware screen to show a different page. no cap.
πΈ NAME πΈ
show_video_bitmap β flips the hardware screen so it shows the page you asked for. it's giving "swap the whole display, babe". part of the Allegro game programming library, obviously. π
π SYNOPSIS π
#include <allegro.h>
int show_video_bitmap(BITMAP *bitmap);
that's it. one function, one bitmap, one slay. π
π¦ DESCRIPTION π¦
so what it does is attempt to page flip the hardware screen so it displays the video bitmap object you hand it. β¨
but listen β there are rules, and the rules are strict:
- the bitmap must be the same size as the physical screen. like, exact. no improvising.
- it should have been obtained by calling the
create_video_bitmap()function. don't just roll up with any random bitmap, she'll know. π
now here's the cute part: Allegro handles any necessary vertical retrace synchronisation when it's page flipping, so you literally do not need to call vsync() before it. she's got you. π«Ά
which means show_video_bitmap() has the same time delay effects as vsync() by default. lowkey important. and you can adjust that with the "disable_vsync" config key in the [graphics] section of allegro.cfg. iykyk. π§
example time, periodt:
int current_page;
BITMAP *video_page[2];
...
/* Create pages for page flipping */
video_page[0] = create_video_bitmap(SCREEN_W, SCREEN_H);
video_page[1] = create_video_bitmap(SCREEN_W, SCREEN_H);
current_page = 0;
...
/* draw the screen and flip pages */
draw_screen(video_page[current_page]);
show_video_bitmap(video_page[current_page]);
current_page = (current_page+1)%2;
...
look at her go. main character energy fr fr. π
β RETURN VALUE β
- zero β success, we ate π
- non-zero β failure, not the vibe π
π SEE ALSO π
go read these next, bestie, they're all connected:
scroll_screen(3alleg4)create_video_bitmap(3alleg4)exaccel(3alleg4)exflip(3alleg4)exupdate(3alleg4)
that's the whole page, gorgeous π this was Allegro, version 4.4.3, and the page itself is show_video_bitmap(3alleg4). stay flipping, stay iconic, mwah πβ¨
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms