d_slider_proc(3)
π d_slider_proc(3) π
okay bestie, welcome to the Allegro manual β yes, the Allegro game programming library, and yes we're about to talk about sliders. sit down, grab a strawberry π, this one's cute.
β¨ NAME β¨
d_slider_proc β it's a dialog procedure that implements a slider control object, and it lives in the Allegro game programming library. that's the whole vibe. ποΈ
πΈ SYNOPSIS πΈ
#include <allegro.h>
int d_slider_proc(int msg, DIALOG *d, int c);
like, that's the signature. no cap. π
π¦ DESCRIPTION π¦
so. it's a slider control object. main character energy honestly. π
here's the tea: this object holds a value in d2, and that value lives in the range from 0 to d1. periodt. so d1 is your ceiling and d2 is where you're currently at.
now, the orientation? that's a whole vibe check on its own:
- if
his greater than or equal tow, it displays as a vertical slider π§ββοΈ - otherwise, it displays as a horizontal slider π
the dp field can contain an optional bitmap to use for the slider handle (the lil thing you drag, you know the one) β¨
and dp2 can contain an optional callback function β and this one's important, bestie β it gets called each time d2 changes. every. single. time. it's giving attentive.
that callback function should have this exact prototype, no improvising:
int function(void *dp3, int d2);
and here's the part where it gets iconic: the d_slider_proc object will return the value of the callback function. yes, the callback's return value is the return value. it's a whole chain. π
ngl, if you skip the callback, nothing breaks β it's optional β but then nobody gets notified when d2 moves and honestly that's a little sad. π
π₯ SEE ALSO π₯
go read those too, iykyk. π
and that's a wrap on the sliders, bestie!! this whole page is from Allegro version 4.4.3 β slay, iconic, no notes ππβ¨π«Άππ¦
π¦ 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