al_get_mouse_cursor_position(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ 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 πŸ‘‘


🌈 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