al_set_haptic_gain(3alleg5)

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

πŸ’– al_set_haptic_gain β€” Allegro 5 API πŸ’–

okay bestie, welcome to the Allegro 5 manual, this one's about al_set_haptic_gain, and it's giving "turn the vibes up (or down) on your rumble toy" ✨


🌸 NAME 🌸

al_set_haptic_gain β€” Allegro 5 API


✨ SYNOPSIS ✨

#include <allegro5/allegro.h>

bool al_set_haptic_gain(ALLEGRO_HAPTIC *hap, double gain)

πŸŽ€ DESCRIPTION πŸŽ€

So like, this function sets the gain of the haptic device β€” but only if the device actually supports it, no cap. Think of gain as the volume knob for sound, but for haptics: it's as if every single effect's intensity gets multiplied by it. πŸ’…

Gain is a value between 0.0 and 1.0. The function returns true if it got set successfully, and false if it didn't. 😭

Heads up bestie: this ONLY works if al_get_haptic_capabilities(3alleg5) returns a value that has ALLEGRO_HAPTIC_GAIN(3alleg5) ALLEGRO_HAPTIC_CONSTANTS(3alleg5) set. If it doesn't, this function just returns false, and all effects will be played without any gain influence at all. periodt.

πŸ¦‹ SINCE πŸ¦‹

5.1.8

[Unstable API]: Perhaps could be simplified due to limited support for all the exposed features across all of the platforms. Awaiting feedback from users. πŸ‘‘ (yes queen, they're literally waiting on you)

that's the whole page, you ate that 🫢 this was the Allegro reference manual talking about al_set_haptic_gain(3alleg5) β€” mwah, go make something rumble πŸ’–βœ¨

πŸ“¦ where this page comes from