init_dialog(3)

πŸ“¦ version 4.4.3.1, in fedora 43, fedora 44

πŸ’– init_dialog(3) β€” the Allegro manual, but make it cute πŸ’–

okay bestie, we're in the Allegro manual and this one is init_dialog(3) β€” low level initialisation of a dialog, from the Allegro game programming library. yes it's the "I'll do it myself" version of a dialog. main character energy fr fr πŸŽ€


✨ NAME ✨

init_dialog β€” low level initialisation of a dialog. Allegro game programming library. that's it, that's the vibe πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <allegro.h>

DIALOG_PLAYER *init_dialog(DIALOG *dialog, int focus_obj);

🌸 DESCRIPTION 🌸

okay so listen. this function gives you lower level access to the exact same functionality as do_dialog(), but β€” and this is the slay part β€” it lets you combine a dialog box with your own program control structures. you're not trapped in do_dialog's little world anymore, you're driving. πŸš—πŸ’¨

it initialises a dialog and returns a pointer to a player object, and that player object is what you feed to update_dialog() and shutdown_dialog(). that's the whole trio, they work together, no cap.

and like, with these functions you could literally implement your own version of do_dialog() with these lines:

DIALOG_PLAYER *player = init_dialog(dialog, focus_obj);

while (update_dialog(player))
   ;

return shutdown_dialog(player);

look at that. iconic. you built a do_dialog() from scratch and it's giving DIY queen ✨

πŸ’€ not me forgetting this part: you are responsible for showing and hiding the mouse cursor, which do_dialog would otherwise do for you. and also for saving and restoring the screen contents, as popup_dialog would do for you. like, nobody's doing that for you here. that's your job now bestie. you wanted low level access, you got low level access πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘

go read those, they're the rest of the girl group 🫢


and that's the page!! this was brought to you by Allegro, version 4.4.3, and by init_dialog(3) itself being an absolute legend. mwah πŸ’–πŸŒΈπŸ¦‹ stay slaying in your dialog loops, bestie πŸ’…βœ¨

πŸ“¦ where this page comes from