SET_MOUSE_CURSOR_BITMAP(3alleg4)

πŸ’– set_mouse_cursor_bitmap πŸ’–

okay bestie, welcome to the Allegro manual, section 3alleg4, and today's main character is set_mouse_cursor_bitmap β€” the glow-up your mouse pointer has been waiting for. let's get into it πŸ¦‹


✨ NAME ✨

set_mouse_cursor_bitmap β€” changes the image Allegro uses for mouse cursors. yes, THE cursor. the lil guy you move around. we're giving it a wardrobe change πŸ’…


🌸 SYNOPSIS 🌸

#include <allegro.h>

void set_mouse_cursor_bitmap(int cursor, BITMAP *bmp);

πŸ‘‘ DESCRIPTION πŸ‘‘

so here's the tea: this function changes the cursor image Allegro uses if select_mouse_cursor() is called but no native operating system cursor can be used. when does that happen? like, for example, because you did not call enable_hardware_cursor(). no native cursor for you, bestie, so Allegro gotta improvise ✨

the cursor argument can be one of these:

  • MOUSE_CURSOR_ALLEGRO
  • MOUSE_CURSOR_ARROW
  • MOUSE_CURSOR_BUSY
  • MOUSE_CURSOR_QUESTION
  • MOUSE_CURSOR_EDIT

but not MOUSE_CURSOR_NONE. like, that one's simply not invited to the party πŸ™ˆ

the bmp argument can either point to a valid bitmap or it can be NULL. passing a bitmap makes Allegro use that image in place of its own default substitution (should the operating system's native cursor be unavailable). the bitmap must remain available for the duration in which it could be used β€” so don't go freeing it, okay? that's the rule πŸŽ€ passing NULL lets Allegro revert to its default substitutions, which is lowkey a full factory reset for your cursor vibe.

heads up: the effect of this function will not be apparent until show_mouse() is called. so if you're sitting there like "where is my cute cursor 😭" β€” call show_mouse(), bestie. that's the vibe check.

🫢 SEE ALSO 🫢


and that's the whole page, no cap πŸ’œ this was brought to you by Allegro, version 4.4.3, serving set_mouse_cursor_bitmap(3alleg4) realness. go make your cursor iconic, bestie β€” periodt βœ¨πŸ’…πŸŒˆ