show_os_cursor(3)
π show_os_cursor β the Allegro manual, but make it make sense
okay bestie so this is a page from the Allegro manual (yes, the game programming library, the icon itself β¨), and today we're talking about show_os_cursor, a low level function that justβ¦ displays the operating system cursor. that's it. that's the whole job. π
β¨ NAME β¨
show_os_cursor β a low level function to display the operating system cursor, from the Allegro game programming library π
π¦ SYNOPSIS π¦
#include <allegro.h>
int show_os_cursor(int cursor);
π DESCRIPTION π
so here's the tea: Allegro has its own mouse cursor API, and that API is so extra β it will automatically emulate a cursor in software if no other cursor is available. cute, right? but maybe you don't need all that. maybe you're built different. in that case, you can use this low level function to try to display or hide the system cursor directly. no middleman, no vibes, just you and the OS. π«Ά
the cursor parameter takes the same values as select_mouse_cursor. and honestly? this function is very similar to calling enable_hardware_cursor, select_mouse_cursor and show_mouse β except for one major thing: it will not try to do anything if no system cursor is available. it's giving "no cursor? okay, not my problem." π
the most common use for this function is to just call it once at the beginning of the program, to tell it to display the system cursor inside the Allegro window. main character energy, honestly. β¨
the return value can be used to see if this succeeded or not. and here's where it gets a lil humbling:
- on some systems (e.g.
DirectXfullscreen) this is not supported and the function will always fail π - 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 π
β οΈ NEVER 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 do not work together with this low level function. it's giving two girlies fighting over one aux cord. it will not end well. π«
π RETURN VALUE π
- returns
0if a system cursor is being displayed after the function returns β - or
-1otherwise β
that's it. two outcomes. very binary of it. π
π SEE ALSO π
and that's the whole page, bestie! this one comes to you courtesy of Allegro, version 4.4.3 π go forth and cursor responsibly, ily, mwah ππΈ
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms