set_mouse_range(3alleg4)
β¨ set_mouse_range β¨
okay bestie, welcome to the Allegro manual (that's 3alleg4 if you're keeping receipts) π this one's a lil function that fences your mouse in, and honestly? iconic behavior.
π NAME π
set_mouse_range β sets the area of the screen restricting mouse movement. it's giving Allegro game programming library β¨
π¦ SYNOPSIS π¦
#include <allegro.h>
void set_mouse_range(int x1, int y1, int x2, int y2);
πΈ DESCRIPTION πΈ
so what this does is set the area of the screen within which the mouse can move. you pass it the top left corner and the bottom right corner β and yes bestie, those corners are inclusive, so the edges count, no sneaky extra pixel π
the way that this is basically a little playpen for your cursor... obsessed π
and here's the tea: if you don't call this function, the range just defaults to (0, 0, SCREEN_W-1, SCREEN_H-1). so your mouse gets the whole screen by default, periodt β¨
π SEE ALSO π
go read those too, iykyk π«Ά
alright that's the whole page, no cap π this beauty came from Allegro, version 4.4.3, and yeah the manual itself calls it set_mouse_range(3alleg4) π mwah, slay, go trap that mouse πβ¨
π¦ 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