show_mouse(3alleg4)

πŸ’– show_mouse β€” Allegro manual, bestie edition πŸ¦‹

ok so like. this is show_mouse(3alleg4) from the Allegro manual and it's literally the function that makes a lil mouse pointer show up on your screen. that's the whole vibe. let's get into it ✨


🌸 NAME 🌸

show_mouse β€” tells Allegro to display a mouse pointer on the screen. yes queen, that's it, that's the job πŸ’…


✨ SYNOPSIS ✨

#include <allegro.h>

void show_mouse(BITMAP *bmp);

πŸŽ€ DESCRIPTION πŸŽ€

okay so show_mouse tells Allegro to display a mouse pointer on the screen. heads up tho: this will only work if the timer module has been installed. no timer module, no pointer. that's the rules bestie 😭

the mouse pointer gets drawn onto the bitmap you specify, which should normally be screen (peep later in the docs for the whole bitmaps situation if you're curious). and if you wanna hide the pointer? you just hit it with show_mouse(NULL). gone. poof. 🫢

⚠️ Warning: if you draw anything onto the screen while the pointer is visible, a mouse movement interrupt could occur in the middle of your drawing operation. and if that happens, the mouse buffering and graphics drawing code will get confused and will leave 'mouse droppings' all over the screen πŸ’€πŸ’€ not cute!! to prevent this, you must make sure you turn off the mouse pointer whenever you draw onto the screen. the one exception: this is not needed if you are using a hardware cursor. slay.
πŸ“Œ Note: you must not be showing a mouse pointer on a bitmap at the time that the bitmap is destroyed with destroy_bitmap(). like, for real, call show_mouse(NULL); before destroying the bitmap. this does not apply to screen, since you never destroy screen with destroy_bitmap(). screen is forever, main character energy fr fr πŸ‘‘

πŸ’œ SEE ALSO πŸ’œ


ok that's the whole page bestie, go forth and show that mouse 🐭✨

this was Allegro version 4.4.3, show_mouse(3alleg4), and yes the manual page itself is also called show_mouse(3alleg4) because consistency is iconic πŸ’…πŸŽ€ bye!! πŸ¦‹