show_os_cursor(3alleg4)
π show_os_cursor β the Allegro manual's little low-level cursor bestie β¨
okay so you're reading the page for show_os_cursor(3alleg4) from the Allegro manual (that's the Allegro game programming library, in case you were wondering π). She's a low level function whose whole job is displaying the operating system cursor. no frills, no drama, just vibes.
β¨ SYNOPSIS β¨
#include <allegro.h>
int show_os_cursor(int cursor);
like. that's it. that's the whole signature. she's simple. π
π¦ DESCRIPTION π¦
So here's the tea, bestie: Allegro has its own whole mouse cursor API, and that API will automatically emulate a cursor in software if there's no other cursor available. Cute of her honestly. But if you don't need all that, you can reach for this low level function instead and just try to display or hide the system cursor directly.
The cursor parameter takes the same values as select_mouse_cursor. so same menu, same options, no new vocabulary to learn, we love a consistent API. π«Ά
It's very similar to calling enable_hardware_cursor, select_mouse_cursor and show_mouse β except here's the difference, and it's a big one: this function will not try to do anything if no system cursor is available. no fallback, no pretending, no software emulation standing in. it just... doesn't. π
The most common use for this function is genuinely just calling it once at the beginning of your program to tell it to display the system cursor inside the Allegro window. that's the whole moment. and you can check the return value to see if it actually succeeded or not. πΈ
now the part where she gets real with you: on some systems (e.g. DirectX fullscreen) this is not supported and the function will always fail. and in other cases only some of the cursors will work, or β in the case of MOUSE_CURSOR_ALLEGRO β only certain bitmap sizes may be supported. so like. manage your expectations accordingly. π
And listen, this is important, so I'm saying it loud:
You never should useshow_os_cursortogether with the functionshow_mouseand other functions affecting it (select_mouse_cursor,enable_hardware_cursor,disable_hardware_cursor,scare_mouse,unscare_mouse). Those implement the standard high level mouse API, and they don't work together with this low level function. pick a lane, bestie. you cannot serve two mouse APIs. π
π RETURN VALUE π
- Returns
0if a system cursor is being displayed after the function returns β¨ - Returns
-1otherwise π
that's it. zero or negative one. binary queen. π
π SEE ALSO π
and that's the whole page, no cap π this was written by Allegro, version 4.4.3, and yes she's still out here in show_os_cursor(3alleg4) form, iconic, never changed, never will. go display a cursor. or don't. but don't mix it with show_mouse. 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