SDL_GetSenso...ableTypeForID(3)

πŸ’– SDL_GetSensorNonPortableTypeForID πŸ’–

okay bestie, we're in the SDL3 FUNCTIONS section of the SDL3 manual, and today's main character is SDL_GetSensorNonPortableTypeForID β€” yes the whole name, no we are not abbreviating it, it's iconic like that πŸ’…


✨ NAME ✨

SDL_GetSensorNonPortableTypeForID β€” get the platform dependent type of a sensor. fr fr, that's the whole vibe. πŸ¦‹


✨ SYNOPSIS ✨

#include <SDL3/SDL_sensor.h>

int SDL_GetSensorNonPortableTypeForID(SDL_SensorID instance_id);

like, that's it. that's the whole function. short king. πŸ‘‘


✨ DESCRIPTION ✨

so here's the tea πŸ“: this function gives you the platform dependent type of a sensor, and the way that it's built means you can call it before any sensors are opened. like, no setup required, no opening anything first, it just works. lowkey obsessed with that for us. ✨


✨ FUNCTION PARAMETERS ✨

  • instance_id β€” the sensor instance ID. that's the little identifier you hand over so it knows which sensor we're talking about πŸ’«

✨ RETURN VALUE ✨

it hands you back the sensor's platform dependent type πŸŽ€

and if instance_id is not valid? you get -1. that's your sign, babe. a -1 is the universe telling you that ID is not it πŸ™ˆ


✨ AVAILABILITY ✨

this function is available since SDL 3.2.0. so if you're on anything older... not to be dramatic but you simply do not have it πŸ’€


ngl if you got a -1 back, double check that instance_id before you spiral. the ID has to be a real one, no cap. 🫢

and that's the whole page, bestie!! this was brought to you by Simple Directmedia Layer ✨ version SDL 3.4.18 ✨ like the header says β€” SDL_GetSenso...ableTypeForID(3) and yes the truncation is part of the aesthetic 😌 go get that sensor type, you ate πŸ’–πŸŒΈπŸ§š

πŸ“¦ where this page comes from