d_slider_proc(3alleg4)

πŸ’– d_slider_proc πŸ’–

okay bestie, welcome to the Allegro manual, the game programming library that's been serving looks since forever. this page is all about d_slider_proc, and it's genuinely such a fun little guy, i'm obsessed. πŸŽ€


✨ NAME ✨

d_slider_proc β€” a dialog procedure that implements a slider control object. yes ma'am, a whole slider, and it lives in the Allegro game programming library. πŸ’…


🌸 SYNOPSIS 🌸

#include <allegro.h>

int d_slider_proc(int msg, DIALOG *d, int c);

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea: this is a slider control object, and it holds a value in d2, in the range from 0 to d1. that's the whole vibe. literally the range is 0 to d1, no cap. ⭐

and the way it decides how to show up?? iconic behaviour honestly:

  • if h is greater than or equal to w, it displays as a vertical slider
  • otherwise, it displays as a horizontal slider

main character energy, it just picks its own orientation based on the vibes. 🧚

now, the dp field can contain an optional bitmap to use for the slider handle. optional!! so if you want a cute lil handle, that's where it goes. πŸ“

and dp2 can contain an optional callback function, which gets called each time d2 changes. every single time. she's communicative like that. πŸ’œ the callback function should have this prototype:

int function(void *dp3, int d2);

and then β€” plot twist β€” the d_slider_proc object will return the value of the callback function. so like, it doesn't just do its own thing, it hands you back whatever your callback said. periodt. πŸ”₯


🌈 SEE ALSO 🌈


πŸ’€ quick reminder bestie: d1, d2, dp, dp2, dp3, h and w are the exact field names, don't go renaming them, iykyk.

and that's the page!! shoutout to Allegro, version 4.4.3, for bringing us this slider. go forth and slide, queen. πŸ‘‘πŸ’–