al_get_mouse_cursor_position(3alleg5)
β¨ al_get_mouse_cursor_position β¨
ok so bestie, this one lives in the Allegro reference manual, section 3alleg5 β yeah that's the whole vibe, Allegro 5 API, let's go π
π¦ NAME π¦
al_get_mouse_cursor_position β Allegro 5 API, and it's giving "where is that cursor rn" π
πΈ SYNOPSIS πΈ
#include <allegro5/allegro.h>
bool al_get_mouse_cursor_position(int *ret_x, int *ret_y)
π DESCRIPTION π
okay so on platforms where this information is available, this function returns the global location of the mouse cursor, relative to the desktop β¨ like not relative to your window, not relative to some little widget β global, desktop-level, the whole screen, periodt.
but here's the tea π« β you should not normally use this function. it's lowkey not useful except for special scenarios, like moving a window. that's the niche, that's the moment, that's literally it π
so likeβ¦ it exists, it works, but it's the "only if you know why you need it" girlie. don't just reach for it because it's there π
it returns true on success, and false on failure. no cap, that's the whole contract π
π SEE ALSO π
al_can_get_mouse_cursor_position(3alleg5)β the bestie that tells you whether this whole thing is even available on your platform π«Ά
π sign-off π
and that's the page!! this came straight from the Allegro reference manual, filed under al_get_mouse_cursor_position(3alleg5) π go check al_can_get_mouse_cursor_position before you assume anything, mwah, bye bestie π§β¨π
π¦ where this page comes from
- debian trixie: allegro5-doc 2:5.2.10.1+dfsg-1 Β· Zlib
- ubuntu questing: allegro5-doc 2:5.2.10.1+dfsg-1build1
- ubuntu resolute: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- ubuntu stonking: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms